Created
September 25, 2022 23:03
-
-
Save amirziai/dfff50d8c06226ac744089851d72f2b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 alloc( | |
ch: ConsistentHashingWithTokens, | |
) -> pd.Series: | |
return pd.Series( | |
ch.key_lookup(url) | |
for url in urls | |
).value_counts(normalize=True) | |
ch = ConsistentHashingWithTokens({'a': 100, 'b': 400, 'c': 500}) | |
alloc(ch=ch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment