code: def _get_trace_info(
      self,
      trace: Sequence,
      include_epochs: bool,
      include_timestamps: bool,
  ) -> dict:
      steps = []
      values = []
  
      steps_vals = (
          trace.data.view("val")
          .range(self.record_range.start, self.record_range.stop)
          .sample(self.record_density)
      )
  
      for step, (val,) in steps_vals:
          steps.append(step)
          values.append(self._value_retriever(step, val, trace))
  
      result = {
          "name": trace.name,
          "context": trace.context.to_dict(),
          "values": values,
          "iters": steps,
      }
      if include_epochs:
          result["epochs"] = (
              trace.data.view("epoch")
              .range(self.record_range.start, self.record_range.stop)
              .sample(self.record_density)
              .values_list()
          )
      if include_timestamps:
          result["timestamps"] = (
              trace.data.view("time")
              .range(self.record_range.start, self.record_range.stop)
              .sample(self.record_density)
              .values_list()
          )
      return result
  
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 7 for calling the CustomObjectApi obj's underlying member method code with example usage: obj._get_trace_info(trace, include_epochs, include_timestamps) and returns: result