<commit_before>from __future__ import print_function
import os
import pip
from six.moves import input #pylint: disable=redefined-builtin

from azure.cli.parser import IncorrectUsageError
from azure.cli.commands import CommandTable, COMMON_PARAMETERS
from azure.cli._locale import L
from azure.cli._logging import logger

from azure.cli.utils.update_checker import check_for_component_update, UpdateCheckError

CLI_PACKAGE_NAME = 'azure-cli'
COMPONENT_PREFIX = 'azure-cli-'

PRIVATE_PYPI_URL = os.environ.get('AZURE_CLI_PRIVATE_PYPI_URL')
PRIVATE_PYPI_HOST = os.environ.get('AZURE_CLI_PRIVATE_PYPI_HOST')

command_table = CommandTable()

@command_table.command('component list')
@command_table.description(L('List the installed components.'))
def list_components(args): #pylint: disable=unused-argument
    components = sorted(["%s (%s)" % (dist.key.replace(COMPONENT_PREFIX, ''), dist.version)
                         for dist in pip.get_installed_distributions(local_only=True)
                         if dist.key.startswith(COMPONENT_PREFIX)])
    print('\n'.join(components))

def _install_or_update(component_name, version, link, private, upgrade=False):
    if not component_name:
        raise IncorrectUsageError(L('Specify a component name.'))
    found = bool([dist for dist in pip.get_installed_distributions(local_only=True)
                  if dist.key == COMPONENT_PREFIX+component_name])
    if found and not upgrade:
        raise RuntimeError("Component already installed.")
    else:
        version_no = '==' + version if version else ''
        options = ['--quiet', '--isolated', '--disable-pip-version-check']
        if upgrade:
            options.append('--upgrade')<commit_msg>Remove unused ref to logger<commit_after>from __future__ import print_function
import os
import pip
from six.moves import input #pylint: disable=redefined-builtin

from azure.cli.parser import IncorrectUsageError
from azure.cli.commands import CommandTable, COMMON_PARAMETERS
from azure.cli._locale import L

from azure.cli.utils.update_checker import check_for_component_update, UpdateCheckError

CLI_PACKAGE_NAME = 'azure-cli'
COMPONENT_PREFIX = 'azure-cli-'

PRIVATE_PYPI_URL = os.environ.get('AZURE_CLI_PRIVATE_PYPI_URL')
PRIVATE_PYPI_HOST = os.environ.get('AZURE_CLI_PRIVATE_PYPI_HOST')

command_table = CommandTable()

@command_table.command('component list')
@command_table.description(L('List the installed components.'))
def list_components(args): #pylint: disable=unused-argument
    components = sorted(["%s (%s)" % (dist.key.replace(COMPONENT_PREFIX, ''), dist.version)
                         for dist in pip.get_installed_distributions(local_only=True)
                         if dist.key.startswith(COMPONENT_PREFIX)])
    print('\n'.join(components))

def _install_or_update(component_name, version, link, private, upgrade=False):
    if not component_name:
        raise IncorrectUsageError(L('Specify a component name.'))
    found = bool([dist for dist in pip.get_installed_distributions(local_only=True)
                  if dist.key == COMPONENT_PREFIX+component_name])
    if found and not upgrade:
        raise RuntimeError("Component already installed.")
    else:
        version_no = '==' + version if version else ''
        options = ['--quiet', '--isolated', '--disable-pip-version-check']
        if upgrade:
            options.append('--upgrade')
{'fraction_non_alphanumeric': 0.10572947430596574, 'fraction_numerical': 0.0, 'mean_word_length': 4.202764976958525, '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': '423906', 'n_tokens_mistral': 1023, 'n_tokens_neox': 1016, 'n_words': 225}