def map_file_to_plot_id(file_path: str, season_id: str, seasons: list) -> str:
    """Find the plot that is associated with the file
    Arguments:
        file_path: the path to the file
        season_id: the ID of the season associated with the file
        seasons: the list of seasons
    Return:
        Returns the found plot ID
    Exceptions:
        Raises RuntimeError if the plot ID isn't found
    """
    found_plot_id = None
    file_parts = file_path.split('/')
    for one_season in seasons:
        if 'id' not in one_season or 'sites' not in one_season or not one_season['id'] == season_id:
            continue
        for one_site in one_season['sites']:
            if 'site' not in one_site or 'sitename' not in one_site['site']:
                continue
            if one_site['site']['sitename'] in file_parts:
                found_plot_id = one_site['site']['id']
                break

    if found_plot_id is None:
        raise RuntimeError("Unable to find plot ID for file %s" % file_path)
    return found_plot_id