code: def get_mocap_head(path_to_mocap_head, filename, start, end):
      f = open(os.path.join(path_to_mocap_head, filename), "r").read()
      f = np.array(f.split("\n"))
      mocap_head = []
      mocap_head_avg = []
      f = f[2:]
      counter = 0
      for data in f:
          counter += 1
          data2 = data.split(" ")
          if len(data2) < 2:
              continue
          if float(data2[1]) > start and float(data2[1]) < end:
              mocap_head_avg.append(
                  np.array(data2[2:]).astype(np.float)
              )
  
      mocap_head_avg = np.array_split(np.array(mocap_head_avg), 200)
      for spl in mocap_head_avg:
          if spl.size != 0:
              mocap_head.append(np.mean(spl, axis=0))
      return np.array(mocap_head)
  
file_path: delta/egs/iemocap/emo/v1/local/python/mocap_data_collect.py
imports: import os
  import sys
  import tqdm
  import numpy
  import wave
  import copy
  import math
  import pickle
  from multiprocessing import Pool, Lock, cpu_count, Manager
  from sklearn.preprocessing import label_binarize
  from helper import *
label_desc: Use image node_id 3 for calling a global function with example usage: get_mocap_head(path_to_mocap_head, filename, start, end) and returns: np