<commit_before>import requests, json
from object import Object

class Culqi:

    API_URL = "https://api.culqi.com/v2"

    def __init__(self, COD_COMMERCE, API_KEY):
        self.COD_COMMERCE = COD_COMMERCE
        self.API_KEY = API_KEY

    def jsonResult(self, url, data):
        headers = {"Authorization": "Bearer "+self.API_KEY, "content-type": "application/json"}
        r = requests.post(self.API_URL+url, headers=headers, data=data)
        return r.json()

    def createToken(self, card_number, currency_code, cvv, exp_month, exp_year, fingerprint, last_name, email, first_name):
        token = Object()
        token.card_number = card_number
        token.currency_code = currency_code
        token.cvv = cvv
        token.expiration_month = exp_month
        token.expiration_year = exp_year
        token.fingerprint = fingerprint
        token.last_name = last_name
        token.email = email
        token.first_name = first_name
        headers = {"Authorization": "Code "+self.COD_COMMERCE, "content-type": "application/json"}
        r = requests.post(self.API_URL+"/tokens/", headers=headers, data=token.toJSON())
        return r.json()

    def createCharge(self, address, address_city, amount, country_code, currency_code, email, first_name, installments, last_name,
                     metadata, order_id, phone_number, product_description, token_id):
        charge = Object()
        charge.address = address
        charge.address_city = address_city
        charge.amount = amount
        charge.country_code = country_code
        charge.currency_code = currency_code
        charge.email = email
        charge.first_name = first_name
        charge.installments = installments
        charge.last_name = last_name
        charge.metadata = metadata
        charge.phone_number = phone_number
        charge.product_description = product_description
        charge.token_id = token_id
        return self.jsonResult("/charges/", charge.toJSON())
<commit_msg>fix culqi.py<commit_after>import requests, json
from object import Object

class Culqi:

    API_URL = "https://api.culqi.com/v2"

    def __init__(self, COD_COMMERCE, API_KEY):
        self.COD_COMMERCE = COD_COMMERCE
        self.API_KEY = API_KEY

    def jsonResult(self, url, data):
        headers = {"Authorization": "Bearer "+self.API_KEY, "content-type": "application/json"}
        r = requests.post(self.API_URL+url, headers=headers, data=data)
        return r.json()

    def createToken(self, card_number, currency_code, cvv, exp_month, exp_year, fingerprint, last_name, email, first_name):
        token = Object()
        token.card_number = card_number
        token.currency_code = currency_code
        token.cvv = cvv
        token.expiration_month = exp_month
        token.expiration_year = exp_year
        token.fingerprint = fingerprint
        token.last_name = last_name
        token.email = email
        token.first_name = first_name
        headers = {"Authorization": "Code "+self.COD_COMMERCE, "content-type": "application/json"}
        r = requests.post(self.API_URL+"/tokens/", headers=headers, data=token.toJSON())
        return r.json()

    def createCharge(self, address, address_city, amount, country_code, currency_code, email, first_name, installments, last_name,
                     metadata, phone_number, product_description, token_id):
        charge = Object()
        charge.address = address
        charge.address_city = address_city
        charge.amount = amount
        charge.country_code = country_code
        charge.currency_code = currency_code
        charge.email = email
        charge.first_name = first_name
        charge.installments = installments
        charge.last_name = last_name
        charge.metadata = metadata
        charge.phone_number = phone_number
        charge.product_description = product_description
        charge.token_id = token_id
        return self.jsonResult("/charges/", charge.toJSON())

{'fraction_non_alphanumeric': 0.09394624466214518, 'fraction_numerical': 0.0005023863350916855, 'mean_word_length': 2.858527131782946, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1627531', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1140, 'n_words': 250}