def get_user_by_username_or_email(username_or_email):
 if ('@' in username_or_email):
  return User.objects.get(email=username_or_email)
 else:
  return User.objects.get(username=username_or_email)

def get_user_by_username_or_email ( username_or_email ) : if ( '@' in username_or_email ) : return User . objects . get ( email = username_or_email ) else : return User . objects . get ( username = username_or_email )
return a user object .