code: def merge_explicit(matmul):
      """Merge explicit MatrixBase arguments
  
      >>> from sympy import MatrixSymbol, Matrix, MatMul, pprint
      >>> from sympy.matrices.expressions.matmul import merge_explicit
      >>> A = MatrixSymbol('A', 2, 2)
      >>> B = Matrix([[1, 1], [1, 1]])
      >>> C = Matrix([[1, 2], [3, 4]])
      >>> X = MatMul(A, B, C)
      >>> pprint(X)
        [1  1] [1  2]
      A*[    ]*[    ]
        [1  1] [3  4]
      >>> pprint(merge_explicit(X))
        [4  6]
      A*[    ]
        [4  6]
  
      >>> X = MatMul(B, A, C)
      >>> pprint(X)
      [1  1]   [1  2]
      [    ]*A*[    ]
      [1  1]   [3  4]
      >>> pprint(merge_explicit(X))
      [1  1]   [1  2]
      [    ]*A*[    ]
      [1  1]   [3  4]
      """
      if not any(isinstance(arg, MatrixBase) for arg in matmul.args):
          return matmul
      newargs = []
      last = matmul.args[0]
      for arg in matmul.args[1:]:
          if isinstance(arg, (MatrixBase, Number)) and isinstance(
              last, (MatrixBase, Number)
          ):
              last = last * arg
          else:
              newargs.append(last)
              last = arg
      newargs.append(last)
  
      return MatMul(*newargs)
  
imports: from sympy.assumptions.ask import ask, Q
  from sympy.assumptions.refine import handlers_dict
  from sympy.core import Basic, sympify, S
  from sympy.core.mul import mul, Mul
  from sympy.core.numbers import Number, Integer
  from sympy.core.symbol import Dummy
  from sympy.functions import adjoint
  from sympy.strategies import rm_id, unpack, typed, flatten, exhaust, do_one, new
  from sympy.matrices.exceptions import NonInvertibleMatrixError
  from sympy.matrices.matrixbase import MatrixBase
  from sympy.utilities.exceptions import sympy_deprecation_warning
  from sympy.matrices.expressions._shape import validate_matmul_integer
  from .inverse import Inverse
  from .matexpr import MatrixExpr
  from .matpow import MatPow
  from .transpose import transpose
  from .permutation import PermutationMatrix
  from .special import ZeroMatrix, Identity, GenericIdentity, OneMatrix
label_desc: Use image node_id 3 for calling a global function with example usage: merge_explicit(matmul) and returns: MatMul, matmul