def _is_valid(report):
    """
    checks if this meets the preconditions for being allowed in the cache
    """
    try:
        return (
            report.request.domain
            and report.request.couch_user._id
            and report.request.get_full_path().startswith(
                '/a/{domain}/'.format(domain=report.request.domain)
            )
        )
    except __HOLE__:
        return False
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/reports/cache.py/_is_valid