code: def db_spec(self, spec):
      if self.format_version == 1:
          return spec
  
      secrets = spec.get("secrets")
      if secrets:
          secrets = [
              [
                  secret["namespace"],
                  secret["name"],
                  secret["mount_path"],
                  int(secret.get("mount_in_copy", False)),
              ]
              for secret in secrets
          ]
  
      service_account = spec.get("service_account")
      if service_account:
          service_account = [
              service_account["namespace"],
              service_account["name"],
          ]
  
      machine_spec = None
      resources = spec.get("resources")
      machine_type = resources.get("machine_type")
      if machine_type:
          preemptible = int(resources["preemptible"])
          storage = resources["storage_gib"]
          machine_spec = [machine_type, preemptible, storage]
  
      if self.format_version < 5:
          return [
              secrets,
              service_account,
              int(len(spec.get("input_files", [])) > 0),
              int(len(spec.get("output_files", [])) > 0),
          ]
  
      return [
          secrets,
          service_account,
          int(len(spec.get("input_files", [])) > 0),
          int(len(spec.get("output_files", [])) > 0),
          machine_spec,
      ]
  
file_path: hail/batch/batch/batch_format_version.py
imports: from typing import Optional, Tuple
  from hailtop.batch_client.aioclient import Job
label_desc: Use image node_id 6 for calling the BatchFormatVersion obj's underlying member method code with example usage: obj.db_spec(spec) and returns: list, spec, list