o ckF[@sGdddeZGdddeZGdddeZGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZ GdddeZ dS)c@s&eZdZdddZddZddZdS) QualificationsNcCs|durg}||_dSN) requirements)selfrr:/usr/lib/python3/dist-packages/boto/mturk/qualification.py__init__s zQualifications.__init__cCs|j|dSr)rappend)rreqrrraddszQualifications.addcCsXi}t|jdks Jt|jD]\}}|}|D]}|||d|d|f<qq|S)N zQualificationRequirement.%s.%s)lenr enumerate get_as_params)rparamsnr reqparamsrprrrr szQualifications.get_as_paramsr)__name__ __module__ __qualname__rr rrrrrrs  rc@s"eZdZdZdddZddZdS) Requirementz0 Representation of a single requirement NFcCs||_||_||_||_dSrqualification_type_id comparator integer_valuerequired_to_preview)rrrrrrrrr/s zRequirement.__init__cCsl|j|jd}|jdvrt|jdD] \}}||d|<qn|jdvr-|jdur-|j|d<|jr4d|d<|S) NQualificationTypeId ComparatorInNotInr zIntegerValue.%d)Exists DoesNotExist IntegerValuetrueRequiredToPreview)rrrrr)rrirrrrr5s  zRequirement.get_as_params)NF)rrr__doc__rrrrrrr*s  rc"eZdZdZdfdd ZZS)&PercentAssignmentsSubmittedRequirementz The percentage of assignments the Worker has submitted, over all assignments the Worker has accepted. The value is an integer between 0 and 100. Fctt|jd|||ddS)N00000000000000000000r)superr+rrrrr __class__rrrHz/PercentAssignmentsSubmittedRequirement.__init__Frrrr)r __classcell__rrr0rr+Cr+cr*)&PercentAssignmentsAbandonedRequirementz The percentage of assignments the Worker has abandoned (allowed the deadline to elapse), over all assignments the Worker has accepted. The value is an integer between 0 and 100. Fcr,)N00000000000000000070r)r.r7rr/r0rrrPr2z/PercentAssignmentsAbandonedRequirement.__init__r3r4rrr0rr7Kr6r7cr*)%PercentAssignmentsReturnedRequirementz The percentage of assignments the Worker has returned, over all assignments the Worker has accepted. The value is an integer between 0 and 100. Fcr,)N000000000000000000E0r)r.r9rr/r0rrrXr2z.PercentAssignmentsReturnedRequirement.__init__r3r4rrr0rr9Sr6r9cr*)%PercentAssignmentsApprovedRequirementz The percentage of assignments the Worker has submitted that were subsequently approved by the Requester, over all assignments the Worker has submitted. The value is an integer between 0 and 100. Fcr,)N000000000000000000L0r)r.r;rr/r0rrr`r2z.PercentAssignmentsApprovedRequirement.__init__r3r4rrr0rr;[r6r;cr*)%PercentAssignmentsRejectedRequirementz The percentage of assignments the Worker has submitted that were subsequently rejected by the Requester, over all assignments the Worker has submitted. The value is an integer between 0 and 100. Fcr,)N000000000000000000S0r)r.r=rr/r0rrrhr2z.PercentAssignmentsRejectedRequirement.__init__r3r4rrr0rr=cr6r=cr*)NumberHitsApprovedRequirementa Specifies the total number of HITs submitted by a Worker that have been approved. The value is an integer greater than or equal to 0. If specifying a Country and Subdivision, use a tuple of valid ISO 3166 country code and ISO 3166-2 subdivision code, e.g. ('US', 'CA') for the US State of California. When using the 'In' and 'NotIn', locale should be a list of Countries and/or (Country, Subdivision) tuples. Fcr,)N00000000000000000040r)r.r?rr/r0rrrur2z&NumberHitsApprovedRequirement.__init__r3r4rrr0rr?ks r?cs*eZdZdZdfdd ZddZZS)LocaleRequirementz A Qualification requirement based on the Worker's location. The Worker's location is specified by the Worker to Mechanical Turk when the Worker creates his account. Fcs"tt|jd|d|d||_dS)N00000000000000000071r)r.rArlocale)rrrCrr0rrr}s zLocaleRequirement.__init__cCs|j|jd}|jdvr4t|jdD] \}}t|tr,|d|d|<|d|d|<q||d|<qnt|jtrI|jd|d<|jd|d<n|j|d<|jrUd |d <|S) Nrr r zLocaleValue.%d.CountryzLocaleValue.%d.SubdivisionzLocaleValue.CountryzLocaleValue.Subdivisionr&r')rrrrC isinstancetupler)rrr(rCrrrrs"    zLocaleRequirement.get_as_paramsr3)rrrr)rrr5rrr0rrAxsrAcr*)AdultRequirementz Requires workers to acknowledge that they are over 18 and that they agree to work on potentially offensive content. The value type is boolean, 1 (required), 0 (not required, the default). Fcr,)N00000000000000000060r)r.rGrr/r0rrrr2zAdultRequirement.__init__r3r4rrr0rrGr6rGN) objectrrr+r7r9r;r=r?rArGrrrrs