code: def logical_not(f):  # function factory
      '''Logical not from functions.
  
      Parameters
      ----------
      f1, f2 : function
          Function that takes array and returns true or false for each item in array.
  
      Returns
      -------
      Function
      '''
      def f_not(arr):
          return np.logical_not(f(arr))
      f_not.__name__ = "not_" + f.__name__
      return f_nof logical_not(f):  # function factory
      '''Logical not from functions.
  
      Parameters
      ----------
      f1, f2 : function
          Function that takes array and returns true or false for each item in array.
  
      Returns
      -------
      Function
      '''
      def f_not(arr):
          return np.logical_not(f(arr))
      f_not.__name__ = "not_" + f.__name__
      return f_not
docs: Logical not from functions.
  
      Parameters
      ----------
      f1, f2 : function
          Function that takes array and returns true or false for each item in array.
  
      Returns
      -------
      Function