code: def arr_select(value):  # function factory
      '''Selecting array elements by bitwise and comparison to a given value.
  
      Parameters:
      value : int
          Value to which array elements are compared to.
  
      Returns:
      array : np.array
      '''
      def f_eq(arr):
          return np.equal(np.bitwise_and(arr, value), value)
      f_eq.__name__ = "arr_bitwise_and_" + str(value)  # or use inspect module: inspect.stack()[0][3]
      return f_ef arr_select(value):  # function factory
      '''Selecting array elements by bitwise and comparison to a given value.
  
      Parameters:
      value : int
          Value to which array elements are compared to.
  
      Returns:
      array : np.array
      '''
      def f_eq(arr):
          return np.equal(np.bitwise_and(arr, value), value)
      f_eq.__name__ = "arr_bitwise_and_" + str(value)  # or use inspect module: inspect.stack()[0][3]
      return f_eq
docs: Selecting array elements by bitwise and comparison to a given value.
  
      Parameters:
      value : int
          Value to which array elements are compared to.
  
      Returns:
      array : np.array