reorder droppables per the passed in list
        :param droppable_ids:
        :return:
434674
def set_droppable_order(self, droppable_ids):
        
        reordered_droppables = []
        current_droppable_ids = [d['id'] for d in self.my_osid_object_form._my_map['droppables']]
        if set(droppable_ids) != set(current_droppable_ids):
            raise IllegalState('droppable_ids do not match existing droppables')

        for droppable_id in droppable_ids:
            for current_droppable in self.my_osid_object_form._my_map['droppables']:
                if droppable_id == current_droppable['id']:
                    reordered_droppables.append(current_droppable)
                    break

        self.my_osid_object_form._my_map['droppables'] = reordered_droppables
646661
def rearrange
      if self.parent_id
        self.parent_ids = parent.parent_ids + [self.parent_id]
      else
        self.parent_ids = []
      end

      self.depth = parent_ids.size

      rearrange_children! if self.parent_ids_changed?
    end
580220
def _action_remove(self, ids):
        
        return self._action_get((self.unlisten_to_node(id_) for id_ in ids))
878562
def set_attachments_order(self, order):
        
        # append single uids to the order
        if isinstance(order, basestring):
            new_order = self.storage.get("order", [])
            new_order.append(order)
            order = new_order
        self.storage.update({"order": order})
170805
def revert_unordered_batches(self):
        
        i = 0
        for key in sorted(self.batches.keys(), reverse=True):
            if compare_3PC_keys(self.last_ordered_3pc, key) > 0:
                ledger_id, discarded, _, prevStateRoot, len_reqIdr = self.batches.pop(key)
                discarded = invalid_index_serializer.deserialize(discarded)
                self.logger.debug('{} reverting 3PC key {}'.format(self, key))
                self.revert(ledger_id, prevStateRoot, len_reqIdr - len(discarded))
                i += 1
            else:
                break
        return i
402200
def get_multi_instances_by_id(self, instance_ids):
        
        result = []

        for reservation in self.all_reservations():
            for instance in reservation.instances:
                if instance.id in instance_ids:
                    result.append(instance)

        # TODO: Trim error message down to specific invalid id.
        if instance_ids and len(instance_ids) > len(result):
            raise InvalidInstanceIdError(instance_ids)

        return result
849169
def reorder_pinned_topics_groups(self, order, group_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - order
        """The ids of the pinned discussion topics in the desired order.
        (For example, "order=104,102,103".)"""
        data["order"] = order

        self.logger.debug("POST /api/v1/groups/{group_id}/discussion_topics/reorder with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/groups/{group_id}/discussion_topics/reorder".format(**path), data=data, params=params, no_data=True)
932605
def flushIndexes(self) :
		""
		for n in self.getIndexes(rabaOnly = True) :
			self.dropIndexByName(n[1])
832752
def order_by(self, *field_names):
        
        obj = self._clone()
        obj._clear_ordering()
        self._insert_ordering(obj, *field_names)
        return obj
1014795
def od_reorder_keys(od, keys_in_new_order): # not used
    '''
    
    '''
    if set(od.keys()) != set(keys_in_new_order):
        raise KeyError('Keys in the new order do not match existing keys')
    for key in keys_in_new_order:
        od[key] = od.pop(key)
    return od
624555
def reorder_keys(self, keys):
        ''''''
        if len(keys) != len(self._keys):
            raise ValueError('The supplied number of keys does not match.')
        if set(keys) != set(self._d.keys()):
            raise ValueError('The supplied keys do not match the current set of keys.')
        self._keys = keys
101187
public function reorder($photo_ids)
    {
        if (count($photo_ids) == 1) {
            if ($edge = $this->getService('repos:photos.edge')
                              ->fetch(array(
                                        'set' => $this,
                                        'photo.id' => $photo_ids[0],
                                      ))
            ) {
                $edge->ordering = $this->photos->getTotal();
            }

            return;
        }

        foreach ($photo_ids as $index => $photo_id) {
            if ($edge = $this->getService('repos:photos.edge')
                             ->fetch(array(
                                      'set' => $this,
                                      'photo.id' => $photo_id, ))
            ) {
                $edge->ordering = $index + 1;
            }
        }
    }
132148
def filter_by_ids(original_list, ids_to_filter):
    """"""
    if not ids_to_filter:
        return original_list

    return [i for i in original_list if i['id'] in ids_to_filter]
783521
def constant_tuples_ordered_by_id(self):
        
        return sorted(list(self.constant_tuple_dict), key=lambda constant_tuple: constant_tuple.constant.id)
1242713
def reorder_indices(self, indices_order):
        ''
        # allow mixed index syntax like int
        indices_order, single = convert_index_to_keys(self.indices, indices_order)
        old_indices = force_list(self.indices.keys())

        if indices_order == old_indices: # no changes
            return

        if set(old_indices) != set(indices_order):
            raise KeyError('Keys in the new order do not match existing keys')

#        if len(old_indices) == 0: # already return since indices_order must equal to old_indices
#            return

        # must have more than 1 index to reorder
        new_idx = [old_indices.index(i) for i in indices_order]
        # reorder items
        items = [map(i.__getitem__, new_idx) for i in self.items()]
        self.clear(True)
        _MI_init(self, items, indices_order)
895325
def batchcancel_orders(self, order_ids: list, _async=False):
        
        assert isinstance(order_ids, list)
        params = {'order-ids': order_ids}
        path = f'/v1/order/orders/batchcancel'
        return api_key_post(params, path, _async=_async)
784336
def compare(self,
                reference_ids: Iterable,
                query_profiles: Iterable[Iterable],
                method: Optional) -> SimResult:
        
        pass