From 20dbeb2f38684c65ff0a4b99012c161295708e88 Mon Sep 17 00:00:00 2001 From: AL-LCL Date: Fri, 19 May 2023 11:01:49 +0200 Subject: NeoRAT --- domestic/utility/validate_dict_key.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 domestic/utility/validate_dict_key.py (limited to 'domestic/utility/validate_dict_key.py') diff --git a/domestic/utility/validate_dict_key.py b/domestic/utility/validate_dict_key.py new file mode 100644 index 0000000..18e246b --- /dev/null +++ b/domestic/utility/validate_dict_key.py @@ -0,0 +1,10 @@ +def validate_dict_key(dictionary, key, lower=True): + try: + if lower: + return dictionary[key].lower() + else: + return dictionary[key] + except KeyError: + return None + except: + return dictionary[key] \ No newline at end of file -- cgit v1.2.3