<commit_before>#!/usr/bin/env python
import os, sys, random
from apps.citizens.models import Person, Country

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)


def generate_citizens():
    # create some countries and save the nodes to countries[]
    country_codes = ['USA', 'DE', 'EU', 'CN', 'MX']

    i = 0
    for c in range(len(country_codes)):
        Country(code=country_codes[i]).save()

        i += 1

    country_category = Country.category()
    countries = country_category.instance.all()

    # create some UNIQUE named people and assign them random countries
    people = ['Joe', 'Bob', 'Daren', 'Jennifer', 'Tasha', 'Natalie', 'Rick']

    i = 0
    for p in range(len(people)):
        person = Person(name=people[i], age=random.randint(18, 70)).save()

        country = random.choice(countries)

        person.country.connect(country)
        person.save()

        i += 1


def delete_people_and_countries():
    # person
    person_category = Person.category()
    for p in person_category.instance.all():
        p.delete()
        
    #country
    country_category = Country.category()
    for c in country_category.instance.all():
        c.delete()<commit_msg>fixes management commands<commit_after>#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)
{'fraction_non_alphanumeric': 0.1198044009779951, 'fraction_numerical': 0.004889975550122249, 'mean_word_length': 3.522099447513812, 'pattern_counts': {'":': 2, '<': 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': '1809551', 'n_tokens_mistral': 520, 'n_tokens_neox': 495, 'n_words': 120}