def dict_get_path(data, path, default=None):
keys = path.split("<STR_LIT:.>")<EOL>for k in keys:<EOL><INDENT>if type(data) == list:<EOL><INDENT>found = False<EOL>for item in data:<EOL><INDENT>name = item.get("<STR_LIT:name>", item.get("<STR_LIT:type>"))<EOL>if name == k:<EOL><INDENT>found = True<EOL>data = item<EOL>break<EOL><DEDENT><DEDENT>if not found:<EOL><INDENT>return default<EOL><DEDENT><DEDENT>elif type(data) == dict:<EOL><INDENT>if k in data:<EOL><INDENT>data = data[k]<EOL><DEDENT>else:<EOL><INDENT>return default<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return default<EOL><DEDENT><DEDENT>return data<EOL>
Returns the value inside nested structure of data located
at period delimited path

When traversing a list, as long as that list is containing objects of
type dict, items in that list will have their "name" and "type" values
tested against the current key in the path.

Args:
    data (dict or list): data to traverse
    path (str): '.' delimited string

Kwargs:
    default: value to return if path does not exist