timor.utilities.asset_handling ============================== .. py:module:: timor.utilities.asset_handling Functions --------- .. autoapisummary:: timor.utilities.asset_handling.find_key timor.utilities.asset_handling.handle_assets Module Contents --------------- .. py:function:: find_key(key, data, modifier = None, search_depth = 20) Find all appearances of key in a nested dict / sequence combination and return references to each. :param key: The key to search for. :param data: The data to search in. :param modifier: An optional modifier function to apply to each found data. :param search_depth: The maximum depth to search in. :return: A tuple of lists of all found values with matching key before and after the applied modifier. :note: Based on https://stackoverflow.com/questions/9807634/find-all-occurrences-of-a-key-in-nested-dictionaries-and-lists .. py:function:: handle_assets(new_files, old_files, handle_missing_assets = DEFAULT_ASSETS_COPY_BEHAVIOR) Check if all old_files exist as new_files and resolve missing according to handle_missing_assets. :param new_files: The list of files at the new location. :param old_files: The list of files at the old location. :param handle_missing_assets: How to handle missing assets at save_at location. * "warning": Warn if missing. * "error": Raise FileNotFoundError if missing. * "ignore": Ignore missing. * "copy": Copy missing from old to new location. * "symlink": Symlink missing from old to new location.