<commit_before>import json
import subprocess
import urllib.request
import xmlrpc.client


def ruby_get_package_versions(package_name):
    url = f'https://rubygems.org/api/v1/versions/{package_name}.json'
    resp = json.load(urllib.request.urlopen(url))
    return list(reversed([version['number'] for version in resp]))


def node_get_package_versions(package_name):
    cmd = ('npm', 'view', package_name, '--json')
    output = json.loads(subprocess.check_output(cmd))
    return output['versions']


def python_get_package_versions(package_name):
    client = xmlrpc.client.ServerProxy('https://pypi.org/pypi')
    versions = client.package_releases(package_name, True)
    return list(reversed(versions))


def rust_get_package_versions(package_name):
    url = f'https://crates.io/api/v1/crates/{package_name}'
    resp = json.load(urllib.request.urlopen(url))
    return [version['num'] for version in resp['versions']]


def node_get_additional_dependencies(package_name, package_version):
    return [f'{package_name}@{package_version}']


def rust_get_additional_dependencies(package_name, package_version):
    return [f'cli:{package_name}:{package_version}']


LIST_VERSIONS = {
    'node': node_get_package_versions,
    'python': python_get_package_versions,
    'ruby': ruby_get_package_versions,
    'rust': rust_get_package_versions,
}

ADDITIONAL_DEPENDENCIES = {
    'node': node_get_additional_dependencies,
    'rust': rust_get_additional_dependencies,
}
<commit_msg>Reverse order of versions for Rust<commit_after>import json
import subprocess
import urllib.request
import xmlrpc.client


def ruby_get_package_versions(package_name):
    url = f'https://rubygems.org/api/v1/versions/{package_name}.json'
    resp = json.load(urllib.request.urlopen(url))
    return list(reversed([version['number'] for version in resp]))


def node_get_package_versions(package_name):
    cmd = ('npm', 'view', package_name, '--json')
    output = json.loads(subprocess.check_output(cmd))
    return output['versions']


def python_get_package_versions(package_name):
    client = xmlrpc.client.ServerProxy('https://pypi.org/pypi')
    versions = client.package_releases(package_name, True)
    return list(reversed(versions))


def rust_get_package_versions(package_name):
    url = f'https://crates.io/api/v1/crates/{package_name}'
    resp = json.load(urllib.request.urlopen(url))
    return list(reversed([version['num'] for version in resp['versions']]))


def node_get_additional_dependencies(package_name, package_version):
    return [f'{package_name}@{package_version}']


def rust_get_additional_dependencies(package_name, package_version):
    return [f'cli:{package_name}:{package_version}']


LIST_VERSIONS = {
    'node': node_get_package_versions,
    'python': python_get_package_versions,
    'ruby': ruby_get_package_versions,
    'rust': rust_get_package_versions,
}

ADDITIONAL_DEPENDENCIES = {
    'node': node_get_additional_dependencies,
    'rust': rust_get_additional_dependencies,
}

{'fraction_non_alphanumeric': 0.12271973466003316, 'fraction_numerical': 0.0013266998341625207, 'mean_word_length': 5.792792792792793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4994786', 'n_tokens_mistral': 1018, 'n_tokens_neox': 966, 'n_words': 157}