code: def add_ivy_container_instance_methods(
      cls: Type[ivy.Container],
      modules: Union[List[ModuleType], ivy.Container],
      static: Union[bool, ivy.Container] = False,
      to_ignore: Union[Iterable, ivy.Container] = (),
  ):
      """Loop over all ivy modules such as activations, general, etc. and add the
      module functions to ivy container 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.
      static
          whether the function should be added as a static method.
      to_ignore
          any functions we don't want to add an instance method for.
  
      Examples
      --------
      As shown, `add_ivy_container_instance_methods` adds all the appropriate functions
      from the statistical module as instance methods to our toy `ContainerExample` class:
  
      >>> from ivy.functional.ivy import statistical
      >>> class ContainerExample:
      ...     pass
      >>> ivy.add_ivy_container_instance_methods(ContainerExample, [statistical])
      >>> print(hasattr(ContainerExample, "mean"), hasattr(ContainerExample, "var"))
      True True
      """
      to_ignore = TO_IGNORE + list(to_ignore)
      for module in modules:
          for key, value in module.__dict__.items():
              full_key = ("static_" if static else "") + key
              # skip cases where the function is protected, or first letter is uppercase
              # (i.e. is a class), or if the instance method already exists etc
              if (
                  key.startswith("_")
                  or key[0].isupper()
                  or not callable(value)
                  or full_key in cls.__dict__
                  or hasattr(cls, full_key)
                  or full_key in to_ignore
                  or key not in ivy.__dict__
              ):
                  continue
              try:
                  setattr(cls, full_key, _wrap_function(key, static))
              except AttributeError:
                  pass
  
imports: import ivy
  from typing import Callable, Type, List, Iterable, Optional, Union, Sequence, Dict
  from types import ModuleType
label_desc: Use image node_id 2 for calling a global function with example usage: add_ivy_container_instance_methods(cls, modules, static, to_ignore) without return types