code: def get_pairwise_labels(samples, label_type="kinships"):
      """Gets a list of all pairs of people that are related and the label of
      their relation, either through the "kinships" or "relationships" field.
  
      Example::
  
          [
             ["F0009/MID2", "F0009/MID4", "sibling"],
             ...
          ]
  
      Args:
          samples: a
              :class:`fiftyone.core.collections.SampleCollection`
          label_type ("kinships"): the type of label of which to return pairwise
              listings options are ``("kinships", "relationships")``
  
      Returns:
          a list of triplets containing the identifier of person 1, identifier of
          person 2, and their kinship or relationship
      """
      supported_types = ("kinships", "relationships")
      if label_type not in supported_types:
          raise ValueError(
              "Invalid label_type=%s. The supported values are %s"
              % (label_type, supported_types)
          )
  
      return samples.values(
          F("%s.classifications" % label_type).reduce(
              VALUE.append(
                  [
                      F("family").concat("/", F("member_id")),
                      F("$identifier"),
                      F("label"),
                  ]
              ),
              init_val=[],
          ),
          unwind=True,
      )
  
imports: import logging
  import os
  from collections import defaultdict
  import eta.core.utils
  import eta.core.web
  import pandas
  import fiftyone
  import fiftyone.core.utils
  import fiftyone.utils.data
  from fiftyone.core.expressions import ViewField
  from fiftyone.core.expressions import VALUE
label_desc: Use image node_id 1 for calling a global function with example usage: get_pairwise_labels(samples, label_type) and returns: samples