Tries to retrieve a sub-structure within some data. If the path does not
    match any sub-structure, returns None.

    >>> data = {'a': 5, 'b': {'c': [1, 2, [{'f': [57]}], 4], 'd': 'test'}}
    >>> get_substructure(island, "bc")
    [1, 2, [{'f': [57]}], 4]
    >>> get_substructure(island, ['b', 'c'])
    [1, 2, [{'f': [57]}], 4]
    >>> get_substructure(island, ['b', 'c', 2, 0, 'f', 0])
    57
    >>> get_substructure(island, ['b', 'c', 2, 0, 'f', 'd'])
    None

    @param data: a container
    @type data: str|dict|list|(an indexable container)

    @param path: location of the data
    @type path: list|str

    @rtype: *

def get_substructure(data, path):
    """
    Tries to retrieve a sub-structure within some data. If the path does not
    match any sub-structure, returns None.

    >>> data = {'a': 5, 'b': {'c': [1, 2, [{'f': [57]}], 4], 'd': 'test'}}
    >>> get_substructure(island, "bc")
    [1, 2, [{'f': [57]}], 4]
    >>> get_substructure(island, ['b', 'c'])
    [1, 2, [{'f': [57]}], 4]
    >>> get_substructure(island, ['b', 'c', 2, 0, 'f', 0])
    57
    >>> get_substructure(island, ['b', 'c', 2, 0, 'f', 'd'])
    None

    @param data: a container
    @type data: str|dict|list|(an indexable container)

    @param path: location of the data
    @type path: list|str

    @rtype: *
    """

    if not len(path):
        return data

    try:
        return get_substructure(data[path[0]], path[1:])
    except (TypeError, IndexError, KeyError):
        return None