class_docstr: Metaclass to ensure that inputs are ndarray for all of the subclass generate and extract calls.
class_docstr_tok: ["Metaclass","to","ensure","that","inputs","are","ndarray","for","all","of","the","subclass","generate","and","extract","calls","."]
docstr: This function overrides any existing generate or extract methods with a new method that
  ensures the input is an ndarray. There is an assumption that the input object has implemented
  __array__ with np.array calls.
code: def __init__(
      cls, name, bases, clsdict
  ):  # pylint: disable=W0231,W0613
      """
      This function overrides any existing generate or extract methods with a new method that
      ensures the input is an ndarray. There is an assumption that the input object has implemented
      __array__ with np.array calls.
      """
  
      def make_replacement(fdict, func_name, has_y):
          """
          This function overrides creates replacement functions dynamically.
          """
  
          def replacement_function(self, *args, **kwargs):
              if len(args) > 0:
                  lst = list(args)
              else:
                  lst = []
  
              if "x" in kwargs:  # pragma: no cover
                  if not isinstance(kwargs["x"], np.ndarray):
                      kwargs["x"] = np.array(kwargs["x"])
              else:
                  if not isinstance(args[0], np.ndarray):
                      lst[0] = np.array(args[0])
  
              if "y" in kwargs:  # pragma: no cover
                  if kwargs["y"] is not None and not isinstance(
                      kwargs["y"], np.ndarray
                  ):
                      kwargs["y"] = np.array(kwargs["y"])
              elif has_y:  # pragma: no cover
                  if not isinstance(args[1], np.ndarray):
                      lst[1] = np.array(args[1])
  
              if len(args) > 0:
                  args = tuple(lst)
              return fdict[func_name](self, *args, **kwargs)
  
          replacement_function.__doc__ = fdict[func_name].__doc__
          replacement_function.__name__ = "new_" + func_name
          return replacement_function
  
      replacement_list_no_y = ["predict"]
      replacement_list_has_y = ["fit"]
  
      for item in replacement_list_no_y:
          if item in clsdict:
              new_function = make_replacement(clsdict, item, False)
              setattr(cls, item, new_function)
      for item in replacement_list_has_y:
          if item in clsdict:
              new_function = make_replacement(clsdict, item, True)
              setattr(cls, item, new_function)
  
imports: from abc import ABC, ABCMeta, abstractmethod
  from typing import List, Optional, Union
  import numpy
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin, LossGradientsMixin, DecisionTreeMixin
label_desc: Use image node_id 1 to create a new InputFilter object from inherited base classes: ABCMeta with example: obj = InputFilter(cls, name, bases, clsdict)