<commit_before>from abstract_action import AbstractAction
from jarvis.api.weather import Weather
from jarvis.helpers.weather_helper import k2f
from jarvis import logger


class WeatherData(AbstractAction):
	
	def __init__(self, params, user, with_voice=False):
		AbstractAction.__init__(self, params, user, with_voice=with_voice)
		self.api = Weather(self.user)
		print "INITIALIZING SHIT"
	
	def search(self):
		print "SEARCHING WITH PARAMS: {}".format(self.params)
		if self.params.get('current_time') == 'true':
			return self.current()
		else:
			return None
				
	def current(self):
		current_loc = 'Palo Alto,us'
		
		try:
			weather = self.api.weather_at_place(current_loc).get_weather()
			if not weather: return None
			
			temp = weather.get_temperature()
			if not temp: return None
			
			temp = k2f(temp['temp'])
			return self.respond("It's currently {} degrees outside.".format(temp))
		except Exception as e:
			logger.error('Error trying to get current weather data for {}, with error: {}'.format(current_loc, e.message))
		
		return None<commit_msg>removing absurd logs<commit_after>from abstract_action import AbstractAction
from jarvis.api.weather import Weather
from jarvis.helpers.weather_helper import k2f
from jarvis import logger


class WeatherData(AbstractAction):
	
	def __init__(self, params, user, with_voice=False):
		AbstractAction.__init__(self, params, user, with_voice=with_voice)
		self.api = Weather(self.user)
	
	def search(self):
		if self.params.get('current_time') == 'true':
			return self.current()
		else:
			return None
				
	def current(self):
		current_loc = 'Palo Alto,us'
		
		try:
			weather = self.api.weather_at_place(current_loc).get_weather()
			if not weather: return None
			
			temp = weather.get_temperature()
			if not temp: return None
			
			temp = k2f(temp['temp'])
			return self.respond("It's currently {} degrees outside.".format(temp))
		except Exception as e:
			logger.error('Error trying to get current weather data for {}, with error: {}'.format(current_loc, e.message))
		
		return None
{'fraction_non_alphanumeric': 0.10743801652892562, 'fraction_numerical': 0.0019445794846864365, 'mean_word_length': 4.4015748031496065, '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': '2621541', 'n_tokens_mistral': 735, 'n_tokens_neox': 617, 'n_words': 177}