Created
September 9, 2021 05:40
-
-
Save GenevieveBuckley/50ebb0a584aac19f5e283d28e6d4a615 to your computer and use it in GitHub Desktop.
Mater Dask keys, ignoring token strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def match_key(key, keylist): | |
# key to match | |
key = list(key) | |
key[0] = key[0].rsplit('-', 1)[0] # remove token | |
# search for matches | |
for k in keylist: | |
temp = list(k) | |
temp[0] = temp[0].rsplit('-', 1)[0] # remove token | |
if temp == key: | |
return tuple(k) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment