<commit_before>import re 
import csv
import sys

import os

from optparse import make_option

from django.core.management.base import BaseCommand, CommandError
from odekro import data


class Command(BaseCommand):
    """Read in an info page file and either create or update existing info"""

    help = 'Add MPs data'
    args = '<file>'

    def handle(self, *args, **options):
        # file = open(args[])
        if len(args) != 1:
            raise CommandError
        
        path = args[0]
        content = open(path, 'r').read()
        data.add_mps_from_json(content)<commit_msg>Code cleanup<commit_after>from django.core.management.base import BaseCommand, CommandError

from odekro import data


class Command(BaseCommand):
    """Read in mps data and either create or update existing info"""

    help = 'Add MPs data'
    args = '<file>'

    def handle(self, *args, **options):
        # file = open(args[])
        if len(args) != 1:
            raise CommandError
        
        path = args[0]
        content = open(path, 'r').read()
        data.add_mps_from_json(content)
{'fraction_non_alphanumeric': 0.10583941605839416, 'fraction_numerical': 0.0036496350364963502, 'mean_word_length': 2.7186440677966104, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5518106', 'n_tokens_mistral': 329, 'n_tokens_neox': 316, 'n_words': 104}