<commit_before>#!/usr/bin/python

import yaml
config = yaml.safe_load(open("config.yml"))

twilio_account_sid = config["twilio"]["account_sid"]
twilio_auth_token = config["twilio"]["auth_token"]

from twilio.rest import TwilioRestClient
twilio_client = TwilioRestClient(twilio_account_sid, twilio_auth_token)

from contacts import Contacts, Contact
c = Contacts()

def name_or_number(number):
	contact = c.find_contact_by_number(number)
	if contact:
		return contact.name
	else:
		return number

messages = twilio_client.messages.list()
for message in twilio_client.messages.list():
	print("From: " + name_or_number(message.from_.encode("utf-8")))
	print("To: " + name_or_number(message.to.encode("utf-8")))
	print("Body: " + message.body.encode("utf-8"))
	print
<commit_msg>print latest texts first<commit_after>#!/usr/bin/python

import yaml
config = yaml.safe_load(open("config.yml"))

twilio_account_sid = config["twilio"]["account_sid"]
twilio_auth_token = config["twilio"]["auth_token"]

from twilio.rest import TwilioRestClient
twilio_client = TwilioRestClient(twilio_account_sid, twilio_auth_token)

from contacts import Contacts, Contact
c = Contacts()

def name_or_number(number):
	contact = c.find_contact_by_number(number)
	if contact:
		return contact.name
	else:
		return number

messages = twilio_client.messages.list()
for message in reversed(twilio_client.messages.list()):
	print("From: " + name_or_number(message.from_.encode("utf-8")))
	print("To: " + name_or_number(message.to.encode("utf-8")))
	print("Body: " + message.body.encode("utf-8"))
	print

{'fraction_non_alphanumeric': 0.13749204328453216, 'fraction_numerical': 0.0038192234245703373, 'mean_word_length': 6.86, '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': '4695275', 'n_tokens_mistral': 550, 'n_tokens_neox': 544, 'n_words': 97}