code: def as_representer(resource, content_type):
      
      reg = get_current_registry()
      rpr_reg = reg.queryUtility(IRepresenterRegistry)
      return rpr_reg.create(type(resource), content_type)
docs: Adapts the given resource and content type to a representer.
  
      :param resource: resource to adapt.
      :param str content_type: content (MIME) type to obtain a representer for.