<commit_before>"""."""
from urllib.parse import parse_qsl, urlparse


DEFAULT_STRATEGY = 'eq'
STRATEGIES = ['eq', 'gt', 'gte', 'lt', 'lte', 'in', 'like', 'ilike']
STRATEGY_PARTITION = ':'


def get_parameters(url: str) -> dict:
    """Convert a URL into a dictionary of parameter, value pairs."""
    parsed_url = urlparse(url)
    return {key: value for key, value in parse_qsl(parsed_url.query)}


def get_includes(parameters: dict) -> list:
    """Return a list of relationships to include.

    :param parameters: Dictionary of parameter name, value pairs.
    """
    return parameters.get('include', '').split(',')


def get_sorts(parameters: dict) -> list:
    """Return a list of doubles to sort by.

    :param parameters: Dictionary of parameter name, value pairs.
    """
    sorts = []
    for sort in parameters.get('sort', '').split(','):
        if sort.startswith('-') or sort.startswith('+'):
            sorts.append((sort[1:], sort[:1]))
        else:
            sorts.append((sort, '+'))
    return sorts


def get_filters(parameters: dict) -> list:
    """Return a list of triples to filter by.

    :param parameters: Dictionary of parameter name, value pairs.
    """
    filters = []
    for parameter, value in parameters.items():<commit_msg>Only appending sorts if there is a sort value<commit_after>"""."""
from urllib.parse import parse_qsl, urlparse


DEFAULT_STRATEGY = 'eq'
STRATEGIES = ['eq', 'gt', 'gte', 'lt', 'lte', 'in', 'like', 'ilike']
STRATEGY_PARTITION = ':'


def get_parameters(url: str) -> dict:
    """Convert a URL into a dictionary of parameter, value pairs."""
    parsed_url = urlparse(url)
    return {key: value for key, value in parse_qsl(parsed_url.query)}


def get_includes(parameters: dict) -> list:
    """Return a list of relationships to include.

    :param parameters: Dictionary of parameter name, value pairs.
    """
    return parameters.get('include', '').split(',')


def get_sorts(parameters: dict) -> list:
    """Return a list of doubles to sort by.

    :param parameters: Dictionary of parameter name, value pairs.
    """
    sorts = []
    for sort in parameters.get('sort', '').split(','):
        if sort.startswith('-') or sort.startswith('+'):
            sorts.append((sort[1:], sort[:1]))
        elif sort != '':
            sorts.append((sort, '+'))
    return sorts


def get_filters(parameters: dict) -> list:
    """Return a list of triples to filter by.

    :param parameters: Dictionary of parameter name, value pairs.
    """
    filters = []
    for parameter, value in parameters.items():
{'fraction_non_alphanumeric': 0.1527723924001551, 'fraction_numerical': 0.0015509887553315238, 'mean_word_length': 3.3434343434343434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '470482', 'n_tokens_mistral': 791, 'n_tokens_neox': 778, 'n_words': 260}