code: def _get_ondemand_prices(self, instances=_instance_specs.keys()):
      # TODO un-hardcode the us-east as a region
      # so that prices are being read for a correct region
  
      price_path = os.path.join(
          os.path.dirname(__file__), "aws/aws_prices.yaml"
      )
      with open(price_path, "r") as f:
          data = yaml.load(f.read(), Loader=yaml.FullLoader)
  
      return {i: data[i] for i in instances}
  
      price_path = os.path.join(
          os.path.expanduser("~"), ".studioml", "awsprices.json"
      )
      offer_file_lock = filelock.FileLock(price_path + ".lock")
  
      try:
          self.logger.info("Reading AWS prices from cache...")
          with offer_file_lock:
              with open(price_path, "r") as f:
                  offer_dict = json.load(f)
  
      except IOError:
          self.logger.info(
              "Getting prices info from AWS (this may take a moment...)"
          )
  
          with offer_file_lock:
              storage_util.download_file(
                  "https://pricing.us-east-1.amazonaws.com/offers/v1.0/"
                  "aws/AmazonEC2/current/index.json",
                  price_path,
              )
  
              with open(price_path, "r") as f:
                  offer_dict = json.load(f)
  
      self.logger.info("Done!")
  
      region_name = "US East (N. Virginia)"
  
      prices = {}
  
      for instance_type in instances:
          product_sku = [
              k
              for k, v in six.iteritems(offer_dict["products"])
              if v["attributes"].get("instanceType") == instance_type
              and v["attributes"]["tenancy"] == "Shared"
              and v["attributes"]["operatingSystem"] == "Linux"
              and v["attributes"]["location"] == region_name
          ]
  
          assert (
              len(product_sku) == 1
          ), "Either no or too many products found for {}!".format(
              instance_type
          )
  
          prices[instance_type] = float(
              list(
                  list(
                      offer_dict["terms"]["OnDemand"][
                          product_sku[0]
                      ].values()
                  )[0]["priceDimensions"].values()
              )[0]["pricePerUnit"]["USD"]
          )
  
      return prices
  
imports: import uuid
  import os
  import base64
  import json
  import yaml
  import six
  import filelock
  import hashlib
  import pickle
  from studio import git_util
  from studio.util import logs
  from studio.storage import storage_util
  from studio.util.gpu_util import memstr2int
  from .cloud_worker_util import insert_user_startup_script
label_desc: Use image node_id 10 for calling the EC2WorkerManager obj's underlying member method code with example usage: obj._get_ondemand_prices(instances) and returns: unknown, prices