code: def _record_to_encodable(
      self, step: int, record, trace: Sequence
  ) -> dict:
      rec_json = record.json()
      if self.resolve_blobs:
          rec_json["data"] = self.dump_fn(record)
      else:
          # TODO make path generation more abstract
          data_path = generate_resource_path(
              trace.values.tree.container, (step, "data")
          )
          rec_json["blob_uri"] = URIService.generate_uri(
              trace.run.repo, trace.run.hash, "seqs", data_path
          )
      return rec_json
  
imports: import asyncio
  import time
  from typing import Iterable, Iterator, List, Tuple, Union, Optional
  from typing import TYPE_CHECKING
  from aim.web.api.runs.utils import ASYNC_SLEEP_INTERVAL, PROGRESS_KEY_SUFFIX, IndexRange, collect_streamable_data, get_run_props, get_run_params
  from aim.web.configs import AIM_PROGRESS_REPORT_INTERVAL
  from aim.sdk.uri_service import URIService, generate_resource_path
  from aim.sdk.sequence_collection import SequenceCollection
  from aim.sdk.sequence import Sequence
  from aim.storage.treeutils import encode_tree
  from aim.storage.context import Context
label_desc: Use image node_id 8 for calling the CustomObjectApi obj's underlying member method code with example usage: obj._record_to_encodable(step, record, trace) and returns: rec_json