code: def do_user_display(parser, token):
      
      bits = token.split_contents()
      if len(bits) == 2:
          user = bits[1]
          as_var = None
      elif len(bits) == 4:
          user = bits[1]
          as_var = bits[3]
      else:
          raise template.TemplateSyntaxError("'{0}' takes either two or four arguments".format(bits[0]))
      return UserDisplayNode(user, as_var)
docs: Example usage::
  
          {% user_display user %}
  
      or if you need to use in a {% blocktrans %}::
  
          {% user_display user as user_display}
          {% blocktrans %}{{ user_display }} has sent you a gift.{% endblocktrans %}