code: def from_record(app, inst_coll, record):
      return Instance(
          app,
          inst_coll,
          record["name"],
          record["state"],
          record["cores_mcpu"],
          record["free_cores_mcpu"],
          record["time_created"],
          record["failed_request_count"],
          record["last_updated"],
          record["ip_address"],
          record["version"],
          record["location"],
          record["machine_type"],
          record["preemptible"],
          instance_config_from_config_dict(
              json.loads(
                  base64.b64decode(record["instance_config"]).decode()
              )
          ),
      )
  
imports: import base64
  import json
  import logging
  import secrets
  from typing import Dict, Optional
  import aiohttp
  from gear import Database, transaction
  from hailtop import httpx
  from hailtop.humanizex import naturaldelta_msec
  from hailtop.utils import retry_transient_errors, time_msecs, time_msecs_str
  from ..cloud.utils import instance_config_from_config_dict
  from ..globals import INSTANCE_VERSION
  from ..instance_config import InstanceConfig
label_desc: Use image node_id 1 for calling the Instance obj's underlying member method code with example usage: obj.from_record(app, inst_coll, record) and returns: Instance