code: def _apply_recursively_over_nested_lists(func, arr):
      if isinstance(arr, (tuple, list, Tuple)):
          return tuple(
              _apply_recursively_over_nested_lists(func, i) for i in arr
          )
      elif isinstance(arr, Tuple):
          return Tuple.fromiter(
              _apply_recursively_over_nested_lists(func, i) for i in arr
          )
      else:
          return func(arr)
  
file_path: sympy/sympy/tensor/array/expressions/utils.py
imports: import bisect
  from collections import defaultdict
  from sympy.combinatorics import Permutation
  from sympy.core.containers import Tuple
  from sympy.core.numbers import Integer
label_desc: Use image node_id 6 for calling a global function with example usage: _apply_recursively_over_nested_lists(func, arr) and returns: tuple, Tuple, func