code: def distribute(A, B):
      """Turns an A containing Bs into a B of As
  
      where A, B are container types
  
      >>> from sympy.strategies import distribute
      >>> from sympy import Add, Mul, symbols
      >>> x, y = symbols('x,y')
      >>> dist = distribute(Mul, Add)
      >>> expr = Mul(2, x+y, evaluate=False)
      >>> expr
      2*(x + y)
      >>> dist(expr)
      2*x + 2*y
      """
  
      def distribute_rl(expr):
          for i, arg in enumerate(expr.args):
              if isinstance(arg, B):
                  first, b, tail = (
                      expr.args[:i],
                      expr.args[i],
                      expr.args[i + 1 :],
                  )
                  return B(
                      *[A(*(first + (arg,) + tail)) for arg in b.args]
                  )
          return expr
  
      return distribute_rl
  
file_path: sympy/sympy/strategies/rl.py
imports: from sympy.utilities.iterables import sift
  from .util import new
label_desc: Use image node_id 4 for calling a global function with example usage: distribute(A, B) and returns: distribute_rl, expr, B