code: def revise(domains, arc, constraints):
      
      x, y = arc
      related_constraints = [(neighbors, constraint)
                             for neighbors, constraint in constraints
                             if set(arc) == set(neighbors)]
  
      modified = False
  
      for neighbors, constraint in related_constraints:
          for x_value in domains[x]:
              constraint_results = (_call_constraint({x: x_value, y: y_value},
                                                     neighbors, constraint)
                                    for y_value in domains[y])
  
              if not any(constraint_results):
                  domains[x].remove(x_value)
                  modified = True
  
      return modified
docs: Given the arc X, Y (variables), removes the values from X's domain that
      do not meet the constraint between X and Y.
  
      That is, given x1 in X's domain, x1 will be removed from the domain, if
      there is no value y in Y's domain that makes constraint(X,Y) True, for
      those constraints affecting X and Y.