code: def _split_dataset_few_shot(dataset, n_fewshot, random_state=None):
      if n_fewshot <= 0:
          raise ValueError(
              f"n_fewshot should be > 0, not '{n_fewshot}'"
          )
      assert n_fewshot > 0
      labels = get_labels(dataset)
      classes = sorted(set(labels))
      if n_fewshot < 1:
          max_few = len(dataset) // len(classes)
          n_fewshot = round(max_few * n_fewshot)
      n_fewshot = int(round(n_fewshot))
  
      random_state = check_random_state(random_state)
      # sample n_fewshot items per class from last dataset
      tindices = []
      uindices = []
      for class_ in classes:
          indices = np.where(labels == class_)[0]
          random_state.shuffle(indices)
          head, tail = np.split(indices, [n_fewshot])
          assert len(head) == n_fewshot
          tindices.append(head)
          uindices.append(tail)
      tindices = np.concatenate(tindices)
      uindices = np.concatenate(uindices)
      assert len(tindices) == len(classes) * n_fewshot
      labeled_dataset = torch.utils.data.Subset(dataset, tindices)
      unlabeled_dataset = torch.utils.data.Subset(dataset, uindices)
      return labeled_dataset, unlabeled_dataset
  
imports: import logging
  import os
  from enum import Enum
  from typing import Any, Callable, cast, Dict, List, Optional, Tuple
  import numpy
  import torch.utils.data
  from sklearn.utils import check_random_state
  from torchvision.datasets import VisionDataset
  from torchvision.datasets.folder import default_loader, has_file_allowed_extension, IMG_EXTENSIONS
  from kale.loaddata.dataset_access import DatasetAccess, get_class_subset, split_by_ratios
  from kale.loaddata.sampler import FixedSeedSamplingConfig, get_labels, MultiDataLoader, SamplingConfig
label_desc: Use image node_id 1 for calling a global function with example usage: _split_dataset_few_shot(dataset, n_fewshot, random_state) and returns: labeled_dataset,  unlabeled_dataset