  def ListInstances(self,
                    resource_group_name: Optional[str] = None
                    ) -> Dict[str, 'AZComputeVirtualMachine']:
    """List instances in an Azure subscription / resource group.

    Args:
      resource_group_name (str): Optional. The resource group name to list
          instances from. If none specified, then all instances in the Azure
          subscription will be listed.

    Returns:
      Dict[str, AZComputeVirtualMachine]: Dictionary mapping instance names
          (str) to their respective AZComputeVirtualMachine object.
    """
    instances = {}  # type: Dict[str, AZComputeVirtualMachine]
    az_vm_client = self.compute_client.virtual_machines
    if not resource_group_name:
      responses = common.ExecuteRequest(az_vm_client, 'list_all')
    else:
      responses = common.ExecuteRequest(
          az_vm_client,
          'list',
          {'resource_group_name': resource_group_name})
    for response in responses:
      for instance in response:
        instances[instance.name] = AZComputeVirtualMachine(
            self.az_account,
            instance.id,
            instance.name,
            instance.location,
            zones=instance.zones)
    return instances
List instances in an Azure subscription / resource group.

Args:
resource_group_name (str): Optional. The resource group name to list
instances from. If none specified, then all instances in the Azure
subscription will be listed.

Returns:
Dict[str, AZComputeVirtualMachine]: Dictionary mapping instance names
(str) to their respective AZComputeVirtualMachine object.
libcloudforensics/providers/azure/internal/compute.py