def METHOD_NAME(
    self, cls: type, data: Dict, runtime_args: Optional[Dict[str, Any]] = None
) -> 'Flow':
    """
    :param cls: the class registered for dumping/loading
    :param data: flow 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 Flow YAML parser given the syntax version number
    """
    p = data.get('with', {})  # type: Dict[str, Any]
    a = p.pop('args') if 'args' in p else ()
    k = p.pop('kwargs') if 'kwargs' in p else {}
    # maybe there are some hanging kwargs in "parameters"
    tmp_a = (expand_env_var(v) for v in a)
    tmp_p = {kk: expand_env_var(vv) for kk, vv in {**k, **p}.items()}
    obj = cls(*tmp_a, **tmp_p)
    pp = data.get('executors', data.get('deployments', []))
    for deployments in pp:
        if isinstance(deployments, str):
            dep = Deployment.load_config(
                deployments,
                extra_search_paths=data.get('with', {}).get('extra_search_paths'),
                include_gateway=False,
                noblock_on_start=True,
            )
            getattr(obj, 'add')(dep, copy_flow=False)
        elif (
            isinstance(deployments, dict)
            and deployments.get('jtype') == 'Deployment'
        ):
            dep = Deployment.load_config(
                deployments,
                extra_search_paths=data.get('with', {}).get('extra_search_paths'),
                include_gateway=False,
                noblock_on_start=True,
            )
            getattr(obj, 'add')(dep, copy_flow=False)
        else:
            p_deployment_attr = {
                kk: expand_env_var(vv) for kk, vv in deployments.items()
            }
            # in v1 YAML, flow is an optional argument
            if p_deployment_attr.get('name', None) != GATEWAY_NAME:
                # ignore gateway when reading, it will be added during build()
                method = p_deployment_attr.get('method', 'add')
                # support methods: add, needs, inspect
                getattr(obj, method)(**p_deployment_attr, copy_flow=False)
    gateway = data.get(GATEWAY_NAME, {})
    if gateway:
        gateway_attr = {kk: expand_env_var(vv) for kk, vv in gateway.items()}
        obj.config_gateway(**gateway_attr, copy_flow=False)
    return obj