<commit_before>__author__ = 'sohammondal'

import commands
import sys
import os
import urllib
import re

'''
24-08-2014
'''

def exec_cmd(cmd):
    '''
    execute the given command
    :param cmd: the command to be execute
    :return:
    '''
    (status, output) = commands.getstatusoutput(cmd)
    if status:
        print 'Could not execute', cmd, sys.stderr
        return False
    return True

def update_ghost():
    '''
    update ghost
    source: http://goo.gl/bG4oXG
    :return:
    '''
    print 'Stopping ghost'
    exec_cmd('service ghost stop')
    os.chdir('/var/www/')
    try:
        os.remove('ghost-latest.zip')
    except OSError:
        pass
    print 'Downloading the latest ghost'
    exec_cmd('wget '+ ghost_url)
    print 'Download complete, unzipping'
    exec_cmd('unzip -uo ghost*.zip -d ghost')
    exec_cmd('chown -R ghost:ghost ghost/*')
    os.chdir('/var/www/ghost')
    print 'Installing/Upgrading...'
    exec_cmd('npm install')
    print 'Successful, starting ghost'
    exec_cmd('service ghost start')
    print 'Great, ghost started, you are good to go!'
    return

#this is the url for the latest ghost
ghost_url = 'https://ghost.org/zip/ghost-0.5.0.zip'

update_ghost()<commit_msg>update url<commit_after>__author__ = 'sohammondal'

import commands
import sys
import os
import urllib
import re

'''
24-08-2014
'''

def exec_cmd(cmd):
    '''
    execute the given command
    :param cmd: the command to be execute
    :return:
    '''
    (status, output) = commands.getstatusoutput(cmd)
    if status:
        print 'Could not execute', cmd, sys.stderr
        return False
    return True

def update_ghost():
    '''
    update ghost
    source: http://goo.gl/bG4oXG
    :return:
    '''
    print 'Stopping ghost'
    exec_cmd('service ghost stop')
    os.chdir('/var/www/')
    try:
        os.remove('ghost-latest.zip')
    except OSError:
        pass
    print 'Downloading the latest ghost'
    exec_cmd('wget '+ ghost_url)
    print 'Download complete, unzipping'
    exec_cmd('unzip -uo ghost*.zip -d ghost')
    exec_cmd('chown -R ghost:ghost ghost/*')
    os.chdir('/var/www/ghost')
    print 'Installing/Upgrading...'
    exec_cmd('npm install')
    print 'Successful, starting ghost'
    exec_cmd('service ghost start')
    print 'Great, ghost started, you are good to go!'
    return

#this is the url for the latest ghost
ghost_url = 'http://ghost.org/zip/ghost-latest.zip'

update_ghost()
{'fraction_non_alphanumeric': 0.12311455360782715, 'fraction_numerical': 0.008560945780676722, 'mean_word_length': 2.858490566037736, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6460120', 'n_tokens_mistral': 830, 'n_tokens_neox': 815, 'n_words': 228}