Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paigeadelethompson/5753fa21153161c25ff96055995a2314 to your computer and use it in GitHub Desktop.
Save paigeadelethompson/5753fa21153161c25ff96055995a2314 to your computer and use it in GitHub Desktop.
distinct_networks = [index for index, _ in groupby([
index for index in dotenv.keys()
if index.endswith("_NET_4")
or index.endswith("_NET_6")],
key=lambda k: re.match("^[^_]+(?=_)", k).group())]
net_zip = zip(
[index for index in range(128, 128 + (len(distinct_networks) * 2)) if index % 2 == 0],
[index for index in range(128, 128 + (len(distinct_networks) * 2)) if index % 2 != 0],
distinct_networks)
log.debug(net_zip)
for red, blue, index in net_zip:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment