def load_baselines(patterns, prefix=False):
    runs = []
    directory = (pathlib.Path(__file__).parent / 'scores')
    for filename in directory.glob('**/*_baselines.json'):
        for (task, methods) in json.loads(filename.read_text()).items():
            for (method, score) in methods.items():
                if prefix:
                    method = f'baseline_{method}'
                if (not any((p.search(method) for p in patterns))):
                    continue
                runs.append(Run(task, method, None, None, score))
    return runs
def load_baselines(patterns, prefix=False):
    runs = []
    directory = (pathlib.Path(__file__).parent / 'scores')
    for filename in directory.glob('**/*_baselines.json'):
        for (task, methods) in json.loads(filename.read_text()).items():
            for (method, score) in methods.items():
                if prefix:
                    method = f'baseline_{method}'
                if (not any((p.search(method) for p in patterns))):
                    continue
                runs.append(Run(task, method, None, None, score))
    return runs