text: from django import template
  from django.forms.fields import FileField
  
  register = template.Library()
  
  
  @register.simple_tag
  def active(request, pattern):
      if request and pattern == request.path:
          return "active"
      return ""
  
  
  @register.inclusion_tag("common/_quick_search.html")
  def quick_search():
      return {}
  
  
  @register.inclusion_tag("ballots/_form.html")
  def round_form(form, gov_team, opp_team):
      return {"form": form, "gov_team": gov_team, "opp_team": opp_team}
  
  
  @register.filter("is_file_field")
  def is_file_field(field):
      if not hasattr(field, "field"):
          return False
      return isinstance(field.field, FileField)
  
  
  @register.filter("is_checked_in")
  def is_checked_in(judge, round_value):
      return judge.is_checked_in_for_round(round_value)
  