code: def add_ivy_array_instance_methods(
      cls: Type[ivy.Array],
      modules: List[ModuleType],
      to_ignore: Iterable = (),
  ):
      """Loop over all ivy modules such as activations, general, etc. and add the
      module functions to ivy arrays as instance methods using _wrap_function.
  
      Parameters
      ----------
      cls
          the class we want to add the instance methods to.
      modules
          the modules to loop over: activations, general etc.
      to_ignore
          any items we don't want to add an instance method for.
  
      Examples
      --------
      As shown, `add_ivy_array_instance_methods` adds all the appropriate functions from
      the activations module as instance methods to our toy `ArrayExample` class:
  
      >>> from ivy.functional.ivy import activations
      >>> class ArrayExample:
      ...     pass
      >>> ivy.add_ivy_array_instance_methods(ArrayExample, [activations])
      >>> print(hasattr(ArrayExample, "relu"), hasattr(ArrayExample, "softmax"))
      True True
      """
      to_ignore = TO_IGNORE + list(to_ignore)
      for module in modules:
          for key, value in module.__dict__.items():
              # we skip the cases where the function is protected, the instance
              # method has already been added manually and a few other cases
              if (
                  key.startswith("_")
                  or key[0].isupper()
                  or not callable(value)
                  or key in cls.__dict__
                  or hasattr(cls, key)
                  or key in to_ignore
                  or key not in ivy.__dict__
              ):
                  continue
              try:
                  setattr(cls, key, _wrap_function(key))
              except AttributeError:
                  pass
  
imports: import ivy
  from typing import Callable, Type, List, Iterable
  from types import ModuleType
label_desc: Use image node_id 2 for calling a global function with example usage: add_ivy_array_instance_methods(cls, modules, to_ignore) without return types