<commit_before>import datetime
import dateutil.parser
import dateutil.tz
import getpass
import markdown as Markdown
import os
import re
import requests

from clint.textui import colored, puts
from flask import Blueprint
from jinja2 import evalcontextfilter, Markup
from tarbell.hooks import register_hook
from time import time

NAME = "Basic Bootstrap 3 template"

blueprint = Blueprint('base', __name__)

@register_hook('newproject')
def create_repo(site, git):
    print site
    print git
    print "hi"
    # @TODO
    create = raw_input("Want to create a Github repo for this project [Y/n]? ")
    if create and not create.lower() == "y":
        return puts("Not creating Github repo...")

    # Set up remote url
    user = raw_input("What is your Github username? ")
    password = <PASSWORD>()
    #raw_input("What is your Github password? ")
    #resp = requests.get('https://api.github.com/user', auth=(user, password)) 
    resp = requests.post('https://api.github.com/user/repos', auth=(user, password), data={
        'name': site.project.NAME,
        'has_issues': True,
        'has_wiki': True,
    })
    import ipdb; ipdb.set_trace();
    print "exit"
    #remote_url = raw_input("\nWhat is the URL of your project repository? (e.g. git@github.com:myaccount/myproject.git, leave blank to skip) ")
    #if remote_url:
        #puts("\nCreating new remote 'origin' to track {0}.".format(colored.yellow(remote_url)))
        #git.remote.add(*["origin", remote_url])
        #puts("\n{0}: Don't forget! It's up to you to create this remote and push to it.".format(colored.cyan("Warning")))
    #else:

    #puts("\n- Not setting up remote repository. Use your own version control!")
<commit_msg>use json in github api call<commit_after>import datetime
import dateutil.parser
import dateutil.tz
import getpass
import json
import markdown as Markdown
import os
import re
import requests

from clint.textui import colored, puts
from flask import Blueprint
from jinja2 import evalcontextfilter, Markup
from tarbell.hooks import register_hook
from time import time

NAME = "Basic Bootstrap 3 template"

blueprint = Blueprint('base', __name__)

@register_hook('newproject')
def create_repo(site, git):
    print site
    print git
    print "hi"
    # @TODO
    create = raw_input("Want to create a Github repo for this project [Y/n]? ")
    if create and not create.lower() == "y":
        return puts("Not creating Github repo...")

    # Set up remote url
    user = raw_input("What is your Github username? ")
    password = <PASSWORD>()
    #raw_input("What is your Github password? ")
    #resp = requests.get('https://api.github.com/user', auth=(user, password)) 
    headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
    data = json.dumps({
        'name': site.project.NAME,
        'has_issues': 1,
        'has_wiki': 1,
    })
    resp = requests.post('https://api.github.com/user/repos', auth=(user, password), headers=headers, data=data)
    import ipdb; ipdb.set_trace();
    print "exit"
    #remote_url = raw_input("\nWhat is the URL of your project repository? (e.g. git@github.com:myaccount/myproject.git, leave blank to skip) ")
    #if remote_url:
        #puts("\nCreating new remote 'origin' to track {0}.".format(colored.yellow(remote_url)))
        #git.remote.add(*["origin", remote_url])
        #puts("\n{0}: Don't forget! It's up to you to create this remote and push to it.".format(colored.cyan("Warning")))
    #else:

    #puts("\n- Not setting up remote repository. Use your own version control!")

{'fraction_non_alphanumeric': 0.126614261650758, 'fraction_numerical': 0.002807411566535654, 'mean_word_length': 3.6272727272727274, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '427088', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1081, 'n_words': 357}