code: def _split_patients(
      data,
      test_fraction=0.15,
      train_fraction=0.765,
      valid_fraction=0.085,
  ):
      """Split the patients in the data dictionary into test, train and valid sets."""
      assert (
          test_fraction > 0
          and train_fraction > 0
          and valid_fraction > 0
      )
      assert (
          np.abs(test_fraction + train_fraction + valid_fraction - 1.0)
          < 1e-9
      )
      all_patient_ids = sorted(list(data.keys()))
      np.random.seed(
          seed=0x12345
      )  # To make sure we always get the same splits.
      np.random.shuffle(all_patient_ids)
      cutoff_test = int(test_fraction * len(all_patient_ids))
      patients_test = all_patient_ids[:cutoff_test]
      cutoff_train = cutoff_test + int(
          train_fraction * len(all_patient_ids)
      )
      patients_train = all_patient_ids[cutoff_test:cutoff_train]
      patients_valid = all_patient_ids[cutoff_train:]
      return (
          set(patients_test),
          set(patients_train),
          set(patients_valid),
      )
  
imports: import csv
  import os
  import re
  from absl import logging
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling a global function with example usage: _split_patients(data, test_fraction, train_fraction, valid_fraction) and returns: set,  set,  set