<commit_before>import conda_build.conda_interface
import networkx as nx
import conda_build.api
from compute_build_graph import construct_graph
import argparse
import os

def build_all(recipes_dir, arch):
    channel_urls=['local', 'conda-forge', 'defaults']
    index = conda_build.conda_interface.get_index(channel_urls=channel_urls)
    conda_resolve = conda_build.conda_interface.Resolve(index)

    exclusive_config_file = os.path.join(conda_build.conda_interface.root_dir, 'conda_build_config.yaml')
    platform =  get_host_platform()
    variant_config_files = []
    if platform == 'win':
        script_dir = os.path.dirname(os.path.realpath(__file__))
        variant_config_files = [os.path.join(script_dir, 'win{}.yaml'.format(arch))]

    config = conda_build.api.Config(variant_config_files=variant_config_files, arch=arch,
                                    exclusive_config_file=exclusive_config_file,
                                    channel_urls=channel_urls)

    worker={'platform': platform, 'arch': arch, 'label': platform}

    G = construct_graph(recipes_dir, worker=worker, run='build', conda_resolve=conda_resolve,
                        folders=os.listdir(recipes_dir), config=config)

    order = list(nx.topological_sort(G))
    order.reverse()

    print('Building packages')
    print('\n'.join(order))

    for node in order:<commit_msg>Fix build_all.py<commit_after>import conda_build.conda_interface
import networkx as nx
import conda_build.api
from compute_build_graph import construct_graph
import argparse
import os

def build_all(recipes_dir, arch):
    folders = os.listdir(recipes_dir)
    if not folders:
        print("Found no recipes to build")
        return
    channel_urls=['local', 'conda-forge', 'defaults']
    index = conda_build.conda_interface.get_index(channel_urls=channel_urls)
    conda_resolve = conda_build.conda_interface.Resolve(index)

    exclusive_config_file = os.path.join(conda_build.conda_interface.root_dir, 'conda_build_config.yaml')
    platform =  get_host_platform()
    variant_config_files = []
    if platform == 'win':
        script_dir = os.path.dirname(os.path.realpath(__file__))
        variant_config_files = [os.path.join(script_dir, 'win{}.yaml'.format(arch))]

    config = conda_build.api.Config(variant_config_files=variant_config_files, arch=arch,
                                    exclusive_config_file=exclusive_config_file,
                                    channel_urls=channel_urls)

    worker={'platform': platform, 'arch': arch, 'label': '{}-{}'.format(platform, arch)}

    G = construct_graph(recipes_dir, worker=worker, run='build', conda_resolve=conda_resolve,
                        folders=folders, config=config)

    order = list(nx.topological_sort(G))
    order.reverse()

    print('Computed that there are {} distributions to build from {} recipes'.format(len(order), len(folders)))
    print("Resolved dependencies, will be built in the following order:")
    print('    '+'\n    '.join(order))

    for node in order:
{'fraction_non_alphanumeric': 0.10825929582099375, 'fraction_numerical': 0.0, 'mean_word_length': 3.691358024691358, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6504692', 'n_tokens_mistral': 943, 'n_tokens_neox': 934, 'n_words': 167}