code: def format_item(item, py=True):
      
      # for non python format, just output itself.
      # so the result is `something` instead of `"something"`
      if not py:
          return unicode(item)
  
      if isinstance(item, (str, unicode)):
          # long int is prefixed by a #
          if item.startswith('#'):
              return unicode(long(item[1:]))
          return u'"{0}"'.format(item)
  
      return unicode(item)
docs: :param py: python format or not