Sort first by latitude, then by longitude
342285
@Override
    public int compareTo( GeoPt o ) {
        int latResult = ((Float) latitude).compareTo( o.latitude );
        if ( latResult != 0 ) {
            return latResult;
        }
        return ((Float) longitude).compareTo( o.longitude );
    }
1178959
function orderByParam(query) {
  const value = query[orderedBy];

  switch (value) {
  case orderByKey:
    return;

  case orderByValue:
    return '$value';

  case orderByPriority:
    return '$priority';

  default:
    return value;
  }
}
291272
function sortByFirst(valueArrays) {
  const firstValues = valueArrays[0];
  const indices = sortedIndices(firstValues);
  return valueArrays.map(function(values) {
    return indices.map(function(sortedIndex) {
      return values[sortedIndex];
    });
  });
}
125087
def sort(args):
    
    import jcvi.formats.blast

    return jcvi.formats.blast.sort(args + ["--coords"])
220285
function sortMainFirst(main) {
  return (entity1, entity2) => {
    if (entity1.key === main.key) {
      return -1;
    }
    else if (entity2.key === main.key) {
      return 1;
    }
    return 0;
  };
}
578166
def get_ordering(self):
        """"""
        if self.sorting_field:
            return [self.sorting_field]
        prefix = self.get_prefix()
        fields = self.get_ordering_with_prefix()
        if self.prefix:
            fields = [f.replace(prefix, "", 1) for f in fields]
        return [
            f
            for f in fields
            if f.lstrip("-") in self.get_ordering_fields_lookups()
        ]
1333573
def sort_order(options = {})
      [[prefix, last].compact.join(' '), suffix, options[:initials] ? initials : first].compact.join(', ')
    end
1239760
def sorted_by_distance_to(self, position: Union[Unit, Point2], reverse: bool = False) -> "Units":
        
        if len(self) in [0, 1]:
            return self
        position = position.position
        return self.sorted(keyfn=lambda unit: unit.position._distance_squared(position), reverse=reverse)
1033904
def interpolate_nearest(self, lons, lats, data):
        
        return self.interpolate(lons, lats, data, order=0)
409224
def _sort_by_region(fnames, regions, ref_file, config):
    
    contig_order = {}
    for i, sq in enumerate(ref.file_contigs(ref_file, config)):
        contig_order[sq.name] = i
    sitems = []
    assert len(regions) == len(fnames), (regions, fnames)
    added_fnames = set([])
    for region, fname in zip(regions, fnames):
        if fname not in added_fnames:
            if isinstance(region, (list, tuple)):
                c, s, e = region
            elif isinstance(region, six.string_types) and region.find(":") >= 0:
                c, coords = region.split(":")
                s, e = [int(x) for x in coords.split("-")]
            else:
                c = region
                s, e = 0, 0
            sitems.append(((contig_order[c], s, e), c, fname))
            added_fnames.add(fname)
    sitems.sort()
    return [(x[1], x[2]) for x in sitems]
504185
function locationOf(element, array, start, end) {
  start = start || 0;
  end = end || array.length;
  var pivot = parseInt(start + (end - start) / 2, 10);
  if (end-start <= 1 || array[pivot] === element) return pivot;
  if (array[pivot] < element) {
    return locationOf(element, array, pivot, end);
  } else {
    return locationOf(element, array, start, pivot);
  }
}
559617
function sortFiles (a, b) {
  if (a.type === b.type) {
    if (a.file === b.file) {
      var ai = a.start || a.mtime || a.index
      var bi = b.start || b.mtime || b.index
      if (sort === 'desc') {
        return parseFloat(bi) - parseFloat(ai)
      } else {
        return parseFloat(ai) - parseFloat(bi)
      }
    } else {
      var ai = a.mtime || a.index
      var bi = b.mtime || b.index
      if (sort === 'desc') {
        return parseFloat(bi) - parseFloat(ai)
      } else {
        return parseFloat(ai) - parseFloat(bi)
      }
    }
  } else {
    var order = [1, 2, 0]
    return order[b.type] - order[a.type]
  }
}
1110900
private function sortMaps()
    {
        uasort($this->activeMaps, function(PrioritizedMap $m1, PrioritizedMap $m2) {
            if ($p = $m2->priority - $m1->priority)
                return $p;
            return $m1->priority2 - $m2->priority2;
        });
    }
153601
public function getPostcodesByCoordinates($latitude, $longitude, $sort = self::POSTCODES_SORT_DISTANCE)
    {
        return $this->get('/postcodes/', [
            'coords' => [
                'latitude' => $latitude,
                'longitude' => $longitude
            ],
            'sort' => $sort
        ]);
    }
529572
public static ListValue of(LatLng first, LatLng... other) {
    return newBuilder().addValue(first, other).build();
  }
1061854
def sortByColumn(self, index, direction):
        
        if self.isPaged() and not self.isFullyLoaded():
            self.reorder(index, direction)
        else:
            super(XOrbTreeWidget, self).sortByColumn(index, direction)
671687
private void selectionSort(final T[] array, int start, int end, Comparator<T> lt) {
    int i;
    int j;
    int bestI;
    T tmp;
    for (i = start; i < end; i++) {
      bestI = i;
      for (j = i + 1; j < end; j++) {
        if (lt.compare(array[j], array[bestI]) < 0)
          bestI = j;
      }
      tmp = array[i];
      array[i] = array[bestI];
      array[bestI] = tmp;
    }
  }