<commit_before>import os

from django.core.management.base import BaseCommand

class Command(BaseCommand):
    help = "Executes a Python file."
    args = "script"

    def handle(self, *scripts, **options):
        if len(scripts) != 1:
            print self.style.ERROR("Script file name required")
            return

        script = scripts[0]
        if not os.path.isfile(script):
            print self.style.ERROR("Invalid file name: %s" % script)
            return

        execfile(
            script, {
                "__builtins__": __builtins__,
                "__name__": "__main__",
                "__doc__": None,
                "__package__": None,
            })<commit_msg>Allowing execfile to accept arguments.<commit_after>import sys
import os

from django.core.management.base import BaseCommand

class Command(BaseCommand):
    help = "Executes a Python file."
    args = "script"

    def handle(self, *args, **options):
        if len(args) < 1:
            print self.style.ERROR("Script file name required")
            return

        script = args[0]
        if not os.path.isfile(script):
            print self.style.ERROR("Invalid file name: %s" % script)
            return

        sys.argv = args
        execfile(
            script, {
                "__builtins__": __builtins__,
                "__name__": "__main__",
                "__doc__": None,
                "__package__": None,
            })
{'fraction_non_alphanumeric': 0.10482758620689656, 'fraction_numerical': 0.002758620689655172, 'mean_word_length': 1.7796934865900382, 'pattern_counts': {'":': 8, '<': 4, '<?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': '5990033', 'n_tokens_mistral': 397, 'n_tokens_neox': 390, 'n_words': 108}