@view_config(context=APIResource, name='fetch', renderer='json',
             permission=NO_PERMISSION_REQUIRED)
@argify(wheel=bool, prerelease=bool)
def fetch_requirements(request, requirements, wheel=True, prerelease=False):
    """
    Fetch packages from the fallback_url

    Parameters
    ----------
    requirements : str
        Requirements in the requirements.txt format (with newlines)
    wheel : bool, optional
        If True, will prefer wheels (default True)
    prerelease : bool, optional
        If True, will allow prerelease versions (default False)

    Returns
    -------
    pkgs : list
        List of Package objects

    """
    if not request.access.can_update_cache():
        return HTTPForbidden()
    packages = []
    for line in requirements.splitlines():
        dist = request.locator.locate(line, prerelease, wheel)
        if dist is not None:
            try:
                packages.append(fetch_dist(request, dist.name, dist.source_url)[0])
            except __HOLE__:
                pass
    return {
        'pkgs': packages,
    }
dataset/ETHPy150Open mathcamp/pypicloud/pypicloud/views/api.py/fetch_requirements