code: def run_command(instance, client, cmd, environment=None, inputs=None):
      stdin, stdout, stderr = client.exec_command(
          cmd, get_pty=True, environment=environment
      )
      if inputs:
          for inp in inputs:
              stdin.write(inp)
  
      def read_lines(fin, fout, line_head):
          line = ""
          while not fin.channel.exit_status_ready():
              line += fin.read(1).decode("utf8")
              if line.endswith("\n"):
                  print(f"{line_head}{line[:-1]}", file=fout)
                  line = ""
          if line:
              # print what remains in line buffer, in case fout does not
              # end with '\n'
              print(f"{line_head}{line[:-1]}", file=fout)
  
      with concurrent.futures.ThreadPoolExecutor(
          max_workers=2
      ) as printer:
          printer.submit(
              read_lines, stdout, sys.stdout, f"[{instance} STDOUT] "
          )
          printer.submit(
              read_lines, stderr, sys.stderr, f"[{instance} STDERR] "
          )
  
file_path: CrypTen/scripts/aws_launcher.py
imports: import concurrent.futures
  import configparser
  import os
  import sys
  import time
  import uuid
  import warnings
  from argparse import ArgumentParser, REMAINDER
  from pathlib import Path
  import boto3
  import paramiko
label_desc: Use image node_id 4 for calling a global function with example usage: run_command(instance, client, cmd, environment, inputs) without return types