code: def simple_topsort(inputs):
      if len(inputs) == 0:
          return []
      outputs = {k: [] for k in inputs}
      for k in inputs:
          for o in inputs[k]:
              outputs[o].append(k)
  
      inedge_count = {k: len(v) for k, v in inputs.items()}
      ret = []
      curboundary = [k for k, v in inedge_count.items() if v == 0]
      nextboundary = []
      if len(curboundary) == 0:
          raise ValueError("Graph is not a DAG!")
  
      while len(curboundary) > 0:
          ret.extend(curboundary)
          for b in curboundary:
              for o in outputs[b]:
                  inedge_count[o] -= 1
                  if inedge_count[o] == 0:
                      nextboundary.append(o)
          curboundary = nextboundary
          nextboundary = []
      if len(ret) != len(inputs):
          raise ValueError("Graph is not a DAG!")
      return ret
  
label_desc: Use image node_id 21 for calling a global function with example usage: simple_topsort(inputs) and returns: ret, list