class_docstr: Wrapper for Ego4D IMU data loads, assuming one csv per video_uid at the provided path.
code: def _load_imu(
      self, video_uid: str
  ) -> Tuple[np.ndarray, np.ndarray, int]:
      file_path = os.path.join(self.path_imu, video_uid) + ".csv"
      data_csv = self._load_csv(file_path)
      data_IMU = defaultdict(list)
      for row in data_csv:
          for k, v in row.items():
              if v != "":
                  data_IMU[k].append(float(v))
              else:
                  data_IMU[k].append(0.0)
      signal = np.array(
          [
              data_IMU["accl_x"],
              data_IMU["accl_y"],
              data_IMU["accl_z"],
              data_IMU["gyro_x"],
              data_IMU["gyro_y"],
              data_IMU["gyro_z"],
          ]
      ).transpose()
      # normalize
      signal = (signal - signal.mean(axis=0)) / signal.std(axis=0)
      timestamps = np.array(data_IMU["canonical_timestamp_ms"])
      sampling_rate = int(1000 * (1 / (np.mean(np.diff(timestamps)))))
      if sampling_rate < 0:
          # regenerate timestamps with 198 hz
          new_timestamps = timestamps[0] + (1000 / 198) * np.arange(
              len(timestamps)
          )
          timestamps = np.array(new_timestamps)
          sampling_rate = int(
              1000 * (1 / (np.mean(np.diff(timestamps))))
          )
      return signal, timestamps, sampling_rate
  
imports: import csv
  import json
  import logging
  import os
  from bisect import bisect_left
  from collections import defaultdict
  from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type
  import numpy
  import torch
  import torch.autograd.profiler
  import torch.utils.data
  import torchaudio
  from iopath.common.file_io import g_pathmgr
  from pytorchvideo.data import LabeledVideoDataset
  from pytorchvideo.data.clip_sampling import ClipSampler
  from pytorchvideo.data.ego4d.utils import Ego4dImuDataBase, get_label_id_map, MomentsClipSampler
  from pytorchvideo.data.utils import get_logger
  from pytorchvideo.data.video import VideoPathHandler
  from pytorchvideo.transforms import ApplyTransformToKey, Div255, Normalize, RandomShortSideScale, ShortSideScale
  from torchvision.transforms import CenterCrop, Compose, RandomCrop, RandomHorizontalFlip
label_desc: Use image node_id 4 for calling the Ego4dImuData obj's underlying member method code with example usage: obj._load_imu(video_uid) and returns: signal,  timestamps,  sampling_rate