def _get_username(user):
 if hasattr(user, 'get_username'):
  return user.get_username()
 elif hasattr(user, 'username'):
  return user.username
 else:
  return user

def _get_username ( user ) : if hasattr ( user , 'get_username' ) : return user . get_username ( ) elif hasattr ( user , 'username' ) : return user . username else : return user
retrieves the mattermosts configured username :return: string: the username string .