Write the Playbook output variables.
485762
def write_output(self):
        
        # output
        self.tcex.log.debug('output_strings: {}'.format(self.output_strings))

        self.tcex.playbook.create_output('string.operation', self.args.tc_action)
        self.tcex.playbook.create_output('string.outputs', self.output_strings)
        if self.output_strings:
            self.tcex.playbook.create_output('string.outputs.0', self.output_strings[0])
        self.tcex.playbook.create_output('string.outputs.count', len(self.output_strings))
576378
def write_output_files(self):
        
        os.mkdir("analysis")
        os.chdir("analysis")
        os.mkdir("hydrogen_bonds")
        os.chdir("hydrogen_bonds")
        for traj in range(len(self.trajectory)):
            with open('hbonds_data_total_'+str(traj)+'.csv', 'wb') as outfile:
                hwriter = csv.writer(outfile, delimiter=' ')
                for time in self.hbonds_by_time[traj]:
                    hwriter.writerow([time[0],time[1]])
            for bond in self.hbonds_by_type[traj]:
                if bond["donor_resnm"]=="LIG" and (bond["acceptor_idx"],bond["donor_idx"]) in [(k[0],k[3]) for k,v in self.hbonds_for_drawing.items()]:
                    with open('hbond_'+bond["acceptor_resnm"]+"_"+str(bond["acceptor_resid"])+"_"+bond["donor_atom"]+"_"+str(traj)+".csv","wb") as outfile:
                        hwriter = csv.writer(outfile, delimiter=' ')
                        for time in self.hbonds_timesteps[traj]:
                            result = [1 if x[0]==time and x["acceptor_idx"]==bond["acceptor_idx"] else 0 for x in self.hbonds[traj]][0]
                            hwriter.writerow([time,result])
                if bond["donor_resnm"]!="LIG" and (bond["donor_idx"],bond["acceptor_idx"]) in [(k[0],k[3]) for k,v in self.hbonds_for_drawing.items()]:
                    with open('hbond_'+bond["donor_resnm"]+"_"+str(bond["donor_resid"])+"_"+bond["acceptor_atom"]+"_"+str(traj)+".csv","wb") as outfile:
                        hwriter = csv.writer(outfile, delimiter=' ')
                        for time in self.hbonds_timesteps[traj]:
                            result = [1 if x[0]==time and x["donor_idx"]==bond["donor_idx"] else 0 for x in self.hbonds[traj]][0]
                            hwriter.writerow([time,result])
        os.chdir("../../")
971500
def write_output(self, data, args=None, filename=None, pretty=False):
        """"""
        if args:
            if not args.sojson:
                return 0
            pretty = args.pretty
        if not filename: filename = args.sojson
        if pretty:
            logstring = json.dumps(
                    data['entries'], indent=2, sort_keys=True,
                    separators=(',', ': '))
        else:
            logstring = json.dumps(data['entries'], sort_keys=True)
        
        with open(str(filename), 'w') as output_file:
            output_file.write(logstring)
506522
def dump(props, output):
    
    def escape(token):
      return re.sub(r'([=:\s])', r'\\\1', token)

    def write(out):
      for k, v in props.items():
        out.write('%s=%s\n' % (escape(str(k)), escape(str(v))))

    if hasattr(output, 'write') and callable(output.write):
      write(output)
    elif isinstance(output, six.string_types):
      with open(output, 'w+') as out:
        write(out)
    else:
      raise TypeError('Can only dump data to a path or a writable object, given: %s' % output)
317847
private void writeFields(JsonWriterImpl out, Object value)
  {
    for (JsonField field : _fields) {
      field.write(out, value);
    }
  }
730870
def _prepare_output_multi(self, model):
        """"""
        model_name = model.__name__
        current_path = os.path.join(self._output_path, '{model}.{extension}'.format(
            model=model_name,
            extension=self.EXTENSION,
        ))
        self._outfile = codecs.open(current_path, 'w', encoding='utf-8')
        print('Dumping {model} to {file}'.format(model=model_name, file=current_path))
783189
def write(self, output):
        
        w = c_int32()
        # print "output max", max(abs(output))
        self.WriteAnalogF64(self.bufsize, 0, 10.0, DAQmx_Val_GroupByChannel,
                            output, w, None);
797208
def write_output_files(self, fh):
    
    for f in self.__output_files:
        print >>fh, "## Job %s generates output file %s" % (self.__name, f)
131351
def RunPlaybookOnHost(playbook_path, host, private_key, extra_vars=None):
  
  return RunPlaybookOnHosts(playbook_path, [host], private_key, extra_vars)
1246534
def _write_script(self, script_name, ref, qry, outfile):
        ''''''
        f = pyfastaq.utils.open_file_write(script_name)
        print(self._nucmer_command(ref, qry, 'p'), file=f)
        print(self._delta_filter_command('p.delta', 'p.delta.filter'), file=f)
        print(self._show_coords_command('p.delta.filter', outfile), file=f)
        if self.show_snps:
            print(self._show_snps_command('p.delta.filter', outfile + '.snps'), file=f)
        pyfastaq.utils.close(f)
585442
def Write(self, output_writer):
    
    if self._title:
      output_writer.Write('### {0:s}\n\n'.format(self._title))

    if not self._columns:
      self._columns = ['' for _ in range(0, self._number_of_columns)]

    output_writer.Write(' | '.join(self._columns))
    output_writer.Write('\n')

    output_writer.Write(' | '.join(['---' for _ in self._columns]))
    output_writer.Write('\n')

    for values in self._rows:
      values = ['{0!s}'.format(value) for value in values]
      output_writer.Write(' | '.join(values))
      output_writer.Write('\n')

    output_writer.Write('\n')
204277
@Override
    public void makeBuildVariables(@SuppressWarnings("rawtypes") AbstractBuild build, Map<String, String> variables) {
        variables.put("ghprbShowMatrixStatus", Boolean.toString(getShowMatrixStatus()));
        variables.put("ghprbUpstreamStatus", "true");
        variables.put("ghprbCommitStatusContext", getCommitStatusContext());
        variables.put("ghprbTriggeredStatus", getTriggeredStatus());
        variables.put("ghprbStartedStatus", getStartedStatus());
        variables.put("ghprbStatusUrl", getStatusUrl());
        variables.put("ghprbAddTestResults", Boolean.toString(getAddTestResults()));

        Map<GHCommitState, StringBuilder> statusMessages = new HashMap<GHCommitState, StringBuilder>(INITIAL_CAPACITY);

        for (GhprbBuildResultMessage message : getCompletedStatus()) {
            GHCommitState state = message.getResult();
            StringBuilder sb;
            if (!statusMessages.containsKey(state)) {
                sb = new StringBuilder();
                statusMessages.put(state, sb);
            } else {
                sb = statusMessages.get(state);
                sb.append("\n");
            }
            sb.append(message.getMessage());
        }

        for (Entry<GHCommitState, StringBuilder> next : statusMessages.entrySet()) {
            String key = String.format("ghprb%sMessage", next.getKey().name());
            variables.put(key, next.getValue().toString());
        }
    }
190191
def _parse_out_variable(self):
        
        self._out_variables = {}
        self._out_variables_type = {}
        if self.tcex.default_args.tc_playbook_out_variables:
            variables = self.tcex.default_args.tc_playbook_out_variables.strip()
            for o in variables.split(','):
                # parse the variable to get individual parts
                parsed_key = self.parse_variable(o)
                variable_name = parsed_key['name']
                variable_type = parsed_key['type']
                # store the variables in dict by name (e.g. "status_code")
                self._out_variables[variable_name] = {'variable': o}
                # store the variables in dict by name-type (e.g. "status_code-String")
                vt_key = '{}-{}'.format(variable_name, variable_type)
                self._out_variables_type[vt_key] = {'variable': o}
771143
def print_variables(self):
        
        print_out = partial(self.print_out, format_options='green')

        print_out('===== variables =====')

        for var, hint in self.vars.get_descriptions().items():
            print_out('    %' + var + ' = ' + var + ' = ' + hint.replace('%', '%%'))

        print_out('=====================')

        return self
472026
def write_conf(self):
        
        f = open(self.output_filename, 'w')
        print(self.t.render(prefixes=self.prefixes), file=f)
        f.close()
1282735
public String write(Map<String, String> outputProperties) {
		StringWriter sw = new StringWriter();
		try {
			write(sw, outputProperties);
		} catch (TransformerException e) {
			//shouldn't be thrown because we're writing to a string
			throw new RuntimeException(e);
		}
		return sw.toString();
	}
539152
public static void write(OutputStream out, List<ApplicationManifest> applicationManifests) {
        try (Writer writer = new OutputStreamWriter(out)) {
            YAML.dump(Collections.singletonMap("applications",
                applicationManifests.stream()
                    .map(ApplicationManifestUtils::toYaml)
                    .collect(Collectors.toList())),
                writer);
        } catch (IOException e) {
            throw Exceptions.propagate(e);
        }
    }