<commit_before>import sys
import json
from copy import deepcopy
import requests
import http.client, urllib
import time
import telepot



def fetch_currency(sources, targets):
    result_dictionary = {}
    targets_serialize = ""
    url_base = "http://apilayer.net/api/live"
    access_key = "<KEY>"

    #   fetch for sources 0, than we are going to calculate for ourselves
    source = sources[0]
    targets.extend(sources[1:])

    for target in targets:
        targets_serialize += target + ","
    targets_serialize = targets_serialize[:-1]
    url = url_base + "?access_key=" + access_key + "&source = " + str(
        source) + "& currencies=" + targets_serialize + "&format=1"

    response = requests.get(url)

    data = response.json()
    if data["success"]:

        for i in range(len(targets) - len(sources) + 1):
            result_dictionary[sources[0] + targets[i]] = data["quotes"][sources[0] + targets[i]]

        for i in range(1, len(sources)):
            for j in range(len(targets) - len(sources) + 1):
                result_dictionary[sources[i] + targets[j]] = (result_dictionary[sources[0] + targets[j]]) / \
                                                             data["quotes"][sources[0] + targets[j + len(sources) - 1]]
    return (result_dictionary)


def current_investment(from_arr, to_arr, investments):
    current_currencies = fetch_currency(from_arr, deepcopy(to_arr))
    sum_invest = 0.0
    index = 0
    for frm in from_arr:
        for to in to_arr:
            sum_invest += (current_currencies[frm + to] * float(investments[index]))
        index += 1
    print(sum_invest)
    return sum_invest


def notify(jackpot, sum_invest):
    bot = telepot.Bot('@moneys_watch_bot id here')
    response = bot.getUpdates()
    ##### response[len(response)-1]['message']['chat']['id']<commit_msg>MultiThreaded new user check method is added<commit_after>import sys
import json
from copy import deepcopy
import requests
import http.client, urllib
import time
import telepot



def fetch_currency(sources, targets):
    result_dictionary = {}
    targets_serialize = ""
    url_base = "http://apilayer.net/api/live"
    access_key = "<KEY>"

    #   fetch for sources 0, than we are going to calculate for ourselves
    source = sources[0]
    targets.extend(sources[1:])

    for target in targets:
        targets_serialize += target + ","
    targets_serialize = targets_serialize[:-1]
    url = url_base + "?access_key=" + access_key + "&source = " + str(
        source) + "& currencies=" + targets_serialize + "&format=1"

    response = requests.get(url)

    data = response.json()
    if data["success"]:

        for i in range(len(targets) - len(sources) + 1):
            result_dictionary[sources[0] + targets[i]] = data["quotes"][sources[0] + targets[i]]

        for i in range(1, len(sources)):
            for j in range(len(targets) - len(sources) + 1):
                result_dictionary[sources[i] + targets[j]] = (result_dictionary[sources[0] + targets[j]]) / \
                                                             data["quotes"][sources[0] + targets[j + len(sources) - 1]]
    return (result_dictionary)


def current_investment(from_arr, to_arr, investments):
    current_currencies = fetch_currency(from_arr, deepcopy(to_arr))
    sum_invest = 0.0
    index = 0
    for frm in from_arr:
        for to in to_arr:
            sum_invest += (current_currencies[frm + to] * float(investments[index]))
        index += 1
    print(sum_invest)
    return sum_invest


def notify(jackpot, sum_invest):
    bot = telepot.Bot('XXXXXXXXXXXXXXXXXXXXXXXXXX')
    response = bot.getUpdates()
    ##### response[len(response)-1]['message']['chat']['id']
{'fraction_non_alphanumeric': 0.1284329563812601, 'fraction_numerical': 0.009693053311793215, 'mean_word_length': 2.931216931216931, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '1616172', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1107, 'n_words': 271}