def METHOD_NAME(loader, node):
    """
    Extracts the environment variable from the yaml node's value
    :param yaml.Loader loader: the yaml loader (as defined above)
    :param node: the current node (key-value) in the yaml
    :return: the parsed string that contains the value of the environment
    variable or the default value if defined for the variable. If no value
    for the variable can be found, then the value is replaced by
    default_value='N/A'
    """
    value = loader.construct_scalar(node)
    match = pattern.findall(value)  # to find all env variables in line
    dt = "".join(type_tag_pattern.findall(value)) or ""
    value = value.replace(dt, "")
    if match:
        full_value = value
        for g in match:
            curr_default_value = default_value
            env_var_name = g
            env_var_name_with_default = g
            if default_sep and isinstance(g, tuple) and len(g) > 1:
                env_var_name = g[0]
                env_var_name_with_default = "".join(g)
                found = False
                for each in g:
                    if default_sep in each:
                        _, curr_default_value = each.split(default_sep, 1)
                        found = True
                        break
                if not found and raise_if_na:
                    raise ValueError(
                        f"Could not find default value for {env_var_name}"
                    )
            full_value = full_value.replace(
                f"${{{env_var_name_with_default}}}",
                os.environ.get(env_var_name, curr_default_value),
            )
            if dt:
                # do one more roundtrip with the dt constructor:
                node.value = full_value
                node.tag = dt.strip()
                return loader.yaml_constructors[node.tag](loader, node)
        return full_value
    return value