@classmethod
def instantiate(cls, resource_type, jsondict):
    """ Instantiate a resource of the type correlating to "resource_type".

        :param str resource_type: The name/type of the resource to instantiate
        :param dict jsondict: The JSON dictionary to use for data
        :returns: A resource of the respective type or `Element`
        """
    if 'Account' == resource_type:
        from . import account
        return account.Account(jsondict)
    if 'AccountCoverage' == resource_type:
        from . import account
        return account.AccountCoverage(jsondict)
    if 'AccountGuarantor' == resource_type:
        from . import account
        return account.AccountGuarantor(jsondict)
    if 'ActivityDefinition' == resource_type:
        from . import activitydefinition
        return activitydefinition.ActivityDefinition(jsondict)
    if 'ActivityDefinitionDynamicValue' == resource_type:
        from . import activitydefinition
        return activitydefinition.ActivityDefinitionDynamicValue(jsondict)
    if 'ActivityDefinitionParticipant' == resource_type:
        from . import activitydefinition
        return activitydefinition.ActivityDefinitionParticipant(jsondict)
    if 'Address' == resource_type:
        from . import address
        return address.Address(jsondict)
    if 'AdverseEvent' == resource_type:
        from . import adverseevent
        return adverseevent.AdverseEvent(jsondict)
    if 'AdverseEventSuspectEntity' == resource_type:
        from . import adverseevent
        return adverseevent.AdverseEventSuspectEntity(jsondict)
    if 'Age' == resource_type:
        from . import age
        return age.Age(jsondict)
    if 'AllergyIntolerance' == resource_type:
        from . import allergyintolerance
        return allergyintolerance.AllergyIntolerance(jsondict)
    if 'AllergyIntoleranceReaction' == resource_type:
        from . import allergyintolerance
        return allergyintolerance.AllergyIntoleranceReaction(jsondict)
    if 'Annotation' == resource_type:
        from . import annotation
        return annotation.Annotation(jsondict)
    if 'Appointment' == resource_type:
        from . import appointment
        return appointment.Appointment(jsondict)
    if 'AppointmentParticipant' == resource_type:
        from . import appointment
        return appointment.AppointmentParticipant(jsondict)
    if 'AppointmentResponse' == resource_type:
        from . import appointmentresponse
        return appointmentresponse.AppointmentResponse(jsondict)
    if 'Attachment' == resource_type:
        from . import attachment
        return attachment.Attachment(jsondict)
    if 'AuditEvent' == resource_type:
        from . import auditevent
        return auditevent.AuditEvent(jsondict)
    if 'AuditEventAgent' == resource_type:
        from . import auditevent
        return auditevent.AuditEventAgent(jsondict)
    if 'AuditEventAgentNetwork' == resource_type:
        from . import auditevent
        return auditevent.AuditEventAgentNetwork(jsondict)
    if 'AuditEventEntity' == resource_type:
        from . import auditevent
        return auditevent.AuditEventEntity(jsondict)
    if 'AuditEventEntityDetail' == resource_type:
        from . import auditevent
        return auditevent.AuditEventEntityDetail(jsondict)
    if 'AuditEventSource' == resource_type:
        from . import auditevent
        return auditevent.AuditEventSource(jsondict)
    if 'BackboneElement' == resource_type:
        from . import backboneelement
        return backboneelement.BackboneElement(jsondict)
    if 'Basic' == resource_type:
        from . import basic
        return basic.Basic(jsondict)
    if 'Binary' == resource_type:
        from . import binary
        return binary.Binary(jsondict)
    if 'BodySite' == resource_type:
        from . import bodysite
        return bodysite.BodySite(jsondict)
    if 'Bundle' == resource_type:
        from . import bundle
        return bundle.Bundle(jsondict)
    if 'BundleEntry' == resource_type:
        from . import bundle
        return bundle.BundleEntry(jsondict)
    if 'BundleEntryRequest' == resource_type:
        from . import bundle
        return bundle.BundleEntryRequest(jsondict)
    if 'BundleEntryResponse' == resource_type:
        from . import bundle
        return bundle.BundleEntryResponse(jsondict)
    if 'BundleEntrySearch' == resource_type:
        from . import bundle
        return bundle.BundleEntrySearch(jsondict)
    if 'BundleLink' == resource_type:
        from . import bundle
        return bundle.BundleLink(jsondict)
    if 'CapabilityStatement' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatement(jsondict)
    if 'CapabilityStatementDocument' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementDocument(jsondict)
    if 'CapabilityStatementImplementation' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementImplementation(jsondict)
    if 'CapabilityStatementMessaging' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementMessaging(jsondict)
    if 'CapabilityStatementMessagingEndpoint' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementMessagingEndpoint(
            jsondict)
    if 'CapabilityStatementMessagingEvent' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementMessagingEvent(jsondict)
    if 'CapabilityStatementMessagingSupportedMessage' == resource_type:
        from . import capabilitystatement
        return (capabilitystatement.
            CapabilityStatementMessagingSupportedMessage(jsondict))
    if 'CapabilityStatementRest' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRest(jsondict)
    if 'CapabilityStatementRestInteraction' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRestInteraction(jsondict)
    if 'CapabilityStatementRestOperation' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRestOperation(jsondict)
    if 'CapabilityStatementRestResource' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRestResource(jsondict)
    if 'CapabilityStatementRestResourceInteraction' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRestResourceInteraction(
            jsondict)
    if 'CapabilityStatementRestResourceSearchParam' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRestResourceSearchParam(
            jsondict)
    if 'CapabilityStatementRestSecurity' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRestSecurity(jsondict)
    if 'CapabilityStatementRestSecurityCertificate' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementRestSecurityCertificate(
            jsondict)
    if 'CapabilityStatementSoftware' == resource_type:
        from . import capabilitystatement
        return capabilitystatement.CapabilityStatementSoftware(jsondict)
    if 'CarePlan' == resource_type:
        from . import careplan
        return careplan.CarePlan(jsondict)
    if 'CarePlanActivity' == resource_type:
        from . import careplan
        return careplan.CarePlanActivity(jsondict)
    if 'CarePlanActivityDetail' == resource_type:
        from . import careplan
        return careplan.CarePlanActivityDetail(jsondict)
    if 'CareTeam' == resource_type:
        from . import careteam
        return careteam.CareTeam(jsondict)
    if 'CareTeamParticipant' == resource_type:
        from . import careteam
        return careteam.CareTeamParticipant(jsondict)
    if 'ChargeItem' == resource_type:
        from . import chargeitem
        return chargeitem.ChargeItem(jsondict)
    if 'ChargeItemParticipant' == resource_type:
        from . import chargeitem
        return chargeitem.ChargeItemParticipant(jsondict)
    if 'Claim' == resource_type:
        from . import claim
        return claim.Claim(jsondict)
    if 'ClaimAccident' == resource_type:
        from . import claim
        return claim.ClaimAccident(jsondict)
    if 'ClaimCareTeam' == resource_type:
        from . import claim
        return claim.ClaimCareTeam(jsondict)
    if 'ClaimDiagnosis' == resource_type:
        from . import claim
        return claim.ClaimDiagnosis(jsondict)
    if 'ClaimInformation' == resource_type:
        from . import claim
        return claim.ClaimInformation(jsondict)
    if 'ClaimInsurance' == resource_type:
        from . import claim
        return claim.ClaimInsurance(jsondict)
    if 'ClaimItem' == resource_type:
        from . import claim
        return claim.ClaimItem(jsondict)
    if 'ClaimItemDetail' == resource_type:
        from . import claim
        return claim.ClaimItemDetail(jsondict)
    if 'ClaimItemDetailSubDetail' == resource_type:
        from . import claim
        return claim.ClaimItemDetailSubDetail(jsondict)
    if 'ClaimPayee' == resource_type:
        from . import claim
        return claim.ClaimPayee(jsondict)
    if 'ClaimProcedure' == resource_type:
        from . import claim
        return claim.ClaimProcedure(jsondict)
    if 'ClaimRelated' == resource_type:
        from . import claim
        return claim.ClaimRelated(jsondict)
    if 'ClaimResponse' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponse(jsondict)
    if 'ClaimResponseAddItem' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseAddItem(jsondict)
    if 'ClaimResponseAddItemDetail' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseAddItemDetail(jsondict)
    if 'ClaimResponseError' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseError(jsondict)
    if 'ClaimResponseInsurance' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseInsurance(jsondict)
    if 'ClaimResponseItem' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseItem(jsondict)
    if 'ClaimResponseItemAdjudication' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseItemAdjudication(jsondict)
    if 'ClaimResponseItemDetail' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseItemDetail(jsondict)
    if 'ClaimResponseItemDetailSubDetail' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseItemDetailSubDetail(jsondict)
    if 'ClaimResponsePayment' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponsePayment(jsondict)
    if 'ClaimResponseProcessNote' == resource_type:
        from . import claimresponse
        return claimresponse.ClaimResponseProcessNote(jsondict)
    if 'ClinicalImpression' == resource_type:
        from . import clinicalimpression
        return clinicalimpression.ClinicalImpression(jsondict)
    if 'ClinicalImpressionFinding' == resource_type:
        from . import clinicalimpression
        return clinicalimpression.ClinicalImpressionFinding(jsondict)
    if 'ClinicalImpressionInvestigation' == resource_type:
        from . import clinicalimpression
        return clinicalimpression.ClinicalImpressionInvestigation(jsondict)
    if 'CodeSystem' == resource_type:
        from . import codesystem
        return codesystem.CodeSystem(jsondict)
    if 'CodeSystemConcept' == resource_type:
        from . import codesystem
        return codesystem.CodeSystemConcept(jsondict)
    if 'CodeSystemConceptDesignation' == resource_type:
        from . import codesystem
        return codesystem.CodeSystemConceptDesignation(jsondict)
    if 'CodeSystemConceptProperty' == resource_type:
        from . import codesystem
        return codesystem.CodeSystemConceptProperty(jsondict)
    if 'CodeSystemFilter' == resource_type:
        from . import codesystem
        return codesystem.CodeSystemFilter(jsondict)
    if 'CodeSystemProperty' == resource_type:
        from . import codesystem
        return codesystem.CodeSystemProperty(jsondict)
    if 'CodeableConcept' == resource_type:
        from . import codeableconcept
        return codeableconcept.CodeableConcept(jsondict)
    if 'Coding' == resource_type:
        from . import coding
        return coding.Coding(jsondict)
    if 'Communication' == resource_type:
        from . import communication
        return communication.Communication(jsondict)
    if 'CommunicationPayload' == resource_type:
        from . import communication
        return communication.CommunicationPayload(jsondict)
    if 'CommunicationRequest' == resource_type:
        from . import communicationrequest
        return communicationrequest.CommunicationRequest(jsondict)
    if 'CommunicationRequestPayload' == resource_type:
        from . import communicationrequest
        return communicationrequest.CommunicationRequestPayload(jsondict)
    if 'CommunicationRequestRequester' == resource_type:
        from . import communicationrequest
        return communicationrequest.CommunicationRequestRequester(jsondict)
    if 'CompartmentDefinition' == resource_type:
        from . import compartmentdefinition
        return compartmentdefinition.CompartmentDefinition(jsondict)
    if 'CompartmentDefinitionResource' == resource_type:
        from . import compartmentdefinition
        return compartmentdefinition.CompartmentDefinitionResource(jsondict)
    if 'Composition' == resource_type:
        from . import composition
        return composition.Composition(jsondict)
    if 'CompositionAttester' == resource_type:
        from . import composition
        return composition.CompositionAttester(jsondict)
    if 'CompositionEvent' == resource_type:
        from . import composition
        return composition.CompositionEvent(jsondict)
    if 'CompositionRelatesTo' == resource_type:
        from . import composition
        return composition.CompositionRelatesTo(jsondict)
    if 'CompositionSection' == resource_type:
        from . import composition
        return composition.CompositionSection(jsondict)
    if 'ConceptMap' == resource_type:
        from . import conceptmap
        return conceptmap.ConceptMap(jsondict)
    if 'ConceptMapGroup' == resource_type:
        from . import conceptmap
        return conceptmap.ConceptMapGroup(jsondict)
    if 'ConceptMapGroupElement' == resource_type:
        from . import conceptmap
        return conceptmap.ConceptMapGroupElement(jsondict)
    if 'ConceptMapGroupElementTarget' == resource_type:
        from . import conceptmap
        return conceptmap.ConceptMapGroupElementTarget(jsondict)
    if 'ConceptMapGroupElementTargetDependsOn' == resource_type:
        from . import conceptmap
        return conceptmap.ConceptMapGroupElementTargetDependsOn(jsondict)
    if 'ConceptMapGroupUnmapped' == resource_type:
        from . import conceptmap
        return conceptmap.ConceptMapGroupUnmapped(jsondict)
    if 'Condition' == resource_type:
        from . import condition
        return condition.Condition(jsondict)
    if 'ConditionEvidence' == resource_type:
        from . import condition
        return condition.ConditionEvidence(jsondict)
    if 'ConditionStage' == resource_type:
        from . import condition
        return condition.ConditionStage(jsondict)
    if 'Consent' == resource_type:
        from . import consent
        return consent.Consent(jsondict)
    if 'ConsentActor' == resource_type:
        from . import consent
        return consent.ConsentActor(jsondict)
    if 'ConsentData' == resource_type:
        from . import consent
        return consent.ConsentData(jsondict)
    if 'ConsentExcept' == resource_type:
        from . import consent
        return consent.ConsentExcept(jsondict)
    if 'ConsentExceptActor' == resource_type:
        from . import consent
        return consent.ConsentExceptActor(jsondict)
    if 'ConsentExceptData' == resource_type:
        from . import consent
        return consent.ConsentExceptData(jsondict)
    if 'ConsentPolicy' == resource_type:
        from . import consent
        return consent.ConsentPolicy(jsondict)
    if 'ContactDetail' == resource_type:
        from . import contactdetail
        return contactdetail.ContactDetail(jsondict)
    if 'ContactPoint' == resource_type:
        from . import contactpoint
        return contactpoint.ContactPoint(jsondict)
    if 'Contract' == resource_type:
        from . import contract
        return contract.Contract(jsondict)
    if 'ContractAgent' == resource_type:
        from . import contract
        return contract.ContractAgent(jsondict)
    if 'ContractFriendly' == resource_type:
        from . import contract
        return contract.ContractFriendly(jsondict)
    if 'ContractLegal' == resource_type:
        from . import contract
        return contract.ContractLegal(jsondict)
    if 'ContractRule' == resource_type:
        from . import contract
        return contract.ContractRule(jsondict)
    if 'ContractSigner' == resource_type:
        from . import contract
        return contract.ContractSigner(jsondict)
    if 'ContractTerm' == resource_type:
        from . import contract
        return contract.ContractTerm(jsondict)
    if 'ContractTermAgent' == resource_type:
        from . import contract
        return contract.ContractTermAgent(jsondict)
    if 'ContractTermValuedItem' == resource_type:
        from . import contract
        return contract.ContractTermValuedItem(jsondict)
    if 'ContractValuedItem' == resource_type:
        from . import contract
        return contract.ContractValuedItem(jsondict)
    if 'Contributor' == resource_type:
        from . import contributor
        return contributor.Contributor(jsondict)
    if 'Count' == resource_type:
        from . import count
        return count.Count(jsondict)
    if 'Coverage' == resource_type:
        from . import coverage
        return coverage.Coverage(jsondict)
    if 'CoverageGrouping' == resource_type:
        from . import coverage
        return coverage.CoverageGrouping(jsondict)
    if 'DataElement' == resource_type:
        from . import dataelement
        return dataelement.DataElement(jsondict)
    if 'DataElementMapping' == resource_type:
        from . import dataelement
        return dataelement.DataElementMapping(jsondict)
    if 'DataRequirement' == resource_type:
        from . import datarequirement
        return datarequirement.DataRequirement(jsondict)
    if 'DataRequirementCodeFilter' == resource_type:
        from . import datarequirement
        return datarequirement.DataRequirementCodeFilter(jsondict)
    if 'DataRequirementDateFilter' == resource_type:
        from . import datarequirement
        return datarequirement.DataRequirementDateFilter(jsondict)
    if 'DetectedIssue' == resource_type:
        from . import detectedissue
        return detectedissue.DetectedIssue(jsondict)
    if 'DetectedIssueMitigation' == resource_type:
        from . import detectedissue
        return detectedissue.DetectedIssueMitigation(jsondict)
    if 'Device' == resource_type:
        from . import device
        return device.Device(jsondict)
    if 'DeviceComponent' == resource_type:
        from . import devicecomponent
        return devicecomponent.DeviceComponent(jsondict)
    if 'DeviceComponentProductionSpecification' == resource_type:
        from . import devicecomponent
        return devicecomponent.DeviceComponentProductionSpecification(jsondict)
    if 'DeviceMetric' == resource_type:
        from . import devicemetric
        return devicemetric.DeviceMetric(jsondict)
    if 'DeviceMetricCalibration' == resource_type:
        from . import devicemetric
        return devicemetric.DeviceMetricCalibration(jsondict)
    if 'DeviceRequest' == resource_type:
        from . import devicerequest
        return devicerequest.DeviceRequest(jsondict)
    if 'DeviceRequestRequester' == resource_type:
        from . import devicerequest
        return devicerequest.DeviceRequestRequester(jsondict)
    if 'DeviceUdi' == resource_type:
        from . import device
        return device.DeviceUdi(jsondict)
    if 'DeviceUseStatement' == resource_type:
        from . import deviceusestatement
        return deviceusestatement.DeviceUseStatement(jsondict)
    if 'DiagnosticReport' == resource_type:
        from . import diagnosticreport
        return diagnosticreport.DiagnosticReport(jsondict)
    if 'DiagnosticReportImage' == resource_type:
        from . import diagnosticreport
        return diagnosticreport.DiagnosticReportImage(jsondict)
    if 'DiagnosticReportPerformer' == resource_type:
        from . import diagnosticreport
        return diagnosticreport.DiagnosticReportPerformer(jsondict)
    if 'Distance' == resource_type:
        from . import distance
        return distance.Distance(jsondict)
    if 'DocumentManifest' == resource_type:
        from . import documentmanifest
        return documentmanifest.DocumentManifest(jsondict)
    if 'DocumentManifestContent' == resource_type:
        from . import documentmanifest
        return documentmanifest.DocumentManifestContent(jsondict)
    if 'DocumentManifestRelated' == resource_type:
        from . import documentmanifest
        return documentmanifest.DocumentManifestRelated(jsondict)
    if 'DocumentReference' == resource_type:
        from . import documentreference
        return documentreference.DocumentReference(jsondict)
    if 'DocumentReferenceContent' == resource_type:
        from . import documentreference
        return documentreference.DocumentReferenceContent(jsondict)
    if 'DocumentReferenceContext' == resource_type:
        from . import documentreference
        return documentreference.DocumentReferenceContext(jsondict)
    if 'DocumentReferenceContextRelated' == resource_type:
        from . import documentreference
        return documentreference.DocumentReferenceContextRelated(jsondict)
    if 'DocumentReferenceRelatesTo' == resource_type:
        from . import documentreference
        return documentreference.DocumentReferenceRelatesTo(jsondict)
    if 'DomainResource' == resource_type:
        from . import domainresource
        return domainresource.DomainResource(jsondict)
    if 'Dosage' == resource_type:
        from . import dosage
        return dosage.Dosage(jsondict)
    if 'Duration' == resource_type:
        from . import duration
        return duration.Duration(jsondict)
    if 'Element' == resource_type:
        from . import element
        return element.Element(jsondict)
    if 'ElementDefinition' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinition(jsondict)
    if 'ElementDefinitionBase' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionBase(jsondict)
    if 'ElementDefinitionBinding' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionBinding(jsondict)
    if 'ElementDefinitionConstraint' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionConstraint(jsondict)
    if 'ElementDefinitionExample' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionExample(jsondict)
    if 'ElementDefinitionMapping' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionMapping(jsondict)
    if 'ElementDefinitionSlicing' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionSlicing(jsondict)
    if 'ElementDefinitionSlicingDiscriminator' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionSlicingDiscriminator(jsondict
            )
    if 'ElementDefinitionType' == resource_type:
        from . import elementdefinition
        return elementdefinition.ElementDefinitionType(jsondict)
    if 'EligibilityRequest' == resource_type:
        from . import eligibilityrequest
        return eligibilityrequest.EligibilityRequest(jsondict)
    if 'EligibilityResponse' == resource_type:
        from . import eligibilityresponse
        return eligibilityresponse.EligibilityResponse(jsondict)
    if 'EligibilityResponseError' == resource_type:
        from . import eligibilityresponse
        return eligibilityresponse.EligibilityResponseError(jsondict)
    if 'EligibilityResponseInsurance' == resource_type:
        from . import eligibilityresponse
        return eligibilityresponse.EligibilityResponseInsurance(jsondict)
    if 'EligibilityResponseInsuranceBenefitBalance' == resource_type:
        from . import eligibilityresponse
        return eligibilityresponse.EligibilityResponseInsuranceBenefitBalance(
            jsondict)
    if 'EligibilityResponseInsuranceBenefitBalanceFinancial' == resource_type:
        from . import eligibilityresponse
        return (eligibilityresponse.
            EligibilityResponseInsuranceBenefitBalanceFinancial(jsondict))
    if 'Encounter' == resource_type:
        from . import encounter
        return encounter.Encounter(jsondict)
    if 'EncounterClassHistory' == resource_type:
        from . import encounter
        return encounter.EncounterClassHistory(jsondict)
    if 'EncounterDiagnosis' == resource_type:
        from . import encounter
        return encounter.EncounterDiagnosis(jsondict)
    if 'EncounterHospitalization' == resource_type:
        from . import encounter
        return encounter.EncounterHospitalization(jsondict)
    if 'EncounterLocation' == resource_type:
        from . import encounter
        return encounter.EncounterLocation(jsondict)
    if 'EncounterParticipant' == resource_type:
        from . import encounter
        return encounter.EncounterParticipant(jsondict)
    if 'EncounterStatusHistory' == resource_type:
        from . import encounter
        return encounter.EncounterStatusHistory(jsondict)
    if 'Endpoint' == resource_type:
        from . import endpoint
        return endpoint.Endpoint(jsondict)
    if 'EnrollmentRequest' == resource_type:
        from . import enrollmentrequest
        return enrollmentrequest.EnrollmentRequest(jsondict)
    if 'EnrollmentResponse' == resource_type:
        from . import enrollmentresponse
        return enrollmentresponse.EnrollmentResponse(jsondict)
    if 'EpisodeOfCare' == resource_type:
        from . import episodeofcare
        return episodeofcare.EpisodeOfCare(jsondict)
    if 'EpisodeOfCareDiagnosis' == resource_type:
        from . import episodeofcare
        return episodeofcare.EpisodeOfCareDiagnosis(jsondict)
    if 'EpisodeOfCareStatusHistory' == resource_type:
        from . import episodeofcare
        return episodeofcare.EpisodeOfCareStatusHistory(jsondict)
    if 'ExpansionProfile' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfile(jsondict)
    if 'ExpansionProfileDesignation' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfileDesignation(jsondict)
    if 'ExpansionProfileDesignationExclude' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfileDesignationExclude(jsondict)
    if 'ExpansionProfileDesignationExcludeDesignation' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfileDesignationExcludeDesignation(
            jsondict)
    if 'ExpansionProfileDesignationInclude' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfileDesignationInclude(jsondict)
    if 'ExpansionProfileDesignationIncludeDesignation' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfileDesignationIncludeDesignation(
            jsondict)
    if 'ExpansionProfileExcludedSystem' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfileExcludedSystem(jsondict)
    if 'ExpansionProfileFixedVersion' == resource_type:
        from . import expansionprofile
        return expansionprofile.ExpansionProfileFixedVersion(jsondict)
    if 'ExplanationOfBenefit' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefit(jsondict)
    if 'ExplanationOfBenefitAccident' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitAccident(jsondict)
    if 'ExplanationOfBenefitAddItem' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitAddItem(jsondict)
    if 'ExplanationOfBenefitAddItemDetail' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitAddItemDetail(jsondict)
    if 'ExplanationOfBenefitBenefitBalance' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitBenefitBalance(jsondict
            )
    if 'ExplanationOfBenefitBenefitBalanceFinancial' == resource_type:
        from . import explanationofbenefit
        return (explanationofbenefit.
            ExplanationOfBenefitBenefitBalanceFinancial(jsondict))
    if 'ExplanationOfBenefitCareTeam' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitCareTeam(jsondict)
    if 'ExplanationOfBenefitDiagnosis' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitDiagnosis(jsondict)
    if 'ExplanationOfBenefitInformation' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitInformation(jsondict)
    if 'ExplanationOfBenefitInsurance' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitInsurance(jsondict)
    if 'ExplanationOfBenefitItem' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitItem(jsondict)
    if 'ExplanationOfBenefitItemAdjudication' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitItemAdjudication(
            jsondict)
    if 'ExplanationOfBenefitItemDetail' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitItemDetail(jsondict)
    if 'ExplanationOfBenefitItemDetailSubDetail' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail(
            jsondict)
    if 'ExplanationOfBenefitPayee' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitPayee(jsondict)
    if 'ExplanationOfBenefitPayment' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitPayment(jsondict)
    if 'ExplanationOfBenefitProcedure' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitProcedure(jsondict)
    if 'ExplanationOfBenefitProcessNote' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitProcessNote(jsondict)
    if 'ExplanationOfBenefitRelated' == resource_type:
        from . import explanationofbenefit
        return explanationofbenefit.ExplanationOfBenefitRelated(jsondict)
    if 'Extension' == resource_type:
        from . import extension
        return extension.Extension(jsondict)
    if 'FamilyMemberHistory' == resource_type:
        from . import familymemberhistory
        return familymemberhistory.FamilyMemberHistory(jsondict)
    if 'FamilyMemberHistoryCondition' == resource_type:
        from . import familymemberhistory
        return familymemberhistory.FamilyMemberHistoryCondition(jsondict)
    if 'Flag' == resource_type:
        from . import flag
        return flag.Flag(jsondict)
    if 'Goal' == resource_type:
        from . import goal
        return goal.Goal(jsondict)
    if 'GoalTarget' == resource_type:
        from . import goal
        return goal.GoalTarget(jsondict)
    if 'GraphDefinition' == resource_type:
        from . import graphdefinition
        return graphdefinition.GraphDefinition(jsondict)
    if 'GraphDefinitionLink' == resource_type:
        from . import graphdefinition
        return graphdefinition.GraphDefinitionLink(jsondict)
    if 'GraphDefinitionLinkTarget' == resource_type:
        from . import graphdefinition
        return graphdefinition.GraphDefinitionLinkTarget(jsondict)
    if 'GraphDefinitionLinkTargetCompartment' == resource_type:
        from . import graphdefinition
        return graphdefinition.GraphDefinitionLinkTargetCompartment(jsondict)
    if 'Group' == resource_type:
        from . import group
        return group.Group(jsondict)
    if 'GroupCharacteristic' == resource_type:
        from . import group
        return group.GroupCharacteristic(jsondict)
    if 'GroupMember' == resource_type:
        from . import group
        return group.GroupMember(jsondict)
    if 'GuidanceResponse' == resource_type:
        from . import guidanceresponse
        return guidanceresponse.GuidanceResponse(jsondict)
    if 'HealthcareService' == resource_type:
        from . import healthcareservice
        return healthcareservice.HealthcareService(jsondict)
    if 'HealthcareServiceAvailableTime' == resource_type:
        from . import healthcareservice
        return healthcareservice.HealthcareServiceAvailableTime(jsondict)
    if 'HealthcareServiceNotAvailable' == resource_type:
        from . import healthcareservice
        return healthcareservice.HealthcareServiceNotAvailable(jsondict)
    if 'HumanName' == resource_type:
        from . import humanname
        return humanname.HumanName(jsondict)
    if 'Identifier' == resource_type:
        from . import identifier
        return identifier.Identifier(jsondict)
    if 'ImagingManifest' == resource_type:
        from . import imagingmanifest
        return imagingmanifest.ImagingManifest(jsondict)
    if 'ImagingManifestStudy' == resource_type:
        from . import imagingmanifest
        return imagingmanifest.ImagingManifestStudy(jsondict)
    if 'ImagingManifestStudySeries' == resource_type:
        from . import imagingmanifest
        return imagingmanifest.ImagingManifestStudySeries(jsondict)
    if 'ImagingManifestStudySeriesInstance' == resource_type:
        from . import imagingmanifest
        return imagingmanifest.ImagingManifestStudySeriesInstance(jsondict)
    if 'ImagingStudy' == resource_type:
        from . import imagingstudy
        return imagingstudy.ImagingStudy(jsondict)
    if 'ImagingStudySeries' == resource_type:
        from . import imagingstudy
        return imagingstudy.ImagingStudySeries(jsondict)
    if 'ImagingStudySeriesInstance' == resource_type:
        from . import imagingstudy
        return imagingstudy.ImagingStudySeriesInstance(jsondict)
    if 'Immunization' == resource_type:
        from . import immunization
        return immunization.Immunization(jsondict)
    if 'ImmunizationExplanation' == resource_type:
        from . import immunization
        return immunization.ImmunizationExplanation(jsondict)
    if 'ImmunizationPractitioner' == resource_type:
        from . import immunization
        return immunization.ImmunizationPractitioner(jsondict)
    if 'ImmunizationReaction' == resource_type:
        from . import immunization
        return immunization.ImmunizationReaction(jsondict)
    if 'ImmunizationRecommendation' == resource_type:
        from . import immunizationrecommendation
        return immunizationrecommendation.ImmunizationRecommendation(jsondict)
    if 'ImmunizationRecommendationRecommendation' == resource_type:
        from . import immunizationrecommendation
        return (immunizationrecommendation.
            ImmunizationRecommendationRecommendation(jsondict))
    if ('ImmunizationRecommendationRecommendationDateCriterion' ==
        resource_type):
        from . import immunizationrecommendation
        return (immunizationrecommendation.
            ImmunizationRecommendationRecommendationDateCriterion(jsondict))
    if 'ImmunizationRecommendationRecommendationProtocol' == resource_type:
        from . import immunizationrecommendation
        return (immunizationrecommendation.
            ImmunizationRecommendationRecommendationProtocol(jsondict))
    if 'ImmunizationVaccinationProtocol' == resource_type:
        from . import immunization
        return immunization.ImmunizationVaccinationProtocol(jsondict)
    if 'ImplementationGuide' == resource_type:
        from . import implementationguide
        return implementationguide.ImplementationGuide(jsondict)
    if 'ImplementationGuideDependency' == resource_type:
        from . import implementationguide
        return implementationguide.ImplementationGuideDependency(jsondict)
    if 'ImplementationGuideGlobal' == resource_type:
        from . import implementationguide
        return implementationguide.ImplementationGuideGlobal(jsondict)
    if 'ImplementationGuidePackage' == resource_type:
        from . import implementationguide
        return implementationguide.ImplementationGuidePackage(jsondict)
    if 'ImplementationGuidePackageResource' == resource_type:
        from . import implementationguide
        return implementationguide.ImplementationGuidePackageResource(jsondict)
    if 'ImplementationGuidePage' == resource_type:
        from . import implementationguide
        return implementationguide.ImplementationGuidePage(jsondict)
    if 'Library' == resource_type:
        from . import library
        return library.Library(jsondict)
    if 'Linkage' == resource_type:
        from . import linkage
        return linkage.Linkage(jsondict)
    if 'LinkageItem' == resource_type:
        from . import linkage
        return linkage.LinkageItem(jsondict)
    if 'List' == resource_type:
        from . import list
        return list.List(jsondict)
    if 'ListEntry' == resource_type:
        from . import list
        return list.ListEntry(jsondict)
    if 'Location' == resource_type:
        from . import location
        return location.Location(jsondict)
    if 'LocationPosition' == resource_type:
        from . import location
        return location.LocationPosition(jsondict)
    if 'Measure' == resource_type:
        from . import measure
        return measure.Measure(jsondict)
    if 'MeasureGroup' == resource_type:
        from . import measure
        return measure.MeasureGroup(jsondict)
    if 'MeasureGroupPopulation' == resource_type:
        from . import measure
        return measure.MeasureGroupPopulation(jsondict)
    if 'MeasureGroupStratifier' == resource_type:
        from . import measure
        return measure.MeasureGroupStratifier(jsondict)
    if 'MeasureReport' == resource_type:
        from . import measurereport
        return measurereport.MeasureReport(jsondict)
    if 'MeasureReportGroup' == resource_type:
        from . import measurereport
        return measurereport.MeasureReportGroup(jsondict)
    if 'MeasureReportGroupPopulation' == resource_type:
        from . import measurereport
        return measurereport.MeasureReportGroupPopulation(jsondict)
    if 'MeasureReportGroupStratifier' == resource_type:
        from . import measurereport
        return measurereport.MeasureReportGroupStratifier(jsondict)
    if 'MeasureReportGroupStratifierStratum' == resource_type:
        from . import measurereport
        return measurereport.MeasureReportGroupStratifierStratum(jsondict)
    if 'MeasureReportGroupStratifierStratumPopulation' == resource_type:
        from . import measurereport
        return measurereport.MeasureReportGroupStratifierStratumPopulation(
            jsondict)
    if 'MeasureSupplementalData' == resource_type:
        from . import measure
        return measure.MeasureSupplementalData(jsondict)
    if 'Media' == resource_type:
        from . import media
        return media.Media(jsondict)
    if 'Medication' == resource_type:
        from . import medication
        return medication.Medication(jsondict)
    if 'MedicationAdministration' == resource_type:
        from . import medicationadministration
        return medicationadministration.MedicationAdministration(jsondict)
    if 'MedicationAdministrationDosage' == resource_type:
        from . import medicationadministration
        return medicationadministration.MedicationAdministrationDosage(jsondict
            )
    if 'MedicationAdministrationPerformer' == resource_type:
        from . import medicationadministration
        return medicationadministration.MedicationAdministrationPerformer(
            jsondict)
    if 'MedicationDispense' == resource_type:
        from . import medicationdispense
        return medicationdispense.MedicationDispense(jsondict)
    if 'MedicationDispensePerformer' == resource_type:
        from . import medicationdispense
        return medicationdispense.MedicationDispensePerformer(jsondict)
    if 'MedicationDispenseSubstitution' == resource_type:
        from . import medicationdispense
        return medicationdispense.MedicationDispenseSubstitution(jsondict)
    if 'MedicationIngredient' == resource_type:
        from . import medication
        return medication.MedicationIngredient(jsondict)
    if 'MedicationPackage' == resource_type:
        from . import medication
        return medication.MedicationPackage(jsondict)
    if 'MedicationPackageBatch' == resource_type:
        from . import medication
        return medication.MedicationPackageBatch(jsondict)
    if 'MedicationPackageContent' == resource_type:
        from . import medication
        return medication.MedicationPackageContent(jsondict)
    if 'MedicationRequest' == resource_type:
        from . import medicationrequest
        return medicationrequest.MedicationRequest(jsondict)
    if 'MedicationRequestDispenseRequest' == resource_type:
        from . import medicationrequest
        return medicationrequest.MedicationRequestDispenseRequest(jsondict)
    if 'MedicationRequestRequester' == resource_type:
        from . import medicationrequest
        return medicationrequest.MedicationRequestRequester(jsondict)
    if 'MedicationRequestSubstitution' == resource_type:
        from . import medicationrequest
        return medicationrequest.MedicationRequestSubstitution(jsondict)
    if 'MedicationStatement' == resource_type:
        from . import medicationstatement
        return medicationstatement.MedicationStatement(jsondict)
    if 'MessageDefinition' == resource_type:
        from . import messagedefinition
        return messagedefinition.MessageDefinition(jsondict)
    if 'MessageDefinitionAllowedResponse' == resource_type:
        from . import messagedefinition
        return messagedefinition.MessageDefinitionAllowedResponse(jsondict)
    if 'MessageDefinitionFocus' == resource_type:
        from . import messagedefinition
        return messagedefinition.MessageDefinitionFocus(jsondict)
    if 'MessageHeader' == resource_type:
        from . import messageheader
        return messageheader.MessageHeader(jsondict)
    if 'MessageHeaderDestination' == resource_type:
        from . import messageheader
        return messageheader.MessageHeaderDestination(jsondict)
    if 'MessageHeaderResponse' == resource_type:
        from . import messageheader
        return messageheader.MessageHeaderResponse(jsondict)
    if 'MessageHeaderSource' == resource_type:
        from . import messageheader
        return messageheader.MessageHeaderSource(jsondict)
    if 'Meta' == resource_type:
        from . import meta
        return meta.Meta(jsondict)
    if 'MetadataResource' == resource_type:
        from . import metadataresource
        return metadataresource.MetadataResource(jsondict)
    if 'Money' == resource_type:
        from . import money
        return money.Money(jsondict)
    if 'NamingSystem' == resource_type:
        from . import namingsystem
        return namingsystem.NamingSystem(jsondict)
    if 'NamingSystemUniqueId' == resource_type:
        from . import namingsystem
        return namingsystem.NamingSystemUniqueId(jsondict)
    if 'Narrative' == resource_type:
        from . import narrative
        return narrative.Narrative(jsondict)
    if 'NutritionOrder' == resource_type:
        from . import nutritionorder
        return nutritionorder.NutritionOrder(jsondict)
    if 'NutritionOrderEnteralFormula' == resource_type:
        from . import nutritionorder
        return nutritionorder.NutritionOrderEnteralFormula(jsondict)
    if 'NutritionOrderEnteralFormulaAdministration' == resource_type:
        from . import nutritionorder
        return nutritionorder.NutritionOrderEnteralFormulaAdministration(
            jsondict)
    if 'NutritionOrderOralDiet' == resource_type:
        from . import nutritionorder
        return nutritionorder.NutritionOrderOralDiet(jsondict)
    if 'NutritionOrderOralDietNutrient' == resource_type:
        from . import nutritionorder
        return nutritionorder.NutritionOrderOralDietNutrient(jsondict)
    if 'NutritionOrderOralDietTexture' == resource_type:
        from . import nutritionorder
        return nutritionorder.NutritionOrderOralDietTexture(jsondict)
    if 'NutritionOrderSupplement' == resource_type:
        from . import nutritionorder
        return nutritionorder.NutritionOrderSupplement(jsondict)
    if 'Observation' == resource_type:
        from . import observation
        return observation.Observation(jsondict)
    if 'ObservationComponent' == resource_type:
        from . import observation
        return observation.ObservationComponent(jsondict)
    if 'ObservationReferenceRange' == resource_type:
        from . import observation
        return observation.ObservationReferenceRange(jsondict)
    if 'ObservationRelated' == resource_type:
        from . import observation
        return observation.ObservationRelated(jsondict)
    if 'OperationDefinition' == resource_type:
        from . import operationdefinition
        return operationdefinition.OperationDefinition(jsondict)
    if 'OperationDefinitionOverload' == resource_type:
        from . import operationdefinition
        return operationdefinition.OperationDefinitionOverload(jsondict)
    if 'OperationDefinitionParameter' == resource_type:
        from . import operationdefinition
        return operationdefinition.OperationDefinitionParameter(jsondict)
    if 'OperationDefinitionParameterBinding' == resource_type:
        from . import operationdefinition
        return operationdefinition.OperationDefinitionParameterBinding(jsondict
            )
    if 'OperationOutcome' == resource_type:
        from . import operationoutcome
        return operationoutcome.OperationOutcome(jsondict)
    if 'OperationOutcomeIssue' == resource_type:
        from . import operationoutcome
        return operationoutcome.OperationOutcomeIssue(jsondict)
    if 'Organization' == resource_type:
        from . import organization
        return organization.Organization(jsondict)
    if 'OrganizationContact' == resource_type:
        from . import organization
        return organization.OrganizationContact(jsondict)
    if 'ParameterDefinition' == resource_type:
        from . import parameterdefinition
        return parameterdefinition.ParameterDefinition(jsondict)
    if 'Parameters' == resource_type:
        from . import parameters
        return parameters.Parameters(jsondict)
    if 'ParametersParameter' == resource_type:
        from . import parameters
        return parameters.ParametersParameter(jsondict)
    if 'Patient' == resource_type:
        from . import patient
        return patient.Patient(jsondict)
    if 'PatientAnimal' == resource_type:
        from . import patient
        return patient.PatientAnimal(jsondict)
    if 'PatientCommunication' == resource_type:
        from . import patient
        return patient.PatientCommunication(jsondict)
    if 'PatientContact' == resource_type:
        from . import patient
        return patient.PatientContact(jsondict)
    if 'PatientLink' == resource_type:
        from . import patient
        return patient.PatientLink(jsondict)
    if 'PaymentNotice' == resource_type:
        from . import paymentnotice
        return paymentnotice.PaymentNotice(jsondict)
    if 'PaymentReconciliation' == resource_type:
        from . import paymentreconciliation
        return paymentreconciliation.PaymentReconciliation(jsondict)
    if 'PaymentReconciliationDetail' == resource_type:
        from . import paymentreconciliation
        return paymentreconciliation.PaymentReconciliationDetail(jsondict)
    if 'PaymentReconciliationProcessNote' == resource_type:
        from . import paymentreconciliation
        return paymentreconciliation.PaymentReconciliationProcessNote(jsondict)
    if 'Period' == resource_type:
        from . import period
        return period.Period(jsondict)
    if 'Person' == resource_type:
        from . import person
        return person.Person(jsondict)
    if 'PersonLink' == resource_type:
        from . import person
        return person.PersonLink(jsondict)
    if 'PlanDefinition' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinition(jsondict)
    if 'PlanDefinitionAction' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinitionAction(jsondict)
    if 'PlanDefinitionActionCondition' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinitionActionCondition(jsondict)
    if 'PlanDefinitionActionDynamicValue' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinitionActionDynamicValue(jsondict)
    if 'PlanDefinitionActionParticipant' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinitionActionParticipant(jsondict)
    if 'PlanDefinitionActionRelatedAction' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinitionActionRelatedAction(jsondict)
    if 'PlanDefinitionGoal' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinitionGoal(jsondict)
    if 'PlanDefinitionGoalTarget' == resource_type:
        from . import plandefinition
        return plandefinition.PlanDefinitionGoalTarget(jsondict)
    if 'Practitioner' == resource_type:
        from . import practitioner
        return practitioner.Practitioner(jsondict)
    if 'PractitionerQualification' == resource_type:
        from . import practitioner
        return practitioner.PractitionerQualification(jsondict)
    if 'PractitionerRole' == resource_type:
        from . import practitionerrole
        return practitionerrole.PractitionerRole(jsondict)
    if 'PractitionerRoleAvailableTime' == resource_type:
        from . import practitionerrole
        return practitionerrole.PractitionerRoleAvailableTime(jsondict)
    if 'PractitionerRoleNotAvailable' == resource_type:
        from . import practitionerrole
        return practitionerrole.PractitionerRoleNotAvailable(jsondict)
    if 'Procedure' == resource_type:
        from . import procedure
        return procedure.Procedure(jsondict)
    if 'ProcedureFocalDevice' == resource_type:
        from . import procedure
        return procedure.ProcedureFocalDevice(jsondict)
    if 'ProcedurePerformer' == resource_type:
        from . import procedure
        return procedure.ProcedurePerformer(jsondict)
    if 'ProcedureRequest' == resource_type:
        from . import procedurerequest
        return procedurerequest.ProcedureRequest(jsondict)
    if 'ProcedureRequestRequester' == resource_type:
        from . import procedurerequest
        return procedurerequest.ProcedureRequestRequester(jsondict)
    if 'ProcessRequest' == resource_type:
        from . import processrequest
        return processrequest.ProcessRequest(jsondict)
    if 'ProcessRequestItem' == resource_type:
        from . import processrequest
        return processrequest.ProcessRequestItem(jsondict)
    if 'ProcessResponse' == resource_type:
        from . import processresponse
        return processresponse.ProcessResponse(jsondict)
    if 'ProcessResponseProcessNote' == resource_type:
        from . import processresponse
        return processresponse.ProcessResponseProcessNote(jsondict)
    if 'Provenance' == resource_type:
        from . import provenance
        return provenance.Provenance(jsondict)
    if 'ProvenanceAgent' == resource_type:
        from . import provenance
        return provenance.ProvenanceAgent(jsondict)
    if 'ProvenanceEntity' == resource_type:
        from . import provenance
        return provenance.ProvenanceEntity(jsondict)
    if 'Quantity' == resource_type:
        from . import quantity
        return quantity.Quantity(jsondict)
    if 'Questionnaire' == resource_type:
        from . import questionnaire
        return questionnaire.Questionnaire(jsondict)
    if 'QuestionnaireItem' == resource_type:
        from . import questionnaire
        return questionnaire.QuestionnaireItem(jsondict)
    if 'QuestionnaireItemEnableWhen' == resource_type:
        from . import questionnaire
        return questionnaire.QuestionnaireItemEnableWhen(jsondict)
    if 'QuestionnaireItemOption' == resource_type:
        from . import questionnaire
        return questionnaire.QuestionnaireItemOption(jsondict)
    if 'QuestionnaireResponse' == resource_type:
        from . import questionnaireresponse
        return questionnaireresponse.QuestionnaireResponse(jsondict)
    if 'QuestionnaireResponseItem' == resource_type:
        from . import questionnaireresponse
        return questionnaireresponse.QuestionnaireResponseItem(jsondict)
    if 'QuestionnaireResponseItemAnswer' == resource_type:
        from . import questionnaireresponse
        return questionnaireresponse.QuestionnaireResponseItemAnswer(jsondict)
    if 'Range' == resource_type:
        from . import range
        return range.Range(jsondict)
    if 'Ratio' == resource_type:
        from . import ratio
        return ratio.Ratio(jsondict)
    if 'Reference' == resource_type:
        from . import reference
        return reference.Reference(jsondict)
    if 'ReferralRequest' == resource_type:
        from . import referralrequest
        return referralrequest.ReferralRequest(jsondict)
    if 'ReferralRequestRequester' == resource_type:
        from . import referralrequest
        return referralrequest.ReferralRequestRequester(jsondict)
    if 'RelatedArtifact' == resource_type:
        from . import relatedartifact
        return relatedartifact.RelatedArtifact(jsondict)
    if 'RelatedPerson' == resource_type:
        from . import relatedperson
        return relatedperson.RelatedPerson(jsondict)
    if 'RequestGroup' == resource_type:
        from . import requestgroup
        return requestgroup.RequestGroup(jsondict)
    if 'RequestGroupAction' == resource_type:
        from . import requestgroup
        return requestgroup.RequestGroupAction(jsondict)
    if 'RequestGroupActionCondition' == resource_type:
        from . import requestgroup
        return requestgroup.RequestGroupActionCondition(jsondict)
    if 'RequestGroupActionRelatedAction' == resource_type:
        from . import requestgroup
        return requestgroup.RequestGroupActionRelatedAction(jsondict)
    if 'ResearchStudy' == resource_type:
        from . import researchstudy
        return researchstudy.ResearchStudy(jsondict)
    if 'ResearchStudyArm' == resource_type:
        from . import researchstudy
        return researchstudy.ResearchStudyArm(jsondict)
    if 'ResearchSubject' == resource_type:
        from . import researchsubject
        return researchsubject.ResearchSubject(jsondict)
    if 'Resource' == resource_type:
        from . import resource
        return resource.Resource(jsondict)
    if 'RiskAssessment' == resource_type:
        from . import riskassessment
        return riskassessment.RiskAssessment(jsondict)
    if 'RiskAssessmentPrediction' == resource_type:
        from . import riskassessment
        return riskassessment.RiskAssessmentPrediction(jsondict)
    if 'SampledData' == resource_type:
        from . import sampleddata
        return sampleddata.SampledData(jsondict)
    if 'Schedule' == resource_type:
        from . import schedule
        return schedule.Schedule(jsondict)
    if 'SearchParameter' == resource_type:
        from . import searchparameter
        return searchparameter.SearchParameter(jsondict)
    if 'SearchParameterComponent' == resource_type:
        from . import searchparameter
        return searchparameter.SearchParameterComponent(jsondict)
    if 'Sequence' == resource_type:
        from . import sequence
        return sequence.Sequence(jsondict)
    if 'SequenceQuality' == resource_type:
        from . import sequence
        return sequence.SequenceQuality(jsondict)
    if 'SequenceReferenceSeq' == resource_type:
        from . import sequence
        return sequence.SequenceReferenceSeq(jsondict)
    if 'SequenceRepository' == resource_type:
        from . import sequence
        return sequence.SequenceRepository(jsondict)
    if 'SequenceVariant' == resource_type:
        from . import sequence
        return sequence.SequenceVariant(jsondict)
    if 'ServiceDefinition' == resource_type:
        from . import servicedefinition
        return servicedefinition.ServiceDefinition(jsondict)
    if 'Signature' == resource_type:
        from . import signature
        return signature.Signature(jsondict)
    if 'Slot' == resource_type:
        from . import slot
        return slot.Slot(jsondict)
    if 'Specimen' == resource_type:
        from . import specimen
        return specimen.Specimen(jsondict)
    if 'SpecimenCollection' == resource_type:
        from . import specimen
        return specimen.SpecimenCollection(jsondict)
    if 'SpecimenContainer' == resource_type:
        from . import specimen
        return specimen.SpecimenContainer(jsondict)
    if 'SpecimenProcessing' == resource_type:
        from . import specimen
        return specimen.SpecimenProcessing(jsondict)
    if 'StructureDefinition' == resource_type:
        from . import structuredefinition
        return structuredefinition.StructureDefinition(jsondict)
    if 'StructureDefinitionDifferential' == resource_type:
        from . import structuredefinition
        return structuredefinition.StructureDefinitionDifferential(jsondict)
    if 'StructureDefinitionMapping' == resource_type:
        from . import structuredefinition
        return structuredefinition.StructureDefinitionMapping(jsondict)
    if 'StructureDefinitionSnapshot' == resource_type:
        from . import structuredefinition
        return structuredefinition.StructureDefinitionSnapshot(jsondict)
    if 'StructureMap' == resource_type:
        from . import structuremap
        return structuremap.StructureMap(jsondict)
    if 'StructureMapGroup' == resource_type:
        from . import structuremap
        return structuremap.StructureMapGroup(jsondict)
    if 'StructureMapGroupInput' == resource_type:
        from . import structuremap
        return structuremap.StructureMapGroupInput(jsondict)
    if 'StructureMapGroupRule' == resource_type:
        from . import structuremap
        return structuremap.StructureMapGroupRule(jsondict)
    if 'StructureMapGroupRuleDependent' == resource_type:
        from . import structuremap
        return structuremap.StructureMapGroupRuleDependent(jsondict)
    if 'StructureMapGroupRuleSource' == resource_type:
        from . import structuremap
        return structuremap.StructureMapGroupRuleSource(jsondict)
    if 'StructureMapGroupRuleTarget' == resource_type:
        from . import structuremap
        return structuremap.StructureMapGroupRuleTarget(jsondict)
    if 'StructureMapGroupRuleTargetParameter' == resource_type:
        from . import structuremap
        return structuremap.StructureMapGroupRuleTargetParameter(jsondict)
    if 'StructureMapStructure' == resource_type:
        from . import structuremap
        return structuremap.StructureMapStructure(jsondict)
    if 'Subscription' == resource_type:
        from . import subscription
        return subscription.Subscription(jsondict)
    if 'SubscriptionChannel' == resource_type:
        from . import subscription
        return subscription.SubscriptionChannel(jsondict)
    if 'Substance' == resource_type:
        from . import substance
        return substance.Substance(jsondict)
    if 'SubstanceIngredient' == resource_type:
        from . import substance
        return substance.SubstanceIngredient(jsondict)
    if 'SubstanceInstance' == resource_type:
        from . import substance
        return substance.SubstanceInstance(jsondict)
    if 'SupplyDelivery' == resource_type:
        from . import supplydelivery
        return supplydelivery.SupplyDelivery(jsondict)
    if 'SupplyDeliverySuppliedItem' == resource_type:
        from . import supplydelivery
        return supplydelivery.SupplyDeliverySuppliedItem(jsondict)
    if 'SupplyRequest' == resource_type:
        from . import supplyrequest
        return supplyrequest.SupplyRequest(jsondict)
    if 'SupplyRequestOrderedItem' == resource_type:
        from . import supplyrequest
        return supplyrequest.SupplyRequestOrderedItem(jsondict)
    if 'SupplyRequestRequester' == resource_type:
        from . import supplyrequest
        return supplyrequest.SupplyRequestRequester(jsondict)
    if 'Task' == resource_type:
        from . import task
        return task.Task(jsondict)
    if 'TaskInput' == resource_type:
        from . import task
        return task.TaskInput(jsondict)
    if 'TaskOutput' == resource_type:
        from . import task
        return task.TaskOutput(jsondict)
    if 'TaskRequester' == resource_type:
        from . import task
        return task.TaskRequester(jsondict)
    if 'TaskRestriction' == resource_type:
        from . import task
        return task.TaskRestriction(jsondict)
    if 'TestReport' == resource_type:
        from . import testreport
        return testreport.TestReport(jsondict)
    if 'TestReportParticipant' == resource_type:
        from . import testreport
        return testreport.TestReportParticipant(jsondict)
    if 'TestReportSetup' == resource_type:
        from . import testreport
        return testreport.TestReportSetup(jsondict)
    if 'TestReportSetupAction' == resource_type:
        from . import testreport
        return testreport.TestReportSetupAction(jsondict)
    if 'TestReportSetupActionAssert' == resource_type:
        from . import testreport
        return testreport.TestReportSetupActionAssert(jsondict)
    if 'TestReportSetupActionOperation' == resource_type:
        from . import testreport
        return testreport.TestReportSetupActionOperation(jsondict)
    if 'TestReportTeardown' == resource_type:
        from . import testreport
        return testreport.TestReportTeardown(jsondict)
    if 'TestReportTeardownAction' == resource_type:
        from . import testreport
        return testreport.TestReportTeardownAction(jsondict)
    if 'TestReportTest' == resource_type:
        from . import testreport
        return testreport.TestReportTest(jsondict)
    if 'TestReportTestAction' == resource_type:
        from . import testreport
        return testreport.TestReportTestAction(jsondict)
    if 'TestScript' == resource_type:
        from . import testscript
        return testscript.TestScript(jsondict)
    if 'TestScriptDestination' == resource_type:
        from . import testscript
        return testscript.TestScriptDestination(jsondict)
    if 'TestScriptFixture' == resource_type:
        from . import testscript
        return testscript.TestScriptFixture(jsondict)
    if 'TestScriptMetadata' == resource_type:
        from . import testscript
        return testscript.TestScriptMetadata(jsondict)
    if 'TestScriptMetadataCapability' == resource_type:
        from . import testscript
        return testscript.TestScriptMetadataCapability(jsondict)
    if 'TestScriptMetadataLink' == resource_type:
        from . import testscript
        return testscript.TestScriptMetadataLink(jsondict)
    if 'TestScriptOrigin' == resource_type:
        from . import testscript
        return testscript.TestScriptOrigin(jsondict)
    if 'TestScriptRule' == resource_type:
        from . import testscript
        return testscript.TestScriptRule(jsondict)
    if 'TestScriptRuleParam' == resource_type:
        from . import testscript
        return testscript.TestScriptRuleParam(jsondict)
    if 'TestScriptRuleset' == resource_type:
        from . import testscript
        return testscript.TestScriptRuleset(jsondict)
    if 'TestScriptRulesetRule' == resource_type:
        from . import testscript
        return testscript.TestScriptRulesetRule(jsondict)
    if 'TestScriptRulesetRuleParam' == resource_type:
        from . import testscript
        return testscript.TestScriptRulesetRuleParam(jsondict)
    if 'TestScriptSetup' == resource_type:
        from . import testscript
        return testscript.TestScriptSetup(jsondict)
    if 'TestScriptSetupAction' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupAction(jsondict)
    if 'TestScriptSetupActionAssert' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionAssert(jsondict)
    if 'TestScriptSetupActionAssertRule' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionAssertRule(jsondict)
    if 'TestScriptSetupActionAssertRuleParam' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionAssertRuleParam(jsondict)
    if 'TestScriptSetupActionAssertRuleset' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionAssertRuleset(jsondict)
    if 'TestScriptSetupActionAssertRulesetRule' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionAssertRulesetRule(jsondict)
    if 'TestScriptSetupActionAssertRulesetRuleParam' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionAssertRulesetRuleParam(jsondict)
    if 'TestScriptSetupActionOperation' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionOperation(jsondict)
    if 'TestScriptSetupActionOperationRequestHeader' == resource_type:
        from . import testscript
        return testscript.TestScriptSetupActionOperationRequestHeader(jsondict)
    if 'TestScriptTeardown' == resource_type:
        from . import testscript
        return testscript.TestScriptTeardown(jsondict)
    if 'TestScriptTeardownAction' == resource_type:
        from . import testscript
        return testscript.TestScriptTeardownAction(jsondict)
    if 'TestScriptTest' == resource_type:
        from . import testscript
        return testscript.TestScriptTest(jsondict)
    if 'TestScriptTestAction' == resource_type:
        from . import testscript
        return testscript.TestScriptTestAction(jsondict)
    if 'TestScriptVariable' == resource_type:
        from . import testscript
        return testscript.TestScriptVariable(jsondict)
    if 'Timing' == resource_type:
        from . import timing
        return timing.Timing(jsondict)
    if 'TimingRepeat' == resource_type:
        from . import timing
        return timing.TimingRepeat(jsondict)
    if 'TriggerDefinition' == resource_type:
        from . import triggerdefinition
        return triggerdefinition.TriggerDefinition(jsondict)
    if 'UsageContext' == resource_type:
        from . import usagecontext
        return usagecontext.UsageContext(jsondict)
    if 'ValueSet' == resource_type:
        from . import valueset
        return valueset.ValueSet(jsondict)
    if 'ValueSetCompose' == resource_type:
        from . import valueset
        return valueset.ValueSetCompose(jsondict)
    if 'ValueSetComposeInclude' == resource_type:
        from . import valueset
        return valueset.ValueSetComposeInclude(jsondict)
    if 'ValueSetComposeIncludeConcept' == resource_type:
        from . import valueset
        return valueset.ValueSetComposeIncludeConcept(jsondict)
    if 'ValueSetComposeIncludeConceptDesignation' == resource_type:
        from . import valueset
        return valueset.ValueSetComposeIncludeConceptDesignation(jsondict)
    if 'ValueSetComposeIncludeFilter' == resource_type:
        from . import valueset
        return valueset.ValueSetComposeIncludeFilter(jsondict)
    if 'ValueSetExpansion' == resource_type:
        from . import valueset
        return valueset.ValueSetExpansion(jsondict)
    if 'ValueSetExpansionContains' == resource_type:
        from . import valueset
        return valueset.ValueSetExpansionContains(jsondict)
    if 'ValueSetExpansionParameter' == resource_type:
        from . import valueset
        return valueset.ValueSetExpansionParameter(jsondict)
    if 'VisionPrescription' == resource_type:
        from . import visionprescription
        return visionprescription.VisionPrescription(jsondict)
    if 'VisionPrescriptionDispense' == resource_type:
        from . import visionprescription
        return visionprescription.VisionPrescriptionDispense(jsondict)
    from . import element
    return element.Element(jsondict)


def rebuildBuild(buildStatus, reason='<rebuild, no reason given>'):
    """Rebuild something we've already built before. This submits a
        BuildRequest to our Builder using the same SourceStamp as the earlier
        build. This has no effect (but may eventually raise an exception) if
        this Build has not yet finished."""


def calculate_relative_difference(i, j):
    """
    Calculate the relative difference between two numbers.

    The function takes the absolute difference divided by the absolute
    value of their arithmetic mean.

    :param i: A number.

    :param j: Another number

    :return: A float representing the relative difference (a ratio) between
        the two numbers passed to this function.
    """
    return 0 if i + j == 0 else abs(i - j) / abs(i + j) * 2


def get_canvas_width() ->int:
    """Returns the canvas width.

    :return:  The canvas width.
    """
    pass


def shared():
    """The type of shared repository or None."""


@classmethod
def from_places(cls, places):
    """Make an event location from a list of places."""
    description = cls.format_place_list(places)
    return cls(description, places)


def sampling(value, sampling_frequency):
    """return the sampled value at a given sampling frequency"""
    ret_value = 0
    if value % (1 / sampling_frequency) <= 1 / sampling_frequency / 2:
        ret_value = value - value % (1 / sampling_frequency)
    else:
        ret_value = value - value % (1 / sampling_frequency
            ) + 1 / sampling_frequency
    return ret_value


def psycopg_uri(username, password, db_name, host='', port=None):
    """Create a URL for psycopg2.

	http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#module-sqlalchemy.dialects.postgresql.psycopg2  # noqa
	"""
    if port:
        return (
            f'postgresql+psycopg2://{username}:{password}@{host}:{port}/{db_name}'
            )
    else:
        return f'postgresql+psycopg2://{username}:{password}@{host}/{db_name}'


def nag_function_is_input(name):
    """
    Check wether a NAG function name is of type input
    """
    if name[0:1] == 'i':
        return True
    else:
        return False


def transform(inventory):
    """Transform an Ansible inventory object prior to JSON serialization.

    This transform is the identity function, and is provided as an example.

    Args:
        inventory: A dictionary containing an Ansible inventory.
            The inventory contains per-host variables for 'ip_address',
            'hostname' and 'mac_address'.

    Returns:
        A dictionary containing an Ansible inventory.
    """
    return inventory


def _set_daily_ward_vaccination_capacity(params, name: str, index: int,
    value: float):
    """Adjust the Parameters.daily_ward_vaccination_capacity
       parameter
    """
    if index is not None:
        raise IndexError(
            'You cannot index the daily_ward_vaccination parameter')
    params.daily_ward_vaccination_capacity = value


def get_all_indices(element, alist):
    """
    Find the index of an element in a list. The element can appear multiple times.
    input:  alist - a list
            element - objective element
    output: index of the element in the list
    """
    result = []
    offset = -1
    while True:
        try:
            offset = alist.index(element, offset + 1)
        except ValueError:
            return result
        result.append(offset)


def dunder_partition(key):
    """Splits a dunderkey into 2 parts

    The first part is everything before the final double underscore
    The second part is after the final double underscore

        >>> dunder_partition('a__b__c')
        >>> ('a__b', 'c')

    :param neskey : String
    :rtype        : 2 Tuple

    """
    parts = key.rsplit('__', 1)
    return tuple(parts) if len(parts) > 1 else (parts[0], None)


@classmethod
def get_method_from_index(cls, index):
    """ Returns the actual refinement method defined by the index """
    return cls.get_all_methods()[index]


def parse_genes(prod_genes):
    """
    Parse the the Biopython SeqRecord representation of the Prodigal GFF output. Specifically, retrieve the
    start positions, end positions, strand orientation and sequences of each gene
    :param prod_genes: A SeqRecord object with genes found by Prodigal
    :return: A dict with the retrieved data
    """
    starts = []
    ends = []
    strands = []
    seqs = []
    for record in prod_genes:
        data = prod_genes[record].description.split(' # ')
        starts.append(int(data[1]))
        ends.append(int(data[2]))
        strands.append(int(data[3]))
        seqs.append(prod_genes[record].seq)
    samp_id = data[0]
    return {'start': starts, 'end': ends, 'strand': strands, 'sequence':
        seqs, 'id': samp_id}


def render_git_describe(pieces):
    """TAG[-DISTANCE-gHEX][-dirty].

    Like 'git describe --tags --dirty --always'.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
    """
    if pieces['closest-tag']:
        rendered = pieces['closest-tag']
        if pieces['distance']:
            rendered += '-%d-g%s' % (pieces['distance'], pieces['short'])
    else:
        rendered = pieces['short']
    if pieces['dirty']:
        rendered += '-dirty'
    return rendered


def get_header(fname):
    """
    helper function to extract header in spec file.
    .. warning :: This function works fine for spec file format
    from Canadian light source. Others may need to be tested.

    Parameters
    ----------
    fname : spec file name
    """
    mydata = []
    with open(fname, 'r') as f:
        for v in f:
            mydata.append(v)
            _sign = '#'
            _sign = _sign.encode('utf-8')
            if _sign not in v:
                break
    header_line = mydata[-2]
    n = [v.strip() for v in header_line[1:].split('\t') if v.strip() != '']
    return n


def convert_boolean(inpt):
    """Return boolean value from input boolean input

    >>> convert_boolean('1')
    True
    >>> convert_boolean('-1')
    True
    >>> convert_boolean('FaLsE')
    False
    >>> convert_boolean('FaLsEx')
    True
    >>> convert_boolean(0)
    False
    """
    val = False
    if str(inpt).lower() in ['false', 'f']:
        val = False
    else:
        try:
            val = int(inpt)
            if val == 0:
                val = False
            else:
                val = True
        except Exception:
            val = True
    return val


def flip_seq(a_c, a_e):
    """
    Flips a sequence from the probabilities
    of being in a state to not benig in the state.
    """
    a_c[a_e < 1] = -a_c[a_e < 1]
    a_c[a_e == 1] = 1 - a_c[a_e == 1]
    return a_c


def has_migrations(engine):
    """Returns true if at least one data row can be migrated."""
    return False


def sort_jid(contact):
    """Sort by contact JID"""
    return contact.bare_jid


def pluralize(singular=None):
    """ Naively pluralize words """
    if singular.endswith('y') and not singular.endswith('ay'):
        plural = singular[:-1] + 'ies'
    elif singular.endswith('s'):
        plural = singular + 'es'
    else:
        plural = singular + 's'
    return plural


def _import_module(name, package=None, warn=True, prefix='_py_', ignore='_'):
    """Try import all public attributes from module into global namespace.

    Existing attributes with name clashes are renamed with prefix.
    Attributes starting with underscore are ignored by default.

    Return True on successful import.

    """
    import warnings
    from importlib import import_module
    try:
        if not package:
            module = import_module(name)
        else:
            module = import_module('.' + name, package=package)
    except ImportError:
        if warn:
            warnings.warn('failed to import module %s' % name)
    else:
        for attr in dir(module):
            if ignore and attr.startswith(ignore):
                continue
            if prefix:
                if attr in globals():
                    globals()[prefix + attr] = globals()[attr]
                elif warn:
                    warnings.warn('no Python implementation of ' + attr)
            globals()[attr] = getattr(module, attr)
        return True


def make_exact(h):
    """Make sure h is an exact representable number

    This is important when calculating numerical derivatives and is
    accomplished by adding 1.0 and then subtracting 1.0.
    """
    return h + 1.0 - 1.0


@classmethod
def is_binary_payload(cls) ->bool:
    """True if payload is not JSON."""
    return True


def with_metaclass(meta, *bases):
    """Create a base class with a metaclass."""
    return meta('NewBase', bases, {})


def add_arg(func, *args, **kwargs):
    """Bind CLI arguments to a shell.py `do_foo` function."""
    if not hasattr(func, 'arguments'):
        func.arguments = []
    if (args, kwargs) not in func.arguments:
        func.arguments.insert(0, (args, kwargs))


def get_application_root(context, application):
    """
    Get Accessibility object of an application, based upon given name.

    :type context: <behave.runner.Context>
    :param context: Context object that is passed from common steps.

    :type application: str
    :param application: String of application identification: name.

    :rtype: <dogtail.tree.root.application>
    :return: Return root object of application.

    .. note::

        Do **NOT** call this by yourself. This function is called by :mod:`common_steps`.
    """
    from dogtail.tree import root
    try:
        root_to_return = root.application(application)
    except Exception:
        assert False, 'Application was not found in accessibility. Check your environment or feature file!'
    return root_to_return


@classmethod
def for_grammar(cls, g):
    """ Create a parser for the Grammar in g """
    p = cls()
    p.init_from_grammar(g)
    return p


def openego_header():
    """openego header in files

    Returns
    -------
    :any:`str`
        openego group py-file header
    """
    header = """""\"This file is part of DING0, the DIstribution Network GeneratOr.
DING0 is a tool to generate synthetic medium and low voltage power
distribution grids based on open data.

It is developed in the project open_eGo: https://openegoproject.wordpress.com

DING0 lives at github: https://github.com/openego/ding0/
The documentation is available on RTD: http://ding0.readthedocs.io""\"

__copyright__  = "Reiner Lemoine Institut gGmbH"
__license__    = "GNU Affero General Public License Version 3 (AGPL-3.0)"
__url__        = "https://github.com/openego/ding0/blob/master/LICENSE"
__author__     = "nesnoj, gplssm"

"""
    return header


def glGetProgramiv(program: int, pname: int, params: int):
    """Returns a parameter from a program object.

    :param program: Specifies the program object to be queried.
    :type program: int
    :param pname: Specifies the object parameter.
    :type pname: int
    :param params: Returns the requested object parameter.
    :type params: int
    """
    pass


def hashable(v):
    """Determine whether `v` can be hashed."""
    try:
        hash(v)
    except TypeError:
        return False
    return True


@classmethod
def no_blocker(cls, path, cls_):
    """Return False if there's a non-Namespace object in the path."""
    try:
        namespace = vars(cls_)
        for name in path:
            namespace = namespace[name]
            if not isinstance(namespace, cls):
                return False
    except KeyError:
        pass
    return True


@classmethod
def from_shape(cls, shape, **kwargs):
    """Construct a mesh from a primitive shape.

        Parameters
        ----------
        shape : :class: `compas.geometry.shape`
            The input shape to generate a mesh from.
        kwargs:
            Optional keyword arguments ``u`` and ``v`` for the resolution in u (Torus, Sphere, Cylinder, Cone) and v direction (Torus and Sphere).

        Returns
        -------
        Mesh
            A mesh object.

        Examples
        --------
        >>>
        """
    vertices, faces = shape.to_vertices_and_faces(**kwargs)
    mesh = cls.from_vertices_and_faces(vertices, faces)
    return mesh


def r_sa_check(template, tag_type, is_standalone):
    """Do a final checkto see if a tag could be a standalone"""
    if is_standalone and tag_type not in ['variable', 'no escape']:
        on_newline = template.split('\n', 1)
        if on_newline[0].isspace() or not on_newline[0]:
            return True
        else:
            return False
    else:
        return False


def set_keybindings(image_widget):
    """
    Set image widget keyboard bindings. The bindings are:

    + Pan by click-and-drag or with arrow keys.
    + Zoom by scrolling or using the ``+``/``-`` keys.
    + Adjust contrast by Ctrl-left click and drag; reset with
      shift-right-click.

    Any existing key bindings are removed.

    Parameters
    ----------

    image_widget : astrowidgets.ImageWidget
        Image widget on which to set the key bindings.
    """
    bind_map = image_widget._viewer.get_bindmap()
    bind_map.clear_event_map()
    bind_map.map_event(None, (), 'ms_left', 'pan')
    bind_map.map_event(None, (), 'pa_pan', 'zoom')
    bind_map.map_event(None, (), 'ms_right', 'contrast')
    bind_map.map_event(None, ('shift',), 'ms_right', 'contrast_restore')
    bind_map.map_event(None, ('ctrl',), 'ms_left', 'cursor')
    bind_map.map_event(None, (), 'kp_+', 'zoom_in')
    bind_map.map_event(None, (), 'kp_=', 'zoom_in')
    bind_map.map_event(None, (), 'kp_-', 'zoom_out')
    bind_map.map_event(None, (), 'kp__', 'zoom_out')
    bind_map.map_event(None, (), 'kp_left', 'pan_right')
    bind_map.map_event(None, (), 'kp_right', 'pan_left')
    bind_map.map_event(None, (), 'kp_up', 'pan_down')
    bind_map.map_event(None, (), 'kp_down', 'pan_up')


@staticmethod
def argparser_add_default_command_line_arguments(argparser):
    """
        Every command line program must offer a similar set of parameter
        to connect to a Bareos File Daemon.
        This method adds the required parameter to an existing ArgParser object.
        Parameter required to initialize a FileDaemon class
        are stored in variables prefixed with BAREOS_.

        Use the argparser_get_bareos_parameter method to retrieve the relevant parameter
        (with the BAREOS_ prefix removed).

        Example:
        argparser = argparse.ArgumentParser(description='Console to Bareos Director.')
        DirectorConsole.argparser_add_default_command_line_arguments(argparser)
        args = argparser.parse_args()
        bareos_args = DirectorConsole.argparser_get_bareos_parameter(args)
        director = DirectorConsole(**bareos_args)

        @param argparser: ArgParser
        @type name: ArgParser
        """
    argparser.add_argument('--name', help=
        'Name of the Director resource in the File Daemon.', required=True,
        dest='BAREOS_name')
    argparser.add_argument('-p', '--password', help=
        'Password to authenticate to a Bareos File Daemon.', required=True,
        dest='BAREOS_password')
    argparser.add_argument('--port', default=9102, help=
        'Bareos File Daemon network port.', dest='BAREOS_port')
    argparser.add_argument('--address', default='localhost', help=
        'Bareos File Daemon network address.', dest='BAREOS_address')
    argparser.add_argument('--tls-psk-require', help=
        'Allow only encrypted connections. Default: False.', action=
        'store_true', dest='BAREOS_tls_psk_require')


def datetime_format(value):
    """Validate the correct format of a datetime string and deserialize."""
    from msrest.serialization import Deserializer
    from msrest.exceptions import DeserializationError
    try:
        datetime_obj = Deserializer.deserialize_iso(value)
    except DeserializationError:
        message = 'Argument {} is not a valid ISO-8601 datetime format'
        raise ValueError(message.format(value))
    return datetime_obj