nodes: 0, module; 1, function_definition; 2, function_name:_sort_r; 3, parameters; 4, block; 5, identifier:sorted; 6, identifier:processed; 7, identifier:key; 8, identifier:deps; 9, identifier:dependency_tree; 10, expression_statement; 11, if_statement; 12, expression_statement; 13, for_statement; 14, expression_statement; 15, comment:"""Recursive topological sort implementation."""; 16, comparison_operator:key in processed; 17, block; 18, call; 19, identifier:dep_key; 20, identifier:deps; 21, block; 22, call; 23, identifier:key; 24, identifier:processed; 25, return_statement; 26, attribute; 27, argument_list; 28, expression_statement; 29, if_statement; 30, expression_statement; 31, attribute; 32, argument_list; 33, identifier:processed; 34, identifier:add; 35, identifier:key; 36, assignment; 37, comparison_operator:dep_deps is None; 38, block; 39, call; 40, identifier:sorted; 41, identifier:append; 42, tuple; 43, identifier:dep_deps; 44, call; 45, identifier:dep_deps; 46, None; 47, expression_statement; 48, continue_statement; 49, identifier:_sort_r; 50, argument_list; 51, identifier:key; 52, identifier:deps; 53, attribute; 54, argument_list; 55, call; 56, identifier:sorted; 57, identifier:processed; 58, identifier:dep_key; 59, identifier:dep_deps; 60, identifier:dependency_tree; 61, identifier:dependency_tree; 62, identifier:get; 63, identifier:dep_key; 64, attribute; 65, argument_list; 66, identifier:log; 67, identifier:debug; 68, string:'"%s" not found, skipped'; 69, call; 70, identifier:Repr; 71, argument_list; 72, identifier:dep_key
code: def _sort_r(sorted, processed, key, deps, dependency_tree):
      """Recursive topological sort implementation."""
      if key in processed:
          return
      processed.add(key)
      for dep_key in deps:
          dep_deps = dependency_tree.get(dep_key)
          if dep_deps is None:
              log.debug('"%s" not found, skipped', Repr(dep_key))
              continue
          _sort_r(sorted, processed, dep_key, dep_deps, dependency_tree)
      sorted.append((key, deps))