def previous_key(tuple_of_tuples, key):
    """Processes a tuple of 2-element tuples and returns the key which comes
    before the given key.
    """
    for i, t in enumerate(tuple_of_tuples):
        if t[0] == key:
            try:
                return tuple_of_tuples[i - 1][0]
            except __HOLE__:
                return None
dataset/ETHPy150Open CiscoSystems/avos/horizon/utils/functions.py/previous_key