code: def _get_all_parser(cls: Type["JAMLCompatible"]):
      """Get all parsers and legacy parser of a class
  
      :param cls: target class
      :return: a tuple of two elements; first is a list of all parsers, second is the legacy parser for default fallback
      """
      from jina.orchestrate.flow.base import Flow
      from jina.serve.executors import BaseExecutor
  
      if issubclass(cls, Flow):
          return _get_flow_parser()
      elif issubclass(cls, BaseExecutor):
          return _get_exec_parser()
      elif issubclass(cls, BaseGateway):
          return _get_gateway_parser()
      elif issubclass(cls, Deployment):
          return _get_deployment_parser()
      else:
          raise NotImplementedError(
              f"No parser exists for cls {cls.__name__}"
          )
  
file_path: jina/jina/jaml/parsers/__init__.py
imports: import warnings
  from typing import List, Optional, Type
  from jina.excepts import BadYAMLVersion
  from jina.jaml import JAMLCompatible
  from jina.jaml.parsers.base import VersionedYAMLParser
  from jina.orchestrate.deployments import Deployment
  from jina.serve.runtimes.gateway.gateway import BaseGateway
label_desc: Use image node_id 1 for calling a global function with example usage: _get_all_parser(cls) and returns: _get_flow_parser, _get_exec_parser, _get_gateway_parser, _get_deployment_parser