def _is_valid(report):
    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 AttributeError:
        return False
Transform a datetime value to an object compatible with what is expected
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/reports/cache.py/_is_valid--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/db/backends/__init__.py/BaseDatabaseOperations.value_to_db_datetime