def METHOD_NAME():
    default_dir = None
    if "DGLDEFAULTDIR" in os.environ:
        default_dir = os.getenv("DGLDEFAULTDIR")
    else:
        default_dir = os.path.join(os.path.expanduser("~"), ".dgl")
    config_path = os.path.join(default_dir, "config.json")
    backend_name = None
    if "DGLBACKEND" in os.environ:
        backend_name = os.getenv("DGLBACKEND")
    elif os.path.exists(config_path):
        with open(config_path, "r") as config_file:
            config_dict = json.load(config_file)
            backend_name = config_dict.get("backend", "").lower()
    if backend_name in ["tensorflow", "mxnet", "pytorch"]:
        return backend_name
    else:
        print(
            "DGL backend not selected or invalid.  "
            "Assuming PyTorch for now.",
            file=sys.stderr,
        )
        set_default_backend(default_dir, "pytorch")
        return "pytorch"