  def GetInstance(
      self,
      instance_name: str,
      zone: Optional[str] = None) -> 'GoogleComputeInstance':
    """Get instance from project.

    Args:
      instance_name: The instance identifier, can be either an instance
        name or ID.
      zone: Compute zone.

    Returns:
      GoogleComputeInstance: A Google Compute Instance object.

    Raises:
      ResourceNotFoundError: If instance does not exist.
    """

    instances = self.Instances()

    if re.match(RESOURCE_ID_REGEX, instance_name):
      instance = instances.get(instance_name)
    else:
      instance = self._FindResourceByName(instances, instance_name, zone)

    if not instance:
      raise errors.ResourceNotFoundError(
          f'Instance {instance_name} was not found in project '
          f'{self.project_id}', __name__)
    return instance
Get instance from project.

Args:
instance_name: The instance identifier, can be either an instance
name or ID.
zone: Compute zone.

Returns:
GoogleComputeInstance: A Google Compute Instance object.

Raises:
ResourceNotFoundError: If instance does not exist.
libcloudforensics/providers/gcp/internal/compute.py