code: def _cse_homogeneous(exprs, **kwargs):
      """
      Same as ``cse`` but the ``reduced_exprs`` are returned
      with the same type as ``exprs`` or a sympified version of the same.
  
      Parameters
      ==========
  
      exprs : an Expr, iterable of Expr or dictionary with Expr values
          the expressions in which repeated subexpressions will be identified
      kwargs : additional arguments for the ``cse`` function
  
      Returns
      =======
  
      replacements : list of (Symbol, expression) pairs
          All of the common subexpressions that were replaced. Subexpressions
          earlier in this list might show up in subexpressions later in this
          list.
      reduced_exprs : list of SymPy expressions
          The reduced expressions with all of the replacements above.
  
      Examples
      ========
  
      >>> from sympy.simplify.cse_main import cse
      >>> from sympy import cos, Tuple, Matrix
      >>> from sympy.abc import x
      >>> output = lambda x: type(cse(x, list=False)[1])
      >>> output(1)
      <class 'sympy.core.numbers.One'>
      >>> output('cos(x)')
      <class 'str'>
      >>> output(cos(x))
      cos
      >>> output(Tuple(1, x))
      <class 'sympy.core.containers.Tuple'>
      >>> output(Matrix([[1,0], [0,1]]))
      <class 'sympy.matrices.dense.MutableDenseMatrix'>
      >>> output([1, x])
      <class 'list'>
      >>> output((1, x))
      <class 'tuple'>
      >>> output({1, x})
      <class 'set'>
      """
      if isinstance(exprs, str):
          replacements, reduced_exprs = _cse_homogeneous(
              sympify(exprs), **kwargs
          )
          return replacements, repr(reduced_exprs)
      if isinstance(exprs, (list, tuple, set)):
          replacements, reduced_exprs = cse(exprs, **kwargs)
          return replacements, type(exprs)(reduced_exprs)
      if isinstance(exprs, dict):
          keys = list(
              exprs.keys()
          )  # In order to guarantee the order of the elements.
          replacements, values = cse([exprs[k] for k in keys], **kwargs)
          reduced_exprs = dict(zip(keys, values))
          return replacements, reduced_exprs
  
      try:
          replacements, (reduced_exprs,) = cse(exprs, **kwargs)
      except TypeError:  # For example 'mpf' objects
          return [], exprs
      else:
          return replacements, reduced_exprs
  
imports: from collections import defaultdict
  from sympy.core import Basic, Mul, Add, Pow, sympify
  from sympy.core.containers import Tuple, OrderedSet
  from sympy.core.exprtools import factor_terms
  from sympy.core.singleton import S
  from sympy.core.sorting import ordered
  from sympy.core.symbol import symbols, Symbol
  from sympy.matrices import MatrixBase, Matrix, ImmutableMatrix, SparseMatrix, ImmutableSparseMatrix
  from sympy.matrices.expressions import MatrixExpr, MatrixSymbol, MatMul, MatAdd, MatPow, Inverse
  from sympy.matrices.expressions.matexpr import MatrixElement
  from sympy.polys.rootoftools import RootOf
  from sympy.utilities.iterables import numbered_symbols, sift, topological_sort, iterable
  from .None import cse_opts
label_desc: Use image node_id 10 for calling a global function with example usage: _cse_homogeneous(exprs) and returns: replacements,  repr, replacements,  type, replacements,  reduced_exprs, replacements,  reduced_exprs, list,  exprs