From 13aefd989f6f08c536c67414ba5ee002ba9ebea2 Mon Sep 17 00:00:00 2001 From: jh-206 Date: Tue, 20 Aug 2024 16:06:17 -0600 Subject: [PATCH] Update utils.py add func for comparing lists --- fmda/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fmda/utils.py b/fmda/utils.py index 09c0645..787a781 100644 --- a/fmda/utils.py +++ b/fmda/utils.py @@ -9,6 +9,10 @@ import inspect import yaml import hashlib +# Function to check if lists are nested, or all elements in given list are in target list +def all_items_exist(source_list, target_list): + return all(item in target_list for item in source_list) + def read_yml(yaml_path, subkey=None): with open(yaml_path, 'r') as file: d = yaml.safe_load(file) -- 2.11.4.GIT