code: def get_output(script, expanded):
      
      env = dict(os.environ)
      env.update(settings.env)
  
      is_slow = shlex.split(expanded) in settings.slow_commands
      with logs.debug_time(u'Call: {}; with env: {}; is slow: '.format(
              script, env, is_slow)):
          result = Popen(expanded, shell=True, stdin=PIPE,
                         stdout=PIPE, stderr=STDOUT, env=env)
          if _wait_output(result, is_slow):
              output = result.stdout.read().decode('utf-8')
              logs.debug(u'Received output: {}'.format(output))
              return output
          else:
              logs.debug(u'Execution timed out!')
              return None
docs: Runs the script and obtains stdin/stderr.
  
      :type script: str
      :type expanded: str
      :rtype: str | None