code: def lineprotocol(
          cls=None,
          *,
          schema: Optional[Mapping[str, type]] = None,
          rm_none: bool = False,
          extra_tags: Optional[Mapping[str, str]] = None,
          placeholder: bool = False
  ):
      
  
      def _lineprotocol(cls):
          _schema = schema or getattr(cls, '__annotations__', {})
          f = _make_serializer(cls.__name__, _schema, rm_none, extra_tags, placeholder)
          cls.to_lineprotocol = f
          return cls
  
      return _lineprotocol(cls) if cls else _lineprotocol
docs: 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)