code: def and_constraint(v=1, sense="minimize"):
      
      assert v in [0,1], "v must be 0 or 1 instead of %s" % v.__repr__()
      model, x, y, z = _init()
      r = model.addVar("r", "B")
      model.addConsAnd([x,y,z], r)
      model.addCons(x==v)
      model.setObjective(r, sense=sense)
      _optimize("AND", model)
docs: AND constraint