[docs]defcheck_config_dict(config_dict:dict,keys:list,object_name:str):""" Function to check if config dictionaries contain a mistake. I.e., it checks if certain keys are contained in the dict and warns the user if some are missing. Is used to prevent accidental misconfigurations. :param config_dict: The config dict to be checked :param keys: A list with the keys in config_dict that should be checked :param object_name: The name of the object in which the check is done. Is used for the print statement """forkinkeys:ifknotinconfig_dict:print(f"ATTENTION: {k} was not found in a config dict for {object_name}.")answer=input("Was this intentional? Enter 'Yes' or 'y' to continue.... ")ifanswer=="Yes"oranswer=="y"oranswer=="Y":continueelse:print("Exiting program...")sys.exit(1)print(f"Checked a config dict of {object_name} for {keys}. No issues were found.")
[docs]definfo(text):""" Puts "INFO: " in front of a text. :param text: The text to which "INFO: " should be added. """print(f"INFO: {text}")