docs: def read_adjacency_matrix(file_path, separator, undirected):
      """
      Reads an edge list in csv format and returns the adjacency matrix in SciPy Sparse COOrdinate format.
  
      Inputs:  - file_path: The path where the adjacency matrix is stored.
               - separator: The delimiter among values (e.g. ",", "\t", " ")
               - undirected: If True, create the reciprocal edge for each edge in edge list.
  
      Outputs: - adjacency_matrix: The adjacency matrix in SciPy Sparse COOrdinate format.
               - node_to_id: A dictionary that maps anonymized node ids to the original node ids.
      """
      # Open file
      file_row_generator = get_file_row_generator(file_path, separator)
  
      # Initialize lists for row and column sparse matrix arguments.
      row = list()
      col = list()
      data = list()
      append_row = row.append
      append_col = col.append
      append_data = data.append
  
      # Initialize node anonymizer.
      id_to_node = dict()
  
      # Read all file rows.
      for file_row in file_row_generator:
          if file_row[0][0] == "#":
              continue
  
          source_node_id = int(file_row[0])
          target_node_id = int(file_row[1])
  
          number_of_nodes = len(id_to_node)
          source_node = id_to_node.setdefault(source_node_id,
                                              number_of_nodes)
          number_of_nodes = len(id_to_node)
          target_node = id_to_node.setdefault(target_node_id,
                                              number_of_nodes)
  
          edge_weight = float(file_row[2])
  
          # Add edge.
          append_row(source_node)
          append_col(target_node)
          append_data(edge_weight)
  
          # Since this is an undirected network also add the reciprocal edge.
          if undirected:
              if source_node != target_node:
                  append_row(target_node)
                  append_col(source_node)
                  append_data(edge_weight)
  
      number_of_nodes = len(id_to_node)
      node_to_id = dict(zip(list(id_to_node.values()),
                            list(id_to_node.keys())))
  
      row = np.array(row, dtype=np.int64)
      col = np.array(col, dtype=np.int64)
      data = np.array(data, dtype=np.float64)
  
      # Form sparse adjacency matrix.
      adjacency_matrix = spsp.coo_matrix((data, (row, col)), shape=(number_of_nodes,
                                                                    number_of_nodes))
  
      return adjacency_matrix, node_to_id