code: def _init_filters(self):
          
          self.filters = {}
  
          @self.template_filter()
          def format_ts(value, format_='%a, %b %d %Y %H:%M:%S'):
              """Formats the supplied timestamp using format_
  
              :param str value: The timestamp to be formatted
              :param str format_:  The format string
              :return: The correctly formatted timestamp as determined by format_
              :rtype: str
              """
              if format_ == '%s':
                  return timestamp_to_sec(value)
              else:
                  value = timestamp_to_datetime(value)
                  return value.strftime(format_)
  
          @self.template_filter('urlsplit')
          def get_urlsplit(url):
              """Splits the supplied URL
  
              :param str url: The url to be split
              :return: The split url
              :rtype: urllib.parse.SplitResult
              """
              split = urlsplit(url)
              return split
  
          @self.template_filter()
          def tojson(obj):
              """Converts the supplied object/array/any to a JSON string if it can be JSONified
  
              :param any obj: The value to be converted to a JSON string
              :return: The JSON string representation of the supplied value
              :rtype: str
              """
              return json.dumps(obj)
  
          @self.template_filter()
          def tobool(bool_val):
              """Converts a python boolean to a JS "true" or "false" string
              :param any obj: A value to be evaluated as a boolean
              :return: The string "true" or "false" to be inserted into JS
              """
  
              return 'true' if bool_val else 'false'
docs: Initialize the default pywb provided Jninja filters available during template rendering