
"""Jinja2 extensions."""

import json

from jinja2.ext import Extension


class JsonifyExtension(Extension):
    """Jinja2 extension to convert a python object to json."""

    def __init__(self, environment):
        """Initilize extension with given environment."""
        super(JsonifyExtension, self).__init__(environment)

        def jsonify(obj):
            return json.dumps(obj, sort_keys=True, indent=4)

        environment.filters['jsonify'] = jsonify


"""Jinja2 extensions."""

import json

from jinja2.ext import Extension


class JsonifyExtension(Extension):
    """Jinja2 extension to convert a Python object to JSON."""

    def __init__(self, environment):
        """Initialize the extension with the given environment."""
        super(JsonifyExtension, self).__init__(environment)

        def jsonify(obj):
            return json.dumps(obj, sort_keys=True, indent=4)

        environment.filters['jsonify'] = jsonify

Fix typo and improve grammar in doc string
Fix typo and improve grammar in doc string

  
  """Jinja2 extensions."""
  
  import json
  
  from jinja2.ext import Extension
  
  
  class JsonifyExtension(Extension):
-     """Jinja2 extension to convert a python object to json."""
+     """Jinja2 extension to convert a Python object to JSON."""
  
      def __init__(self, environment):
-         """Initilize extension with given environment."""
+         """Initialize the extension with the given environment."""
          super(JsonifyExtension, self).__init__(environment)
  
          def jsonify(obj):
              return json.dumps(obj, sort_keys=True, indent=4)
  
          environment.filters['jsonify'] = jsonify
  
Fix typo and improve grammar in doc string
## Code Before:

"""Jinja2 extensions."""

import json

from jinja2.ext import Extension


class JsonifyExtension(Extension):
    """Jinja2 extension to convert a python object to json."""

    def __init__(self, environment):
        """Initilize extension with given environment."""
        super(JsonifyExtension, self).__init__(environment)

        def jsonify(obj):
            return json.dumps(obj, sort_keys=True, indent=4)

        environment.filters['jsonify'] = jsonify

## Instruction:
Fix typo and improve grammar in doc string
## Code After:

"""Jinja2 extensions."""

import json

from jinja2.ext import Extension


class JsonifyExtension(Extension):
    """Jinja2 extension to convert a Python object to JSON."""

    def __init__(self, environment):
        """Initialize the extension with the given environment."""
        super(JsonifyExtension, self).__init__(environment)

        def jsonify(obj):
            return json.dumps(obj, sort_keys=True, indent=4)

        environment.filters['jsonify'] = jsonify
