docs: def GetFilter(cls, filter_name):
      """Return an initialized filter. Only initialize filters once.
  
      Args:
        filter_name: The name of the filter, as a string.
  
      Returns:
        an initialized instance of the filter.
  
      Raises:
        DefinitionError if the type of filter has not been defined.
      """
      # Check if the filter is defined in the registry.
      try:
        filt_cls = cls.GetPlugin(filter_name)
      except KeyError:
        raise DefinitionError("Filter %s does not exist." % filter_name)
  
      return filt_cls()