create TxOut object
12272
def tx_output(network: str, value: Decimal, n: int,
              script: ScriptSig) -> TxOut:
    ''''''

    network_params = net_query(network)

    return TxOut(network=network_params,
                 value=int(value * network_params.to_unit),
                 n=n, script_pubkey=script)
514810
def create_table_from_object(self, obj):
        '''
        
        '''
        get_type = lambda item: str(type(item)).split("'")[1]
        if not os.path.exists(os.path.join(self.db_path, obj._TABLE)):
            with gzip.open(os.path.join(self.db_path, obj._TABLE), 'wb') as table_file:
                csv.writer(table_file).writerow(['{col}:{type}'.format(col=elm[0], type=get_type(elm[1]))
                                                 for elm in tuple(obj.__dict__.items())])
            self._tables[obj._TABLE] = self._load_table(obj._TABLE)
765340
def txtsubst(lines, variables, target_file=None, charset=None):
    
    if target_file:
        LOG.info("In process of generating file %r", target_file)

    if not charset:
        return [linesubst(line, variables) for line in lines]

    ret = []
    for line in lines:
        linesub = linesubst(line, variables)
        if isinstance(line, unicode):
            ret.append(linesub.encode(charset))
        else:
            ret.append(linesub)
    return ret
1334939
def make_fout(fout='./tmp', fmt='pcap'):
        
        if fmt == 'pcap':       # output PCAP file
            from pcapkit.dumpkit import PCAP as output
        elif fmt == 'plist':    # output PLIST file
            from dictdumper import PLIST as output
        elif fmt == 'json':     # output JSON file
            from dictdumper import JSON as output
        elif fmt == 'tree':     # output treeview text file
            from dictdumper import Tree as output
            fmt = 'txt'
        elif fmt == 'html':     # output JavaScript file
            from dictdumper import JavaScript as output
            fmt = 'js'
        elif fmt == 'xml':      # output XML file
            from dictdumper import XML as output
        else:                   # no output file
            from pcapkit.dumpkit import NotImplementedIO as output
            if fmt is not None:
                warnings.warn(f'Unsupported output format: {fmt}; disabled file output feature',
                              FormatWarning, stacklevel=stacklevel())
            return output, ''

        try:
            pathlib.Path(fout).mkdir(parents=True, exist_ok=True)
        except FileExistsError as error:
            if fmt is None:
                warnings.warn(error.strerror, FileWarning, stacklevel=stacklevel())
            else:
                raise FileExists(*error.args) from None

        return output, fmt
1000813
def dbg(*objects, file=sys.stderr, flush=True, **kwargs):
    ""
    print(*objects, file=file, flush=flush, **kwargs)
83471
def create_transaction_output(address, output_value):
    
    bitcoin_address = CBitcoinAddress(address)
    tx_out = CMutableTxOut(output_value, bitcoin_address.to_scriptPubKey())
    return tx_out
1087923
def create_from_file(cls, filename):
        """"""
        obj = cls()
        obj.object_file = filename
        obj.load()
        return obj
872414
def build_output(self, fout):
        
        fout.write('\n'.join([s for s in self.out]))
1310496
protected ObjectOutputStream getObjectOutputStream (FramingOutputStream fout)
    {
        // we're lazy about creating our output stream because we may be inheriting it from our
        // authing connection and we don't want to unnecessarily create it in that case
        if (_oout == null) {
            _oout = new ObjectOutputStream(fout);
        }
        return _oout;
    }
345969
function writeTxt(buff, val) {
  //TODO XXX FIXME -- split on max char string and loop
  assertUndefined(val.data, 'TXT record requires "data"');
  for (var i=0,len=val.data.length; i<len; i++) {
    var dataLen = Buffer.byteLength(val.data[i], 'utf8');
    buff.writeUInt8(dataLen);
    buff.write(val.data[i], dataLen, 'utf8');
  }
  return WRITE_RESOURCE_DONE;
}
716237
protected static void dumpInstance (
        PrintStream out, Object object, boolean includeToString, String indent)
    {
        // summarize the current object
        summarizeObject(out, object, includeToString, indent);
        // increment the indentation level
        indent += " ";
        // summarize the object's fields
        Field[] fields = object.getClass().getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            try {
                Object field = fields[i].get(object);
                dumpInstance(out, field, includeToString, indent);
            } catch (Exception e) {
                out.println(indent + "*** unable to fetch field " +
                            "[field=" + fields[i] + ", error=" + e + "]");
            }
        }
    }
452661
def compress_txn_outputs(txn_outputs):
    '''
    
    '''
    result_dict = {}
    outputs = (output for output in txn_outputs if output.get('address'))
    for txn_output in outputs:
        if txn_output['address'] in result_dict:
            result_dict[txn_output['address']] += txn_output['value']
        else:
            result_dict[txn_output['address']] = txn_output['value']
    return result_dict
775916
def wr_txt(self, fout_txt):
        """"""
        with open(fout_txt, 'w') as prt:
            for line in self.ver_list:
                prt.write("{LINE}\n".format(LINE=line))
            self.prt_txt(prt)
            print("  WROTE: {TXT}".format(TXT=fout_txt))
542189
def write_output(self):
        
        self.tcex.log.info('Writing Output')
        self.tcex.playbook.create_output('json.pretty', self.pretty_json)
584340
function TXRequest(options) {
  if (!(this instanceof TXRequest))
    return new TXRequest(options);

  this.hash = encoding.NULL_HASH;
  this.indexes = [];

  if (options)
    this.fromOptions(options);
}
1241860
def writeout(ds, outfn):
    
    print("Writing out %s" % outfn) 
    #Use outfn extension to get driver
    #This may have issues if outfn already exists and the mem ds has different dimensions/res
    out_ds = iolib.gtif_drv.CreateCopy(outfn, ds, 0, options=iolib.gdal_opt)
    out_ds = None
189558
def _wr_ver_n_key(self, fout_txt, verbose):
        """"""
        with open(fout_txt, 'w') as prt:
            self._prt_ver_n_key(prt, verbose)
            print('               WROTE: {TXT}'.format(TXT=fout_txt))