<commit_before>#!/usr/bin/env python

import time
import ConfigParser
from random import random, randint, seed
from twilio.rest import TwilioRestClient

def random_line(file):
	'''Selects a random line from a file.'''
	# sort of oblique but works without reading whole files into memory 
	# yoinked from @smammy's fix to my computers-will-never script

        seed()
        selected = next(file)
        for n, line in enumerate(file, start=1):
            if random() * n < 1:
                selected = line
        return selected.rstrip()

def send(number, sender, sid, token):
        '''Sends an SMS to a number.'''

        ACCOUNT_SID = sid
        AUTH_TOKEN = token

        client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)

        strategy=random_line(open('obliques.txt','r'))

	# twilio is a tad weird and this actually sends the message instead of just creating the object
        msg = client.messages.create(
            to=number,
            from=sender,
            body=strategy,
            )

        print msg.sid

if __name__=='__main__':
	time.sleep(randint(36000,72000)) # sleep until somewhere between 10:00 and 20:00
	# remove or modify the line above for your own purposes
	
	config = ConfigParser.RawConfigParser()
	config.read('obliques.conf') # i know this should be in a conf/ dir but i'm lazy and this is quick and dirty

	recipient = config.get('numbers', recipient)
	sender = config.get('numbers', sender)
	sid = config.get('auth', sid)
	token = config.get('auth', token)

	send(recipient, sender, sid, token)
<commit_msg>unfucking syntax errors<commit_after>#!/usr/bin/env python

import time
import ConfigParser
from random import random, randint, seed
from twilio.rest import TwilioRestClient

def random_line(file):
	'''Selects a random line from a file.'''
	# sort of oblique but works without reading whole files into memory 
	# yoinked from @smammy's fix to my computers-will-never script

        seed()
        selected = next(file)
        for n, line in enumerate(file, start=1):
            if random() * n < 1:
                selected = line
        return selected.rstrip()

def send(number, sender, sid, token):
        '''Sends an SMS to a number.'''

        ACCOUNT_SID = sid
        AUTH_TOKEN = token

        client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)

        strategy=random_line(open('obliques.txt','r'))

	# twilio is a tad weird and this actually sends the message instead of just creating the object
        msg = client.messages.create(
            to=number,
            from_=sender,
            body=strategy,
            )

        print msg.sid

if __name__=='__main__':
	time.sleep(randint(36000,72000)) # sleep until somewhere between 10:00 and 20:00
	# remove or modify the line above for your own purposes
	
	config = ConfigParser.RawConfigParser()
	config.read('obliques.conf') # i know this should be in a conf/ dir but i'm lazy and this is quick and dirty

	recipient = config.get('numbers', 'recipient')
	sender = config.get('numbers', 'sender')
	sid = config.get('auth', 'sid')
	token = config.get('auth', 'token')

	send(recipient, sender, sid, token)

{'fraction_non_alphanumeric': 0.0985691573926868, 'fraction_numerical': 0.012718600953895072, 'mean_word_length': 2.9672131147540983, 'pattern_counts': {'":': 0, '<': 5, '<?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': '444931', 'n_tokens_mistral': 981, 'n_tokens_neox': 906, 'n_words': 324}