def METHOD_NAME(cmd):
    popen = subprocess.Popen(cmd,
                             stdout=subprocess.PIPE,
                             stderr=subprocess.STDOUT,
                             universal_newlines=True)
    for line in iter(popen.stdout.readline, ""):
        yield line
    popen.stdout.close()
    while popen.poll() is None:
        time.sleep(.1)
    if popen.returncode != 0:
        raise RuntimeError("%s: %s" % (' '.join(cmd), popen.returncode))