parameters: (constraints)
return_statement: return pruned_constraints
docstring: Returns a new list of constraints with constant terms removed.
  
      Parameters
      ----------
      constraints : list
          The constraints that form the matrix.
  
      Returns
      -------
      list
          The pruned constraints.
docstring_summary: Returns a new list of constraints with constant terms removed.
docstring_tokens: Returns a new list of constraints with constant terms removed .
function: def prune_constants(constraints):
      """Returns a new list of constraints with constant terms removed.
  
      Parameters
      ----------
      constraints : list
          The constraints that form the matrix.
  
      Returns
      -------
      list
          The pruned constraints.
      """
      pruned_constraints = []
      for constr in constraints:
          constr_type = type(constr)
          expr = copy.deepcopy(constr.expr)
          is_constant = prune_expr(expr)
          # Replace a constant root with a NO_OP.
          if is_constant:
              expr = lo.LinOp(lo.NO_OP, expr.shape, [], None)
          pruned = constr_type(expr, constr.constr_id, constr.shape)
          pruned_constraints.append(pruned)
      return pruned_constraints
function_tokens: def prune_constants ( constraints ) : pruned_constraints = [ ] for constr in constraints : constr_type = type ( constr ) expr = copy . deepcopy ( constr . expr ) is_constant = prune_expr ( expr ) # Replace a constant root with a NO_OP. if is_constant : expr = lo . LinOp ( lo . NO_OP , expr . shape , [ ] , None ) pruned = constr_type ( expr , constr . constr_id , constr . shape ) pruned_constraints . append ( pruned ) return pruned_constraints