def METHOD_NAME(
    docs_file: typing.TextIO
) -> Tuple[Union[Dict[str, env_var_docs.parser.Variable], None],
           List[env_var_docs.parser.NodeParseError]]:
    """If docs_file has no parsing errors, returns the set of defined
    environment variables in an environment variable documentation file.
    Otherwise returns the parsing errors.
    """
    vars = dict()
    def add(node: env_var_docs.parser.Node):
        if isinstance(node.details, env_var_docs.parser.Variable):
            vars[node.name] = node.details
    errors = env_var_docs.parser.visit(docs_file, add)
    if len(errors) != 0:
        return None, errors
    return vars, []