class_docstr: Stream-51 Pytorch Dataset
code: def _instance_ordering(
      data_list: Sequence[TSequence], seed
  ) -> List[TSequence]:
      # organize data by video
      total_videos = 0
      new_data_list = []
      temp_video: List[TSequence] = []
      for x in data_list:
          if x[3] == 0:
              new_data_list.append(temp_video)
              total_videos += 1
              temp_video = [x]
          else:
              temp_video.append(x)
      new_data_list.append(temp_video)
      new_data_list = new_data_list[1:]
      # shuffle videos
      random.seed(seed)
      random.shuffle(new_data_list)
      # reorganize by clip
      data_list_result = []
      for v in new_data_list:
          for x in v:
              data_list_result.append(x)
      return data_list_result
  
imports: import os
  import shutil
  import json
  import random
  from pathlib import Path
  from typing import Any, List, Optional, Sequence, Tuple, TypeVar, Union
  from torchvision.datasets.folder import default_loader
  from zipfile import ZipFile
  from torchvision.transforms import ToTensor
  from avalanche.benchmarks.datasets import DownloadableDataset, default_dataset_location
  from avalanche.benchmarks.datasets.stream51 import stream51_data
label_desc: Use image node_id 5 for calling the Stream51 obj's underlying member method code with example usage: obj._instance_ordering(data_list, seed) and returns: data_list_result