parameters: (a)
docstring: Recursively look up the original np.memmap instance base if any
docstring_summary: Recursively look up the original np.memmap instance base if any
docstring_tokens: Recursively look up the original np . memmap instance base if any
function: def _get_backing_memmap(a):
      """Recursively look up the original np.memmap instance base if any"""
      b = getattr(a, 'base', None)
      if b is None:
          # TODO: check scipy sparse datastructure if scipy is installed
          # a nor its descendants do not have a memmap base
          return None
  
      elif isinstance(b, mmap):
          # a is already a real memmap instance.
          return a
  
      else:
          # Recursive exploration of the base ancestry
          return _get_backing_memmap(b)
function_tokens: def _get_backing_memmap ( a ) : b = getattr ( a , 'base' , None ) if b is None : # TODO: check scipy sparse datastructure if scipy is installed # a nor its descendants do not have a memmap base return None elif isinstance ( b , mmap ) : # a is already a real memmap instance. return a else : # Recursive exploration of the base ancestry return _get_backing_memmap ( b )