def _get_yaml_config(substructure, config=None):
if config is None:<EOL><INDENT>config = _load_config_from_yaml()<EOL><DEDENT>try:<EOL><INDENT>return _extract_substructure(config, substructure)<EOL><DEDENT>except MissingConfigError as e:<EOL><INDENT>yaml.add_representer(<EOL>_Optional,<EOL>lambda d, x: d.represent_scalar(u'<STR_LIT>', repr(x)))<EOL>print (<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>e.message,<EOL>yaml.dump(substructure, default_flow_style=False)))<EOL>raise unittest.SkipTest()<EOL><DEDENT>
Extract the keys from the config in substructure, which may be a nested
dictionary.

Raises a ``unittest.SkipTest`` if the substructure is not found in the
configuration.

This can be used to load credentials all at once for testing purposes.