code: def _get_ids(samples, link_field=None, ref=None, is_frames=False):
      if link_field is None:
          ids = samples.values("id")
          ptype = "sample"
      elif link_field == "frames":
          ids = samples.values("frames.id")
          ptype = "frame"
      else:
          _, id_path = samples._get_label_field_path(link_field, "id")
          ids = samples.values(id_path)
          ptype = "label"
  
      if is_frames:
          ids = [_unwind_values(_ids) for _ids in ids]
      else:
          ids = _unwind_values(ids)
  
      if ref is not None:
          values_type = "%s IDs" % ptype
          _validate_values(ids, ref, values_type, is_frames=is_frames)
  
      return ids
  
imports: import itertools
  import warnings
  import numpy
  import sklearn.linear_model
  import sklearn.metrics
  import eta.core.serial
  import eta.core.utils
  import fiftyone.core.expressions
  import fiftyone.core.labels
label_desc: Use image node_id 7 for calling a global function with example usage: _get_ids(samples, link_field, ref, is_frames) and returns: ids