code: def _copy_func(func):
      """Copy function."""
      new_func = types.FunctionType(
          func.__code__,
          func.__globals__,
          func.__name__,
          func.__defaults__,
          func.__closure__,
      )
      new_func.__dict__.update(func.__dict__)
      new_func.__kwdefaults__ = func.__kwdefaults__
  
      return new_func
  
file_path: geomstats/geomstats/_backend/_dtype_utils.py
imports: import functools
  import inspect
  import types
  from geomstats._backend import _backend_config
label_desc: Use image node_id 1 for calling a global function with example usage: _copy_func(func) and returns: new_func