code: def adjust_cores_for_packability(cores_in_mcpu: int) -> int:
      cores_in_mcpu = max(1, cores_in_mcpu)
      power = max(-2, math.ceil(math.log2(cores_in_mcpu / 1000)))
      return int(2**power * 1000)
  
imports: import logging
  import math
  from typing import Dict, List, Optional, Tuple
  from ..globals import RESERVED_STORAGE_GB_PER_CORE
  from .azure.resource_utils import azure_is_valid_storage_request, azure_local_ssd_size, azure_machine_type_to_worker_type_and_cores, azure_memory_to_worker_type, azure_requested_to_actual_storage_bytes, azure_valid_cores_from_worker_type, azure_valid_machine_types, azure_worker_memory_per_core_mib
  from .gcp.resource_utils import gcp_cost_from_msec_mcpu, gcp_is_valid_storage_request, gcp_local_ssd_size, gcp_machine_type_to_worker_type_and_cores, gcp_memory_to_worker_type, gcp_requested_to_actual_storage_bytes, gcp_valid_cores_from_worker_type, gcp_valid_machine_types, gcp_worker_memory_per_core_mib
label_desc: Use image node_id 14 for calling a global function with example usage: adjust_cores_for_packability(cores_in_mcpu) and returns: int