order matters here, top is last to match, bottom is first
435344
def watch(ec)
      ec.watch('features/support/.*')  { |m| Providence::CucumberWatchr.run_all }
      ec.watch('features/.*\.feature') { |m| Providence::CucumberWatchr.run m[0] }
    end
1203798
def _move_to_top(self, pos):
        """"""
        if pos > 0:
            self.queue.rotate(-pos)
            item = self.queue.popleft()
            self.queue.rotate(pos)
            self.queue.appendleft(item)
1363987
public boolean inOrder() {
        SortedSet<Integer> prev = null;
        for (SortedSet<Integer> cell : cells) {
            if (prev == null) {
                prev = cell;
            } else {
                int first = cell.first();
                int last = cell.last();
                if (first > prev.first() && last > prev.last()) {
                    prev = cell;
                } else {
                    return false;
                }
            }
        }
        return true;
    }
1120691
def process_order(self, order):
        
        try:
            dt_orders = self._orders_by_modified[order.dt]
        except KeyError:
            self._orders_by_modified[order.dt] = OrderedDict([
                (order.id, order),
            ])
            self._orders_by_id[order.id] = order
        else:
            self._orders_by_id[order.id] = dt_orders[order.id] = order
            # to preserve the order of the orders by modified date
            move_to_end(dt_orders, order.id, last=True)

        move_to_end(self._orders_by_id, order.id, last=True)
186862
function sortByDepth(arr, descending) {
    arr.sort(function (a, b) {
        return dom(descending ? b : a).parents().length - dom(descending ? a : b).parents().length;
    });
}
375295
def bottoms(panels):
    
    bottom_lines = [(p['col'], p['row'] + p['size_y'], p['col'] + p['size_x'], p['row'] + p['size_y']) for p in panels]
    return sorted(bottom_lines, key=lambda l: l[1], reverse=True)
138896
function orderCoords(coords){
  if (config.coordinateOrder){
    return coords;
  }
  if (coords[2]){
    return [coords[1], coords[0], coords[2]];
  }
  return coords.reverse();
}
1205566
def inside(self, other):
        
        return ( self.left >= other.left and
                 self.right <= other.right and
                 self.top <= other.top and
                 self.bottom >= other.bottom)
503789
def _bottom_position(self, resource):
        
        image = self._get_scaled_image(resource)

        left = int(round(resource.size[0] // 2 - image.size[0] // 2))
        upper = int(round(resource.size[1] - image.size[1]))

        return image, left, upper
1190921
private function order()
    {
        $result = [];

        $data = $this->request;

        if ($data['table1'] > $data['table2']) {
            $result['first'] = $data['table2'];
            $result['second'] = $data['table1'];
        } else {
            $result['first'] = $data['table1'];
            $result['second'] = $data['table2'];
        }

        return $result;
    }
134219
def order_by_position(qs, reverse=False):
    """"""
    if qs:
        # ATTENTION: Django creates an invalid sql statement if two related
        # models have both generic positions, so we cannot use
        # qs.oder_by('generic_position__position')
        position = 'position'
        if reverse:
            position = '-' + position
        # Get content type of first queryset item
        c_type = ContentType.objects.get_for_model(qs[0])
        # Check that every item has a valid position item
        for obj in qs:
            ObjectPosition.objects.get_or_create(
                content_type=c_type, object_id=obj.pk)
        return [
            o.content_object for o in ObjectPosition.objects.filter(
                content_type=c_type, object_id__in=qs).order_by(position)
        ]
    return qs
220285
function sortMainFirst(main) {
  return (entity1, entity2) => {
    if (entity1.key === main.key) {
      return -1;
    }
    else if (entity2.key === main.key) {
      return 1;
    }
    return 0;
  };
}
832084
def bottom(self):
        """"""
        if self._has_real():
            return self._data.real_bottom
        return self._data.bottom
524567
function orderByComparator(a, b) {
    if (a === null || typeof a === 'undefined')
        a = 0;
    if (b === null || typeof b === 'undefined')
        b = 0;
    if (a instanceof Date && b instanceof Date) {
        if (a < b)
            return -1;
        if (a > b)
            return 1;
    }
    else if ((isNaN(parseFloat(a)) || !isFinite(a)) || (isNaN(parseFloat(b)) || !isFinite(b))) {
        // Convert to string in case of a=0 or b=0
        a = String(a);
        b = String(b);
        // Isn't a number so lowercase the string to properly compare
        if (a.toLowerCase() < b.toLowerCase())
            return -1;
        if (a.toLowerCase() > b.toLowerCase())
            return 1;
    }
    else {
        // Parse strings as numbers to compare properly
        if (parseFloat(a) < parseFloat(b))
            return -1;
        if (parseFloat(a) > parseFloat(b))
            return 1;
    }
    // equal each other
    return 0;
}
1203731
function (t) {
        var o_p = this.offsetParent(),
            o = o_p.offset(),
            p = t.offset();

        p.top -= o.top;
        p.left -= o.left;

        return p;
      }
139136
final void fallbackSort(final BZip2CompressorOutputStream.Data data,
                            final int last) {
        data.block[0] = data.block[last + 1];
        fallbackSort(data.fmap, data.block, last + 1);
        for (int i = 0; i < last + 1; i++) {
            --data.fmap[i];
        }
        for (int i = 0; i < last + 1; i++) {
            if (data.fmap[i] == -1) {
                data.fmap[i] = last;
                break;
            }
        }
    }
1354047
def get_ordering(self):
        """"""
        _, ordering = self.token_next_by(t=T.Keyword.Order)
        return ordering.normalized if ordering else None