<commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-21 17:35
from __future__ import unicode_literals

import os

from django.db import migrations
from jinjasql import JinjaSql

class Migration(migrations.Migration):

    dependencies = [
        ('timetable', '0010_auto_20190220_1835'),
    ]

    path_to_sql = os.path.join(
        os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
        'sql',
        'generate_student_timetable_template.sql'
    )

    with open(path_to_sql, 'r') as sql_file:
        template = sql_file.read()

    j = JinjaSql()

    query_a, _ = j.prepare_query(template, { "bucket_id": "a" })
    query_b, _ = j.prepare_query(template, { "bucket_id": "b" })

    operations = [
        migrations.RunSQL(
            'DROP FUNCTION IF EXISTS get_student_timetable_a(TEXT, TEXT, TEXT, TEXT);',
            hints={"type": "raw_sql"}
        ),
        migrations.RunSQL(
            'DROP FUNCTION IF EXISTS get_student_timetable_b(TEXT, TEXT, TEXT, TEXT);',
            hints={"type": "raw_sql"}
        ),
        migrations.RunSQL(
            query_a,
            hints={"type": "raw_sql"}
        ),
        migrations.RunSQL(
            query_b,
            hints={"type": "raw_sql"}
        ),
    ]<commit_msg>PEP 8 on Create Personal Timetable Function migration<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-21 17:35
from __future__ import unicode_literals

import os

from django.db import migrations
from jinjasql import JinjaSql

class Migration(migrations.Migration):

    dependencies = [
        ('timetable', '0010_auto_20190220_1835'),
    ]

    path_to_sql = os.path.join(
        os.path.dirname(os.path.dirname(os.path.realpath(__file__))),
        'sql',
        'generate_student_timetable_template.sql'
    )

    with open(path_to_sql, 'r') as sql_file:
        template = sql_file.read()

    j = JinjaSql()

    query_a, _ = j.prepare_query(template, {"bucket_id": "a"})
    query_b, _ = j.prepare_query(template, {"bucket_id": "b"})

    operations = [
        migrations.RunSQL(
            'DROP FUNCTION IF EXISTS get_student_timetable_a(TEXT, TEXT, TEXT, TEXT);',  # noqa
            hints={"type": "raw_sql"}
        ),
        migrations.RunSQL(
            'DROP FUNCTION IF EXISTS get_student_timetable_b(TEXT, TEXT, TEXT, TEXT);',  # noqa
            hints={"type": "raw_sql"}
        ),
        migrations.RunSQL(
            query_a,
            hints={"type": "raw_sql"}
        ),
        migrations.RunSQL(
            query_b,
            hints={"type": "raw_sql"}
        ),
    ]
{'fraction_non_alphanumeric': 0.12871287128712872, 'fraction_numerical': 0.026275704493526276, 'mean_word_length': 2.3940568475452197, 'pattern_counts': {'":': 12, '<': 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': '20341', 'n_tokens_mistral': 936, 'n_tokens_neox': 876, 'n_words': 173}