from __future__ import absolute_import  # Python 2 only

from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from wagtail.wagtailcore.templatetags import wagtailcore_tags
from wagtail.wagtailadmin.templatetags import wagtailuserbar

from jinja2 import Environment
from compressor.contrib.jinja2ext import CompressorExtension


def environment(**options):
    options.setdefault('extensions', []).append(CompressorExtension)
    env = Environment(**options)
    env.globals.update({
        'static': staticfiles_storage.url,
        'reverse': reverse,
        'wagtailuserbar': wagtailuserbar.wagtailuserbar
    })
    env.filters.update({
        'slugify': slugify,
        'richtext': wagtailcore_tags.richtext
    })
    return env

from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from wagtail.wagtailcore.templatetags import wagtailcore_tags
from wagtail.wagtailadmin.templatetags import wagtailuserbar

from jinja2 import Environment
from compressor.contrib.jinja2ext import CompressorExtension


def environment(**options):
    options.setdefault('extensions', []).append(CompressorExtension)
    env = Environment(**options)
    env.globals.update({
        'static': staticfiles_storage.url,
        'reverse': reverse,
        'wagtailuserbar': wagtailuserbar.wagtailuserbar
    })
    env.filters.update({
        'slugify': slugify,
        'richtext': wagtailcore_tags.richtext
    })
    return env

Remove unused Python 2 support
Remove unused Python 2 support

- from __future__ import absolute_import  # Python 2 only
- 
  from django.contrib.staticfiles.storage import staticfiles_storage
  from django.core.urlresolvers import reverse
  from django.template.defaultfilters import slugify
  from wagtail.wagtailcore.templatetags import wagtailcore_tags
  from wagtail.wagtailadmin.templatetags import wagtailuserbar
  
  from jinja2 import Environment
  from compressor.contrib.jinja2ext import CompressorExtension
  
  
  def environment(**options):
      options.setdefault('extensions', []).append(CompressorExtension)
      env = Environment(**options)
      env.globals.update({
          'static': staticfiles_storage.url,
          'reverse': reverse,
          'wagtailuserbar': wagtailuserbar.wagtailuserbar
      })
      env.filters.update({
          'slugify': slugify,
          'richtext': wagtailcore_tags.richtext
      })
      return env
  
Remove unused Python 2 support
## Code Before:
from __future__ import absolute_import  # Python 2 only

from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from wagtail.wagtailcore.templatetags import wagtailcore_tags
from wagtail.wagtailadmin.templatetags import wagtailuserbar

from jinja2 import Environment
from compressor.contrib.jinja2ext import CompressorExtension


def environment(**options):
    options.setdefault('extensions', []).append(CompressorExtension)
    env = Environment(**options)
    env.globals.update({
        'static': staticfiles_storage.url,
        'reverse': reverse,
        'wagtailuserbar': wagtailuserbar.wagtailuserbar
    })
    env.filters.update({
        'slugify': slugify,
        'richtext': wagtailcore_tags.richtext
    })
    return env

## Instruction:
Remove unused Python 2 support
## Code After:
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from wagtail.wagtailcore.templatetags import wagtailcore_tags
from wagtail.wagtailadmin.templatetags import wagtailuserbar

from jinja2 import Environment
from compressor.contrib.jinja2ext import CompressorExtension


def environment(**options):
    options.setdefault('extensions', []).append(CompressorExtension)
    env = Environment(**options)
    env.globals.update({
        'static': staticfiles_storage.url,
        'reverse': reverse,
        'wagtailuserbar': wagtailuserbar.wagtailuserbar
    })
    env.filters.update({
        'slugify': slugify,
        'richtext': wagtailcore_tags.richtext
    })
    return env
