class_docstr: Associative operations, can separate noncommutative and
  commutative parts.
  
  (a op b) op c == a op (b op c) == a op b op c.
  
  Base class for Add and Mul.
  
  This is an abstract base class, concrete derived classes must define
  the attribute `identity`.
  
  .. deprecated:: 1.7
  
     Using arguments that aren't subclasses of :class:`~.Expr` in core
     operators (:class:`~.Mul`, :class:`~.Add`, and :class:`~.Pow`) is
     deprecated. See :ref:`non-expr-args-deprecated` for details.
  
  Parameters
  ==========
  
  *args :
      Arguments which are operated
  
  evaluate : bool, optional
      Evaluate the operation. If not passed, refer to ``global_parameters.evaluate``.
docstr: Return seq so that none of the elements are of type `cls`. This is
  the vanilla routine that will be used if a class derived from AssocOp
  does not define its own flatten routine.
docstr_tok: ["Return","seq","so","that","none","of","the","elements","are","of","type","`","cls","`",".","This","is","the","vanilla","routine","that","will","be","used","if","a","class","derived","from","AssocOp","does","not","define","its","own","flatten","routine","."]
code: def flatten(cls, seq):
      """Return seq so that none of the elements are of type `cls`. This is
      the vanilla routine that will be used if a class derived from AssocOp
      does not define its own flatten routine."""
      # apply associativity, no commutativity property is used
      new_seq = []
      while seq:
          o = seq.pop()
          if o.__class__ is cls:  # classes must match exactly
              seq.extend(o.args)
          else:
              new_seq.append(o)
      new_seq.reverse()
  
      # c_part, nc_part, order_symbols
      return [], new_seq, None
  
imports: from __future__ import annotations
  from operator import attrgetter
  from collections import defaultdict
  from sympy.utilities.exceptions import sympy_deprecation_warning
  from .sympify import _sympify, sympify
  from .basic import Basic
  from .cache import cacheit
  from .sorting import ordered
  from .logic import fuzzy_and
  from .parameters import global_parameters
  from sympy.utilities.iterables import sift
  from sympy.multipledispatch.dispatcher import Dispatcher, ambiguity_register_error_ignore_dup, str_signature, RaiseNotImplementedError
label_desc: Use image node_id 4 for calling the AssocOp obj's underlying member method code with example usage: obj.flatten(cls, seq) and returns: list,  new_seq,  None