code: def satisfies_constraint(self, site):
          
          if not site.is_ordered:
              return False
  
          if self.species_constraints \
                  and str(site.specie) in self.species_constraints:
              satisfies_constraints = True
          else:
              satisfies_constraints = False
  
          if self.site_constraint_name \
                  and self.site_constraint_name in site.properties:
              prop = site.properties[self.site_constraint_name]
              if prop in self.site_constraints:
                  satisfies_constraints = True
              else:
                  satisfies_constraints = False
  
          return satisfies_constraints
docs: Checks if a periodic site satisfies the constraint.