docs: def generate_rankings(params, n_rankings, size=3):
      """Generate rankings according to a Plackett--Luce model.
  
      This function samples subsets of items (of size ``size``) independently and
      uniformly at random, and samples the correspoding partial ranking from a
      Plackett--Luce model parametrized by ``params``.
  
      Parameters
      ----------
      params : array_like
          Model parameters.
      n_rankings : int
          Number of rankings to generate.
      size : int, optional
          Number of items to include in each ranking.
  
      Returns
      -------
      data : list of numpy.ndarray
          A list of (partial) rankings generated according to a Plackett--Luce
          model with the specified model parameters.
      """
      n = len(params)
      items = tuple(range(n))
      params = np.asarray(params)
      data = list()
      for _ in range(n_rankings):
          # Pick the alternatives uniformly at random.
          alts = random.sample(items, size)
          ranking = compare(alts, params, rank=True)
          data.append(ranking)
      return tuple(data)