<commit_before>import logging
import docker
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase


log = logging.getLogger()


class DockerExecutor(DjangoCmdBase):

    def add_arguments(self, parser):
        # Positional arguments
        """
        :param: in the args it could be: /usr/local/bin/python /home/richard/codes/django-dev-server/manage.py help
        NO need to add '"' as "/usr/local/bin/python /home/richard/codes/django-dev-server/manage.py help"
        :return:
        """
        parser.add_argument('container_id', nargs=1)
        parser.add_argument('work_dir', nargs='?', default=None)
        parser.add_argument('path_and_params', nargs='+')

    def msg_loop(self):
        print(self.options["path_and_params"])
        client = docker.from_env()
        container = client.containers.get(self.options["container_id"][0])
        container.exec_run(" ".join(self.options["path_and_params"]), workdir=self.options["work_dir"])


Command = DockerExecutor
<commit_msg>Print execution result for docker.<commit_after>import logging
import docker
from djangoautoconf.cmd_handler_base.msg_process_cmd_base import DjangoCmdBase


log = logging.getLogger()


class DockerExecutor(DjangoCmdBase):

    def add_arguments(self, parser):
        # Positional arguments
        """
        :param: in the args it could be: /usr/local/bin/python /home/richard/codes/django-dev-server/manage.py help
        NO need to add '"' as "/usr/local/bin/python /home/richard/codes/django-dev-server/manage.py help"
        :return:
        """
        parser.add_argument('container_id', nargs=1)
        parser.add_argument('work_dir', nargs='?', default=None)
        parser.add_argument('path_and_params', nargs='+')

    def msg_loop(self):
        print(self.options["path_and_params"])
        client = docker.from_env()
        container = client.containers.get(self.options["container_id"][0])
        print(container.exec_run(" ".join(self.options["path_and_params"]), workdir=self.options["work_dir"]))


Command = DockerExecutor

{'fraction_non_alphanumeric': 0.1295761078998073, 'fraction_numerical': 0.0019267822736030828, 'mean_word_length': 3.6155555555555554, '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': '6810787', 'n_tokens_mistral': 655, 'n_tokens_neox': 629, 'n_words': 114}