code: def set_tweights(self, tweights):
          r        
          for node, weight in list(tweights.items()):
              self.set_tweight(node, weight[0], weight[1])
docs: r"""
          Set multiple t-weights to the current collection of t-weights, overwriting
          already existing ones.
          
          Parameters
          ----------
          tweights : dict
              A dictionary with node_ids as keys and (weight-to-source, weight-to-sink) tuples as values.
          
          Raises
          ------
          ValueError
              If a passed node id does not refer to any node of the graph
              (i.e. it is either higher than the initially set number of
              nodes or lower than zero).        
          
          Notes
          -----
          Since this method overrides already existing t-weights, it is strongly
          recommended to run `set_source_nodes` and `set_sink_nodes` after the
          last call to this method.
          
          The weights for nodes directly connected to either the source or the sink
          are best set using `set_source_nodes` or `set_sink_nodes` to ensure
          consistency of their maximum values.