<commit_before># Copyright 2014 Cloudbase Solutions Srl
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import argparse
import base64
import importlib
import itertools
import logging
import pkgutil
import random
import socket
import struct
import subprocess
import sys
import time

import six

from argus import config
from argus import exceptions
from argus import remote_client


RETRY_COUNT = 15
RETRY_DELAY = 10

__all__ = (
    'ConfigurationPatcher',
    'WinRemoteClient',
    'decrypt_password',
    'get_config',
    'get_logger',
    'get_resource',
    'cached_property',
    'load_qualified_object',
    'parse_cli',
    'run_once',
    'rand_name',
    'with_retry',
)

DEFAULT_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
DEFAULT_LOG_FILE = 'argus.log'


class WinRemoteClient(remote_client.WinRemoteClient):

    def run_command(self, cmd):
        """Run the given command and return execution details.

        :rtype: tuple
        :returns: stdout, stderr, exit_code
        """

        LOG.info("Running command %s...", cmd)
        return self.run_remote_cmd(cmd)

    def run_command_verbose(self, cmd):
        """Run the given command and log anything it returns.

        :rtype: string
        :returns: stdout
        """
        stdout, stderr, exit_code = self.run_command(cmd)<commit_msg>Execute with retry all of the commands.<commit_after># Copyright 2014 Cloudbase Solutions Srl
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import argparse
import base64
import importlib
import itertools
import logging
import pkgutil
import random
import socket
import struct
import subprocess
import sys
import time

import six

from argus import config
from argus import exceptions
from argus import remote_client


RETRY_COUNT = 15
RETRY_DELAY = 10

__all__ = (
    'ConfigurationPatcher',
    'WinRemoteClient',
    'decrypt_password',
    'get_config',
    'get_logger',
    'get_resource',
    'cached_property',
    'load_qualified_object',
    'parse_cli',
    'run_once',
    'rand_name',
    'with_retry',
)

DEFAULT_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
DEFAULT_LOG_FILE = 'argus.log'


class WinRemoteClient(remote_client.WinRemoteClient):

    def run_command(self, cmd):
        """Run the given command and return execution details.

        :rtype: tuple
        :returns: stdout, stderr, exit_code
        """

        LOG.info("Running command %s...", cmd)
        return self.run_remote_cmd(cmd)

    def run_command_verbose(self, cmd):
        """Run the given command and log anything it returns.

        Do this with retrying support.

        :rtype: string
        :returns: stdout
        """
        stdout, stderr, exit_code = self.run_command_with_retry(cmd)
{'fraction_non_alphanumeric': 0.08357124318712691, 'fraction_numerical': 0.007267064624967558, 'mean_word_length': 3.3157894736842106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5672719', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1105, 'n_words': 398}