def lookup(data, *args):
    """Return result of sequence of lookups on data."""
    for arg in args:
        if isinstance(arg, int):
            data = data[arg]
        elif isinstance(arg, str):
            data = data[arg]
        elif isinstance(arg, tuple):
            key, value = arg
            for item in data:
                if item[key] == value:
                    data = item
                    break
            else:
                raise LookupError
    return data
