<commit_before># -*- coding:utf-8 -*-
import threading  # 多线程
import time

import itchat  # 主要库

import bytime
import check_aria2
import film
import tuling
import weather
import query_database

itchat.auto_login()  # enableCmdQR=True,hotReload=True
# find the traget account by name,if you want to notice your self,then type your own nickname
users = itchat.search_friends(name="Lee's robot")
# find user by name
userName = users[0]['UserName']

# rigister message reply
@itchat.msg_register(itchat.content.TEXT)
def text_reply(msg):
    msg=msg["Text"]
    msg=msg.encode('utf-8')
    #if the message has define in your database ,then return the define
    query=query_database.query_title(msg)
    if query!='null':
        result = query
    else:
        result = tuling.getTuling(msg)
    return result


# send message
def send_msg(msg):
    # use itchat API
    msg = msg.decode('utf-8')
    itchat.send(msg, userName)


# Push today and two more days' weather to your wechat
def push_weather():
    while 1:
        # get temperature information
        temperature = weather.get_temp()
        # get living index information
        life = weather.get_life()
        # send temperature information
        send_msg(temperature)
        time.sleep(1)
        # send living index information
        send_msg(life)
        # the parameter is the time you want it be sent to you tomorrow
        bytime.dosleep('10')

# Push your download trends<commit_msg>optimization<commit_after># -*- coding:utf-8 -*-
import threading  # 多线程
import time

import itchat  # 主要库

import bytime
import check_aria2
import film
import tuling
import weather
import query_database


itchat.auto_login(enableCmdQR=True,hotReload=True)  # enableCmdQR=True,hotReload=True
# find the traget account by name,if you want to notice your self,then type your own nickname
users = itchat.search_friends(name="123456")
# find user by name
userName = users[0]['UserName']

# rigister message reply
@itchat.msg_register(itchat.content.TEXT)
def text_reply(msg):
    msg=msg["Text"]
    msg=msg.encode('utf-8')
    #if the message has define in your database ,then return the define
    query=query_database.query_title(msg)
    if query!='null':
        result = query
    else:
        result = tuling.getTuling(msg)
    return result


# send message
def send_msg(msg):
    # use itchat API
    msg = msg.decode('utf-8')
    itchat.send(msg, userName)


# Push today and two more days' weather to your wechat
def push_weather():
    while 1:
        # get temperature information
        temperature = weather.get_temp()
        # get living index information
        life = weather.get_life()
        # send temperature information
        send_msg(temperature)
        time.sleep(1)
        # send living index information
        send_msg(life)
        # the parameter is the time you want it be sent to you tomorrow
        bytime.dosleep('16')
        time.sleep(3600)

# Push your download trends
{'fraction_non_alphanumeric': 0.08700033590863285, 'fraction_numerical': 0.009405441719852201, 'mean_word_length': 3.224113475177305, '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': '4757636', 'n_tokens_mistral': 926, 'n_tokens_neox': 891, 'n_words': 285}