class_docstr: The base class of all Executors, can be used to build encoder, indexer, etc.
  
  :class:`jina.Executor` as an alias for this class.
  
  EXAMPLE USAGE
  
  .. code-block:: python
  
      from jina import Executor, requests, Flow
  
  
      class MyExecutor(Executor):
          @requests
          def foo(self, docs, **kwargs):
              print(docs)  # process docs here
  
  
      f = Flow().add(uses=Executor)  # you can add your Executor to a Flow
  
  Any executor inherited from :class:`BaseExecutor` always has the **meta** defined in :mod:`jina.executors.metas.defaults`.
  
  All arguments in the :func:`__init__` can be specified with a ``with`` map in the YAML config. Example:
  
  .. highlight:: python
  .. code-block:: python
  
      class MyAwesomeExecutor(Executor):
          def __init__(awesomeness=5):
              pass
  
  is equal to
  
  .. highlight:: yaml
  .. code-block:: yaml
  
      jtype: MyAwesomeExecutor
      with:
          awesomeness: 5
class_docstr_tok: ["The","base","class","of","all","Executors",",","can","be","used","to","build","encoder",",","indexer",",","etc",".",":","class",":","`","jina.Executor","`","as","an","alias","for","this","class",".","EXAMPLE","USAGE","..","code-block",":",":","python","from","jina","import","Executor",",","requests",",","Flow","class","MyExecutor","(","Executor",")",":","@","requests","def","foo","(","self",",","docs",",","*","*","kwargs",")",":","print","(","docs",")","#","process","docs","here","f","=","Flow","(",")",".add","(","uses=Executor",")","#","you","can","add","your","Executor","to","a","Flow","Any","executor","inherited","from",":","class",":","`","BaseExecutor","`","always","has","the","*","*","meta","*","*","defined","in",":","mod",":","`","jina.executors.metas.defaults","`",".","All","arguments","in","the",":","func",":","`","__init__","`","can","be","specified","with","a","``","with","``","map","in","the","YAML","config",".","Example",":","..","highlight",":",":","python","..","code-block",":",":","python","class","MyAwesomeExecutor","(","Executor",")",":","def","__init__","(","awesomeness=5",")",":","pass","is","equal","to","..","highlight",":",":","yaml","..","code-block",":",":","yaml","jtype",":","MyAwesomeExecutor","with",":","awesomeness",":","5"]
code: def _get_endpoint_models_dict(self):
      from jina._docarray import docarray_v2
  
      if not docarray_v2:
          from docarray.document.pydantic_model import PydanticDocument
  
      endpoint_models = {}
      for endpoint, function_with_schema in self.requests.items():
          _is_generator = function_with_schema.is_generator
          _is_singleton_doc = function_with_schema.is_singleton_doc
          _is_batch_docs = function_with_schema.is_batch_docs
          _parameters_model = function_with_schema.parameters_model
          if docarray_v2:
              # if the endpoint is not a generator endpoint, then the request schema is a DocumentArray and we need
              # to get the doc_type from the schema
              # otherwise, since generator endpoints only accept a Document as input, the request_schema is the schema
              # of the Document
              if not _is_generator:
                  request_schema = (
                      function_with_schema.request_schema.doc_type
                      if _is_batch_docs
                      else function_with_schema.request_schema
                  )
                  response_schema = (
                      function_with_schema.response_schema.doc_type
                      if _is_batch_docs
                      else function_with_schema.response_schema
                  )
              else:
                  request_schema = function_with_schema.request_schema
                  response_schema = function_with_schema.response_schema
          else:
              request_schema = PydanticDocument
              response_schema = PydanticDocument
          endpoint_models[endpoint] = {
              "input": {
                  "name": request_schema.__name__,
                  "model": request_schema,
              },
              "output": {
                  "name": response_schema.__name__,
                  "model": response_schema,
              },
              "is_generator": _is_generator,
              "is_singleton_doc": _is_singleton_doc,
              "parameters": {
                  "name": _parameters_model.__name__
                  if _parameters_model is not None
                  else None,
                  "model": _parameters_model,
              },
          }
      return endpoint_models
  
imports: from __future__ import annotations
  import asyncio
  import contextlib
  import copy
  import functools
  import inspect
  import multiprocessing
  import os
  import threading
  import warnings
  from collections.abc import AsyncGenerator, AsyncIterator, Generator, Iterator
  from types import SimpleNamespace
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, NamedTuple, Optional, Type, TypeVar, Union, _GenericAlias, overload
  from jina._docarray import DocumentArray, docarray_v2
  from jina.constants import __args_executor_init__, __cache_path__, __default_endpoint__
  from jina.enums import BetterEnum, ProviderType
  from jina.helper import ArgNamespace, T, get_or_reuse_loop, iscoroutinefunction, typename
  from jina.importer import ImportExtensions
  from jina.jaml import JAML, JAMLCompatible, env_var_regex, internal_var_regex
  from jina.logging.logger import JinaLogger
  from jina.serve.executors.decorators import _init_requests_by_class, avoid_concurrent_lock_cls
  from jina.serve.executors.metas import get_executor_taboo
  from jina.serve.helper import _get_workspace_from_name_and_shards, store_init_kwargs, wrap_func
  from jina.serve.instrumentation import MetricsTimer
label_desc: Use image node_id 2 for calling the BaseExecutor obj's underlying member method code with example usage: obj._get_endpoint_models_dict() and returns: endpoint_models