def METHOD_NAME(cmd, shell=True, env=None):
    # type: (Union[str,list], bool, Optional[dict]) -> Tuple[int, str, str]
    env = env or {}
    if isinstance(cmd, (list, tuple)):
        command_string = " ".join(cmd)
    else:
        command_string = cmd
    print("--------------------------------------")
    print("Running command: %s" % (command_string))
    process = subprocess.Popen(
        cmd,
        shell=True,
        stdin=subprocess.PIPE,
        stderr=subprocess.PIPE,
        stdout=subprocess.PIPE,
        env=env,
    )
    process.wait()
    exit_code = process.returncode
    stdout = process.stdout.read().decode("utf-8".strip())
    stderr = process.stderr.read().decode("utf-8").strip()
    print("Command finished")
    print("exit code: %s" % (exit_code))
    print("stdout: %s" % (stdout))
    print("stderr: %s" % (stderr))
    print("--------------------------------------")
    return exit_code, stdout, stderr