def get_nickname(email, never_me=False, request=None):
  if isinstance(email, users.User):
    email = email.email()
  if not never_me:
    if request is not None:
      user = request.user
    else:
      user = auth_utils.get_current_user()
    if user is not None and email == user.email():
      return 'me'

  if request is None:
    return models.Account.get_nickname_for_email(email)

  # _nicknames is injected into request as a cache.
  # TODO(maruel): Use memcache instead.
  # Access to a protected member _nicknames of a client class
  # pylint: disable=W0212
  if getattr(request, '_nicknames', None) is None:
    request._nicknames = {}
  if email in request._nicknames:
    return request._nicknames[email]
  result = models.Account.get_nickname_for_email(email)
  request._nicknames[email] = result
  return result
Return a nickname for an email address.
dataset/ETHPy150Open rietveld-codereview/rietveld/codereview/library.py/get_nickname