parameters: (widget, a, edges)
return_statement: return frozenset(result)
docstring: Return a list of (edge, source, target) of edges that should not
      be displayed due to transitive reduction (also reflexive reduction).
docstring_summary: Return a list of (edge, source, target) of edges that should not
      be displayed due to transitive reduction (also reflexive reduction).
docstring_tokens: Return a list of ( edge source target ) of edges that should not be displayed due to transitive reduction ( also reflexive reduction ) .
function: def get_transitive_reduction(widget, a, edges):
      """
      Return a list of (edge, source, target) of edges that should not
      be displayed due to transitive reduction (also reflexive reduction).
      """
  
      # filter only all_to_all edges for which transitive reduction is turned on
      edges = [x for x in edges if
               widget.edge_display_checkboxes[x[0]]['transitive'].value and
               a[('edge_info', 'all_to_all') + x]]
  
      # first hide all self edges
      result = [x for x in edges if x[1] == x[2]]
      edges = [x for x in edges if x[1] != x[2]]
  
      by_source = defaultdict(list)
      for edge, source, target in edges:
          by_source[(edge, source)].append(target)
  
      for edge, x, y in edges:
          for z in by_source[(edge, y)]:
              result.append((edge, x, z))
  
      return frozenset(result)
function_tokens: def get_transitive_reduction ( widget , a , edges ) : # filter only all_to_all edges for which transitive reduction is turned on edges = [ x for x in edges if widget . edge_display_checkboxes [ x [ 0 ] ] [ 'transitive' ] . value and a [ ( 'edge_info' , 'all_to_all' ) + x ] ] # first hide all self edges result = [ x for x in edges if x [ 1 ] == x [ 2 ] ] edges = [ x for x in edges if x [ 1 ] != x [ 2 ] ] by_source = defaultdict ( list ) for edge , source , target in edges : by_source [ ( edge , source ) ] . append ( target ) for edge , x , y in edges : for z in by_source [ ( edge , y ) ] : result . append ( ( edge , x , z ) ) return frozenset ( result )