code: def sample_label_unlabeled(
      samples: List[InputExample], no_labeled: int, no_unlabeled: int
  ):
      """
      Randomly sample 2 sets of samples from a given collection of InputExamples
      (used for semi-supervised models)
      """
      num_of_examples = len(samples)
      assert (
          no_labeled > 0 and no_unlabeled > 0
      ), "Must provide no_samples > 0"
      assert (
          num_of_examples >= no_labeled + no_unlabeled
      ), "num of total samples smaller than requested sub sets"
      all_indices = list(range(num_of_examples))
      labeled_indices = random.sample(all_indices, no_labeled)
      remaining_indices = list(
          set(all_indices).difference(set(labeled_indices))
      )
      unlabeled_indices = random.sample(remaining_indices, no_unlabeled)
      label_samples = [samples[i] for i in labeled_indices]
      unlabel_samples = [samples[i] for i in unlabeled_indices]
      return label_samples, unlabel_samples
  
imports: from __future__ import absolute_import, division, print_function
  import csv
  import os
  import random
  import sys
  from abc import ABC
  from io import open
  from typing import List, Tuple
label_desc: Use image node_id 4 for calling a global function with example usage: sample_label_unlabeled(samples, no_labeled, no_unlabeled) and returns: label_samples,  unlabel_samples