code: def parse_locations(locations, samples, ids=None):
      if locations is not None and not etau.is_str(locations):
          return np.asarray(locations)
  
      if samples is None:
          raise ValueError(
              "You must provide `samples` in order to extract `locations` from "
              "your dataset"
          )
  
      if locations is None:
          location_field = samples._get_geo_location_field()
      else:
          location_field = locations
          samples.validate_field_type(
              location_field, embedded_doc_type=fol.GeoLocation
          )
  
      path = location_field + ".point.coordinates"
      if ids is not None:
          locations = samples._get_values_by_id(path, ids)
      else:
          locations = samples.values(path)
  
      return np.asarray(locations)
  
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 2 for calling a global function with example usage: parse_locations(locations, samples, ids) and returns: np, np