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

import subprocess

from pytz import common_timezones

from flask import Flask, render_template, request

# Configuration
DEBUG = True

PANDA_PATH = '/opt/panda'
LOCAL_SETTINGS_PATH = '%s/local_settings.py' % PANDA_PATH

# Setup
app = Flask(__name__)
app.debug = DEBUG

@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'POST':
        timezone = request.form['timezone']

        with open(LOCAL_SETTINGS_PATH, 'w') as f:
            f.write("TIME_ZONE = '%s'\n" % timezone)

        app.logger.debug('before popen')
        subprocess.Popen(['bash', 'swap.sh'])
        app.logger.debug('after popen')

        return 'Reload me!'
    else:
        context = {
            'timezones': common_timezones
        }
<commit_msg>Testing.<commit_after>#!/usr/bin/env python

import subprocess

from pytz import common_timezones

from flask import Flask, render_template, request

# Configuration
DEBUG = True

PANDA_PATH = '/opt/panda'
LOCAL_SETTINGS_PATH = '%s/local_settings.py' % PANDA_PATH

# Setup
app = Flask(__name__)
app.debug = DEBUG

@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'POST':
        timezone = request.form['timezone']

        with open(LOCAL_SETTINGS_PATH, 'w') as f:
            f.write("TIME_ZONE = '%s'\n" % timezone)

        app.logger.debug('before popen')
        subprocess.Popen(['bash', 'swap.sh'], shell=True, stderr=subprocess.STDOUT)
        app.logger.debug('after popen')

        return 'Reload me!'
    else:
        context = {
            'timezones': common_timezones
        }

{'fraction_non_alphanumeric': 0.14082767140210006, 'fraction_numerical': 0.0, 'mean_word_length': 3.0198511166253104, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1325504', 'n_tokens_mistral': 549, 'n_tokens_neox': 537, 'n_words': 118}