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"]
docstr: Converts the Executor into a set of yaml deployments to deploy in Kubernetes.
  
  If you don't want to rebuild image on Jina Hub,
  you can set `JINA_HUB_NO_IMAGE_REBUILD` environment variable.
  
  :param uses: the Executor to use. Has to be containerized and accessible from K8s
  :param output_base_path: The base path where to dump all the yaml files
  :param k8s_namespace: The name of the k8s namespace to set for the configurations. If None, the name of the Flow will be used.
  :param executor_type: The type of Executor. Can be external or shared. External Executors include the Gateway. Shared Executors don't. Defaults to External
  :param uses_with: dictionary of parameters to overwrite from the default config's with field
  :param uses_metas: dictionary of parameters to overwrite from the default config's metas field
  :param uses_requests: dictionary of parameters to overwrite from the default config's requests field
  :param uses_dynamic_batching: dictionary of parameters to overwrite from the default config's dynamic_batching field
  :param kwargs: other kwargs accepted by the Flow, full list can be found `here <https://docs.jina.ai/api/jina.orchestrate.flow.base/>`
code: def to_kubernetes_yaml(
      uses: str,
      output_base_path: str,
      k8s_namespace: Optional[str] = None,
      executor_type: Optional[
          StandaloneExecutorType
      ] = StandaloneExecutorType.EXTERNAL,
      uses_with: Optional[Dict] = None,
      uses_metas: Optional[Dict] = None,
      uses_requests: Optional[Dict] = None,
      uses_dynamic_batching: Optional[Dict] = None,
      **kwargs,
  ):
      """
      Converts the Executor into a set of yaml deployments to deploy in Kubernetes.
  
      If you don't want to rebuild image on Jina Hub,
      you can set `JINA_HUB_NO_IMAGE_REBUILD` environment variable.
  
      :param uses: the Executor to use. Has to be containerized and accessible from K8s
      :param output_base_path: The base path where to dump all the yaml files
      :param k8s_namespace: The name of the k8s namespace to set for the configurations. If None, the name of the Flow will be used.
      :param executor_type: The type of Executor. Can be external or shared. External Executors include the Gateway. Shared Executors don't. Defaults to External
      :param uses_with: dictionary of parameters to overwrite from the default config's with field
      :param uses_metas: dictionary of parameters to overwrite from the default config's metas field
      :param uses_requests: dictionary of parameters to overwrite from the default config's requests field
      :param uses_dynamic_batching: dictionary of parameters to overwrite from the default config's dynamic_batching field
      :param kwargs: other kwargs accepted by the Flow, full list can be found `here <https://docs.jina.ai/api/jina.orchestrate.flow.base/>`
      """
      warnings.warn(
          f"Executor.to_kubernetes_yaml() is no more supported and will be deprecated soon. Use Deployment to export kubernetes YAML files: "
          f"https://docs.jina.ai/concepts/executor/serve/#serve-via-kubernetes",
          DeprecationWarning,
      )
      from jina.orchestrate.flow.base import Flow
  
      Flow(**kwargs).add(
          uses=uses,
          uses_with=uses_with,
          uses_metas=uses_metas,
          uses_requests=uses_requests,
          uses_dynamic_batching=uses_dynamic_batching,
      ).to_kubernetes_yaml(
          output_base_path=output_base_path,
          k8s_namespace=k8s_namespace,
          include_gateway=executor_type
          == BaseExecutor.StandaloneExecutorType.EXTERNAL,
      )
  
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 20 for calling the BaseExecutor obj's underlying member method code with example usage: obj.to_kubernetes_yaml(uses, output_base_path, k8s_namespace, executor_type, uses_with, uses_metas, uses_requests, uses_dynamic_batching) without return types