code: def _recursive(fun, A, B, *args, **kwargs):
      """Recursive function with two inputs."""
      if A.ndim == 2:
          return fun(A, B, *args, **kwargs)
      else:
          return np.asarray(
              [
                  _recursive(fun, a, b, *args, **kwargs)
                  for a, b in zip(A, B)
              ]
          )
  
imports: import numpy
  from scipy.linalg import eigvalsh, solve
  from sklearn.metrics import euclidean_distances
  from .base import logm, sqrtm, invsqrtm
label_desc: Use image node_id 2 for calling a global function with example usage: _recursive(fun, A, B) and returns: fun, np