def find_in_dict(data, keys):
    """
    Finds the value in a potentially nested dictionary by a key or set of
    nested keys.

    Parameters:
    ----------
    data: :obj:`dict`
        The dictionary for which we want to find the value indexed by the
        potentially nested keys.
    keys: :obj:`list`, :obj:`tuple`, :obj:`str`
        Either an iterable of nested keys or a single key for which we want
        to locate the associated value in the dictionary for.

    Example:
    -------
    >>> data = {'foo': {'bar': 'banana'}}
    >>> find_in_dict(data, 'foo')
    >>> {'bar': 'banana'}
    >>> find_in_dict(data, ['foo', 'bar'])
    >>> 'banana'
    """
    if hasattr(keys, '__iter__') and not isinstance(keys, str):
        if len(keys) == 1:
            return data[keys[0]]
        current = data[keys[0]]
        for key in keys[1:]:
            current = current[key]
        return current
    return data[keys]