(data_sources, output_directory="generated_content")
write a CSV linking techniques to the data sources that can potentially detect those techniques.

    arguments:
        data_sources: string[] of datasource names. The output will be filtered according to this list.
        output_directory: string. The folder the output data will be written to. The folder will be created if it doesn't already exist.
write a CSV linking techniques to the data sources that can potentially detect those techniques.
write a CSV linking techniques to the data sources that can potentially detect those techniques .
def write_techniquesToDatasources(data_sources, output_directory="generated_content"):
    """write a CSV linking techniques to the data sources that can potentially detect those techniques.

    arguments:
        data_sources: string[] of datasource names. The output will be filtered according to this list.
        output_directory: string. The folder the output data will be written to. The folder will be created if it doesn't already exist.
    """

    output_file = os.path.join(output_directory, "techniques_datasources.csv")
    # make sure the directory exists
    if not os.path.exists(output_directory):
        os.makedirs(output_directory)
    with open (output_file, "w") as output_file:
        # Write the header of the CSV
        output_file.write("technique,data source\n")
        for tech in tech_to_data:
            for data in tech_to_data[tech]:
                if data.lower() in data_sources:
                    output_file.write(tech.lower() + "," + data.lower() + "\n")
def write_techniquesToDatasources ( data_sources , output_directory = "generated_content" ) : output_file = os . path . join ( output_directory , "techniques_datasources.csv" ) # make sure the directory exists if not os . path . exists ( output_directory ) : os . makedirs ( output_directory ) with open ( output_file , "w" ) as output_file : # Write the header of the CSV output_file . write ( "technique,data source\n" ) for tech in tech_to_data : for data in tech_to_data [ tech ] : if data . lower ( ) in data_sources : output_file . write ( tech . lower ( ) + "," + data . lower ( ) + "\n" )