@register.filter
def munki_property(tag, tagname=None):
  """Prints a formatted, colored tag."""
  if not tag:
    return ''
  tags = {
      'managed_installs': 'install',
      'managed_updates': 'update',
      'managed_uninstalls': 'uninstall',
      'optional_installs': 'optional',
      'unattended_install': 'unattd',
      'unattended_uninstall': 'unattended_uninstall',
  }
  html = '<span class="tags %s" title="%s">%s</span>'
  abbr = tags.get(tag, tag)
  return mark_safe(html % (tagname or tag, tag, abbr))
dataset/ETHPy150Open google/simian/src/simian/mac/admin/custom_filters.py/munki_property/original