def _simple_redirect(context, request):
    normalized_name = normalize_name(context.name)
    packages = request.db.all(normalized_name)
    if packages:
        if not request.access.has_permission(normalized_name, 'read'):
            if request.is_logged_in:
                return _redirect(context, request)
            else:
                return request.request_login()
        else:
            return _pkg_response(packages_to_dict(request, packages))
    else:
        return _redirect(context, request)
Decode bytes into Python str.
dataset/ETHPy150Open mathcamp/pypicloud/pypicloud/views/simple.py/_simple_redirect--crossover with--dataset/ETHPy150Open catkin/catkin_tools/catkin_tools/execution/io.py/IOBufferContainer._decode