Skip to content

Instantly share code, notes, and snippets.

@hskang9
Created June 29, 2020 20:48
Show Gist options
  • Save hskang9/e50a8d362edbc025ab79cc61374d4994 to your computer and use it in GitHub Desktop.
Save hskang9/e50a8d362edbc025ab79cc61374d4994 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import random
random.seed(1)
# Translators
members = ["Hyungsuk Kang", "Denise Kim", "ge su", "JHH"]
# Assignments board
assignments = {}
# put translators as key
for i in members:
assignments[i] = []
# required pages to translate
pages = ["apps", "apps-config", "apps-routing", "page-accounts", "page-claims", "page-contracts", "page-council", "page-democracy", "page-explorer", "page-extrinsics", "page-generic-asset", "page-js", "page-parachains", "page-settings", "page-society", "page-staking", "page-storage", "page-sudo", "page-tech-comm", "page-toolbox", "page-treasury", "react-components", "react-params", "react-query", "react-signer"]
quota = len(pages)//len(members)+1
for page in pages:
# assign pages to ones who have not assigned more than or equal to quota
while(True):
role = random.randint(0,3)
mem = members[role]
if len(assignments[mem]) < quota:
assignments[mem].append(page)
break
# print result
print(assignments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment