def get_current_user():
    req = get_current_request()

    if req:
        return getattr(req, 'user', None)
Just like self.assert_(a in b), but with a nicer default message.
dataset/ETHPy150Open scieloorg/scielo-manager/scielomanager/scielomanager/utils/middlewares/threadlocal.py/get_current_user--crossover with--dataset/ETHPy150Open baz/app-sales-machine/lib/graphy/graphy_test.py/GraphyTest.assertIn