<commit_before>from configparser import ConfigParser
from googletrans import Translator
import pyowm
import logging
import re

logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
cfg = ConfigParser()
cfg.read('config')
api_key = cfg.get('auth', 'owm_api_key')

def weather(bot, update):
    owm = pyowm.OWM(api_key, language='zh_tw')
    translator = Translator()
    location = update.message.text
    location = re.sub(u'天氣 ','',location)
    trans = translator.translate(location).text
    logger.info("get weather at %s" %trans)
    try:
        obs = owm.weather_at_place(trans)
        w = obs.get_weather()
        update.message.reply_text(location+'的天氣\n'+'溫度：'+str(w.get_temperature(unit='celsius')['temp'])+
                '   濕度：'+str(w.get_humidity()))
    except:
        update.message.reply_text('Location fucking not found')<commit_msg>Add Info to Weather Check<commit_after>from configparser import ConfigParser
from googletrans import Translator
import pyowm
import logging
import re

logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
cfg = ConfigParser()
cfg.read('config')
api_key = cfg.get('auth', 'owm_api_key')

def weather(bot, update):
    owm = pyowm.OWM(api_key, language='zh_tw')
    translator = Translator()
    location = update.message.text
    location = re.sub(u'天氣 ','',location)
    trans = translator.translate(location).text
    logger.info("get weather at %s" %trans)
    try:
        obs = owm.weather_at_place(trans)
        w = obs.get_weather()
        update.message.reply_text(location+'的天氣\n'+'溫度：'+str(w.get_temperature(unit='celsius')['temp'])+
                '   濕度：'+str(w.get_humidity())+'   天氣狀況：'+str(w.get_status()))
    except:
        update.message.reply_text('Location fucking not found')
{'fraction_non_alphanumeric': 0.14945511157239233, 'fraction_numerical': 0.0, 'mean_word_length': 4.224932249322493, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1729569', 'n_tokens_mistral': 684, 'n_tokens_neox': 661, 'n_words': 122}