import json


def is_bilby_json_file(path):
    """Determine if the results file is a bilby json results file

    Parameters
    ----------
    path: str
        path to the results file
    """
    with open(path, "r") as f:
        data = json.load(f)
    try:
        if "bilby" in data["version"]:
            return True
        elif "bilby" in data["version"][0]:
            return True
        else:
            return False
    except Exception:
        return False