def METHOD_NAME(self, buf):
    buf = six.ensure_text(buf, encoding=self._encoding or "utf-8")
    lines = buf.splitlines()
    if not lines:
        return
    if self._buf:
        lines[0] = self._buf + lines[0]
        self._buf = ""
    if not buf.endswith("\n"):
        self._buf = lines.pop()
    for line in lines:
        self._callback(line)