def get_username(identifier):
    pattern = re.compile('.+@\w+\..+')
    if pattern.match(identifier):
        try:
            user = User.objects.get(email=identifier)
        except:
            raise Http404
        else:
            return user.username
    else:
        return identifier
Is the current thread holding the lock exclusively at this time?
dataset/ETHPy150Open bitmazk/django-libs/django_libs/decorators.py/get_username--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/locking.py/SharedLock.__is_exclusive