def METHOD_NAME(data, prm, req):
    """ Encode a raw output item."""
    if isinstance(prm, LiteralData):
        return _encode_raw_literal(data, prm, req)
    elif isinstance(prm, BoundingBoxData):
        return _encode_raw_bbox(data, prm, req)
    elif isinstance(prm, ComplexData):
        return _encode_raw_complex(data, prm)
    raise TypeError("Invalid output type! %r"%(prm))