text:
class FHIRElementFactory(object):
    """ Factory class to instantiate resources by resource name.
    """

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

        :param str resource_name: 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_name:
            from . import account
            return account.Account(jsondict)
        if "Address" == resource_name:
            from . import address
            return address.Address(jsondict)
        if "Age" == resource_name:
            from . import age
            return age.Age(jsondict)
        if "AllergyIntolerance" == resource_name:
            from . import allergyintolerance
            return allergyintolerance.AllergyIntolerance(jsondict)
        if "AllergyIntoleranceReaction" == resource_name:
            from . import allergyintolerance
            return allergyintolerance.AllergyIntoleranceReaction(jsondict)
        if "Annotation" == resource_name:
            from . import annotation
            return annotation.Annotation(jsondict)
        if "Appointment" == resource_name:
            from . import appointment
            return appointment.Appointment(jsondict)
        if "AppointmentParticipant" == resource_name:
            from . import appointment
            return appointment.AppointmentParticipant(jsondict)
        if "AppointmentResponse" == resource_name:
            from . import appointmentresponse
            return appointmentresponse.AppointmentResponse(jsondict)
        if "Attachment" == resource_name:
            from . import attachment
            return attachment.Attachment(jsondict)
        if "AuditEvent" == resource_name:
            from . import auditevent
            return auditevent.AuditEvent(jsondict)
        if "AuditEventEvent" == resource_name:
            from . import auditevent
            return auditevent.AuditEventEvent(jsondict)
        if "AuditEventObject" == resource_name:
            from . import auditevent
            return auditevent.AuditEventObject(jsondict)
        if "AuditEventObjectDetail" == resource_name:
            from . import auditevent
            return auditevent.AuditEventObjectDetail(jsondict)
        if "AuditEventParticipant" == resource_name:
            from . import auditevent
            return auditevent.AuditEventParticipant(jsondict)
        if "AuditEventParticipantNetwork" == resource_name:
            from . import auditevent
            return auditevent.AuditEventParticipantNetwork(jsondict)
        if "AuditEventSource" == resource_name:
            from . import auditevent
            return auditevent.AuditEventSource(jsondict)
        if "BackboneElement" == resource_name:
            from . import backboneelement
            return backboneelement.BackboneElement(jsondict)
        if "Basic" == resource_name:
            from . import basic
            return basic.Basic(jsondict)
        if "Binary" == resource_name:
            from . import binary
            return binary.Binary(jsondict)
        if "BodySite" == resource_name:
            from . import bodysite
            return bodysite.BodySite(jsondict)
        if "Bundle" == resource_name:
            from . import bundle
            return bundle.Bundle(jsondict)
        if "BundleEntry" == resource_name:
            from . import bundle
            return bundle.BundleEntry(jsondict)
        if "BundleEntryRequest" == resource_name:
            from . import bundle
            return bundle.BundleEntryRequest(jsondict)
        if "BundleEntryResponse" == resource_name:
            from . import bundle
            return bundle.BundleEntryResponse(jsondict)
        if "BundleEntrySearch" == resource_name:
            from . import bundle
            return bundle.BundleEntrySearch(jsondict)
        if "BundleLink" == resource_name:
            from . import bundle
            return bundle.BundleLink(jsondict)
        if "CarePlan" == resource_name:
            from . import careplan
            return careplan.CarePlan(jsondict)
        if "CarePlanActivity" == resource_name:
            from . import careplan
            return careplan.CarePlanActivity(jsondict)
        if "CarePlanActivityDetail" == resource_name:
            from . import careplan
            return careplan.CarePlanActivityDetail(jsondict)
        if "CarePlanParticipant" == resource_name:
            from . import careplan
            return careplan.CarePlanParticipant(jsondict)
        if "CarePlanRelatedPlan" == resource_name:
            from . import careplan
            return careplan.CarePlanRelatedPlan(jsondict)
        if "Claim" == resource_name:
            from . import claim
            return claim.Claim(jsondict)
        if "ClaimCoverage" == resource_name:
            from . import claim
            return claim.ClaimCoverage(jsondict)
        if "ClaimDiagnosis" == resource_name:
            from . import claim
            return claim.ClaimDiagnosis(jsondict)
        if "ClaimItem" == resource_name:
            from . import claim
            return claim.ClaimItem(jsondict)
        if "ClaimItemDetail" == resource_name:
            from . import claim
            return claim.ClaimItemDetail(jsondict)
        if "ClaimItemDetailSubDetail" == resource_name:
            from . import claim
            return claim.ClaimItemDetailSubDetail(jsondict)
        if "ClaimItemProsthesis" == resource_name:
            from . import claim
            return claim.ClaimItemProsthesis(jsondict)
        if "ClaimMissingTeeth" == resource_name:
            from . import claim
            return claim.ClaimMissingTeeth(jsondict)
        if "ClaimPayee" == resource_name:
            from . import claim
            return claim.ClaimPayee(jsondict)
        if "ClaimResponse" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponse(jsondict)
        if "ClaimResponseAddItem" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseAddItem(jsondict)
        if "ClaimResponseAddItemAdjudication" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseAddItemAdjudication(jsondict)
        if "ClaimResponseAddItemDetail" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseAddItemDetail(jsondict)
        if "ClaimResponseAddItemDetailAdjudication" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseAddItemDetailAdjudication(jsondict)
        if "ClaimResponseCoverage" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseCoverage(jsondict)
        if "ClaimResponseError" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseError(jsondict)
        if "ClaimResponseItem" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseItem(jsondict)
        if "ClaimResponseItemAdjudication" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseItemAdjudication(jsondict)
        if "ClaimResponseItemDetail" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseItemDetail(jsondict)
        if "ClaimResponseItemDetailAdjudication" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseItemDetailAdjudication(jsondict)
        if "ClaimResponseItemDetailSubDetail" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseItemDetailSubDetail(jsondict)
        if "ClaimResponseItemDetailSubDetailAdjudication" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseItemDetailSubDetailAdjudication(jsondict)
        if "ClaimResponseNote" == resource_name:
            from . import claimresponse
            return claimresponse.ClaimResponseNote(jsondict)
        if "ClinicalImpression" == resource_name:
            from . import clinicalimpression
            return clinicalimpression.ClinicalImpression(jsondict)
        if "ClinicalImpressionFinding" == resource_name:
            from . import clinicalimpression
            return clinicalimpression.ClinicalImpressionFinding(jsondict)
        if "ClinicalImpressionInvestigations" == resource_name:
            from . import clinicalimpression
            return clinicalimpression.ClinicalImpressionInvestigations(jsondict)
        if "ClinicalImpressionRuledOut" == resource_name:
            from . import clinicalimpression
            return clinicalimpression.ClinicalImpressionRuledOut(jsondict)
        if "CodeableConcept" == resource_name:
            from . import codeableconcept
            return codeableconcept.CodeableConcept(jsondict)
        if "Coding" == resource_name:
            from . import coding
            return coding.Coding(jsondict)
        if "Communication" == resource_name:
            from . import communication
            return communication.Communication(jsondict)
        if "CommunicationPayload" == resource_name:
            from . import communication
            return communication.CommunicationPayload(jsondict)
        if "CommunicationRequest" == resource_name:
            from . import communicationrequest
            return communicationrequest.CommunicationRequest(jsondict)
        if "CommunicationRequestPayload" == resource_name:
            from . import communicationrequest
            return communicationrequest.CommunicationRequestPayload(jsondict)
        if "Composition" == resource_name:
            from . import composition
            return composition.Composition(jsondict)
        if "CompositionAttester" == resource_name:
            from . import composition
            return composition.CompositionAttester(jsondict)
        if "CompositionEvent" == resource_name:
            from . import composition
            return composition.CompositionEvent(jsondict)
        if "CompositionSection" == resource_name:
            from . import composition
            return composition.CompositionSection(jsondict)
        if "ConceptMap" == resource_name:
            from . import conceptmap
            return conceptmap.ConceptMap(jsondict)
        if "ConceptMapContact" == resource_name:
            from . import conceptmap
            return conceptmap.ConceptMapContact(jsondict)
        if "ConceptMapElement" == resource_name:
            from . import conceptmap
            return conceptmap.ConceptMapElement(jsondict)
        if "ConceptMapElementTarget" == resource_name:
            from . import conceptmap
            return conceptmap.ConceptMapElementTarget(jsondict)
        if "ConceptMapElementTargetDependsOn" == resource_name:
            from . import conceptmap
            return conceptmap.ConceptMapElementTargetDependsOn(jsondict)
        if "Condition" == resource_name:
            from . import condition
            return condition.Condition(jsondict)
        if "ConditionEvidence" == resource_name:
            from . import condition
            return condition.ConditionEvidence(jsondict)
        if "ConditionStage" == resource_name:
            from . import condition
            return condition.ConditionStage(jsondict)
        if "Conformance" == resource_name:
            from . import conformance
            return conformance.Conformance(jsondict)
        if "ConformanceContact" == resource_name:
            from . import conformance
            return conformance.ConformanceContact(jsondict)
        if "ConformanceDocument" == resource_name:
            from . import conformance
            return conformance.ConformanceDocument(jsondict)
        if "ConformanceImplementation" == resource_name:
            from . import conformance
            return conformance.ConformanceImplementation(jsondict)
        if "ConformanceMessaging" == resource_name:
            from . import conformance
            return conformance.ConformanceMessaging(jsondict)
        if "ConformanceMessagingEndpoint" == resource_name:
            from . import conformance
            return conformance.ConformanceMessagingEndpoint(jsondict)
        if "ConformanceMessagingEvent" == resource_name:
            from . import conformance
            return conformance.ConformanceMessagingEvent(jsondict)
        if "ConformanceRest" == resource_name:
            from . import conformance
            return conformance.ConformanceRest(jsondict)
        if "ConformanceRestInteraction" == resource_name:
            from . import conformance
            return conformance.ConformanceRestInteraction(jsondict)
        if "ConformanceRestOperation" == resource_name:
            from . import conformance
            return conformance.ConformanceRestOperation(jsondict)
        if "ConformanceRestResource" == resource_name:
            from . import conformance
            return conformance.ConformanceRestResource(jsondict)
        if "ConformanceRestResourceInteraction" == resource_name:
            from . import conformance
            return conformance.ConformanceRestResourceInteraction(jsondict)
        if "ConformanceRestResourceSearchParam" == resource_name:
            from . import conformance
            return conformance.ConformanceRestResourceSearchParam(jsondict)
        if "ConformanceRestSecurity" == resource_name:
            from . import conformance
            return conformance.ConformanceRestSecurity(jsondict)
        if "ConformanceRestSecurityCertificate" == resource_name:
            from . import conformance
            return conformance.ConformanceRestSecurityCertificate(jsondict)
        if "ConformanceSoftware" == resource_name:
            from . import conformance
            return conformance.ConformanceSoftware(jsondict)
        if "ContactPoint" == resource_name:
            from . import contactpoint
            return contactpoint.ContactPoint(jsondict)
        if "Contract" == resource_name:
            from . import contract
            return contract.Contract(jsondict)
        if "ContractActor" == resource_name:
            from . import contract
            return contract.ContractActor(jsondict)
        if "ContractFriendly" == resource_name:
            from . import contract
            return contract.ContractFriendly(jsondict)
        if "ContractLegal" == resource_name:
            from . import contract
            return contract.ContractLegal(jsondict)
        if "ContractRule" == resource_name:
            from . import contract
            return contract.ContractRule(jsondict)
        if "ContractSigner" == resource_name:
            from . import contract
            return contract.ContractSigner(jsondict)
        if "ContractTerm" == resource_name:
            from . import contract
            return contract.ContractTerm(jsondict)
        if "ContractTermActor" == resource_name:
            from . import contract
            return contract.ContractTermActor(jsondict)
        if "ContractTermValuedItem" == resource_name:
            from . import contract
            return contract.ContractTermValuedItem(jsondict)
        if "ContractValuedItem" == resource_name:
            from . import contract
            return contract.ContractValuedItem(jsondict)
        if "Count" == resource_name:
            from . import count
            return count.Count(jsondict)
        if "Coverage" == resource_name:
            from . import coverage
            return coverage.Coverage(jsondict)
        if "DataElement" == resource_name:
            from . import dataelement
            return dataelement.DataElement(jsondict)
        if "DataElementContact" == resource_name:
            from . import dataelement
            return dataelement.DataElementContact(jsondict)
        if "DataElementMapping" == resource_name:
            from . import dataelement
            return dataelement.DataElementMapping(jsondict)
        if "DetectedIssue" == resource_name:
            from . import detectedissue
            return detectedissue.DetectedIssue(jsondict)
        if "DetectedIssueMitigation" == resource_name:
            from . import detectedissue
            return detectedissue.DetectedIssueMitigation(jsondict)
        if "Device" == resource_name:
            from . import device
            return device.Device(jsondict)
        if "DeviceComponent" == resource_name:
            from . import devicecomponent
            return devicecomponent.DeviceComponent(jsondict)
        if "DeviceComponentProductionSpecification" == resource_name:
            from . import devicecomponent
            return devicecomponent.DeviceComponentProductionSpecification(jsondict)
        if "DeviceMetric" == resource_name:
            from . import devicemetric
            return devicemetric.DeviceMetric(jsondict)
        if "DeviceMetricCalibration" == resource_name:
            from . import devicemetric
            return devicemetric.DeviceMetricCalibration(jsondict)
        if "DeviceUseRequest" == resource_name:
            from . import deviceuserequest
            return deviceuserequest.DeviceUseRequest(jsondict)
        if "DeviceUseStatement" == resource_name:
            from . import deviceusestatement
            return deviceusestatement.DeviceUseStatement(jsondict)
        if "DiagnosticOrder" == resource_name:
            from . import diagnosticorder
            return diagnosticorder.DiagnosticOrder(jsondict)
        if "DiagnosticOrderEvent" == resource_name:
            from . import diagnosticorder
            return diagnosticorder.DiagnosticOrderEvent(jsondict)
        if "DiagnosticOrderItem" == resource_name:
            from . import diagnosticorder
            return diagnosticorder.DiagnosticOrderItem(jsondict)
        if "DiagnosticReport" == resource_name:
            from . import diagnosticreport
            return diagnosticreport.DiagnosticReport(jsondict)
        if "DiagnosticReportImage" == resource_name:
            from . import diagnosticreport
            return diagnosticreport.DiagnosticReportImage(jsondict)
        if "Distance" == resource_name:
            from . import distance
            return distance.Distance(jsondict)
        if "DocumentManifest" == resource_name:
            from . import documentmanifest
            return documentmanifest.DocumentManifest(jsondict)
        if "DocumentManifestContent" == resource_name:
            from . import documentmanifest
            return documentmanifest.DocumentManifestContent(jsondict)
        if "DocumentManifestRelated" == resource_name:
            from . import documentmanifest
            return documentmanifest.DocumentManifestRelated(jsondict)
        if "DocumentReference" == resource_name:
            from . import documentreference
            return documentreference.DocumentReference(jsondict)
        if "DocumentReferenceContent" == resource_name:
            from . import documentreference
            return documentreference.DocumentReferenceContent(jsondict)
        if "DocumentReferenceContext" == resource_name:
            from . import documentreference
            return documentreference.DocumentReferenceContext(jsondict)
        if "DocumentReferenceContextRelated" == resource_name:
            from . import documentreference
            return documentreference.DocumentReferenceContextRelated(jsondict)
        if "DocumentReferenceRelatesTo" == resource_name:
            from . import documentreference
            return documentreference.DocumentReferenceRelatesTo(jsondict)
        if "DomainResource" == resource_name:
            from . import domainresource
            return domainresource.DomainResource(jsondict)
        if "Duration" == resource_name:
            from . import duration
            return duration.Duration(jsondict)
        if "Element" == resource_name:
            from . import element
            return element.Element(jsondict)
        if "ElementDefinition" == resource_name:
            from . import elementdefinition
            return elementdefinition.ElementDefinition(jsondict)
        if "ElementDefinitionBase" == resource_name:
            from . import elementdefinition
            return elementdefinition.ElementDefinitionBase(jsondict)
        if "ElementDefinitionBinding" == resource_name:
            from . import elementdefinition
            return elementdefinition.ElementDefinitionBinding(jsondict)
        if "ElementDefinitionConstraint" == resource_name:
            from . import elementdefinition
            return elementdefinition.ElementDefinitionConstraint(jsondict)
        if "ElementDefinitionMapping" == resource_name:
            from . import elementdefinition
            return elementdefinition.ElementDefinitionMapping(jsondict)
        if "ElementDefinitionSlicing" == resource_name:
            from . import elementdefinition
            return elementdefinition.ElementDefinitionSlicing(jsondict)
        if "ElementDefinitionType" == resource_name:
            from . import elementdefinition
            return elementdefinition.ElementDefinitionType(jsondict)
        if "EligibilityRequest" == resource_name:
            from . import eligibilityrequest
            return eligibilityrequest.EligibilityRequest(jsondict)
        if "EligibilityResponse" == resource_name:
            from . import eligibilityresponse
            return eligibilityresponse.EligibilityResponse(jsondict)
        if "Encounter" == resource_name:
            from . import encounter
            return encounter.Encounter(jsondict)
        if "EncounterHospitalization" == resource_name:
            from . import encounter
            return encounter.EncounterHospitalization(jsondict)
        if "EncounterLocation" == resource_name:
            from . import encounter
            return encounter.EncounterLocation(jsondict)
        if "EncounterParticipant" == resource_name:
            from . import encounter
            return encounter.EncounterParticipant(jsondict)
        if "EncounterStatusHistory" == resource_name:
            from . import encounter
            return encounter.EncounterStatusHistory(jsondict)
        if "EnrollmentRequest" == resource_name:
            from . import enrollmentrequest
            return enrollmentrequest.EnrollmentRequest(jsondict)
        if "EnrollmentResponse" == resource_name:
            from . import enrollmentresponse
            return enrollmentresponse.EnrollmentResponse(jsondict)
        if "EpisodeOfCare" == resource_name:
            from . import episodeofcare
            return episodeofcare.EpisodeOfCare(jsondict)
        if "EpisodeOfCareCareTeam" == resource_name:
            from . import episodeofcare
            return episodeofcare.EpisodeOfCareCareTeam(jsondict)
        if "EpisodeOfCareStatusHistory" == resource_name:
            from . import episodeofcare
            return episodeofcare.EpisodeOfCareStatusHistory(jsondict)
        if "ExplanationOfBenefit" == resource_name:
            from . import explanationofbenefit
            return explanationofbenefit.ExplanationOfBenefit(jsondict)
        if "Extension" == resource_name:
            from . import extension
            return extension.Extension(jsondict)
        if "FamilyMemberHistory" == resource_name:
            from . import familymemberhistory
            return familymemberhistory.FamilyMemberHistory(jsondict)
        if "FamilyMemberHistoryCondition" == resource_name:
            from . import familymemberhistory
            return familymemberhistory.FamilyMemberHistoryCondition(jsondict)
        if "Flag" == resource_name:
            from . import flag
            return flag.Flag(jsondict)
        if "Goal" == resource_name:
            from . import goal
            return goal.Goal(jsondict)
        if "GoalOutcome" == resource_name:
            from . import goal
            return goal.GoalOutcome(jsondict)
        if "Group" == resource_name:
            from . import group
            return group.Group(jsondict)
        if "GroupCharacteristic" == resource_name:
            from . import group
            return group.GroupCharacteristic(jsondict)
        if "GroupMember" == resource_name:
            from . import group
            return group.GroupMember(jsondict)
        if "HealthcareService" == resource_name:
            from . import healthcareservice
            return healthcareservice.HealthcareService(jsondict)
        if "HealthcareServiceAvailableTime" == resource_name:
            from . import healthcareservice
            return healthcareservice.HealthcareServiceAvailableTime(jsondict)
        if "HealthcareServiceNotAvailable" == resource_name:
            from . import healthcareservice
            return healthcareservice.HealthcareServiceNotAvailable(jsondict)
        if "HealthcareServiceServiceType" == resource_name:
            from . import healthcareservice
            return healthcareservice.HealthcareServiceServiceType(jsondict)
        if "HumanName" == resource_name:
            from . import humanname
            return humanname.HumanName(jsondict)
        if "Identifier" == resource_name:
            from . import identifier
            return identifier.Identifier(jsondict)
        if "ImagingObjectSelection" == resource_name:
            from . import imagingobjectselection
            return imagingobjectselection.ImagingObjectSelection(jsondict)
        if "ImagingObjectSelectionStudy" == resource_name:
            from . import imagingobjectselection
            return imagingobjectselection.ImagingObjectSelectionStudy(jsondict)
        if "ImagingObjectSelectionStudySeries" == resource_name:
            from . import imagingobjectselection
            return imagingobjectselection.ImagingObjectSelectionStudySeries(jsondict)
        if "ImagingObjectSelectionStudySeriesInstance" == resource_name:
            from . import imagingobjectselection
            return imagingobjectselection.ImagingObjectSelectionStudySeriesInstance(jsondict)
        if "ImagingObjectSelectionStudySeriesInstanceFrames" == resource_name:
            from . import imagingobjectselection
            return imagingobjectselection.ImagingObjectSelectionStudySeriesInstanceFrames(jsondict)
        if "ImagingStudy" == resource_name:
            from . import imagingstudy
            return imagingstudy.ImagingStudy(jsondict)
        if "ImagingStudySeries" == resource_name:
            from . import imagingstudy
            return imagingstudy.ImagingStudySeries(jsondict)
        if "ImagingStudySeriesInstance" == resource_name:
            from . import imagingstudy
            return imagingstudy.ImagingStudySeriesInstance(jsondict)
        if "Immunization" == resource_name:
            from . import immunization
            return immunization.Immunization(jsondict)
        if "ImmunizationExplanation" == resource_name:
            from . import immunization
            return immunization.ImmunizationExplanation(jsondict)
        if "ImmunizationReaction" == resource_name:
            from . import immunization
            return immunization.ImmunizationReaction(jsondict)
        if "ImmunizationRecommendation" == resource_name:
            from . import immunizationrecommendation
            return immunizationrecommendation.ImmunizationRecommendation(jsondict)
        if "ImmunizationRecommendationRecommendation" == resource_name:
            from . import immunizationrecommendation
            return immunizationrecommendation.ImmunizationRecommendationRecommendation(jsondict)
        if "ImmunizationRecommendationRecommendationDateCriterion" == resource_name:
            from . import immunizationrecommendation
            return immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion(jsondict)
        if "ImmunizationRecommendationRecommendationProtocol" == resource_name:
            from . import immunizationrecommendation
            return immunizationrecommendation.ImmunizationRecommendationRecommendationProtocol(jsondict)
        if "ImmunizationVaccinationProtocol" == resource_name:
            from . import immunization
            return immunization.ImmunizationVaccinationProtocol(jsondict)
        if "ImplementationGuide" == resource_name:
            from . import implementationguide
            return implementationguide.ImplementationGuide(jsondict)
        if "ImplementationGuideContact" == resource_name:
            from . import implementationguide
            return implementationguide.ImplementationGuideContact(jsondict)
        if "ImplementationGuideDependency" == resource_name:
            from . import implementationguide
            return implementationguide.ImplementationGuideDependency(jsondict)
        if "ImplementationGuideGlobal" == resource_name:
            from . import implementationguide
            return implementationguide.ImplementationGuideGlobal(jsondict)
        if "ImplementationGuidePackage" == resource_name:
            from . import implementationguide
            return implementationguide.ImplementationGuidePackage(jsondict)
        if "ImplementationGuidePackageResource" == resource_name:
            from . import implementationguide
            return implementationguide.ImplementationGuidePackageResource(jsondict)
        if "ImplementationGuidePage" == resource_name:
            from . import implementationguide
            return implementationguide.ImplementationGuidePage(jsondict)
        if "List" == resource_name:
            from . import list
            return list.List(jsondict)
        if "ListEntry" == resource_name:
            from . import list
            return list.ListEntry(jsondict)
        if "Location" == resource_name:
            from . import location
            return location.Location(jsondict)
        if "LocationPosition" == resource_name:
            from . import location
            return location.LocationPosition(jsondict)
        if "Media" == resource_name:
            from . import media
            return media.Media(jsondict)
        if "Medication" == resource_name:
            from . import medication
            return medication.Medication(jsondict)
        if "MedicationAdministration" == resource_name:
            from . import medicationadministration
            return medicationadministration.MedicationAdministration(jsondict)
        if "MedicationAdministrationDosage" == resource_name:
            from . import medicationadministration
            return medicationadministration.MedicationAdministrationDosage(jsondict)
        if "MedicationDispense" == resource_name:
            from . import medicationdispense
            return medicationdispense.MedicationDispense(jsondict)
        if "MedicationDispenseDosageInstruction" == resource_name:
            from . import medicationdispense
            return medicationdispense.MedicationDispenseDosageInstruction(jsondict)
        if "MedicationDispenseSubstitution" == resource_name:
            from . import medicationdispense
            return medicationdispense.MedicationDispenseSubstitution(jsondict)
        if "MedicationOrder" == resource_name:
            from . import medicationorder
            return medicationorder.MedicationOrder(jsondict)
        if "MedicationOrderDispenseRequest" == resource_name:
            from . import medicationorder
            return medicationorder.MedicationOrderDispenseRequest(jsondict)
        if "MedicationOrderDosageInstruction" == resource_name:
            from . import medicationorder
            return medicationorder.MedicationOrderDosageInstruction(jsondict)
        if "MedicationOrderSubstitution" == resource_name:
            from . import medicationorder
            return medicationorder.MedicationOrderSubstitution(jsondict)
        if "MedicationPackage" == resource_name:
            from . import medication
            return medication.MedicationPackage(jsondict)
        if "MedicationPackageContent" == resource_name:
            from . import medication
            return medication.MedicationPackageContent(jsondict)
        if "MedicationProduct" == resource_name:
            from . import medication
            return medication.MedicationProduct(jsondict)
        if "MedicationProductBatch" == resource_name:
            from . import medication
            return medication.MedicationProductBatch(jsondict)
        if "MedicationProductIngredient" == resource_name:
            from . import medication
            return medication.MedicationProductIngredient(jsondict)
        if "MedicationStatement" == resource_name:
            from . import medicationstatement
            return medicationstatement.MedicationStatement(jsondict)
        if "MedicationStatementDosage" == resource_name:
            from . import medicationstatement
            return medicationstatement.MedicationStatementDosage(jsondict)
        if "MessageHeader" == resource_name:
            from . import messageheader
            return messageheader.MessageHeader(jsondict)
        if "MessageHeaderDestination" == resource_name:
            from . import messageheader
            return messageheader.MessageHeaderDestination(jsondict)
        if "MessageHeaderResponse" == resource_name:
            from . import messageheader
            return messageheader.MessageHeaderResponse(jsondict)
        if "MessageHeaderSource" == resource_name:
            from . import messageheader
            return messageheader.MessageHeaderSource(jsondict)
        if "Meta" == resource_name:
            from . import meta
            return meta.Meta(jsondict)
        if "Money" == resource_name:
            from . import money
            return money.Money(jsondict)
        if "NamingSystem" == resource_name:
            from . import namingsystem
            return namingsystem.NamingSystem(jsondict)
        if "NamingSystemContact" == resource_name:
            from . import namingsystem
            return namingsystem.NamingSystemContact(jsondict)
        if "NamingSystemUniqueId" == resource_name:
            from . import namingsystem
            return namingsystem.NamingSystemUniqueId(jsondict)
        if "Narrative" == resource_name:
            from . import narrative
            return narrative.Narrative(jsondict)
        if "NutritionOrder" == resource_name:
            from . import nutritionorder
            return nutritionorder.NutritionOrder(jsondict)
        if "NutritionOrderEnteralFormula" == resource_name:
            from . import nutritionorder
            return nutritionorder.NutritionOrderEnteralFormula(jsondict)
        if "NutritionOrderEnteralFormulaAdministration" == resource_name:
            from . import nutritionorder
            return nutritionorder.NutritionOrderEnteralFormulaAdministration(jsondict)
        if "NutritionOrderOralDiet" == resource_name:
            from . import nutritionorder
            return nutritionorder.NutritionOrderOralDiet(jsondict)
        if "NutritionOrderOralDietNutrient" == resource_name:
            from . import nutritionorder
            return nutritionorder.NutritionOrderOralDietNutrient(jsondict)
        if "NutritionOrderOralDietTexture" == resource_name:
            from . import nutritionorder
            return nutritionorder.NutritionOrderOralDietTexture(jsondict)
        if "NutritionOrderSupplement" == resource_name:
            from . import nutritionorder
            return nutritionorder.NutritionOrderSupplement(jsondict)
        if "Observation" == resource_name:
            from . import observation
            return observation.Observation(jsondict)
        if "ObservationComponent" == resource_name:
            from . import observation
            return observation.ObservationComponent(jsondict)
        if "ObservationReferenceRange" == resource_name:
            from . import observation
            return observation.ObservationReferenceRange(jsondict)
        if "ObservationRelated" == resource_name:
            from . import observation
            return observation.ObservationRelated(jsondict)
        if "OperationDefinition" == resource_name:
            from . import operationdefinition
            return operationdefinition.OperationDefinition(jsondict)
        if "OperationDefinitionContact" == resource_name:
            from . import operationdefinition
            return operationdefinition.OperationDefinitionContact(jsondict)
        if "OperationDefinitionParameter" == resource_name:
            from . import operationdefinition
            return operationdefinition.OperationDefinitionParameter(jsondict)
        if "OperationDefinitionParameterBinding" == resource_name:
            from . import operationdefinition
            return operationdefinition.OperationDefinitionParameterBinding(jsondict)
        if "OperationOutcome" == resource_name:
            from . import operationoutcome
            return operationoutcome.OperationOutcome(jsondict)
        if "OperationOutcomeIssue" == resource_name:
            from . import operationoutcome
            return operationoutcome.OperationOutcomeIssue(jsondict)
        if "Order" == resource_name:
            from . import order
            return order.Order(jsondict)
        if "OrderResponse" == resource_name:
            from . import orderresponse
            return orderresponse.OrderResponse(jsondict)
        if "OrderWhen" == resource_name:
            from . import order
            return order.OrderWhen(jsondict)
        if "Organization" == resource_name:
            from . import organization
            return organization.Organization(jsondict)
        if "OrganizationContact" == resource_name:
            from . import organization
            return organization.OrganizationContact(jsondict)
        if "Parameters" == resource_name:
            from . import parameters
            return parameters.Parameters(jsondict)
        if "ParametersParameter" == resource_name:
            from . import parameters
            return parameters.ParametersParameter(jsondict)
        if "Patient" == resource_name:
            from . import patient
            return patient.Patient(jsondict)
        if "PatientAnimal" == resource_name:
            from . import patient
            return patient.PatientAnimal(jsondict)
        if "PatientCommunication" == resource_name:
            from . import patient
            return patient.PatientCommunication(jsondict)
        if "PatientContact" == resource_name:
            from . import patient
            return patient.PatientContact(jsondict)
        if "PatientLink" == resource_name:
            from . import patient
            return patient.PatientLink(jsondict)
        if "PaymentNotice" == resource_name:
            from . import paymentnotice
            return paymentnotice.PaymentNotice(jsondict)
        if "PaymentReconciliation" == resource_name:
            from . import paymentreconciliation
            return paymentreconciliation.PaymentReconciliation(jsondict)
        if "PaymentReconciliationDetail" == resource_name:
            from . import paymentreconciliation
            return paymentreconciliation.PaymentReconciliationDetail(jsondict)
        if "PaymentReconciliationNote" == resource_name:
            from . import paymentreconciliation
            return paymentreconciliation.PaymentReconciliationNote(jsondict)
        if "Period" == resource_name:
            from . import period
            return period.Period(jsondict)
        if "Person" == resource_name:
            from . import person
            return person.Person(jsondict)
        if "PersonLink" == resource_name:
            from . import person
            return person.PersonLink(jsondict)
        if "Practitioner" == resource_name:
            from . import practitioner
            return practitioner.Practitioner(jsondict)
        if "PractitionerPractitionerRole" == resource_name:
            from . import practitioner
            return practitioner.PractitionerPractitionerRole(jsondict)
        if "PractitionerQualification" == resource_name:
            from . import practitioner
            return practitioner.PractitionerQualification(jsondict)
        if "Procedure" == resource_name:
            from . import procedure
            return procedure.Procedure(jsondict)
        if "ProcedureFocalDevice" == resource_name:
            from . import procedure
            return procedure.ProcedureFocalDevice(jsondict)
        if "ProcedurePerformer" == resource_name:
            from . import procedure
            return procedure.ProcedurePerformer(jsondict)
        if "ProcedureRequest" == resource_name:
            from . import procedurerequest
            return procedurerequest.ProcedureRequest(jsondict)
        if "ProcessRequest" == resource_name:
            from . import processrequest
            return processrequest.ProcessRequest(jsondict)
        if "ProcessRequestItem" == resource_name:
            from . import processrequest
            return processrequest.ProcessRequestItem(jsondict)
        if "ProcessResponse" == resource_name:
            from . import processresponse
            return processresponse.ProcessResponse(jsondict)
        if "ProcessResponseNotes" == resource_name:
            from . import processresponse
            return processresponse.ProcessResponseNotes(jsondict)
        if "Provenance" == resource_name:
            from . import provenance
            return provenance.Provenance(jsondict)
        if "ProvenanceAgent" == resource_name:
            from . import provenance
            return provenance.ProvenanceAgent(jsondict)
        if "ProvenanceAgentRelatedAgent" == resource_name:
            from . import provenance
            return provenance.ProvenanceAgentRelatedAgent(jsondict)
        if "ProvenanceEntity" == resource_name:
            from . import provenance
            return provenance.ProvenanceEntity(jsondict)
        if "Quantity" == resource_name:
            from . import quantity
            return quantity.Quantity(jsondict)
        if "Questionnaire" == resource_name:
            from . import questionnaire
            return questionnaire.Questionnaire(jsondict)
        if "QuestionnaireGroup" == resource_name:
            from . import questionnaire
            return questionnaire.QuestionnaireGroup(jsondict)
        if "QuestionnaireGroupQuestion" == resource_name:
            from . import questionnaire
            return questionnaire.QuestionnaireGroupQuestion(jsondict)
        if "QuestionnaireResponse" == resource_name:
            from . import questionnaireresponse
            return questionnaireresponse.QuestionnaireResponse(jsondict)
        if "QuestionnaireResponseGroup" == resource_name:
            from . import questionnaireresponse
            return questionnaireresponse.QuestionnaireResponseGroup(jsondict)
        if "QuestionnaireResponseGroupQuestion" == resource_name:
            from . import questionnaireresponse
            return questionnaireresponse.QuestionnaireResponseGroupQuestion(jsondict)
        if "QuestionnaireResponseGroupQuestionAnswer" == resource_name:
            from . import questionnaireresponse
            return questionnaireresponse.QuestionnaireResponseGroupQuestionAnswer(jsondict)
        if "Range" == resource_name:
            from . import range
            return range.Range(jsondict)
        if "Ratio" == resource_name:
            from . import ratio
            return ratio.Ratio(jsondict)
        if "Reference" == resource_name:
            from . import reference
            return reference.Reference(jsondict)
        if "ReferralRequest" == resource_name:
            from . import referralrequest
            return referralrequest.ReferralRequest(jsondict)
        if "RelatedPerson" == resource_name:
            from . import relatedperson
            return relatedperson.RelatedPerson(jsondict)
        if "Resource" == resource_name:
            from . import resource
            return resource.Resource(jsondict)
        if "RiskAssessment" == resource_name:
            from . import riskassessment
            return riskassessment.RiskAssessment(jsondict)
        if "RiskAssessmentPrediction" == resource_name:
            from . import riskassessment
            return riskassessment.RiskAssessmentPrediction(jsondict)
        if "SampledData" == resource_name:
            from . import sampleddata
            return sampleddata.SampledData(jsondict)
        if "Schedule" == resource_name:
            from . import schedule
            return schedule.Schedule(jsondict)
        if "SearchParameter" == resource_name:
            from . import searchparameter
            return searchparameter.SearchParameter(jsondict)
        if "SearchParameterContact" == resource_name:
            from . import searchparameter
            return searchparameter.SearchParameterContact(jsondict)
        if "Signature" == resource_name:
            from . import signature
            return signature.Signature(jsondict)
        if "Slot" == resource_name:
            from . import slot
            return slot.Slot(jsondict)
        if "Specimen" == resource_name:
            from . import specimen
            return specimen.Specimen(jsondict)
        if "SpecimenCollection" == resource_name:
            from . import specimen
            return specimen.SpecimenCollection(jsondict)
        if "SpecimenContainer" == resource_name:
            from . import specimen
            return specimen.SpecimenContainer(jsondict)
        if "SpecimenTreatment" == resource_name:
            from . import specimen
            return specimen.SpecimenTreatment(jsondict)
        if "StructureDefinition" == resource_name:
            from . import structuredefinition
            return structuredefinition.StructureDefinition(jsondict)
        if "StructureDefinitionContact" == resource_name:
            from . import structuredefinition
            return structuredefinition.StructureDefinitionContact(jsondict)
        if "StructureDefinitionDifferential" == resource_name:
            from . import structuredefinition
            return structuredefinition.StructureDefinitionDifferential(jsondict)
        if "StructureDefinitionMapping" == resource_name:
            from . import structuredefinition
            return structuredefinition.StructureDefinitionMapping(jsondict)
        if "StructureDefinitionSnapshot" == resource_name:
            from . import structuredefinition
            return structuredefinition.StructureDefinitionSnapshot(jsondict)
        if "Subscription" == resource_name:
            from . import subscription
            return subscription.Subscription(jsondict)
        if "SubscriptionChannel" == resource_name:
            from . import subscription
            return subscription.SubscriptionChannel(jsondict)
        if "Substance" == resource_name:
            from . import substance
            return substance.Substance(jsondict)
        if "SubstanceIngredient" == resource_name:
            from . import substance
            return substance.SubstanceIngredient(jsondict)
        if "SubstanceInstance" == resource_name:
            from . import substance
            return substance.SubstanceInstance(jsondict)
        if "SupplyDelivery" == resource_name:
            from . import supplydelivery
            return supplydelivery.SupplyDelivery(jsondict)
        if "SupplyRequest" == resource_name:
            from . import supplyrequest
            return supplyrequest.SupplyRequest(jsondict)
        if "SupplyRequestWhen" == resource_name:
            from . import supplyrequest
            return supplyrequest.SupplyRequestWhen(jsondict)
        if "TestScript" == resource_name:
            from . import testscript
            return testscript.TestScript(jsondict)
        if "TestScriptContact" == resource_name:
            from . import testscript
            return testscript.TestScriptContact(jsondict)
        if "TestScriptFixture" == resource_name:
            from . import testscript
            return testscript.TestScriptFixture(jsondict)
        if "TestScriptMetadata" == resource_name:
            from . import testscript
            return testscript.TestScriptMetadata(jsondict)
        if "TestScriptMetadataCapability" == resource_name:
            from . import testscript
            return testscript.TestScriptMetadataCapability(jsondict)
        if "TestScriptMetadataLink" == resource_name:
            from . import testscript
            return testscript.TestScriptMetadataLink(jsondict)
        if "TestScriptSetup" == resource_name:
            from . import testscript
            return testscript.TestScriptSetup(jsondict)
        if "TestScriptSetupAction" == resource_name:
            from . import testscript
            return testscript.TestScriptSetupAction(jsondict)
        if "TestScriptSetupActionAssert" == resource_name:
            from . import testscript
            return testscript.TestScriptSetupActionAssert(jsondict)
        if "TestScriptSetupActionOperation" == resource_name:
            from . import testscript
            return testscript.TestScriptSetupActionOperation(jsondict)
        if "TestScriptSetupActionOperationRequestHeader" == resource_name:
            from . import testscript
            return testscript.TestScriptSetupActionOperationRequestHeader(jsondict)
        if "TestScriptTeardown" == resource_name:
            from . import testscript
            return testscript.TestScriptTeardown(jsondict)
        if "TestScriptTeardownAction" == resource_name:
            from . import testscript
            return testscript.TestScriptTeardownAction(jsondict)
        if "TestScriptTest" == resource_name:
            from . import testscript
            return testscript.TestScriptTest(jsondict)
        if "TestScriptTestAction" == resource_name:
            from . import testscript
            return testscript.TestScriptTestAction(jsondict)
        if "TestScriptVariable" == resource_name:
            from . import testscript
            return testscript.TestScriptVariable(jsondict)
        if "Timing" == resource_name:
            from . import timing
            return timing.Timing(jsondict)
        if "TimingRepeat" == resource_name:
            from . import timing
            return timing.TimingRepeat(jsondict)
        if "ValueSet" == resource_name:
            from . import valueset
            return valueset.ValueSet(jsondict)
        if "ValueSetCodeSystem" == resource_name:
            from . import valueset
            return valueset.ValueSetCodeSystem(jsondict)
        if "ValueSetCodeSystemConcept" == resource_name:
            from . import valueset
            return valueset.ValueSetCodeSystemConcept(jsondict)
        if "ValueSetCodeSystemConceptDesignation" == resource_name:
            from . import valueset
            return valueset.ValueSetCodeSystemConceptDesignation(jsondict)
        if "ValueSetCompose" == resource_name:
            from . import valueset
            return valueset.ValueSetCompose(jsondict)
        if "ValueSetComposeInclude" == resource_name:
            from . import valueset
            return valueset.ValueSetComposeInclude(jsondict)
        if "ValueSetComposeIncludeConcept" == resource_name:
            from . import valueset
            return valueset.ValueSetComposeIncludeConcept(jsondict)
        if "ValueSetComposeIncludeFilter" == resource_name:
            from . import valueset
            return valueset.ValueSetComposeIncludeFilter(jsondict)
        if "ValueSetContact" == resource_name:
            from . import valueset
            return valueset.ValueSetContact(jsondict)
        if "ValueSetExpansion" == resource_name:
            from . import valueset
            return valueset.ValueSetExpansion(jsondict)
        if "ValueSetExpansionContains" == resource_name:
            from . import valueset
            return valueset.ValueSetExpansionContains(jsondict)
        if "ValueSetExpansionParameter" == resource_name:
            from . import valueset
            return valueset.ValueSetExpansionParameter(jsondict)
        if "VisionPrescription" == resource_name:
            from . import visionprescription
            return visionprescription.VisionPrescription(jsondict)
        if "VisionPrescriptionDispense" == resource_name:
            from . import visionprescription
            return visionprescription.VisionPrescriptionDispense(jsondict)
        from . import element
        return element.Element(jsondict)


text:
package com.moonlightpixels.jrpg.legacy.party;

import com.moonlightpixels.jrpg.legacy.combat.Battle;
import com.moonlightpixels.jrpg.legacy.combat.BattleSpriteSet;
import com.moonlightpixels.jrpg.legacy.combat.Combatant;
import com.moonlightpixels.jrpg.legacy.combat.action.ActionTypeProvider;
import com.moonlightpixels.jrpg.legacy.combat.action.AllowedTargets;
import com.moonlightpixels.jrpg.legacy.combat.action.CombatActionType;
import com.moonlightpixels.jrpg.legacy.combat.action.TargetChoiceProvider;
import com.moonlightpixels.jrpg.legacy.combat.action.TargetableChoiceProvider;
import com.moonlightpixels.jrpg.legacy.combat.stats.MaxHP;
import com.moonlightpixels.jrpg.legacy.combat.stats.MaxMP;
import com.moonlightpixels.jrpg.legacy.combat.stats.MissingStatException;
import com.moonlightpixels.jrpg.legacy.combat.stats.Stat;
import com.moonlightpixels.jrpg.legacy.map.actor.ActorSpriteSet;
import com.moonlightpixels.jrpg.legacy.animation.SpriteSetDefinition;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PlayerCharacter implements Combatant {
    private final String name;
    private final SpriteSetDefinition<ActorSpriteSet> spriteSetDefinition;
    private final SpriteSetDefinition<? extends BattleSpriteSet> battlerSpriteSetDefinition;
    private final CharacterClass characterClass;
    private int currentHp;
    private int currentMp;
    private final Map<Class<? extends Stat>, Stat> stats = new HashMap<>();
    private int level;
    private int xp;
    private boolean backrow = false;

    public PlayerCharacter(final String name, final SpriteSetDefinition<ActorSpriteSet> spriteSetDefinition,
                           final SpriteSetDefinition<? extends BattleSpriteSet> battlerSpriteSetDefinition,
                           final CharacterClass characterClass, final Stat... stats) {
        this.name = name;
        this.spriteSetDefinition = spriteSetDefinition;
        this.battlerSpriteSetDefinition = battlerSpriteSetDefinition;
        this.characterClass = characterClass;
        for (Stat stat : stats) {
            this.stats.put(stat.getClass(), stat);
        }
    }

    @Override
    public final String getName() {
        return name;
    }

    public final List<CombatActionType> getActionTypes() {
        return characterClass.getActionTypes();
    }

    public final SpriteSetDefinition<ActorSpriteSet> getSpriteSetDefinition() {
        return spriteSetDefinition;
    }

    public final SpriteSetDefinition<? extends BattleSpriteSet> getBattlerSpriteSetDefinition() {
        return battlerSpriteSetDefinition;
    }

    public final int getCurrentHp() {
        return Math.min(currentHp, getStatValue(MaxHP.class));
    }

    public final void setCurrentHp(final int currentHp) {
        this.currentHp = Math.min(currentHp, getStatValue(MaxHP.class));
    }

    public final int getCurrentMp() {
        return Math.min(currentMp, getStatValue(MaxMP.class));
    }

    public final void setCurrentMp(final int currentMp) {
        this.currentMp = Math.min(currentMp, getStatValue(MaxMP.class));
    }

    @Override
    public final int getLevel() {
        return level;
    }

    @Override
    public final ActionTypeProvider getActionTypeProvider(final Battle battle) {
        final ActionTypeProvider provider = new ActionTypeProvider();
        battle.handlePlayerInput(this, provider);

        return provider;
    }

    @Override
    public final TargetableChoiceProvider getTargetableChoiceProvider(final CombatActionType actionType,
                                                                final Battle battle) {
        TargetableChoiceProvider provider = actionType.getTargetableChoiceProvider();
        if (!provider.isComplete()) {
            battle.handlePlayerInput(this, provider);
        }

        return provider;
    }

    @Override
    public final TargetChoiceProvider getTargetChoiceProvider(final AllowedTargets allowedTargets,
                                                              final Battle battle) {
        TargetChoiceProvider provider = new TargetChoiceProvider();
        battle.handlePlayerInput(this, provider, allowedTargets);

        return provider;
    }

    @Override
    public final boolean isAlive() {
        return currentHp > 0;
    }

    public final void setLevel(final int level) {
        this.level = level;
    }

    public final int getXp() {
        return xp;
    }

    public final void setXp(final int xp) {
        this.xp = xp;
    }

    public final boolean isBackrow() {
        return backrow;
    }

    public final void setBackrow(final boolean backrow) {
        this.backrow = backrow;
    }

    @Override
    public final <T extends Stat> Stat getStat(final Class<T> statClass) throws MissingStatException {
        if (!stats.containsKey(statClass)) {
            throw new MissingStatException(statClass);
        }

        return stats.get(statClass);
    }

    public final CharacterClass getCharacterClass() {
        return characterClass;
    }

    @Override
    public final void applyHpChange(final int hpChange) {
        setCurrentHp(Math.max(getCurrentHp() + hpChange, 0));
    }
}

redpajama_set_name: RedPajamaGithub


text:
Winner of ICCV 2017 2D reflection symmetry detection challenge (among participants - conference rank A*)

[Funk, Christopher, et al. "2017 ICCV challenge: Detecting symmetry in the wild." Proceedings of the IEEE International Conference on Computer Vision Workshops. 2017.](http://openaccess.thecvf.com/content_ICCV_2017_workshops/papers/w24/Funk_2017_ICCV_Challenge_ICCV_2017_paper.pdf)

![Award certificate](ICCV_WinningCertificates.png "Award certificate")

Users of this software are encouraged to cite the following article:
+ Elawady, Mohamed, Christophe Ducottet, Olivier Alata, Cécile Barat, and Philippe Colantoni. "Wavelet-based reflection symmetry detection via textural and color histograms." In Proceedings, ICCV Workshop on Detecting Symmetry in the Wild, Venice, vol. 3, p. 7. 2017.
```
@inproceedings{elawady2017wavelet,
  title={Wavelet-based reflection symmetry detection via textural and color histograms},
  author={Elawady, Mohamed and Ducottet, Christophe and Alata, Olivier and Barat, Cecile and Colantoni, Philippe},
  booktitle={Proceedings, ICCV Workshop on Detecting Symmetry in the Wild, Venice},
  volume={3},
  pages={7},
  year={2017}
}
```

[You can download the paper here!](http://openaccess.thecvf.com/content_ICCV_2017_workshops/papers/w24/Elawady_Wavelet-Based_Reflection_Symmetry_ICCV_2017_paper.pdf)

The sample photos are kindly provided by Aesthetic Visual Analysis (AVA) dataset.

Contact: Mohamed Elawady (mohamed [dot] elawady [at] univ-st-etienne [dot] fr)

FILE:
+ main.m - code for computer symmetry on an image and display the candidates' info (axes, voting representation)
+ symBilOurCentLogGaborHSV.m - code for main function to compute symmetry on an image


text:
form

    <?php echo validation_errors();?>

    Question
    <input type="text" name="question" class="form-control"
           placeholder="question" required id="question"
           value="<?php echo $data['question'];?>">

<button type="button" class="btn btn-success" id="Add_answer">Add answers</button>

<?php
if(isset($is_edit))
{
?>

    <input type="hidden" name="id"
           class="form-control" value="<?php echo $data['id'];?>" >
<?php
    for($i=0;$i< count( $data['answers']);$i++)
    {
        $input='
' .
            ' Answer'.
            ''.
            '<input name="answers[]" class="form-control Answer" ' .
            'type="text" value="'.$data['answers'][$i]['answer'].'">';
        $input.=''
            .'
';
        echo $input;
    }
}
?>

<button type="submit" class="btn btn-default" id="submit">Submit</button>


text:
<?php

namespace OpenCloud\Tests\CloudMonitoring\Resource;

use OpenCloud\Tests\CloudMonitoring\CloudMonitoringTestCase;

class AgentHostTest extends CloudMonitoringTestCase
{
    const AGENT_ID = '1d29b4f9-87ca-4b22-b5a2-4e40a07bf068';

    private $agent;
    private $host;

    public function setupObjects()
    {
        $this->service = $this->getClient()->cloudMonitoringService();

        $this->addMockSubscriber($this->getTestFilePath('Agent'));
        $this->agent = $this->service->resource('Agent', self::AGENT_ID);
        $this->host = $this->service->resource('AgentHost', null, $this->agent);
    }

    public function testResourceClass()
    {
        $this->assertInstanceOf(
            'OpenCloud\\CloudMonitoring\\Resource\\AgentHost',
            $this->host
        );
    }

    /**
     * @expectedException OpenCloud\Common\Exceptions\CreateError
     */
    public function testCreateFails()
    {
        $this->host->create();
    }

    /**
     * @expectedException OpenCloud\Common\Exceptions\UpdateError
     */
    public function testUpdateFails()
    {
        $this->host->update();
    }

    /**
     * @mockFile Agent_Host_CPU
     */
    public function testCollection()
    {
        $this->assertInstanceOf(
            self::COLLECTION_CLASS,
            $this->host->info('cpus')
        );
    }

    /**
     * @mockFile Agent_Host_CPU
     */
    public function testCPU()
    {
        $list = $this->host->info('cpus');

        foreach ($list as $info) {
            $this->assertObjectHasAttribute('name', $info);
            $this->assertObjectHasAttribute('vendor', $info);
            $this->assertObjectHasAttribute('model', $info);
        }
    }

    /**
     * @mockFile Agent_Host_Disks
     */
    public function testDisks()
    {
        $list = $this->host->info('disks');
        foreach ($list as $info) {
            $this->assertObjectHasAttribute('read_bytes', $info);
            $this->assertObjectHasAttribute('reads', $info);
            $this->assertObjectHasAttribute('rtime', $info);
        }
    }

    /**
     * @mockFile Agent_Host_Filesystems
     */
    public function testFilesystems()
    {
        $list = $this->host->info('filesystems');
        foreach ($list as $info) {
            $this->assertObjectHasAttribute('dir_name', $info);
            $this->assertObjectHasAttribute('dev_name', $info);
            $this->assertObjectHasAttribute('free_files', $info);
        }
    }

    /**
     * @mockFile Agent_Host_NetworkInterfaces
     */
    public function testNetworkInterfaces()
    {
        $list = $this->host->info('network_interfaces');
        foreach ($list as $info) {
            $this->assertObjectHasAttribute('name', $info);
            $this->assertObjectHasAttribute('type', $info);
            $this->assertObjectHasAttribute('netmask', $info);
        }
    }

    /**
     * @expectedException OpenCloud\CloudMonitoring\Exception\AgentException
     */
    public function testInfoFailsWithIncorrectType()
    {
        $this->host->info('foobar');
    }

}


text:
import 'bootstrap-select/dist/css/bootstrap-select.css';
import 'daterangepicker/daterangepicker.css';

import 'bootstrap-select/js/bootstrap-select.js';
import 'bootstrap-select/js/i18n/defaults-fr_FR.js';
import 'moment/locale/fr';
import 'daterangepicker';
import { debounce } from 'lodash';

import Widgets from '../components/Widgets';

$(function () {
    init_custom_tab();
    init_criteres();
    load_infinite_scroll();
    init_pagination();

    var countLoads = 0;
    var isLoading = false;
    var widgets = new Widgets();
    widgets.init();

    function load_infinite_scroll() {
        var marginScroll = 250;
        var countStep = 2;
        var paginate = $('#paginate');

        $(window).scroll(
            debounce(
                function () {
                    if (countLoads < countStep || isLoading) {
                        return;
                    }

                    if (
                        paginate.length > 0 &&
                        $(window).scrollTop() + $(window).height() > paginate.offset().top - marginScroll
                    ) {
                        isLoading = true;
                        paginate.trigger('click');
                    }
                },
                200,
                { leading: true }
            )
        );
    }

    function init_custom_tab() {
        var tabs = $('#custom-tab');
        tabs.find('a.nav-link').click(function () {
            var oldActive = $(this).closest('.nav').find('a.nav-link.active');
            if (oldActive[0] !== this) {
                desactivate(oldActive);
                activate(this);
            }

            return false;
        });

        function activate(tab) {
            var target = $(tab).attr('href');
            $(target).addClass('active');
            $(tab).addClass('active');
            $('html, body').animate({ scrollTop: 0 }, 'fast');
        }

        function desactivate(tab) {
            var target = $(tab).attr('href');
            $(target).removeClass('active');
            $(tab).removeClass('active');
        }

        var lastScrollTop = 0;
        var toTop = $('#toTop');
        var bottomNavigation = $('#bottom-navigation');
        $(window).scroll(function () {
            var st = $(this).scrollTop();
            if (st > lastScrollTop) {
                toTop.removeClass('hidden');
                bottomNavigation.removeClass('visible');
            } else {
                toTop.addClass('hidden');
                bottomNavigation.addClass('visible');
            }
            lastScrollTop = st;
        });
    }

    function init_pagination() {
        $('#paginate').click(function (e) {
            e.preventDefault();

            isLoading = true;
            countLoads++;
            $(this)
                .attr('disabled', true)
                .prepend(' ');

            var btn = $(this);
            var container = btn.parent().prev();
            $.get($(btn).attr('href'), function (html) {
                isLoading = true;
                var currentContainer = $('
').html(html);
                btn.parent().remove();
                currentContainer.insertAfter(container);
                App.dispatchPageLoadedEvent(currentContainer[0]);
                init_pagination(currentContainer);
            });
        });
    }

    /**
     *
     */
    function init_criteres() {
        var options = {
            css_hidden: 'cache',
            css_initial_hidden: 'hidden',
            css_icon_class_open: 'fa-chevron-down',
            css_icon_class_close: 'fa-chevron-up',
            selector_btn_criteres: '.btn_criteres',
            selector_icon: '.fa',
            selector_block_criteres: '.criteres',
            selector_main_block: '.block_criteres',
            duration: 0,
        };

        //Bon bloc indigeste :)
        var block = $(options.selector_btn_criteres)
            .click(function () {
                if (block.hasClass(options.css_hidden)) {
                    $(this)
                        .find(options.selector_icon)
                        .removeClass(options.css_icon_class_open)
                        .addClass(options.css_icon_class_close);
                    block.show(options.duration, function () {
                        $(this).removeClass(options.css_hidden);
                    });
                } else {
                    $(this)
                        .find(options.selector_icon)
                        .removeClass(options.css_icon_class_close)
                        .addClass(options.css_icon_class_open);
                    block.hide(options.duration, function () {
                        $(this).addClass(options.css_hidden);
                    });
                }
            })
            .closest(options.selector_main_block)
            .find(options.selector_block_criteres);

        //Pas de besoins d'ouvrir la recherche avancée
        if (block.hasClass(options.css_hidden)) {
            block.hide().removeClass(options.css_initial_hidden);
        }
    }
});


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/pageerrLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
   >

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:orientation="vertical">

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal">

                <ImageView
                    android:id="@+id/img_error_layout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/view_failed_bg"
                    android:visibility="gone" />

                <net.qiujuer.genius.ui.widget.Loading
                    android:id="@+id/animProgress"
                    android:layout_width="26dip"
                    android:layout_height="26dip"
                 />
            </RelativeLayout>

            <TextView
                android:id="@+id/tv_error_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="10.0dip"
                android:gravity="center"
                android:lines="2"
                android:text="@string/error_view_loading"
                android:textSize="@dimen/font_14" />
        </LinearLayout>
    </RelativeLayout>

</RelativeLayout>


text:
using System;
using System.Text;
using InvokeIR.Win32;

namespace InvokeIR.PowerForensics.Ntfs
{
    #region VolumeNameClass

    public class VolumeName : Attr
    {
        #region Properties

        public readonly string VolumeNameString;

        #endregion Properties

        #region Constructors

        internal VolumeName(ResidentHeader header, byte[] attrBytes, string attrName)
        {
            Name = (ATTR_TYPE)header.commonHeader.ATTRType;
            NameString = attrName;
            NonResident = header.commonHeader.NonResident;
            AttributeId = header.commonHeader.Id;

            VolumeNameString = Encoding.Unicode.GetString(attrBytes, 0x00, (int)header.AttrSize);
        }

        #endregion Constructors
    }

    #endregion VolumeNameClass
}


text:
package org.robolectric.internal;

import java.util.List;
import org.robolectric.res.FsFile;

public class ManifestIdentifier {
  private final FsFile manifestFile;
  private final FsFile resDir;
  private final FsFile assetDir;
  private final String packageName;
  private final List<FsFile> libraryDirs;

  public ManifestIdentifier(FsFile manifestFile, FsFile resDir, FsFile assetDir, String packageName,
                            List<FsFile> libraryDirs) {
    this.manifestFile = manifestFile;
    this.resDir = resDir;
    this.assetDir = assetDir;
    this.packageName = packageName;
    this.libraryDirs = libraryDirs;
  }

  public FsFile getManifestFile() {
    return manifestFile;
  }

  public FsFile getResDir() {
    return resDir;
  }

  public FsFile getAssetDir() {
    return assetDir;
  }

  public String getPackageName() {
    return packageName;
  }

  public List<FsFile> getLibraryDirs() {
    return libraryDirs;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    ManifestIdentifier that = (ManifestIdentifier) o;

    if (manifestFile != null ? !manifestFile.equals(that.manifestFile) : that.manifestFile != null) return false;
    if (resDir != null ? !resDir.equals(that.resDir) : that.resDir != null) return false;
    if (assetDir != null ? !assetDir.equals(that.assetDir) : that.assetDir != null) return false;
    if (packageName != null ? !packageName.equals(that.packageName) : that.packageName != null) return false;
    return libraryDirs != null ? libraryDirs.equals(that.libraryDirs) : that.libraryDirs == null;

  }

  @Override
  public int hashCode() {
    int result = manifestFile != null ? manifestFile.hashCode() : 0;
    result = 31 * result + (resDir != null ? resDir.hashCode() : 0);
    result = 31 * result + (assetDir != null ? assetDir.hashCode() : 0);
    result = 31 * result + (packageName != null ? packageName.hashCode() : 0);
    result = 31 * result + (libraryDirs != null ? libraryDirs.hashCode() : 0);
    return result;
  }
}


text:
echo "----------------------"
echo
echo
echo "Running apt-gets (this might take a while)."
echo
echo
echo "----------------------"

apt-get install
 libx11-dev \
 libfreetype6-dev \
 libasound2-dev \
 libxinerama-dev \
 libxcursor-dev \
 python-numpy \
 python2.7-dev \
 python3.4-dev \
 zlib1g-dev \
&&\
\
echo "----------------------" &&\
echo &&\
echo &&\
echo "Installing Pillow." &&\
echo &&\
echo &&\
echo "----------------------" &&\
\
python2 -m pip install Pillow &&\
python3 -m pip install Pillow &&\

echo "Raspberry Pi libraries installation completed."


text:
<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://jboss.org/schema/arquillian"
  xsi:schemaLocation="http://jboss.org/schema/arquillian
    http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

  <extension qualifier="persistence-jpacacheeviction">
    <property name="defaultPhase">BEFORE</property>
    <property name="defaultEntityManager">java:comp/env/ExamplePersistenceUnit</property>
    <property name="defaultStrategy">org.jboss.arquillian.persistence.jpa.cache.FullCacheEvictionStrategy</property>
  </extension>

</arquillian>


text:
package com.twitter.finagle.httpx

import com.twitter.finagle.httpx.netty.Bijections
import com.twitter.finagle.netty3.{ChannelBufferBuf, BufChannelBuffer}
import com.twitter.util.Base64StringEncoder
import com.twitter.io.Buf
import java.net.URL
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers}
import org.jboss.netty.handler.codec.http.multipart.{DefaultHttpDataFactory, HttpPostRequestEncoder, HttpDataFactory}
import org.jboss.netty.handler.codec.http.{HttpRequest, HttpHeaders, HttpVersion, HttpMethod, DefaultHttpRequest}
import scala.annotation.implicitNotFound
import scala.collection.JavaConversions._
import scala.collection.mutable.ListBuffer

import Bijections._

/*
 * HTML form element.
 */
sealed abstract class FormElement

/*
 * HTML form simple input field.
 */
case class SimpleElement(name: String, content: String) extends FormElement

/*
 * HTML form file input field.
 */
case class FileElement(name: String, content: Buf, contentType: Option[String] = None,
  filename: Option[String] = None) extends FormElement

/**
 * Provides a class for building [[org.jboss.netty.handler.codec.http.HttpRequest]]s.
 * The main class to use is [[com.twitter.finagle.httpx.RequestBuilder]], as so
 *
 * {{{
 * val getRequest = RequestBuilder()
 *   .setHeader(HttpHeaders.Names.USER_AGENT, "MyBot")
 *   .setHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE)
 *   .url(new URL("http://www.example.com"))
 *   .buildGet()
 * }}}
 *
 * The `RequestBuilder` requires the definition of `url`. In Scala,
 * this is statically type checked, and in Java the lack of any of
 * a url causes a runtime error.
 *
 * The `buildGet`, 'buildHead`, `buildPut`, and `buildPost` methods use an implicit argument
 * to statically typecheck the builder (to ensure completeness, see above).
 * The Java compiler cannot provide such implicit, so we provide separate
 * functions in Java to accomplish this. Thus, the Java code for the
 * above is
 *
 * {{{
 * HttpRequest getRequest =
 *   RequestBuilder.safeBuildGet(
 *     RequestBuilder.create()
 *       .setHeader(HttpHeaders.Names.USER_AGENT, "MyBot")
 *       .setHeader(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE)
 *       .url(new URL("http://www.example.com")))
 * }}}
 *
 * Overall RequestBuilder's pretty barebones. It does provide certain protocol level support
 * for more involved requests. For example, it support easy creation of POST request to submit
 * multipart web forms with `buildMultipartPost` and default form post with `buildFormPost`.
 */

/**
 * Factory for [[com.twitter.finagle.httpx.RequestBuilder]] instances
 */
object RequestBuilder {
  @implicitNotFound("Http RequestBuilder is not correctly configured: HasUrl (exp: Yes): ${HasUrl}, HasForm (exp: Nothing) ${HasForm}.")
  private trait RequestEvidence[HasUrl, HasForm]
  private object RequestEvidence {
    implicit object FullyConfigured extends RequestEvidence[RequestConfig.Yes, Nothing]
  }

  @implicitNotFound("Http RequestBuilder is not correctly configured for form post: HasUrl (exp: Yes): ${HasUrl}, HasForm (exp: Yes): ${HasForm}.")
  private trait PostRequestEvidence[HasUrl, HasForm]
  private object PostRequestEvidence {
    implicit object FullyConfigured extends PostRequestEvidence[RequestConfig.Yes, RequestConfig.Yes]
  }

  type Complete = RequestBuilder[RequestConfig.Yes, Nothing]
  type CompleteForm = RequestBuilder[RequestConfig.Yes, RequestConfig.Yes]

  def apply() = new RequestBuilder()

  /**
   * Used for Java access.
   */
  def create() = apply()

  /**
   * Provides a typesafe `build` with content for Java.
   */
  def safeBuild(builder: Complete, method: Method, content: Option[Buf]): Request =
    builder.build(method, content)(RequestEvidence.FullyConfigured)

  /**
   * Provides a typesafe `buildGet` for Java.
   */
  def safeBuildGet(builder: Complete): Request =
    builder.buildGet()(RequestEvidence.FullyConfigured)

  /**
   * Provides a typesafe `buildHead` for Java.
   */
  def safeBuildHead(builder: Complete): Request =
    builder.buildHead()(RequestEvidence.FullyConfigured)

  /**
   * Provides a typesafe `buildDelete` for Java.
   */
  def safeBuildDelete(builder: Complete): Request =
    builder.buildDelete()(RequestEvidence.FullyConfigured)

  /**
   * Provides a typesafe `buildPut` for Java.
   */
  def safeBuildPut(builder: Complete, content: Buf): Request =
    builder.buildPut(content)(RequestEvidence.FullyConfigured)

  /**
   * Provides a typesafe `buildPut` for Java.
   */
  @deprecated("Typo, use safeBuildPut instead", "5.3.7")
  def safeBuidlPut(builder: Complete, content: Buf): Request =
    safeBuildPut(builder, content)

  /**
   * Provides a typesafe `buildPost` for Java.
   */
  def safeBuildPost(builder: Complete, content: Buf): Request =
    builder.buildPost(content)(RequestEvidence.FullyConfigured)

  /**
   * Provides a typesafe `buildFormPost` for Java.
   */
  def safeBuildFormPost(builder: CompleteForm, multipart: Boolean): Request =
    builder.buildFormPost(multipart)(PostRequestEvidence.FullyConfigured)
}

object RequestConfig {
  sealed abstract trait Yes

  type FullySpecifiedConfig = RequestConfig[Yes, Nothing]
  type FullySpecifiedConfigForm = RequestConfig[Yes, Yes]
}

private[httpx] final case class RequestConfig[HasUrl, HasForm](
  url: Option[URL]                  = None,
  headers: Map[String, Seq[String]] = Map.empty,
  formElements: Seq[FormElement]    = Nil,
  version: Version                  = Version.Http11,
  proxied: Boolean                  = false
)

class RequestBuilder[HasUrl, HasForm] private[httpx](
  config: RequestConfig[HasUrl, HasForm]
) {
  import RequestConfig._

  type This = RequestBuilder[HasUrl, HasForm]

  private[this] val SCHEME_WHITELIST = Seq("http","https")

  private[httpx] def this() = this(RequestConfig())

  /*
   * Specify url as String
   */
  def url(u: String): RequestBuilder[Yes, HasForm] = url(new java.net.URL(u))

  /**
   * Specify the url to request. Sets the HOST header and possibly
   * the Authorization header using the authority portion of the URL.
   */
  def url(u: URL): RequestBuilder[Yes, HasForm] = {
    require(SCHEME_WHITELIST.contains(u.getProtocol), "url must be http(s)")
    val uri = u.toURI
    val host = uri.getHost.toLowerCase
    val hostValue =
      if (u.getPort == -1 || u.getDefaultPort == u.getPort)
        host
      else
        "%s:%d".format(host, u.getPort)
    val withHost = config.headers.updated(HttpHeaders.Names.HOST, Seq(hostValue))
    val userInfo =  uri.getUserInfo
    val updated =
      if (userInfo == null || userInfo.isEmpty)
        withHost
      else {
        val auth = "Basic " + Base64StringEncoder.encode(userInfo.getBytes)
        withHost.updated(HttpHeaders.Names.AUTHORIZATION, Seq(auth))
      }
    new RequestBuilder(config.copy(url = Some(u), headers = updated))
  }

  /*
   * Add simple form name/value pairs. In this mode, this RequestBuilder will only
   * be able to generate a multipart/form POST request.
   */
   def addFormElement(kv: (String, String)*): RequestBuilder[HasUrl, Yes] = {
     val elems = config.formElements
     val updated = kv.foldLeft(elems) { case (es, (k, v)) => es :+ new SimpleElement(k, v) }
     new RequestBuilder(config.copy(formElements = updated))
   }

  /*
   * Add a FormElement to a request. In this mode, this RequestBuilder will only
   * be able to generate a multipart/form POST request.
   */
  def add(elem: FormElement): RequestBuilder[HasUrl, Yes] = {
    val elems = config.formElements
    val updated = elems ++ Seq(elem)
    new RequestBuilder(config.copy(formElements = updated))
  }

  /*
   * Add a group of FormElements to a request. In this mode, this RequestBuilder will only
   * be able to generate a multipart/form POST request.
   */
  def add(elems: Seq[FormElement]): RequestBuilder[HasUrl, Yes] = {
    val first = this.add(elems.head)
    elems.tail.foldLeft(first) { (b, elem) => b.add(elem) }
  }

  /**
   * Declare the HTTP protocol version be HTTP/1.0
   */
  def http10(): This =
    new RequestBuilder(config.copy(version = Version.Http10))

  /**
   * Set a new header with the specified name and value.
   */
  def setHeader(name: String, value: String): This = {
    val updated = config.headers.updated(name, Seq(value))
    new RequestBuilder(config.copy(headers = updated))
  }

  /**
   * Set a new header with the specified name and values.
   */
  def setHeader(name: String, values: Seq[String]): This = {
    val updated = config.headers.updated(name, values)
    new RequestBuilder(config.copy(headers = updated))
  }

  /**
   * Set a new header with the specified name and values.
   *
   * Java convenience variant.
   */
  def setHeader(name: String, values: java.lang.Iterable[String]): This = {
    setHeader(name, values.toSeq)
  }

  /**
   * Add a new header with the specified name and value.
   */
  def addHeader(name: String, value: String): This = {
    val values = config.headers.get(name).getOrElse(Seq())
    val updated = config.headers.updated(
      name, values ++ Seq(value))
    new RequestBuilder(config.copy(headers = updated))
  }

  /**
   * Add group of headers expressed as a Map
   */
  def addHeaders(headers: Map[String, String]): This = {
      headers.foldLeft(this) { case (b, (k, v)) => b.addHeader(k, v) }
  }

  /**
   * Declare the request will be proxied. Results in using the
   * absolute URI in the request line.
   */
  def proxied(): This = proxied(None)

  /**
   * Declare the request will be proxied. Results in using the
   * absolute URI in the request line and setting the Proxy-Authorization
   * header using the provided {{ProxyCredentials}}.
   */
  def proxied(credentials: ProxyCredentials): This = proxied(Some(credentials))

  /**
   * Declare the request will be proxied. Results in using the
   * absolute URI in the request line and optionally setting the
   * Proxy-Authorization header using the provided {{ProxyCredentials}}.
   */
  def proxied(credentials: Option[ProxyCredentials]): This = {
    val headers: Map[String,Seq[String]] = credentials map { creds =>
      config.headers.updated(HttpHeaders.Names.PROXY_AUTHORIZATION, Seq(creds.basicAuthorization))
    } getOrElse config.headers

    new RequestBuilder(config.copy(headers = headers, proxied = true))
  }

  /**
   * Construct an HTTP request with a specified method.
   */
  def build(method: Method, content: Option[Buf])(
    implicit HTTP_REQUEST_BUILDER_IS_NOT_FULLY_SPECIFIED: RequestBuilder.RequestEvidence[HasUrl, HasForm]
  ): Request = {
    content match {
      case Some(content) => withContent(method, content)
      case None => withoutContent(method)
    }
  }

  /**
   * Construct an HTTP GET request.
   */
  def buildGet()(
    implicit HTTP_REQUEST_BUILDER_IS_NOT_FULLY_SPECIFIED: RequestBuilder.RequestEvidence[HasUrl, HasForm]
  ): Request = withoutContent(Method.Get)

  /**
   * Construct an HTTP HEAD request.
   */
  def buildHead()(
    implicit HTTP_REQUEST_BUILDER_IS_NOT_FULLY_SPECIFIED: RequestBuilder.RequestEvidence[HasUrl, HasForm]
  ): Request = withoutContent(Method.Head)

  /**
   * Construct an HTTP DELETE request.
   */
  def buildDelete()(
    implicit HTTP_REQUEST_BUILDER_IS_NOT_FULLY_SPECIFIED: RequestBuilder.RequestEvidence[HasUrl, HasForm]
  ): Request = withoutContent(Method.Delete)

  /**
   * Construct an HTTP POST request.
   */
  def buildPost(content: Buf)(
    implicit HTTP_REQUEST_BUILDER_IS_NOT_FULLY_SPECIFIED: RequestBuilder.RequestEvidence[HasUrl, HasForm]
  ): Request = withContent(Method.Post, content)

  /**
   * Construct an HTTP PUT request.
   */
  def buildPut(content: Buf)(
    implicit HTTP_REQUEST_BUILDER_IS_NOT_FULLY_SPECIFIED: RequestBuilder.RequestEvidence[HasUrl, HasForm]
  ): Request = withContent(Method.Put, content)

  /**
   * Construct a form post request.
   */
  def buildFormPost(multipart: Boolean = false) (
    implicit HTTP_REQUEST_BUILDER_IS_NOT_FULLY_SPECIFIED: RequestBuilder.PostRequestEvidence[HasUrl, HasForm]
  ): Request = {
    val dataFactory = new DefaultHttpDataFactory(false) // we don't use disk
    val req = withoutContent(Method.Post)
    val encoder = new HttpPostRequestEncoder(dataFactory, req, multipart)

    config.formElements.foreach {
      case FileElement(name, content, contentType, filename) =>
        HttpPostRequestEncoderEx.addBodyFileUpload(encoder, dataFactory, req)(name, filename.getOrElse(""), BufChannelBuffer(content), contentType.getOrElse(null), false)
      case SimpleElement(name, value) =>
        encoder.addBodyAttribute(name, value)
    }
    val encodedReq = encoder.finalizeRequest()

    if (encodedReq.isChunked) {
      val encodings = encodedReq.headers.getAll(HttpHeaders.Names.TRANSFER_ENCODING)
      encodings.remove(HttpHeaders.Values.CHUNKED)
      if (encodings.isEmpty)
        encodedReq.headers.remove(HttpHeaders.Names.TRANSFER_ENCODING)
      else
        encodedReq.headers.set(HttpHeaders.Names.TRANSFER_ENCODING, encodings)

      val chunks = new ListBuffer[ChannelBuffer]
      while (encoder.hasNextChunk) {
        chunks += encoder.nextChunk().getContent()
      }
      encodedReq.setContent(ChannelBuffers.wrappedBuffer(chunks:_*))
    }

    from(encodedReq)
  }

  // absoluteURI if proxied, otherwise relativeURI
  private[this] def resource(): String = {
    val url = config.url.get
    if (config.proxied) {
      return url.toString
    } else {
      val builder = new StringBuilder()

      val path = url.getPath
      if (path == null || path.isEmpty)
        builder.append("/")
      else
        builder.append(path)

      val query = url.getQuery
      if (query != null && !query.isEmpty)
        builder.append("?%s".format(query))

      builder.toString
    }
  }

  private[httpx] def withoutContent(method: Method): Request =
    Request(method, resource, config.version, config.headers)

  private[httpx] def withContent(method: Method, content: Buf): Request = {
    require(content != null)
    val req = withoutContent(method)
    req.content = content
    req.headers.set(HttpHeaders.Names.CONTENT_LENGTH, content.length.toString)
    req
  }
}

/**
 * Add a missing method to HttpPostRequestEncoder to allow specifying a ChannelBuffer directly as
 * content of a file. This logic should eventually move to netty.
 */
private object HttpPostRequestEncoderEx {
  //TODO: HttpPostBodyUtil not accessible from netty 3.5.0.Final jar
  //      This HttpPostBodyUtil simulates what we need.
  object HttpPostBodyUtil {
    val DEFAULT_TEXT_CONTENT_TYPE = "text/plain"
    val DEFAULT_BINARY_CONTENT_TYPE = "application/octet-stream"
    object TransferEncodingMechanism {
      val BINARY = "binary"
      val BIT7 = "7bit"
    }
  }

  /*
   * allow specifying post body as ChannelBuffer, the logic is adapted from netty code.
   */
  def addBodyFileUpload(encoder: HttpPostRequestEncoder, factory: HttpDataFactory, request: HttpRequest)
    (name: String, filename: String, content: ChannelBuffer, contentType: String, isText: Boolean) {
    require(name != null)
    require(filename != null)
    require(content != null)

    val scontentType =
      if (contentType == null) {
        if (isText) {
          HttpPostBodyUtil.DEFAULT_TEXT_CONTENT_TYPE
        } else {
          HttpPostBodyUtil.DEFAULT_BINARY_CONTENT_TYPE
        }
      } else {
        contentType
      }
    val contentTransferEncoding =
      if (!isText) {
        HttpPostBodyUtil.TransferEncodingMechanism.BINARY
      } else {
        HttpPostBodyUtil.TransferEncodingMechanism.BIT7
      }

    val fileUpload = factory.createFileUpload(request, name, filename, scontentType, contentTransferEncoding, null, content.readableBytes)
    fileUpload.setContent(content)
    encoder.addBodyHttpData(fileUpload)
  }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

  add

    Log::add()
    AdminLog::add()

  admin
  AdminController

  admin.php

  admin.php

  admin_controller.php

  AdminController

  AdminLog

    AdminLog
    AdminController::adminlog()

  adminuser_controller.php

  AdminuserController

  all

    Log::all()
    AdminLog::all()

Searching...

No Matches


text:
typedef void(^BNDBindingsBlock)(NSArray *bindings, NSError *error);
typedef void(^BNDErrorBlock)(NSError *error);

#endif


text:
//
//  GTLPostUserPostListResponse.m
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   post/v1
// Description:
//   Rogag API for Viewing and Posting Funny Pics
// Classes:
//   GTLPostUserPostListResponse (0 custom class methods, 4 custom properties)

#import "GTLPostUserPostListResponse.h"

#import "GTLPostAppError.h"
#import "GTLPostUserPost.h"

// ----------------------------------------------------------------------------
//
//   GTLPostUserPostListResponse
//

@implementation GTLPostUserPostListResponse
@dynamic appErrors, cursor, posts, serverTime;

+ (NSDictionary *)arrayPropertyToClassMap {
  NSDictionary *map =
    [NSDictionary dictionaryWithObjectsAndKeys:
      [GTLPostAppError class], @"appErrors",
      [GTLPostUserPost class], @"posts",
      nil];
  return map;
}

@end