class_docstr: Hook to connect to a remote instance in compute engine.
  
  :param instance_name: The name of the Compute Engine instance
  :param zone: The zone of the Compute Engine instance
  :param user: The name of the user on which the login attempt will be made
  :param project_id: The project ID of the remote instance
  :param gcp_conn_id: The connection id to use when fetching connection info
  :param hostname: The hostname of the target instance. If it is not passed, it will be detected
      automatically.
  :param use_iap_tunnel: Whether to connect through IAP tunnel
  :param use_internal_ip: Whether to connect using internal IP
  :param use_oslogin: Whether to manage keys using OsLogin API. If false,
      keys are managed using instance metadata
  :param expire_time: The maximum amount of time in seconds before the private key expires
  :param gcp_conn_id: The connection id to use when fetching connection information
  :param max_retries: Maximum number of retries the process will try to establish connection to instance.
      Could be decreased/increased by user based on the amount of parallel SSH connections to the instance.
  :param impersonation_chain: Optional. The service account email to impersonate using short-term
      credentials. The provided service account must grant the originating account
      the Service Account Token Creator IAM role and have the sufficient rights to perform the request
class_docstr_tok: ["Hook","to","connect","to","a","remote","instance","in","compute","engine",".",":","param","instance_name",":","The","name","of","the","Compute","Engine","instance",":","param","zone",":","The","zone","of","the","Compute","Engine","instance",":","param","user",":","The","name","of","the","user","on","which","the","login","attempt","will","be","made",":","param","project_id",":","The","project","ID","of","the","remote","instance",":","param","gcp_conn_id",":","The","connection","id","to","use","when","fetching","connection","info",":","param","hostname",":","The","hostname","of","the","target","instance",".","If","it","is","not","passed",",","it","will","be","detected","automatically",".",":","param","use_iap_tunnel",":","Whether","to","connect","through","IAP","tunnel",":","param","use_internal_ip",":","Whether","to","connect","using","internal","IP",":","param","use_oslogin",":","Whether","to","manage","keys","using","OsLogin","API",".","If","false",",","keys","are","managed","using","instance","metadata",":","param","expire_time",":","The","maximum","amount","of","time","in","seconds","before","the","private","key","expires",":","param","gcp_conn_id",":","The","connection","id","to","use","when","fetching","connection","information",":","param","max_retries",":","Maximum","number","of","retries","the","process","will","try","to","establish","connection","to","instance",".","Could","be","decreased\/increased","by","user","based","on","the","amount","of","parallel","SSH","connections","to","the","instance",".",":","param","impersonation_chain",":","Optional",".","The","service","account","email","to","impersonate","using","short-term","credentials",".","The","provided","service","account","must","grant","the","originating","account","the","Service","Account","Token","Creator","IAM","role","and","have","the","sufficient","rights","to","perform","the","request"]
code: def _compute_hook(self) -> ComputeEngineHook:
      if self.impersonation_chain:
          return ComputeEngineHook(
              gcp_conn_id=self.gcp_conn_id,
              impersonation_chain=self.impersonation_chain,
          )
      else:
          return ComputeEngineHook(gcp_conn_id=self.gcp_conn_id)
  
imports: from __future__ import annotations
  import random
  import shlex
  import time
  from functools import cached_property
  from io import StringIO
  from typing import Any
  from googleapiclient.errors import HttpError
  from paramiko.ssh_exception import SSHException
  from airflow.exceptions import AirflowException
  from airflow.providers.google.cloud.hooks.compute import ComputeEngineHook
  from airflow.providers.google.cloud.hooks.os_login import OSLoginHook
  from airflow.providers.ssh.hooks.ssh import SSHHook
  from airflow.utils.types import NOTSET, ArgNotSet
  import paramiko
label_desc: Use image node_id 4 for calling the ComputeEngineSSHHook obj's underlying member method code with example usage: obj._compute_hook() and returns: ComputeEngineHook, ComputeEngineHook