def _convert_track(track, state_types, media, attribute_mapping, localizations):
    """ Converts a Tator Native track into a State spec.
    """
    spec = {'type': state_types['Localization'].id,
            'media_id': media.id,
            'frame': int(track['frame_added'])}
    spec['localization_ids'] = localizations[int(track['id'])]
    spec['media_ids'] = [media.id]
    for src_name in attribute_mapping:
        if src_name in track:
            spec[attribute_mapping[src_name]] = track[src_name]
    return spec