<commit_before>import sys, ujson
from flask import Flask, render_template, url_for

app = Flask(__name__)

@app.route('/')
def app_main():
  fin = open('data/generated/cube_map.json', 'r')
  cube_map_raw = fin.readline()
  fin.close()

  return render_template('app.html',
      # Let's do this the ghetto way to save a json encode/decode
      JS_VARS_FROM_SERVER_JSON=('{cube_map:%s}' % cube_map_raw))

@app.template_filter('url_for_asset')
def url_for_asset_filter(filename):
  return url_for('static', filename=('assets/%s' % filename))

if __name__ == '__main__':
  # Check if we should run in production
  if len(sys.argv) >= 3 and sys.argv[2] == 'prod':
    # Production
    app.port = 7702
  else:
    # Development
    app.debug = True

  app.run()<commit_msg>Fixing app to run on prod<commit_after>import sys, ujson
from flask import Flask, render_template, url_for

app = Flask(__name__)

@app.route('/')
def app_main():
  fin = open('data/generated/cube_map.json', 'r')
  cube_map_raw = fin.readline()
  fin.close()

  return render_template('app.html',
      # Let's do this the ghetto way to save a json encode/decode
      JS_VARS_FROM_SERVER_JSON=('{cube_map:%s}' % cube_map_raw))

@app.template_filter('url_for_asset')
def url_for_asset_filter(filename):
  return url_for('static', filename=('assets/%s' % filename))

if __name__ == '__main__':
  # Check if we should run in production
  if len(sys.argv) >= 2 and sys.argv[1] == 'prod':
    # Production
    port = 7702
  else:
    # Development
    app.debug = True
    port = 5000

  app.run(port=port)
{'fraction_non_alphanumeric': 0.13685550604710375, 'fraction_numerical': 0.010184595798854232, 'mean_word_length': 4.137254901960785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2899892', 'n_tokens_mistral': 580, 'n_tokens_neox': 555, 'n_words': 138}