def extract_inner_value(source, attr_chain):
    """
    Search for a stored value by recursing through dict keys and attributes.
    Erroneous/missing keys/attribute names will return None.

    :param source: The original object, that either has attributes or is itself a dict.
    :param attr_chain: A tuple of properly ordered strings,
                       containing the attributes and/or keys to successively obtain.
    :type attr_chain: tuple

    >>> mydict = {"foo": {"bar": {"thing": 25}}}
    >>> extract_inner_value(mydict, ("foo", "bar", "thing"))
    25
    >>> extract_inner_value(mydict, ("foo", "bar", "unthing"))
    >>> bool(extract_inner_value(mydict, ("__getitem__",)))
    True
    >>> bool(extract_inner_value(mydict, ("__getotem__",)))
    False
    """
    cur_element = source
    for attr in attr_chain:
        if hasattr(cur_element, '__getitem__'):
            try:
                cur_element = cur_element[attr]
                continue
            except (KeyError, TypeError):
                pass
        cur_element = getattr(cur_element, attr, None)
        if cur_element is None:
            return None
    return cur_element
