Skip to content

Instantly share code, notes, and snippets.

@GenevieveBuckley
Created September 9, 2021 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GenevieveBuckley/50ebb0a584aac19f5e283d28e6d4a615 to your computer and use it in GitHub Desktop.
Save GenevieveBuckley/50ebb0a584aac19f5e283d28e6d4a615 to your computer and use it in GitHub Desktop.
Mater Dask keys, ignoring token strings
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