code: def _split_train_val_data(data: Dict, split: float = 0) -> List[Dict]:
      assert split > 0
      assert split < 1
      file_path = data.get("export_json", None)
  
      if not file_path:
          raise TypeError(
              "The key `export_json` should be provided as a string."
          )
  
      fs = get_filesystem(file_path)
      with fs.open(file_path) as f:
          raw_data = np.asarray(json.load(f))
  
      L = len(raw_data)
      indices = np.random.permutation(L)
      limit = int(L * split)
      train_raw_data = raw_data[indices[limit:]]
      val_raw_data = raw_data[indices[:limit]]
  
      dirname = os.path.dirname(file_path)
      basename = os.path.basename(file_path)
      results = []
      for stage, raw_data in [
          ("train", train_raw_data),
          ("val", val_raw_data),
      ]:
          filename = (
              basename if stage in basename else f"{stage}_{basename}"
          )
          export_path = os.path.join(dirname, filename)
          LabelStudioInput._export_data_to_json(
              export_path, raw_data.tolist()
          )
          output_data = deepcopy(data)
          output_data["export_json"] = export_path
          results.append(output_data)
      return results
  
imports: import json
  import os
  from copy import deepcopy
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, Dict, List, Mapping, Optional, Sequence, Set, Type
  import numpy
  import torch
  from pytorch_lightning.utilities.cloud_io import get_filesystem
  from torch.utils.data import Sampler
  from flash.core.data.io.input import DataKeys, Input, IterableInput
  from flash.core.data.properties import Properties
  from flash.core.data.utilities.loading import load_image
  from flash.core.utilities.imports import _PYTORCHVIDEO_AVAILABLE
  from flash.core.utilities.stages import RunningStage
label_desc: Use image node_id 5 for calling the BaseLabelStudioInput obj's underlying member method code with example usage: obj._split_train_val_data(data, split) and returns: results