code: def process_dataset_for_video(path, is_mpi=False):
      # add some content for specified dataset(h5)
      f = h5py.File(path, "a")
      imagenames = [name.decode() for name in f["imagename"][:]]
      seqnames = ["/".join(name.split("/")[:-1]) for name in imagenames]
      if is_mpi:
          indices_in_seq_ref = [
              int(name.split("/")[-1].split(".")[0].split("_")[1])
              for name in imagenames
          ]
          # reset indices
          indices_in_seq = []
          i = 0
          last_seqname = None
          for index, seqname in zip(indices_in_seq_ref, seqnames):
              if last_seqname is not None and seqname != last_seqname:
                  i = 0
              last_seqname = seqname
              indices_in_seq.append(i)
              i += 1
          # indices_in_seq = [i for i, index in enumerate(indices_in_seq)]
      else:
          indices_in_seq = [
              int(name.split("/")[-1]) for name in imagenames
          ]
      f["index_in_seq"] = indices_in_seq
      f["seqname"] = [name.encode() for name in seqnames]
      seq_lens = {}
      for seqname in seqnames:
          if seqname not in seq_lens:
              seq_lens[seqname] = 0
          seq_lens[seqname] += 1
  
      f["seqlen"] = [seq_lens[seqname] for seqname in seqnames]
      f.close()
  
file_path: insightface/body/human_pose/ambiguity_aware/lib/utils/misc.py
imports: import os
  import os.path
  import h5py
  import math
  import time
  import logging
  import pickle
  import torch.nn
  from pathlib import Path
label_desc: Use image node_id 5 for calling a global function with example usage: process_dataset_for_video(path, is_mpi) without return types