class_docstr: Represents a morphism which is a composition of other morphisms.
  
  Explanation
  ===========
  
  Two composite morphisms are equal if the morphisms they were
  obtained from (components) are the same and were listed in the
  same order.
  
  The arguments to the constructor for this class should be listed
  in diagram order: to obtain the composition `g\circ f` from the
  instances of :class:`Morphism` ``g`` and ``f`` use
  ``CompositeMorphism(f, g)``.
  
  Examples
  ========
  
  >>> from sympy.categories import Object, NamedMorphism, CompositeMorphism
  >>> A = Object("A")
  >>> B = Object("B")
  >>> C = Object("C")
  >>> f = NamedMorphism(A, B, "f")
  >>> g = NamedMorphism(B, C, "g")
  >>> g * f
  CompositeMorphism((NamedMorphism(Object("A"), Object("B"), "f"),
  NamedMorphism(Object("B"), Object("C"), "g")))
  >>> CompositeMorphism(f, g) == g * f
  True
class_docstr_tok: ["Represents","a","morphism","which","is","a","composition","of","other","morphisms",".","Explanation","===========","Two","composite","morphisms","are","equal","if","the","morphisms","they","were","obtained","from","(","components",")","are","the","same","and","were","listed","in","the","same","order",".","The","arguments","to","the","constructor","for","this","class","should","be","listed","in","diagram","order",":","to","obtain","the","composition","`","g\\circ","f","`","from","the","instances","of",":","class",":","`","Morphism","`","``","g","``","and","``","f","``","use","``","CompositeMorphism","(","f",",","g",")","``",".","Examples","========",">",">",">","from","sympy.categories","import","Object",",","NamedMorphism",",","CompositeMorphism",">",">",">","A","=","Object","(","``","A","''",")",">",">",">","B","=","Object","(","``","B","''",")",">",">",">","C","=","Object","(","``","C","''",")",">",">",">","f","=","NamedMorphism","(","A",",","B",",","``","f","''",")",">",">",">","g","=","NamedMorphism","(","B",",","C",",","``","g","''",")",">",">",">","g","*","f","CompositeMorphism","(","(","NamedMorphism","(","Object","(","``","A","''",")",",","Object","(","``","B","''",")",",","``","f","''",")",",","NamedMorphism","(","Object","(","``","B","''",")",",","Object","(","``","C","''",")",",","``","g","''",")",")",")",">",">",">","CompositeMorphism","(","f",",","g",")","==","g","*","f","True"]
docstr: Intelligently adds ``morphism`` to tuple ``t``.
  
  Explanation
  ===========
  
  If ``morphism`` is a composite morphism, its components are
  added to the tuple.  If ``morphism`` is an identity, nothing
  is added to the tuple.
  
  No composability checks are performed.
docstr_tok: ["Intelligently","adds","``","morphism","``","to","tuple","``","t","``",".","Explanation","===========","If","``","morphism","``","is","a","composite","morphism",",","its","components","are","added","to","the","tuple",".","If","``","morphism","``","is","an","identity",",","nothing","is","added","to","the","tuple",".","No","composability","checks","are","performed","."]
code: def _add_morphism(t, morphism):
      """
      Intelligently adds ``morphism`` to tuple ``t``.
  
      Explanation
      ===========
  
      If ``morphism`` is a composite morphism, its components are
      added to the tuple.  If ``morphism`` is an identity, nothing
      is added to the tuple.
  
      No composability checks are performed.
      """
      if isinstance(morphism, CompositeMorphism):
          # ``morphism`` is a composite morphism; we have to
          # denest its components.
          return t + morphism.components
      elif isinstance(morphism, IdentityMorphism):
          # ``morphism`` is an identity.  Nothing happens.
          return t
      else:
          return t + Tuple(morphism)
  
imports: from sympy.core import S, Basic, Dict, Symbol, Tuple, sympify
  from sympy.core.symbol import Str
  from sympy.sets import Set, FiniteSet, EmptySet
  from sympy.utilities.iterables import iterable
label_desc: Use image node_id 1 for calling the CompositeMorphism obj's underlying member method code with example usage: obj._add_morphism(t, morphism) and returns: unknown, t, unknown