code: def _unary_method(ufunc, name):
      """Implement a unary special method with a ufunc."""
  
      def func(self):
          return ufunc(self)
  
      func.__name__ = "__{}__".format(name)
      return func
  
file_path: numpy/numpy/lib/mixins.py
imports: from numpy._core import umath
label_desc: Use image node_id 6 for calling a global function with example usage: _unary_method(ufunc, name) and returns: func, ufunc