<commit_before>from django.core.management.base import BaseCommand
from django.db import connection
from django.db import transaction


class Command(BaseCommand):

    def handle(self, *args, **options):
        with transaction.atomic():
            with connection.cursor() as c:
                c.execute('''
                    DO $$
                    DECLARE
                    tname TEXT;
                    keep  TEXT [] = ARRAY [];
                    BEGIN FOR tname IN (SELECT table_name
                                        FROM information_schem.tables
                                        WHERE table_schema = 'public' AND NOT (table_name = ANY (keep))
                                            AND table_name LIKE 'share_%'
                                            AND NOT table_name LIKE 'share_shareuser%'
                                        LOOP
                                        RAISE NOTICE 'DROP TABLE % CASCADE', tname;
                    EXECUTE 'DROP TABLE ' || tname || ' CASCADE';
                    END LOOP;
                    END;
                    $$
                ''')
                c.execute("DELETE FROM django_migrations WHERE app = 'share';")<commit_msg>Correct release2 command<commit_after>from django.core.management.base import BaseCommand
from django.db import connection
from django.db import transaction


class Command(BaseCommand):

    def handle(self, *args, **options):
        with transaction.atomic():
            with connection.cursor() as c:
                c.execute('''
                    DO $$
                    DECLARE
                    tname TEXT;
                    keep  TEXT [] = ARRAY ['share_rawdata', 'share_shareuser', 'share_providerregistration'];
                    BEGIN
                    FOR tname IN (SELECT table_name
                                    FROM information_schema.tables
                                    WHERE table_schema = 'public' AND NOT (table_name = ANY (keep))
                                        AND table_name LIKE 'share_%'
                                        AND NOT table_name LIKE 'share_shareuser%'
                                    )
                    LOOP
                        RAISE NOTICE 'DROP TABLE % CASCADE', tname;
                        EXECUTE 'DROP TABLE ' || tname || ' CASCADE';
                    END LOOP;
                    END;
                    $$;
                ''')
                c.execute("DELETE FROM django_migrations WHERE app = 'share';")
{'fraction_non_alphanumeric': 0.07343071456770628, 'fraction_numerical': 0.00039478878799842083, 'mean_word_length': 1.0702614379084967, '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': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '915174', 'n_tokens_mistral': 565, 'n_tokens_neox': 511, 'n_words': 160}