code: def _init_requests_by_class(cls):
      """
      To allow inheritance and still have coherent usage of `requests`. Makes sure that a child class inherits requests from parents
  
      :param cls: The class.
      """
      if not hasattr(cls, "requests_by_class"):
          cls.requests_by_class = {}
  
      if cls.__name__ not in cls.requests_by_class:
          cls.requests_by_class[cls.__name__] = {}
  
          def _inherit_from_parent_class_inner(cls_):
              for parent_class in cls_.__bases__:
                  parent_dict = cls.requests_by_class.get(
                      parent_class.__name__, {}
                  )
                  for k, v in parent_dict.items():
                      if k not in cls.requests_by_class[cls.__name__]:
                          cls.requests_by_class[cls.__name__][k] = v
                  _inherit_from_parent_class_inner(parent_class)
  
          # assume that `requests` is called when importing class, so parent classes will be processed before
          # inherit all the requests from parents
          _inherit_from_parent_class_inner(cls)
  
file_path: jina/jina/serve/executors/decorators.py
imports: import functools
  import inspect
  import os
  from pathlib import Path
  from typing import Callable, Dict, List, Optional, Sequence, Type, Union
  from jina._docarray import Document, DocumentArray, docarray_v2
  from jina.constants import __cache_path__
  from jina.helper import is_generator, iscoroutinefunction
  from jina.importer import ImportExtensions
label_desc: Use image node_id 3 for calling a global function with example usage: _init_requests_by_class(cls) without return types