code: def get_edge_colors_by_attr(G, attr, num_bins=5, cmap='viridis', start=0, stop=1, na_color='none'):
      
      if num_bins is None:
          num_bins=len(G.edges())
      bin_labels = range(num_bins)
      attr_values = pd.Series([data[attr] for u, v, key, data in G.edges(keys=True, data=True)])
      cats = pd.qcut(x=attr_values, q=num_bins, labels=bin_labels)
      colors = get_colors(num_bins, cmap, start, stop)
      edge_colors = [colors[int(cat)] if pd.notnull(cat) else na_color for cat in cats]
      return edge_colors
docs: Get a list of edge colors by binning some continuous-variable attribute into
      quantiles.
  
      Parameters
      ----------
      G : networkx multidigraph
      attr : string
          the name of the continuous-variable attribute
      num_bins : int
          how many quantiles
      cmap : string
          name of a colormap
      start : float
          where to start in the colorspace
      stop : float
          where to end in the colorspace
      na_color : string
          what color to assign nodes with null attribute values
  
      Returns
      -------
      list