  def ListMIGSByInstanceName(self, location: str) -> Dict[str, str]:
    """Gets a mapping from instance names to their managed instance group.

    Args:
      location (str): The region/zone in which to list managed instance groups.

    Returns:
      Dict[str, str]: A mapping from instance names to their managed instance
          group.

    Raises:
      RuntimeError: If multiple managed instance groups are found for a single
          instance.
    """
    groups = self.ListMIGS(location)
    groups_by_instance = {}
    for group_id, instances in groups.items():
      for instance in instances:
        if instance.name in groups_by_instance:
          raise RuntimeError('Multiple managed instance groups for instance')
        groups_by_instance[instance.name] = group_id
    return groups_by_instance
Gets a mapping from instance names to their managed instance group.

Args:
location (str): The region/zone in which to list managed instance groups.

Returns:
Dict[str, str]: A mapping from instance names to their managed instance
group.

Raises:
RuntimeError: If multiple managed instance groups are found for a single
instance.
libcloudforensics/providers/gcp/internal/compute.py