def output(self, name):
    """Returns the output buffer for the specified output name (e.g., 'stdout'), creating it if
    necessary.

    :API: public
    """
    m = WorkUnit._valid_name_re.match(name)
    if not m or m.group(0) != name:
      raise Exception('Invalid output name: {}'.format(name))
    if name not in self._outputs:
      workunit_name = re.sub(r'\W', '_', self.name)
      path = os.path.join(self.run_info_dir,
                          'tool_outputs', '{workunit_name}-{id}.{output_name}'
                          .format(workunit_name=workunit_name,
                                  id=self.id,
                                  output_name=name))
      safe_mkdir_for(path)
      self._outputs[name] = FileBackedRWBuf(path)
      self._output_paths[name] = path
    return self._outputs[name]
Returns the output buffer for the specified output name (e.g., 'stdout'), creating it if
    necessary.

    :API: public