<commit_before>from models import Vote


def votes_json(track):
    votes = Vote.select().where(Vote.track_uri == track.uri)

    for vote in votes:
        yield {
            'user': vote.user.name,
            'time': vote.timestamp.isoformat()
        }

def track_json(track):
    """
    Generate JSON from a Mopidy track
    :param track: A mopidy.models.Track
    :return:
    """
    return {
        'track_name': track.name,
        'track_uri': track.uri,
        'artists': [artist.name for artist in track.artists],
        'album': track.album.name,
        'images': [image for image in track.album.images],
        'votes': list(votes_json(track))
    }<commit_msg>Format<commit_after>from models import Vote


def votes_json(track):
    votes = Vote.select().where(Vote.track_uri == track.uri)

    for vote in votes:
        yield {
            'user': vote.user.name,
            'time': vote.timestamp.isoformat()
        }


def track_json(track):
    """
    Generate JSON from a Mopidy track
    :param track: A mopidy.models.Track
    :return:
    """
    return {
        'track_name': track.name,
        'track_uri': track.uri,
        'artists': [artist.name for artist in track.artists],
        'album': track.album.name,
        'images': [image for image in track.album.images],
        'votes': list(votes_json(track))
    }
{'fraction_non_alphanumeric': 0.13107511045655376, 'fraction_numerical': 0.0, 'mean_word_length': 2.2985436893203883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2812375', 'n_tokens_mistral': 436, 'n_tokens_neox': 427, 'n_words': 104}