code: def read_tsv_graph(filename):
      r"""Reads the file `filename` containing graph edges in TSV format.
  
      Args:
        filename: Name of a TSV file specifying the edges of a graph. Each line of
          the input file should be the specification of a single graph edge in the
          form `source\<TAB\>target[\<TAB\>weight]`. If supplied, `weight` should
          be a floating point number; if not supplied, it defaults to 1.0. Multiple
          edges between the same source and target node IDs are combined by picking
          the edge with the largest weight.
  
      Returns:
        A graph represented as a `dict`: source -> (target -> weight).
      """
      start_time = time.time()
      logging.info("Reading graph file: %s...", filename)
      graph = {}
      edge_cnt = 0
      with open(filename, "r") as f:
          for tsv_line in f:
              edge = tsv_line.rstrip("\n").split("\t")
              if add_edge(graph, edge):
                  edge_cnt += 1
      logging.info(
          "Done reading %d edges from: %s (%.2f seconds).",
          edge_cnt,
          filename,
          (time.time() - start_time),
      )
      return graph
  
file_path: neural-structured-learning/neural_structured_learning/tools/graph_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import time
  from absl import logging
  import six
label_desc: Use image node_id 3 for calling a global function with example usage: read_tsv_graph(filename) and returns: graph