<commit_before>import logging
import os

from cloudbridge.cloud.base import BaseCloudProvider
from cloudbridge.cloud.providers.azure.azure_client import AzureClient
from cloudbridge.cloud.providers.azure.services \
    import AzureBlockStoreService, AzureComputeService, \
    AzureNetworkingService, AzureObjectStoreService, AzureSecurityService

from msrestazure.azure_exceptions import CloudError

log = logging.getLogger(__name__)


class AzureCloudProvider(BaseCloudProvider):
    PROVIDER_ID = 'azure'

    def __init__(self, config):
        super(AzureCloudProvider, self).__init__(config)

        # mandatory config values
        self.subscription_id = self. \
            _get_config_value('azure_subscription_id',
                              os.environ.get('AZURE_SUBSCRIPTION_ID', None))
        self.client_Id = self._get_config_value(
            'azure_client_id', os.environ.get('AZURE_CLIENT_ID', None))
        self.secret = self._get_config_value(
            'azure_secret', os.environ.get('AZURE_SECRET', None))
        self.tenant = self._get_config_value(
            'azure_tenant', os.environ.get('AZURE_TENANT', None))

        # optional config values
        self.region_name = self._get_config_value(
            'azure_region_name', os.environ.get('AZURE_REGION_NAME',
                                                'eastus'))
        self.resource_group = self._get_config_value(
            'azure_resource_group', os.environ.get('AZURE_RESOURCE_GROUP',
                                                   'cloudbridge'))

        self.storage_account = self._get_config_value(
            'azure_storage_account', os.environ.get
            ('AZURE_STORAGE_ACCOUNT', 'cloudbridgestorage'))

        self.vm_default_user_name = self._get_config_value(
            'azure_vm_default_user_name', os.environ.get
            ('AZURE_VM_DEFAULT_USER_NAME', 'cbuser'))

        self.public_key_storage_table_name = self._get_config_value(
            'azure_public_key_storage_table_name', os.environ.get
            ('AZURE_PUBLIC_KEY_STORAGE_TABLE_NAME', 'cbcerts'))

        self._azure_client = None

        self._security = AzureSecurityService(self)
        self._object_store = AzureObjectStoreService(self)
        self._block_store = AzureBlockStoreService(self)
        self._compute = AzureComputeService(self)
        self._networking = AzureNetworkingService(self)

    @property
    def compute(self):<commit_msg>Make sure storage account name is unique per resource group<commit_after>import logging
import os

from cloudbridge.cloud.base import BaseCloudProvider
from cloudbridge.cloud.providers.azure.azure_client import AzureClient
from cloudbridge.cloud.providers.azure.services \
    import AzureBlockStoreService, AzureComputeService, \
    AzureNetworkingService, AzureObjectStoreService, AzureSecurityService

from msrestazure.azure_exceptions import CloudError

log = logging.getLogger(__name__)


class AzureCloudProvider(BaseCloudProvider):
    PROVIDER_ID = 'azure'

    def __init__(self, config):
        super(AzureCloudProvider, self).__init__(config)

        # mandatory config values
        self.subscription_id = self. \
            _get_config_value('azure_subscription_id',
                              os.environ.get('AZURE_SUBSCRIPTION_ID', None))
        self.client_Id = self._get_config_value(
            'azure_client_id', os.environ.get('AZURE_CLIENT_ID', None))
        self.secret = self._get_config_value(
            'azure_secret', os.environ.get('AZURE_SECRET', None))
        self.tenant = self._get_config_value(
            'azure_tenant', os.environ.get('AZURE_TENANT', None))

        # optional config values
        self.region_name = self._get_config_value(
            'azure_region_name', os.environ.get('AZURE_REGION_NAME',
                                                'eastus'))
        self.resource_group = self._get_config_value(
            'azure_resource_group', os.environ.get('AZURE_RESOURCE_GROUP',
                                                   'cloudbridge'))

        self.storage_account = self._get_config_value(
            'azure_storage_account',
            os.environ.get('AZURE_STORAGE_ACCOUNT',
                           self.resource_group + 'storage'))

        self.vm_default_user_name = self._get_config_value(
            'azure_vm_default_user_name', os.environ.get
            ('AZURE_VM_DEFAULT_USER_NAME', 'cbuser'))

        self.public_key_storage_table_name = self._get_config_value(
            'azure_public_key_storage_table_name', os.environ.get
            ('AZURE_PUBLIC_KEY_STORAGE_TABLE_NAME', 'cbcerts'))

        self._azure_client = None

        self._security = AzureSecurityService(self)
        self._object_store = AzureObjectStoreService(self)
        self._block_store = AzureBlockStoreService(self)
        self._compute = AzureComputeService(self)
        self._networking = AzureNetworkingService(self)

    @property
    def compute(self):
{'fraction_non_alphanumeric': 0.08601720344068814, 'fraction_numerical': 0.0, 'mean_word_length': 2.802281368821293, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5316038', 'n_tokens_mistral': 1404, 'n_tokens_neox': 1397, 'n_words': 216}