def lineprotocol(<EOL>cls=None,<EOL>*,<EOL>schema: Optional[Mapping[str, type]] = None,<EOL>rm_none: bool = False,<EOL>extra_tags: Optional[Mapping[str, str]] = None,<EOL>placeholder: bool = False<EOL>):
def _lineprotocol(cls):<EOL><INDENT>_schema = schema or getattr(cls, '<STR_LIT>', {})<EOL>f = _make_serializer(cls.__name__, _schema, rm_none, extra_tags, placeholder)<EOL>cls.to_lineprotocol = f<EOL>return cls<EOL><DEDENT>return _lineprotocol(cls) if cls else _lineprotocol<EOL>
Adds ``to_lineprotocol`` method to arbitrary user-defined classes

    :param cls: Class to monkey-patch
    :param schema: Schema dictionary (attr/type pairs).
    :param rm_none: Whether apply a regex to remove ``None`` values.
        If ``False``, passing ``None`` values to boolean, integer or float or time fields
        will result in write errors. Setting to ``True`` is "safer" but impacts performance.
    :param extra_tags: Hard coded tags to be added to every point generated.
    :param placeholder: If no field attributes are present, add a placeholder attribute (``_``)
        which is always equal to ``True``. This is a workaround for creating field-less points
        (which is not supported natively by InfluxDB)