code: def paginator(context, adjacent_pages=2, template_name=None):
      
      tname, context = _do_paginator(context, adjacent_pages, template_name)
      return render_to_string(tname, context)
docs: Renders a ``inclusion_tags/paginator.html`` or ``inc/paginator.html``
      template with additional pagination context. To be used in conjunction
      with the ``object_list`` generic
      view.
  
      If ``TEMPLATE_NAME`` parameter is given,
      ``inclusion_tags/paginator_TEMPLATE_NAME.html`` or 
      ``inc/paginator_TEMPLATE_NAME.html`` will be used instead.
  
      Adds pagination context variables for use in displaying first, adjacent pages and
      last page links in addition to those created by the ``object_list`` generic
      view.
  
      Taken from http://www.djangosnippets.org/snippets/73/
  
      Syntax::
  
          {% paginator [NUMBER_OF_ADJACENT_PAGES] [TEMPLATE_NAME] %}
  
      Examples::
  
          {% paginator %}
          {% paginator 5 %}
          {% paginator 5 "special" %}
          # with Django 1.4 and above you can also do:
          {% paginator template_name="special" %}