docs: def log_likelihood_network(
          digraph, traffic_in, traffic_out, params, weight=None):
      """
      Compute the log-likelihood of model parameters.
  
      If ``weight`` is not ``None``, the log-likelihood is correct only up to a
      constant (independent of the parameters).
      """
      loglik = 0
      for i in range(len(traffic_in)):
          loglik += traffic_in[i] * params[i]
          if digraph.out_degree(i) > 0:
              neighbors = list(digraph.successors(i))
              if weight is None:
                  loglik -= traffic_out[i] * logsumexp(params.take(neighbors))
              else:
                  weights = [digraph[i][j][weight] for j in neighbors]
                  loglik -= traffic_out[i] * logsumexp(
                          params.take(neighbors), b=weights)
      return loglik