class_docstr: Legacy parser for gateway.
docstr: :param cls: target class type to parse into, must be a :class:`JAMLCompatible` type
  :param data: deployment yaml file loaded as python dict
  :param runtime_args: Optional runtime_args to be directly passed without being parsed into a yaml config
  :return: the Deployment YAML parser given the syntax version number
docstr_tok: [":","param","cls",":","target","class","type","to","parse","into",",","must","be","a",":","class",":","`","JAMLCompatible","`","type",":","param","data",":","deployment","yaml","file","loaded","as","python","dict",":","param","runtime_args",":","Optional","runtime_args","to","be","directly","passed","without","being","parsed","into","a","yaml","config",":","return",":","the","Deployment","YAML","parser","given","the","syntax","version","number"]
code: def parse(
      self,
      cls: Type["Deployment"],
      data: Dict,
      runtime_args: Optional[Dict[str, Any]] = None,
  ) -> "Deployment":
      """
      :param cls: target class type to parse into, must be a :class:`JAMLCompatible` type
      :param data: deployment yaml file loaded as python dict
      :param runtime_args: Optional runtime_args to be directly passed without being parsed into a yaml config
      :return: the Deployment YAML parser given the syntax version number
      """
      cls._init_from_yaml = True
      # tmp_p = {kk: expand_env_var(vv) for kk, vv in data.get('with', {}).items()}
  
      obj = cls(
          **data.get("with", {}),
          needs=data.get("needs"),
          runtime_args=runtime_args,
      )
      cls._init_from_yaml = False
  
      obj.is_updated = False
      return obj
  
file_path: jina/jina/jaml/parsers/deployment/legacy.py
imports: from typing import TYPE_CHECKING, Any, Dict, Optional, Type
  from jina.helper import ArgNamespace
  from jina.jaml.parsers.base import BaseLegacyParser
  from jina.jaml.parsers.flow.v1 import _get_taboo
  from jina.parsers import set_deployment_parser
label_desc: Use image node_id 1 for calling the DeploymentLegacyParser obj's underlying member method code with example usage: obj.parse(cls, data, runtime_args) and returns: obj