<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_pmf(fsamps, y, **kwargs):
 """ 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)` """

    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