code: def _piecewise_simplify_eq_and(args):
      """
      Try to simplify conditions and the expression for
      equalities that are part of the condition, e.g.
      Piecewise((n, And(Eq(n,0), Eq(n + m, 0))), (1, True))
      -> Piecewise((0, And(Eq(n, 0), Eq(m, 0))), (1, True))
      """
      for i, (expr, cond) in enumerate(args):
          if isinstance(cond, And):
              eqs, other = sift(
                  cond.args, lambda i: isinstance(i, Eq), binary=True
              )
          elif isinstance(cond, Eq):
              eqs, other = [cond], []
          else:
              eqs = other = []
          if eqs:
              eqs = list(ordered(eqs))
              for j, e in enumerate(eqs):
                  # these blessed lhs objects behave like Symbols
                  # and the rhs are simple replacements for the "symbols"
                  if _blessed(e):
                      expr = expr.subs(*e.args)
                      eqs[j + 1 :] = [
                          ei.subs(*e.args) for ei in eqs[j + 1 :]
                      ]
                      other = [ei.subs(*e.args) for ei in other]
              cond = And(*(eqs + other))
              args[i] = args[i].func(expr, cond)
      return args
  
imports: from sympy.core import S, Function, diff, Tuple, Dummy, Mul
  from sympy.core.basic import Basic, as_Basic
  from sympy.core.numbers import Rational, NumberSymbol, _illegal
  from sympy.core.parameters import global_parameters
  from sympy.core.relational import Lt, Gt, Eq, Ne, Relational, _canonical, _canonical_coeff
  from sympy.core.sorting import ordered
  from sympy.functions.elementary.miscellaneous import Max, Min
  from sympy.logic.boolalg import And, Boolean, distribute_and_over_or, Not, true, false, Or, ITE, simplify_logic, to_cnf, distribute_or_over_and
  from sympy.utilities.iterables import uniq, sift, common_prefix
  from sympy.utilities.misc import filldedent, func_name
  from itertools import product
label_desc: Use image node_id 7 for calling a global function with example usage: _piecewise_simplify_eq_and(args) and returns: args