<commit_before>from django.core.management.base import BaseCommand

from us_ignite.events.models import Audience


AUDIENCE_LIST = (
    ('Developer', 'developer'),
    ('End-User', 'end-user'),
    ('Community Member', 'community-member'),
    ('Community Leader', 'community-leader'),
    ('Government', 'government'),
)


class Command(BaseCommand):

    def handle(self, *args, **options):
        for name, slug in AUDIENCE_LIST:
            audience, is_new = (Audience.objects
                                .get_or_create(name=name, slug=slug))
            if is_new:
                print u"Imported audience: %s" % audience
        print "Done!"<commit_msg>Load initial ``EventType`` fixtures.<commit_after>from django.core.management.base import BaseCommand

from us_ignite.events.models import Audience, EventType


AUDIENCE_LIST = (
    ('Developer', 'developer'),
    ('End-User', 'end-user'),
    ('Community Member', 'community-member'),
    ('Community Leader', 'community-leader'),
    ('Government', 'government'),
)

TYPE_LIST = (
    ('Workshop', 'workshop'),
    ('Conference', 'conference'),
    ('Meeting', 'meeting'),
    ('Networking', 'networking'),
    ('Challenge', 'challenge'),
    ('Hackaton', 'hackaton'),
    ('Other', 'other'),
)


class Command(BaseCommand):

    def handle(self, *args, **options):
        for name, slug in AUDIENCE_LIST:
            audience, is_new = (Audience.objects
                                .get_or_create(name=name, slug=slug))
            if is_new:
                print u"Imported audience: %s" % audience
        for name, slug in TYPE_LIST:
            event_type, is_new = (EventType.objects
                                  .get_or_create(name=name, slug=slug))
            if is_new:
                print u"Imported event type: %s" % event_type
{'fraction_non_alphanumeric': 0.14097641250685683, 'fraction_numerical': 0.0, 'mean_word_length': 2.611881188118812, '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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4228593', 'n_tokens_mistral': 566, 'n_tokens_neox': 528, 'n_words': 126}