<commit_before>"""
Built-in extensions.
"""

import os
import sys

from tea_party.path import windows_to_unix_path
from tea_party.extensions.decorators import named_extension


@named_extension('prefix')
def prefix(builder, style='default'):
    """
    Get the builder prefix.
    """

    result = os.path.join(builder.attendee.party.prefix, builder.attendee.prefix, builder.prefix)

    if sys.platform.startswith('win32') and style == 'unix':
        result = windows_to_unix_path(result)

    return result

@named_extension('prefix_for')
def prefix_for(builder, for_attendee, for_builder='', style='default'):
    """
    Get the builder prefix for a given attendee, and optionally one of its builders.
    """

    party = builder.attendee.party

    for_attendee = party.get_attendee_by_name(for_attendee)
    builder_prefix = attendee.get_builder_by_name(for_builder).prefix if for_builder else ''

    result = os.path.join(party.prefix, attendee.prefix, builder_prefix)

    if sys.platform.startswith('win32') and style == 'unix':
        result = windows_to_unix_path(result)

    return result

@named_extension('current_attendee')
def current_attendee(builder):
    """
    Get the current attendee.
    """

    return builder.attendee

@named_extension('current_builder')
def current_builder(builder):
    """
    Get the current builder.
    """

    return builder

@named_extension('current_archive_path')
def current_builder(builder):
    """
    Get the current archive path.
    """

    return builder.attendee.archive_path

@named_extension('current_source_tree_path')
def current_builder(builder):
    """
    Get the current source tree path.
    """

    return builder.attendee.source_tree_path
<commit_msg>Fixed function names<commit_after>"""
Built-in extensions.
"""

import os
import sys

from tea_party.path import windows_to_unix_path
from tea_party.extensions.decorators import named_extension


@named_extension('prefix')
def prefix(builder, style='default'):
    """
    Get the builder prefix.
    """

    result = os.path.join(builder.attendee.party.prefix, builder.attendee.prefix, builder.prefix)

    if sys.platform.startswith('win32') and style == 'unix':
        result = windows_to_unix_path(result)

    return result

@named_extension('prefix_for')
def prefix_for(builder, for_attendee, for_builder='', style='default'):
    """
    Get the builder prefix for a given attendee, and optionally one of its builders.
    """

    party = builder.attendee.party

    for_attendee = party.get_attendee_by_name(for_attendee)
    builder_prefix = attendee.get_builder_by_name(for_builder).prefix if for_builder else ''

    result = os.path.join(party.prefix, attendee.prefix, builder_prefix)

    if sys.platform.startswith('win32') and style == 'unix':
        result = windows_to_unix_path(result)

    return result

@named_extension('current_attendee')
def current_attendee(builder):
    """
    Get the current attendee.
    """

    return builder.attendee

@named_extension('current_builder')
def current_builder(builder):
    """
    Get the current builder.
    """

    return builder

@named_extension('current_archive_path')
def current_archive_path(builder, style='default'):
    """
    Get the current archive path.
    """

    result = builder.attendee.archive_path

    if sys.platform.startswith('win32') and style == 'unix':
        result = windows_to_unix_path(result)

    return result

@named_extension('current_source_tree_path')
def current_source_tree_path(builder, style='default'):
    """
    Get the current source tree path.
    """

    result = builder.attendee.source_tree_path

    if sys.platform.startswith('win32') and style == 'unix':
        result = windows_to_unix_path(result)

    return result

{'fraction_non_alphanumeric': 0.10885072655217966, 'fraction_numerical': 0.003170409511228534, 'mean_word_length': 4.081879194630872, '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': '6937035', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1152, 'n_words': 256}