Write to the given stream the list of ABINIT errors for all tasks whose status is S_ABICRITICAL.

        Args:
            nids: optional list of node identifiers used to filter the tasks.
            stream: File-like object. Default: sys.stdout
497721
def show_abierrors(self, nids=None, stream=sys.stdout):
        
        lines = []
        app = lines.append

        for task in self.iflat_tasks(status=self.S_ABICRITICAL, nids=nids):
            header = "=== " + task.qout_file.path + "==="
            app(header)
            report = task.get_event_report()

            if report is not None:
                app("num_errors: %s, num_warnings: %s, num_comments: %s" % (
                    report.num_errors, report.num_warnings, report.num_comments))
                app("*** ERRORS ***")
                app("\n".join(str(e) for e in report.errors))
                app("*** BUGS ***")
                app("\n".join(str(b) for b in report.bugs))

            else:
                app("get_envent_report returned None!")

            app("=" * len(header) + 2*"\n")

        return stream.writelines(lines)
971479
def dump_all_thread_tracebacks(exclude_thread_ids=None, file=None):
    
    if exclude_thread_ids is None:
        exclude_thread_ids = []
    if not file:
        file = sys.stdout
    import threading

    if hasattr(sys, "_current_frames"):
        print("", file=file)
        threads = {t.ident: t for t in threading.enumerate()}
        # noinspection PyProtectedMember
        for tid, stack in sys._current_frames().items():
            if tid in exclude_thread_ids:
                continue
            # This is a bug in earlier Python versions.
            # http://bugs.python.org/issue17094
            # Note that this leaves out all threads not created via the threading module.
            if tid not in threads:
                continue
            tags = []
            thread = threads.get(tid)
            if thread:
                assert isinstance(thread, threading.Thread)
                if thread is threading.currentThread():
                    tags += ["current"]
                # noinspection PyProtectedMember,PyUnresolvedReferences
                if isinstance(thread, threading._MainThread):
                    tags += ["main"]
                tags += [str(thread)]
            else:
                tags += ["unknown with id %i" % tid]
            print("Thread %s:" % ", ".join(tags), file=file)
            print_tb(stack, file=file)
            print("", file=file)
        print("That were all threads.", file=file)
    else:
        print("Does not have sys._current_frames, cannot get thread tracebacks.", file=file)
1102422
def tasks_from_nids(self, nids):
        
        if not isinstance(nids, collections.abc.Iterable): nids = [nids]

        n2task = {task.node_id: task for task in self.iflat_tasks()}
        return [n2task[n] for n in nids if n in n2task]
502548
private void sendNSFailed(IConnection conn, String errorCode, String description, String name, Number streamId) {
        StreamService.sendNetStreamStatus(conn, errorCode, description, name, Status.ERROR, streamId);
    }
1080393
function(task, pid) {
  this.task = task;
  this.pid = pid;
  this.failedCount = 0;
  this.buffer = '';
  this.exitCode = -1;
  this.insertTag = true;
}
735901
def node_to_ini(node, output=sys.stdout):
    
    for subnode in node:
        output.write(u'\n[%s]\n' % subnode.tag)
        for name, value in sorted(subnode.attrib.items()):
            output.write(u'%s=%s\n' % (name, value))
    output.flush()
1364321
def write(self, output):
        
        self._stream.write(output)

        if self._auto_flush:
            self._stream.flush()
22472
def write(self, buf):
        '''
        
        '''
        for line in buf.rstrip().splitlines():
            self.orig_stdout.write(line.rstrip() + '\n')
            self.orig_stdout.flush()
            try:
                self.logger.log(self.log_level, line.rstrip())
            except Exception as e:
                pass
255499
private void failedTasklets(final Exception exception, final List<Integer> taskletIds)
      throws InterruptedException {

    final List<TInput> inputs = getInputs(taskletIds);
    final AggregateResult failure = new AggregateResult(exception, inputs);

    if (callbackHandler != null) {
      executor.execute(new Runnable() {
        @Override
        public void run() {
          callbackHandler.onFailure(new VortexAggregateException(exception, inputs));
        }
      });
    }

    resultQueue.put(new ImmutablePair<>(taskletIds, failure));
  }
888594
private static Map<WriterKind, PrintWriter> initWriters(PrintWriter out, PrintWriter err) {
        Map<WriterKind, PrintWriter> writers = new EnumMap<>(WriterKind.class);
        writers.put(WriterKind.ERROR, err);
        writers.put(WriterKind.WARNING, err);
        writers.put(WriterKind.NOTICE, err);

        writers.put(WriterKind.STDOUT, out);
        writers.put(WriterKind.STDERR, err);

        return writers;
    }
465209
def writeline(self, data, crlf="\r\n"):
        
        if self.read_thread:
            if self.read_thread.has_error():
                raise RuntimeError("Error writing PIPE")
        # Check if process still alive
        if self.proc.poll() is not None:
            raise RuntimeError("Process stopped")
        if self.__print_io:
            self.logger.info(data, extra={'type': '-->'})
        self.proc.stdin.write(bytearray(data + crlf, 'ascii'))
        self.proc.stdin.flush()
577104
def write_events(stream, events):
    '''
    
    '''
    for event in events:
        data = event.SerializeToString()
        len_field = struct.pack('<Q', len(data))
        len_crc = struct.pack('<I', masked_crc(len_field))
        data_crc = struct.pack('<I', masked_crc(data))
        stream.write(len_field)
        stream.write(len_crc)
        stream.write(data)
        stream.write(data_crc)
1066944
def _write(self, *args, **kwargs):
        
        if self.filter_fn(*args, **kwargs):
            self.stream.write(*args, **kwargs)
918111
def task2ics():
    """"""
    from argparse import ArgumentParser, FileType
    from sys import stdout

    parser = ArgumentParser(description='Converter from Taskwarrior to iCalendar syntax.')
    parser.add_argument('indir', nargs='?', help='Input Taskwarrior directory (default to ~/.task)', default=expanduser('~/.task'))
    parser.add_argument('outfile', nargs='?', type=FileType('w'), default=stdout,
                        help='Output iCalendar file (default: stdout)')
    args = parser.parse_args()

    task = IcsTask(args.indir)
    args.outfile.write(task.to_vobject().serialize())
390380
def stdout(self):
        
        streams = self._payload.get('streams', None)
        return streams[0] if streams is not None and len(streams) >= 1 else ''
691624
public void write(List<NodeTypeData> nodeTypes, OutputStream os) throws RepositoryException
   {
      OutputStreamWriter out = new OutputStreamWriter(os);
      try
      {
         for (NodeTypeData nodeType : nodeTypes)
         {
            printNamespaces(nodeType, out);
            printNodeTypeDeclaration(nodeType, out);
         }
         out.close();
      }
      catch (IOException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }

   }
202278
private void writeAndFlushValue(OutputStream output, ObjectNode value) throws IOException {
		logger.debug("Response: {}", value);

		for (JsonRpcInterceptor interceptor : interceptorList) {
			interceptor.postHandleJson(value);
		}
		mapper.writeValue(new NoCloseOutputStream(output), value);
		output.write('\n');
	}