(profile_filename, data)
Update `data` in-place with the contents of base profile files listed in the 'extends' section.

    Base profiles should be referenced by filename, which can be relative (built-in profile)
    or absolute (custom profile).

    Raises:
    * Exception: if any definition file referred in the 'extends' section was not found or is malformed.
Update `data` in-place with the contents of base profile files listed in the 'extends' section.
Update data in - place with the contents of base profile files listed in the extends section .
def _recursively_expand_profile(profile_filename, data):
    """
    Update `data` in-place with the contents of base profile files listed in the 'extends' section.

    Base profiles should be referenced by filename, which can be relative (built-in profile)
    or absolute (custom profile).

    Raises:
    * Exception: if any definition file referred in the 'extends' section was not found or is malformed.
    """

    expanded_data = _load_profile_from_yaml(profile_filename)
    expanded_metrics = expanded_data.get('metrics', [])
    existing_metrics = data.get('metrics', [])

    data['metrics'] = expanded_metrics + existing_metrics  # NOTE: expanded metrics must be added first.

    extends = expanded_data.get('extends', [])

    for base_filename in extends:
        _recursively_expand_profile(base_filename, data)
def _recursively_expand_profile ( profile_filename , data ) : expanded_data = _load_profile_from_yaml ( profile_filename ) expanded_metrics = expanded_data . get ( 'metrics' , [ ] ) existing_metrics = data . get ( 'metrics' , [ ] ) data [ 'metrics' ] = expanded_metrics + existing_metrics # NOTE: expanded metrics must be added first. extends = expanded_data . get ( 'extends' , [ ] ) for base_filename in extends : _recursively_expand_profile ( base_filename , data )