async def METHOD_NAME(self, input):
    debug = self._loop.get_debug()
    self.stdin.write(input)
    if debug:
        logger.debug(
            '%r communicate: feed stdin (%s bytes)', self, len(input))
    try:
        await self.stdin.drain()
    except (BrokenPipeError, ConnectionResetError) as exc:
        # communicate() ignores BrokenPipeError and ConnectionResetError
        if debug:
            logger.debug('%r communicate: stdin got %r', self, exc)
    if debug:
        logger.debug('%r communicate: close stdin', self)
    self.stdin.close()