'Pop an item from the dict.'

def popitem(self):

    try:
        item = dict.popitem(self)
        if (len(item[1]) == 0):
            raise exceptions.BadRequestKeyError()
        return (item[0], item[1][0])
    except KeyError as e:
        raise exceptions.BadRequestKeyError(str(e))
