code: def _discover_autoserialize(module, visited):
      """
      Traverses a module tree given by the head module and
      returns all functions that are marked with ``@autoserialize`` decorator.
  
      :param module: Module currently searched.
      :param visited: Paths to the ``__init__.py`` of the modules already searched.
      :return: All functions that are marked with ``@autoserialize`` decorator.
      """
      assert module is not None
      ret = []
      try:
          module_members = inspect.getmembers(module)
      except (ModuleNotFoundError, ImportError):
          # If any module can't be inspected, DALI will not be able to find the @autoserialize
          # anyway. We can just skip this module.
          return ret
      modules = []
      for name, path in module_members:
          obj = getattr(module, name, None)
          if inspect.ismodule(obj) and path not in visited:
              modules.append(name)
              visited.append(path)
          elif inspect.isfunction(obj) and _is_marked_autoserializable(
              obj
          ):
              ret.append(obj)
      for mod in modules:
          ret.extend(
              _discover_autoserialize(
                  getattr(module, mod, None), visited=visited
              )
          )
      return ret
  
label_desc: Use image node_id 2 for calling a global function with example usage: _discover_autoserialize(module, visited) and returns: ret, ret