def get_via_name_list(src, name_parts):
if len(name_parts) > <NUM_LIT:1>:<EOL><INDENT>for part in name_parts[:-<NUM_LIT:1>]:<EOL><INDENT>if part not in src:<EOL><INDENT>return None<EOL><DEDENT>src = src[part]<EOL><DEDENT><DEDENT>return src.get(name_parts[-<NUM_LIT:1>])<EOL>
Util to get name sequence from a dict. For instance, `("location","query")`
would return src["location"]["query"].