<commit_before>''' A library providing a python interface to Wargaming.net's World of Tanks API '''

import requests

class API(object):

	BASE_URL = 'https://api.worldoftanks.com/wot'	# no trailing slash

	def __init__(self, app_id):
		self.app_id = app_id

	def _api_call(self, **kwargs):
		''' Initiates an API call '''
		r = requests.get('https://api.worldoftanks.com/wot/encyclopedia/tanks', params=kwargs)
		return r.json()<commit_msg>Completed method to initiate an API call<commit_after>''' A library providing a python interface to Wargaming.net's World of Tanks API '''

import requests
import json

class API(object):

	BASE_URL = 'https://api.worldoftanks.com/wot'	# no trailing slash

	def __init__(self, app_id):
		self.app_id = app_id

	def _api_call(self, url, **kwargs):
		''' Initiates an API call '''
		
		payload = kwargs
		
		# add the application id to our payload
		payload['application_id'] = self.app_id
		r = requests.get(url, params=payload)
		
		# return pretty-printed json
		return json.dumps(r.json(), sort_keys=True, indent=4)
				
{'fraction_non_alphanumeric': 0.12229539040451552, 'fraction_numerical': 0.0009407337723424271, 'mean_word_length': 4.267326732673268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '1817701', 'n_tokens_mistral': 383, 'n_tokens_neox': 344, 'n_words': 102}