def METHOD_NAME(*args, input=None):
    """
    Run command args, iterating over lines read from the child process stdout.
    Assumes that the child process output UTF-8. Will raise if the command
    outputs binary data. This is not a problem in this projects since all our
    commands are text based.
    Invalid UTF-8 in child process stderr is handled gracefully so we don't
    fail to raise an error about the failing command. Invalid characters will
    be replaced with unicode replacement character (U+FFFD).
    Raises Error if creating a child process failed or the child process
    terminated with non-zero exit code. The error includes all data read from
    the child process stderr.
    """
    # Avoid delays in python child process logs.
    env = dict(os.environ)
    env["PYTHONUNBUFFERED"] = "1"
    try:
        p = subprocess.Popen(
            args,
            stdin=subprocess.PIPE if input else None,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            env=env,
        )
    except OSError as e:
        raise Error(args, f"Could not execute: {e}").with_exception(e)
    with p:
        error = bytearray()
        partial = bytearray()
        for src, data in stream(p, input=input):
            if src is ERR:
                error += data
            else:
                for line in data.splitlines(keepends=True):
                    if not line.endswith(b"\n"):
                        partial += line
                        break
                    if partial:
                        line = bytes(partial) + line
                        del partial[:]
                    yield line.rstrip().decode()
        if partial:
            yield partial.rstrip().decode()
            del partial[:]
    if p.returncode != 0:
        error = error.decode(errors="replace")
        raise Error(args, error, exitcode=p.returncode)