# Path: libcloudforensics/logging_utils.py
# def _GenerateColorSequences() -> List[str]:
#   def __init__(self,
#                colorize: bool = True,
#                random_color: bool = False,
#                **kwargs: str) -> None:
#   def format(self, record: logging.LogRecord) -> str:
# def SetUpLogger(name: str, no_newline: bool = False) -> None:
# def GetLogger(name: str) -> logging.Logger:
# COLOR_SEQS = _GenerateColorSequences()
# RESET_SEQ = '\u001b[0m'
# BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = COLOR_SEQS[8:16]
# BG_RED = '\u001b[41m'  # Red background
# BOLD = '\u001b[1m'  # Bold / bright modifier
# LOG_FORMAT = ('[%(asctime)s] [{0:s}{color:s}%(name)-20s{1:s}] %(levelname)-8s'
#               ' %(message)s')
# LEVEL_COLOR_MAP = {
#     'WARNING': YELLOW,
#     'INFO': WHITE,
#     'DEBUG': BLUE,
#     'CRITICAL': BOLD + BG_RED + WHITE,
#     'ERROR': RED
# }
# class Formatter(logging.Formatter):
# 
# Path: libcloudforensics/providers/azure/internal/account.py
# class AZAccount:
#   def __init__(self,
#                default_resource_group_name: str,
#                default_region: str = 'eastus',
#                profile_name: Optional[str] = None) -> None:
#   def compute(self) -> compute_module.AZCompute:
#   def monitoring(self) -> monitoring_module.AZMonitoring:
#   def network(self) -> network_module.AZNetwork:
#   def resource(self) -> resource_module.AZResource:
#   def storage(self) -> storage_module.AZStorage:
# 
# Path: libcloudforensics/providers/azure/internal/monitoring.py
# class AZMonitoring:
#   def __init__(self,
#                az_account: 'account.AZAccount') -> None:
#   def ListAvailableMetricsForResource(self, resource_id: str) -> List[str]:
#   def GetMetricsForResource(
#       self,
#       resource_id: str,
#       metrics: str,
#       from_date: Optional['datetime'] = None,
#       to_date: Optional['datetime'] = None,
#       interval: Optional[str] = None,
#       aggregation: str = 'Total',
#       qfilter: Optional[str] = None) -> Dict[str, Dict[str, str]]:
# 
# Path: libcloudforensics/providers/azure/forensics.py
# def CreateDiskCopy(
#     resource_group_name: str,
#     instance_name: Optional[str] = None,
#     disk_name: Optional[str] = None,
#     disk_type: Optional[str] = None,
#     region: str = 'eastus',
#     src_profile: Optional[str] = None,
#     dst_profile: Optional[str] = None) -> 'compute.AZComputeDisk':
# def StartAnalysisVm(
#     resource_group_name: str,
#     vm_name: str,
#     boot_disk_size: int,
#     ssh_public_key: str,
#     cpu_cores: int = 4,
#     memory_in_mb: int = 8192,
#     region: str = 'eastus',
#     attach_disks: Optional[List[str]] = None,
#     tags: Optional[Dict[str, str]] = None,
#     dst_profile: Optional[str] = None
#     ) -> Tuple['compute.AZComputeVirtualMachine', bool]:


import os
  import argparse
from datetime import datetime
from typing import TYPE_CHECKING
from Crypto.PublicKey import RSA
from libcloudforensics import logging_utils
from libcloudforensics.providers.azure.internal import account
from libcloudforensics.providers.azure.internal import monitoring
from libcloudforensics.providers.azure import forensics
    f.write(public_key)

  logger.info('SSH key pair generated. Public key saved in {0:s}, private key '
              'saved in {1:s}'.format(path_public_key, path_private_key))

  return public_key.decode('utf-8')


def ListMetrics(args: 'argparse.Namespace') -> None:
  """List Azure Monitoring metrics for a resource.

  Args:
    args (argparse.Namespace): Arguments from ArgumentParser.
  """
  az_account = account.AZAccount(args.default_resource_group_name)
  az_monitoring = monitoring.AZMonitoring(az_account)
  metrics = az_monitoring.ListAvailableMetricsForResource(args.resource_id)
  for metric in metrics:
    logger.info('Available metric: {0:s}'.format(metric))


def QueryMetrics(args: 'argparse.Namespace') -> None:
  """Query Azure Monitoring metrics for a resource.

  Args:
    args (argparse.Namespace): Arguments from ArgumentParser.

  Raises:
    RuntimeError: If from_date or to_date could not be parsed.
  """

# Path: libcloudforensics/logging_utils.py
# def _GenerateColorSequences() -> List[str]:
#   def __init__(self,
#                colorize: bool = True,
#                random_color: bool = False,
#                **kwargs: str) -> None:
#   def format(self, record: logging.LogRecord) -> str:
# def SetUpLogger(name: str, no_newline: bool = False) -> None:
# def GetLogger(name: str) -> logging.Logger:
# COLOR_SEQS = _GenerateColorSequences()
# RESET_SEQ = '\u001b[0m'
# BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = COLOR_SEQS[8:16]
# BG_RED = '\u001b[41m'  # Red background
# BOLD = '\u001b[1m'  # Bold / bright modifier
# LOG_FORMAT = ('[%(asctime)s] [{0:s}{color:s}%(name)-20s{1:s}] %(levelname)-8s'
#               ' %(message)s')
# LEVEL_COLOR_MAP = {
#     'WARNING': YELLOW,
#     'INFO': WHITE,
#     'DEBUG': BLUE,
#     'CRITICAL': BOLD + BG_RED + WHITE,
#     'ERROR': RED
# }
# class Formatter(logging.Formatter):
# 
# Path: libcloudforensics/providers/azure/internal/account.py
# class AZAccount:
#   def __init__(self,
#                default_resource_group_name: str,
#                default_region: str = 'eastus',
#                profile_name: Optional[str] = None) -> None:
#   def compute(self) -> compute_module.AZCompute:
#   def monitoring(self) -> monitoring_module.AZMonitoring:
#   def network(self) -> network_module.AZNetwork:
#   def resource(self) -> resource_module.AZResource:
#   def storage(self) -> storage_module.AZStorage:
# 
# Path: libcloudforensics/providers/azure/internal/monitoring.py
# class AZMonitoring:
#   def __init__(self,
#                az_account: 'account.AZAccount') -> None:
#   def ListAvailableMetricsForResource(self, resource_id: str) -> List[str]:
#   def GetMetricsForResource(
#       self,
#       resource_id: str,
#       metrics: str,
#       from_date: Optional['datetime'] = None,
#       to_date: Optional['datetime'] = None,
#       interval: Optional[str] = None,
#       aggregation: str = 'Total',
#       qfilter: Optional[str] = None) -> Dict[str, Dict[str, str]]:
# 
# Path: libcloudforensics/providers/azure/forensics.py
# def CreateDiskCopy(
#     resource_group_name: str,
#     instance_name: Optional[str] = None,
#     disk_name: Optional[str] = None,
#     disk_type: Optional[str] = None,
#     region: str = 'eastus',
#     src_profile: Optional[str] = None,
#     dst_profile: Optional[str] = None) -> 'compute.AZComputeDisk':
# def StartAnalysisVm(
#     resource_group_name: str,
#     vm_name: str,
#     boot_disk_size: int,
#     ssh_public_key: str,
#     cpu_cores: int = 4,
#     memory_in_mb: int = 8192,
#     region: str = 'eastus',
#     attach_disks: Optional[List[str]] = None,
#     tags: Optional[Dict[str, str]] = None,
#     dst_profile: Optional[str] = None
#     ) -> Tuple['compute.AZComputeVirtualMachine', bool]:


# Path: tools/az_cli.py
import os
  import argparse
from datetime import datetime
from typing import TYPE_CHECKING
from Crypto.PublicKey import RSA
from libcloudforensics import logging_utils
from libcloudforensics.providers.azure.internal import account
from libcloudforensics.providers.azure.internal import monitoring
from libcloudforensics.providers.azure import forensics

    f.write(public_key)

  logger.info('SSH key pair generated. Public key saved in {0:s}, private key '
              'saved in {1:s}'.format(path_public_key, path_private_key))

  return public_key.decode('utf-8')


def ListMetrics(args: 'argparse.Namespace') -> None:
  """List Azure Monitoring metrics for a resource.

  Args:
    args (argparse.Namespace): Arguments from ArgumentParser.
  """
  az_account = account.AZAccount(args.default_resource_group_name)
  az_monitoring = monitoring.AZMonitoring(az_account)
  metrics = az_monitoring.ListAvailableMetricsForResource(args.resource_id)
  for metric in metrics:
    logger.info('Available metric: {0:s}'.format(metric))


def QueryMetrics(args: 'argparse.Namespace') -> None:
  """Query Azure Monitoring metrics for a resource.

  Args:
    args (argparse.Namespace): Arguments from ArgumentParser.

  Raises:
    RuntimeError: If from_date or to_date could not be parsed.
  """

  az_account = account.AZAccount(args.default_resource_group_name)