code: def get_ec2_info(
      instance_id: str, boto3_session: boto3.session.Session
  ) -> Dict:
      ec2 = boto3_session.client("ec2")
  
      response = ec2.describe_instances(InstanceIds=[instance_id])
      info = response["Reservations"][0]["Instances"][0]
      assert isinstance(
          info, dict
      ), f"expected a dict of instance info but got {info}"
      return info
  
imports: import sys
  import threading
  import time
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import boto3
  import tqdm
  from botocore.exceptions import ClientError, WaiterError
  from determined.deploy.aws import constants
label_desc: Use image node_id 16 for calling a global function with example usage: get_ec2_info(instance_id, boto3_session) and returns: info