old_contents: from django import template
  from django.shortcuts import render
  from django.template import loader
  
  register = template.Library()
  
  
  def get_widget_name(field):
      return field.field.widget.__class__.__name__
  
  
  def append_classes(field):
      field.field.label_suffix = ''
      classes = field.field.widget.attrs.get('class', '')
      classes += ' validate'
      if field.errors:
          classes += ' invalid'
      field.field.widget.attrs['class'] = classes
  
  
  def render_field(template, field, prefix=None):
      t = loader.get_template(template)
      c = {
          'field': field,
          'prefix': prefix,
      }
      return t.render(c)
  
  
  @register.simple_tag
  def materialize_field(field, prefix=None):
      widget = get_widget_name(field)
      if widget in ['TextInput', 'EmailInput', 'PasswordInput', 'Select',
                    'Textarea']:
          append_classes(field)
          return render_field('materialize/form/input.html', field, prefix)
      else:
          return field.as_widget()
  
  
  @register.inclusion_tag('materialize/pagination.html')
  def materialize_pagination(page, url):
      return {
          'page': page,
          'paginator': page.paginator,
          'url': url,
      }
  
new_contents: from django import template
  from django.template import loader
  
  register = template.Library()
  
  
  def get_widget_name(field):
      return field.field.widget.__class__.__name__
  
  
  def append_classes(field):
      field.field.label_suffix = ''
      classes = field.field.widget.attrs.get('class', '')
      classes += ' validate'
      if field.errors:
          classes += ' invalid'
      field.field.widget.attrs['class'] = classes
  
  
  def render_field(template, field, prefix=None):
      t = loader.get_template(template)
      c = {
          'field': field,
          'prefix': prefix,
      }
      return t.render(c)
  
  
  @register.simple_tag
  def materialize_field(field, prefix=None):
      widget = get_widget_name(field)
      if widget in ['TextInput', 'EmailInput', 'PasswordInput', 'Select',
                    'Textarea']:
          append_classes(field)
          return render_field('materialize/form/input.html', field, prefix)
      else:
          return field.as_widget()
  
  
  @register.inclusion_tag('materialize/pagination.html')
  def materialize_pagination(page, url):
      return {
          'page': page,
          'paginator': page.paginator,
          'url': url,
      }
  
subject: Remove unused import