def _get_username(user):
    if hasattr(user, 'get_username'):  # custom user, django 1.5+
        return user.get_username()
    elif hasattr(user, 'username'):    # standard User
        return user.username
    else:                              # assume user is just an username
        return user
Test finding any nodes named gar and getting their text contents.
dataset/ETHPy150Open django-webtest/django-webtest/django_webtest/__init__.py/_get_username--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/words/test/test_xpath.py/XPathTest.test_anyLocationAndText