code: def split_val(data_dict, num_val=None):
      """split train/val sets"""
  
      count = 0
      test_list = []
      tr_list = []
      for key, content in data_dict.items():
          if content["split"] in {"devman", "devsge"}:
              test_list.append(key)
          elif content["split"] == "train":
              tr_list.append(key)
  
      rd.shuffle(tr_list)
      val_len = num_val if num_val else int(len(tr_list) * 0.05)
      tr_list, val_list = tr_list[:-val_len], tr_list[-val_len:]
  
      for key in val_list:
          data_dict[key]["split"] = "valid"
  
      return data_dict, tr_list, val_list, test_list
  
imports: import argparse
  import collections
  import itertools
  import os
  import random
  import re
  import sys
label_desc: Use image node_id 17 for calling a global function with example usage: split_val(data_dict, num_val) and returns: data_dict,  tr_list,  val_list,  test_list