Skip to content

Instantly share code, notes, and snippets.

@berdario
Created April 21, 2015 12:07
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 berdario/eba432153633777f5811 to your computer and use it in GitHub Desktop.
Save berdario/eba432153633777f5811 to your computer and use it in GitHub Desktop.
>>> raw_assessments = [('sslyze', ('ssl', 'infra')), ('nmap common', ('infra', ))]
>>> from collections import defaultdict
>>> types = defaultdict(set)
>>> for (name, _types) in raw_assessments:
... for t in _types:
... types[t].add(name)
...
>>> types
defaultdict(<class 'set'>, {'ssl': {'sslyze'}, 'infra': {'sslyze', 'nmap common'}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment