import json


def load_args_from_json(args, path):
    """Load argparse namespace from json file.

    Args:
        args: The argparse namespace to save.
        path: Path to json file for storage.

    """
    with open(path, 'r') as f:
        arguments_dict = json.load(f)
    for name, value in arguments_dict.items():
        if getattr(args, name, None) is None:
            setattr(args, name, value)
    return args