<commit_before># noqa
from dodo_commands.system_commands import DodoCommand
import os
import sys


class Command(DodoCommand):  # noqa
    help = ""
    decorators = []

    def handle_imp(self, **kwargs):  # noqa
        pip = os.path.join(os.path.dirname(sys.executable), "pip")
        self.runcmd([pip, "install", "--upgrade", "dodo_commands"])<commit_msg>Prevent running dodo upgrade with activated dodo project<commit_after># noqa
from dodo_commands.system_commands import DodoCommand, CommandError
import os
import sys


class Command(DodoCommand):  # noqa
    help = ""
    decorators = []

    def handle_imp(self, **kwargs):  # noqa
        import dodo_commands
        dodo_commands_path = dodo_commands.__path__[0]
        if os.path.realpath(dodo_commands_path) != dodo_commands_path:
            raise CommandError("Please deactivate your dodo project first.")
        pip = os.path.join(os.path.dirname(sys.executable), "pip")
        self.runcmd([pip, "install", "--upgrade", "dodo_commands"])
{'fraction_non_alphanumeric': 0.11793855302279485, 'fraction_numerical': 0.0009910802775024777, 'mean_word_length': 3.7417840375586855, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1546739', 'n_tokens_mistral': 322, 'n_tokens_neox': 311, 'n_words': 73}