Skip to content

Instantly share code, notes, and snippets.

View diogoffmelo's full-sized avatar

Diogo Felipe Felix de Melo diogoffmelo

View GitHub Profile
from collections import defaultdict, OrderedDict
import luigi
from luigi.task import flatten, getpaths
def topological_sorting(struct, outnodes_funct, transform_funct):
struct = flatten(struct.keys()) if isinstance(struct, dict) else flatten(struct)
visited = OrderedDict()
def dvisit(root):