code: def fight_splits(video_dict, train_percent=0.8):
      videos = list(video_dict.keys())
  
      train_num = int(len(videos) * train_percent)
  
      train_list = []
      val_list = []
  
      random.shuffle(videos)
  
      for i in range(train_num):
          train_list.append(
              videos[i] + " " + str(video_dict[videos[i]])
          )
      for i in range(train_num, len(videos)):
          val_list.append(videos[i] + " " + str(video_dict[videos[i]]))
  
      print("train:", len(train_list), ",val:", len(val_list))
  
      with open("fight_train_list.txt", "w") as f:
          for item in train_list:
              f.write(item + "\n")
  
      with open("fight_val_list.txt", "w") as f:
          for item in val_list:
              f.write(item + "\n")
  
file_path: PaddleDetection/deploy/pipeline/tools/split_fight_train_test_dataset.py
imports: import os
  import glob
  import random
  import fnmatch
  import re
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: fight_splits(video_dict, train_percent) without return types