code: def samples_from_source(
      sample_source, buffering=BUFFER_SIZE, labeled=None, reverse=False
  ):
      """
      Loads samples from a sample source file.
  
      Parameters
      ----------
      sample_source : str
          Path to the sample source file (SDB or CSV)
      buffering : int
          Read-buffer size to use while reading files
      labeled : bool or None
          If True: Reads LabeledSample instances. Fails, if source provides no transcripts.
          If False: Ignores transcripts (if available) and reads (unlabeled) util.audio.Sample instances.
          If None: Automatically determines if source provides transcripts
          (reading util.sample_collections.LabeledSample instances) or not (reading util.audio.Sample instances).
      reverse : bool
          If the order of the samples should be reversed
  
      Returns
      -------
      iterable of util.sample_collections.LabeledSample or util.audio.Sample instances supporting len.
      """
      ext = os.path.splitext(sample_source)[1].lower()
      if ext == ".sdb":
          return SDB(
              sample_source,
              buffering=buffering,
              labeled=labeled,
              reverse=reverse,
          )
      if ext == ".csv":
          return CSV(sample_source, labeled=labeled, reverse=reverse)
      raise ValueError('Unknown file type: "{}"'.format(ext))
  
imports: import os
  import io
  import csv
  import json
  import tarfile
  from pathlib import Path
  from functools import partial
  from .helpers import KILOBYTE, MEGABYTE, GIGABYTE, Interleaved, LenMap
  from .audio import Sample, AUDIO_TYPE_PCM, AUDIO_TYPE_OPUS, SERIALIZABLE_AUDIO_TYPES, get_loadable_audio_type_from_extension, write_wav
  from .io import open_remote, is_remote_path
label_desc: Use image node_id 3 for calling a global function with example usage: samples_from_source(sample_source, buffering, labeled, reverse) and returns: SDB, CSV