def get_next_entry(self, method, info, request):

        if method not in self.current_entries:
            self.current_entries[method] = 0

        # restrict selection to entries that match the requested
        # method
        entries_for_method = [e for e in self.entries if e.method == method]

        if self.current_entries[method] >= len(entries_for_method):
            self.current_entries[method] = -1

        if not self.entries or not entries_for_method:
            raise ValueError('I have no entries for method %s: %s'
                             % (method, self))

        entry = entries_for_method[self.current_entries[method]]
        if self.current_entries[method] != -1:
            self.current_entries[method] += 1

        # Attach more info to the entry
        # So the callback can be more clever about what to do
        # This does also fix the case where the callback
        # would be handed a compiled regex as uri instead of the
        # real uri
        entry.info = info
        entry.request = request
        return entry
Find an item by key
dataset/ETHPy150Open gabrielfalcao/HTTPretty/httpretty/core.py/URIMatcher.get_next_entry--crossover with--dataset/ETHPy150Open christabor/MoAL/MOAL/data_structures/trees/splay_trees.py/SplayTree.find