def execute_command(self, cmd):
    process = popen_filtered("[%s]" % self.label, cmd, self.cwd,
                             shell=True, redirect_output=self.redirect_output)
    output = ""
    while True:
      recv = process.stdout.read(100)  # arbitrary
      output += recv
      if recv == '' and process.poll() is not None:
        break
    if self.redirect_output:
      return ''
    return output
Execute command locally and return the stdout results
dataset/ETHPy150Open ucb-sts/sts/sts/entities/base.py/LocalEntity.execute_command