<commit_before>from bravado.client import SwaggerClient
from bravado.requests_client import RequestsClient
from bravado.swagger_model import Loader

def load_client(apikey=None):
    host = 'api.mpcontribs.org' if apikey else 'localhost:5000'
    protocol = 'https' if apikey else 'http'
    spec_url = f'{protocol}://{host}/apispec.json'
    http_client = RequestsClient()
    if apikey:
        http_client.set_api_key(
            host, apikey, param_in='header', param_name='x-api-key'
        )
    loader = Loader(http_client)
    spec_dict = loader.load_spec(spec_url)
    spec_dict['host'] = host
    return SwaggerClient.from_spec(spec_dict, spec_url, http_client,
                                   {'validate_responses': False})<commit_msg>load_client: set spec scheme<commit_after>from bravado.client import SwaggerClient
from bravado.requests_client import RequestsClient
from bravado.swagger_model import Loader

def load_client(apikey=None):
    host = 'api.mpcontribs.org' if apikey else 'localhost:5000'
    protocol = 'https' if apikey else 'http'
    spec_url = f'{protocol}://{host}/apispec.json'
    http_client = RequestsClient()
    if apikey:
        http_client.set_api_key(
            host, apikey, param_in='header', param_name='x-api-key'
        )
    loader = Loader(http_client)
    spec_dict = loader.load_spec(spec_url)
    spec_dict['host'] = host
    spec_dict['schemes'] = [protocol]
    return SwaggerClient.from_spec(spec_dict, spec_url, http_client,
                                   {'validate_responses': False})
{'fraction_non_alphanumeric': 0.10289389067524116, 'fraction_numerical': 0.005144694533762058, 'mean_word_length': 3.433048433048433, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6120876', 'n_tokens_mistral': 502, 'n_tokens_neox': 487, 'n_words': 102}