def create_bystandards_dict(components_path):
    """ Open component files and organize them by the standards/controls
    each satisfies """
    bystandards_dict = dict()
    for component_dict in utils.yaml_gen_loader(components_path):
        convert_to_bystandards(
            component_dict=component_dict, bystandards_dict=bystandards_dict)
    return bystandards_dict
def build_certifications(certifications_path, components, standards):
    """ Merges the components and standards data with the certification
    data """
    for certification in utils.yaml_gen_loader(certifications_path):
        for standard in sorted(certification['standards']):
            for control in sorted(certification['standards'][standard]):
                # Create a reference to the certification control
                certification['standards'][standard][control] = dict()
                merge_components(certification, components, standard, control)
                merge_standard(certification, standards, standard, control)
        yield certification['name'], certification
def create_standards_dic(standards_path):
    """ Create a standards dictionary for later merging with the
    certifications documentation """
    return {
        standard['name']: standard for standard in utils.yaml_gen_loader(standards_path)
    }