code: def assign(self, var, val, assignment):
          "Assign var, and keep track of conflicts."
          oldval = assignment.get(var, None)
          if val != oldval:
              if oldval is not None: # Remove old val if there was one
                  self.record_conflict(assignment, var, oldval, -1)
              self.record_conflict(assignment, var, val, +1)
              CSP.assign(self, var, val, assignmentf assign(self, var, val, assignment):
          "Assign var, and keep track of conflicts."
          oldval = assignment.get(var, None)
          if val != oldval:
              if oldval is not None: # Remove old val if there was one
                  self.record_conflict(assignment, var, oldval, -1)
              self.record_conflict(assignment, var, val, +1)
              CSP.assign(self, var, val, assignment)
docs: Assign var, and keep track of conflicts.