code: def vectorize(
      *,
      otypes: Optional[Union[str, Iterable[DTypeLike]]] = None,
      doc: Optional[str] = None,
      excluded: Optional[Iterable[Union[int, str]]] = None,
      cache: bool = False,
      signature: Optional[str] = None,
  ) -> Callable[[_F], _F]:
      """Wrap a function for use with np.vectorize.
  
      This function is not quite a decorator, but is used as a wrapper
      to np.vectorize that preserves scalar behavior.
      """
  
      def __wrapper(function):
          vecfunc = np.vectorize(
              function,
              otypes=otypes,
              doc=doc,
              excluded=excluded,
              cache=cache,
              signature=signature,
          )
  
          @functools.wraps(function)
          def _vec(*args, **kwargs):
              y = vecfunc(*args, **kwargs)
              if np.isscalar(args[0]):
                  return y.item()
              else:
                  return y
  
          return _vec
  
      return __wrapper
  
file_path: librosa/librosa/util/decorators.py
imports: from typing import Any, Callable, Iterable, Optional, Set, TypeVar, Union
  import warnings
  import functools
  from decorator import decorator
  import numpy
  from numpy.typing import DTypeLike
label_desc: Use image node_id 3 for calling a global function with example usage: vectorize() and returns: __wrapper, _vec, y, y