<commit_before>from twilio.rest import TwilioRestClient
from twilio.rest.resources import Connection
import json
from data import module_locator

json_path = module_locator.modeule_path()

# with open("./"+json_path+"/"+'config.json','r') as f:
with open(json_path+"/"+'config.json','r') as f:
    conf = json.load(f)

    #Speical thanks to  https://github.com/OrkoHunter/ping-me/blob/master/ping_me/authenticate.py#L102

from twilio.rest.resources.connection  import PROXY_TYPE_SOCKS5, PROXY_TYPE_HTTP
import sys



# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = conf['auth']['AuthSid']
auth_token  = conf['auth']['AuthToken']

#-----------------------------------------------------------------------------------------
# Proxy settings, like you want, use PROXY_TYPE_SOCKS5 for socks proxy
if (conf['proxy']['ProxyType'] == "HTTP"):
    Connection.set_proxy_info(
        str(conf['proxy']['Proxy']),
        conf['proxy']['Port'],
        proxy_type=PROXY_TYPE_HTTP,
        )

else:
    Connection.set_proxy_info(
        str(conf['proxy']['Proxy']),  #proxy server
        conf['proxy']['Port'],               #port
        proxy_type=PROXY_TYPE_SOCKS5)
#-----------------------------------------------------------------------------------------

client = TwilioRestClient(account_sid, auth_token)

def print_error():
    print("Usage : sms [name] ['message']")
    print("Define `name` in `config.json`. ")

def send_message(num,text=conf['user']['default_message']):
    message = client.messages.create(body=text,
        to=num,
        from_= conf['personal']['your_twilio_number']    )
    print ("[{}] -> {} to {}".format(message.sid,message.body,num))



def  main():
    """
    usage : sms me "forget to eat!"
    ErrorCase: sms me forget to eat!
    the message is only 'forget', rest of the string is ignored. So, please use double quotes
    """
    command = sys.argv[1:]
    if not command:
        print_error()
        sys.exit(2)
    print (command[0])<commit_msg>Remove bug for NO Proxy Setting. - Works without proxy too.<commit_after>from twilio.rest import TwilioRestClient
from twilio.rest.resources import Connection
import json
from data import module_locator

json_path = module_locator.modeule_path()

# with open("./"+json_path+"/"+'config.json','r') as f:
with open(json_path+"/"+'config.json','r') as f:
    conf = json.load(f)

    #Speical thanks to  https://github.com/OrkoHunter/ping-me/blob/master/ping_me/authenticate.py#L102

from twilio.rest.resources.connection  import PROXY_TYPE_SOCKS5, PROXY_TYPE_HTTP
import sys



# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = conf['auth']['AuthSid']
auth_token  = conf['auth']['AuthToken']

#-----------------------------------------------------------------------------------------
# Proxy settings, like you want, use PROXY_TYPE_SOCKS5 for socks proxy
if (conf['proxy']['use_proxy']==1):
    if (conf['proxy']['ProxyType'] == "HTTP"):
        Connection.set_proxy_info(
            str(conf['proxy']['Proxy']),
            conf['proxy']['Port'],
            proxy_type=PROXY_TYPE_HTTP,
            )

    else:
        Connection.set_proxy_info(
            str(conf['proxy']['Proxy']),  #proxy server
            conf['proxy']['Port'],               #port
            proxy_type=PROXY_TYPE_SOCKS5)
else:
    pass
#-----------------------------------------------------------------------------------------

client = TwilioRestClient(account_sid, auth_token)

def print_error():
    print("Usage : sms [name] ['message']")
    print("Define `name` in `config.json`. ")

def send_message(num,text=conf['user']['default_message']):
    message = client.messages.create(body=text,
        to=num,
        from_= conf['personal']['your_twilio_number']    )
    print ("[{}] -> {} to {}".format(message.sid,message.body,num))



def  main():
    """
    usage : sms me "forget to eat!"
    ErrorCase: sms me forget to eat!
    the message is only 'forget', rest of the string is ignored. So, please use double quotes
    """
    command = sys.argv[1:]
    if not command:
        print_error()
        sys.exit(2)
    print (command[0])
{'fraction_non_alphanumeric': 0.22118380062305296, 'fraction_numerical': 0.00455307931943446, 'mean_word_length': 2.4841402337228713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3455022', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1241, 'n_words': 284}