code: def compute_pmf(fsamps, y, **kwargs):
      
      parallel = kwargs.pop('parallel', False)
      cache = kwargs.pop('cache', '')
      tqdm_kwargs = kwargs.pop('tqdm_kwargs', {})
      if kwargs:
          raise TypeError('Unexpected **kwargs: %r' % kwargs)
  
      if cache:
          cache = Cache(cache + '_masses')
          try:
              return cache.check(fsamps, y)
          except CacheException as e:
              print(e)
  
      masses = parallel_apply(PMF, fsamps, postcurry=(y,), parallel=parallel,
                              tqdm_kwargs=tqdm_kwargs)
      masses = numpy.array(masses).transpose().copy()
  
      if cache:
          cache.save(fsamps, y, masses)
  
      return masses
docs: Compute the pmf defined by fsamps at each x for each y.
  
      Parameters
      ----------
      fsamps: 2D array-like
          array of function samples, as returned by
          :func:`fgivenx.compute_samples`
  
      y: 1D array-like
          y values to evaluate the PMF at
  
      parallel, tqdm_kwargs: optional
          see docstring for :func:`fgivenx.parallel.parallel_apply`.
  
      Returns
      -------
      2D numpy.array
          probability mass function at each x for each y
          `shape=(len(fsamps),len(y)`