def METHOD_NAME(data_path, synset_id, json_data):
    """
    Returns the parent synset_id if it exists. If the synset_id is already parent synset_id, it is just returned
    :param data_path: path to the ShapeNetCore.v2 folder
    :param synset_id: the id of the category something like: '02691156', see the data_path folder for more ids
    :param json_data: loaded data from the ShapeNet taxonomy.json file
    :return: parent synset_id
    """
    id_path = os.path.join(data_path, synset_id)
    # Check if the synset_id is alreay a parent synset_id
    if os.path.exists(id_path):
        return synset_id
    for block in json_data:
        if synset_id in block["children"]:
            parent_synset_id = block["synsetId"]
            return _ShapeNetLoader.METHOD_NAME(data_path, parent_synset_id, json_data)
    raise ValueError(f"The used_synset_id {synset_id} does not exists in the taxonomy file")