def get_substructure(data, path):
if not len(path):<EOL><INDENT>return data<EOL><DEDENT>try:<EOL><INDENT>return get_substructure(data[path[<NUM_LIT:0>]], path[<NUM_LIT:1>:])<EOL><DEDENT>except (TypeError, IndexError, KeyError):<EOL><INDENT>return None<EOL><DEDENT>
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: *