<commit_before>from flask import Flask, render_template, request, redirect, url_for
from opentok import OpenTok
from email.utils import formatdate
import os, time

try:
    api_key = os.environ['API_KEY']
    api_secret = os.environ['API_SECRET']
except Exception:
    raise Exception('You must define API_KEY and API_SECRET environment variables')

app = Flask(__name__)
opentok = OpenTok(api_key, api_secret)
session = opentok.create_session()

@app.template_filter('datefmt')
def datefmt(dt):
    return formatdate(time.mktime(dt.timetuple()))

@app.route("/")
def index():
    return render_template('index.html')

@app.route("/host")
def host():
    key = api_key
    session_id = session.session_id
    token = opentok.generate_token(session_id)
    return render_template('host.html', api_key=key, session_id=session_id, token=token)

@app.route("/participant")<commit_msg>adjusts archiving sample for mediaMode change<commit_after>from flask import Flask, render_template, request, redirect, url_for
from opentok import OpenTok, MediaModes
from email.utils import formatdate
import os, time

try:
    api_key = os.environ['API_KEY']
    api_secret = os.environ['API_SECRET']
except Exception:
    raise Exception('You must define API_KEY and API_SECRET environment variables')

app = Flask(__name__)
opentok = OpenTok(api_key, api_secret)
session = opentok.create_session(media_mode=MediaModes.routed)

@app.template_filter('datefmt')
def datefmt(dt):
    return formatdate(time.mktime(dt.timetuple()))

@app.route("/")
def index():
    return render_template('index.html')

@app.route("/host")
def host():
    key = api_key
    session_id = session.session_id
    token = opentok.generate_token(session_id)
    return render_template('host.html', api_key=key, session_id=session_id, token=token)

@app.route("/participant")
{'fraction_non_alphanumeric': 0.11626637554585152, 'fraction_numerical': 0.0, 'mean_word_length': 5.689781021897811, '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': '750662', 'n_tokens_mistral': 599, 'n_tokens_neox': 597, 'n_words': 139}