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

import getopt
import os
import sys


DEFAULT_PORT = "8080"


def usage():
    print "usage:  %s options" % sys.argv[0]
    print
    print "OPTIONS:"
    print "   -h           Show this message"
    print "   -p PORT      Set server port (defaults to %s)" % DEFAULT_PORT


def main():
    # Assign default settings
    server_port = DEFAULT_PORT

    # Do any command-line argument processing
    (opts, args) = getopt.getopt(sys.argv[1:], 'hp:')

    for opt, arg in opts:
        if opt == '-h':
            usage()
            sys.exit(1)
        elif opt == '-p':
            server_port = arg
        else:
            usage()
            sys.exit(1)

    # Ensure we're at the top-level Review Board directory
    if not os.path.exists(os.path.join('reviewboard', 'manage.py')):
        sys.stderr.write('This must be run from the top-level Review Board'
                         ' directory\n')
        sys.exit(1)

    # Next, ensure settings_local.py exists where we expect it
    if not os.path.exists('settings_local.py'):
        sys.stderr.write('You must create a settings_local.py in the '
                         'top-level source \n'
                         'directory. You can use '
                         'contrib/conf/settings_local.py.tmpl\n'
                         'as a basis.\n')
        sys.exit(1)

    # Next, make sure we're in the Djblets media path
    if not os.path.exists(os.path.join('reviewboard', 'htdocs',
                                       'media', 'djblets')):
	sys.stderr.write('You must set up the Djblets media path. Create '
	                 'a symlink pointing\n'
	                 'to a development djblets/media directory and name '
	                 'it\n'
	                 'reviewboard/htdocs/media/djblets\n'
	                 '\n'
	                 'For example:\n'
	                 '$ ln -s /path/to/djblets/djblets/media '
	                 'reviewboard/htdocs/media/djblets\n')
        sys.exit(1)

    # Build ReviewBoard.egg-info if it doesn't already exist
    if not os.path.exists('ReviewBoard.egg-info'):
        os.system("python ./setup.py egg_info")

    # And now just boot up the server
    os.system('python ./reviewboard/manage.py runserver 0.0.0.0:%s'
              % server_port)

if __name__ == "__main__":
    main()
<commit_msg>Use the same interpreter when running devserver<commit_after>#!/usr/bin/env python

import getopt
import os
import sys


DEFAULT_PORT = "8080"


def usage():
    print "usage:  %s options" % sys.argv[0]
    print
    print "OPTIONS:"
    print "   -h           Show this message"
    print "   -p PORT      Set server port (defaults to %s)" % DEFAULT_PORT


def main():
    # Assign default settings
    server_port = DEFAULT_PORT

    # Do any command-line argument processing
    (opts, args) = getopt.getopt(sys.argv[1:], 'hp:')

    for opt, arg in opts:
        if opt == '-h':
            usage()
            sys.exit(1)
        elif opt == '-p':
            server_port = arg
        else:
            usage()
            sys.exit(1)

    # Ensure we're at the top-level Review Board directory
    if not os.path.exists(os.path.join('reviewboard', 'manage.py')):
        sys.stderr.write('This must be run from the top-level Review Board'
                         ' directory\n')
        sys.exit(1)

    # Next, ensure settings_local.py exists where we expect it
    if not os.path.exists('settings_local.py'):
        sys.stderr.write('You must create a settings_local.py in the '
                         'top-level source \n'
                         'directory. You can use '
                         'contrib/conf/settings_local.py.tmpl\n'
                         'as a basis.\n')
        sys.exit(1)

    # Next, make sure we're in the Djblets media path
    if not os.path.exists(os.path.join('reviewboard', 'htdocs',
                                       'media', 'djblets')):
	sys.stderr.write('You must set up the Djblets media path. Create '
	                 'a symlink pointing\n'
	                 'to a development djblets/media directory and name '
	                 'it\n'
	                 'reviewboard/htdocs/media/djblets\n'
	                 '\n'
	                 'For example:\n'
	                 '$ ln -s /path/to/djblets/djblets/media '
	                 'reviewboard/htdocs/media/djblets\n')
        sys.exit(1)

    # Build ReviewBoard.egg-info if it doesn't already exist
    if not os.path.exists('ReviewBoard.egg-info'):
        os.system("python ./setup.py egg_info")

    # And now just boot up the server
    os.system(sys.executable + ' ./reviewboard/manage.py runserver 0.0.0.0:%s'
              % server_port)

if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.11291341900147461, 'fraction_numerical': 0.006319780914261639, 'mean_word_length': 1.6764374295377678, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '493182', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1392, 'n_words': 396}