Save Frame in binary NFF/Jay format.

    :param dest: destination where the Frame should be saved.
    :param _strategy: one of "mmap", "write" or "auto"
192329
def save_nff(self, dest, _strategy="auto"):
    
    if _strategy not in ("auto", "write", "mmap"):
        raise TValueError("Invalid parameter _strategy: only 'write' / 'mmap' "
                          "/ 'auto' are allowed")

    dest = os.path.expanduser(dest)
    if not os.path.exists(dest):
        os.makedirs(dest)

    self.materialize()
    mins = self.min().to_list()
    maxs = self.max().to_list()

    metafile = os.path.join(dest, "_meta.nff")
    with _builtin_open(metafile, "w", encoding="utf-8") as out:
        out.write("# NFF2\n")
        out.write("# nrows = %d\n" % self.nrows)
        out.write('filename,stype,meta,colname,min,max\n')
        l = len(str(self.ncols))
        for i in range(self.ncols):
            filename = "c%0*d" % (l, i + 1)
            colname = self.names[i].replace('"', '""')
            stype = self.stypes[i]
            if stype == dt.stype.obj64:
                dtwarn("Column %r of type obj64 was not saved" % self.names[i])
                continue
            smin = _stringify(mins[i][0])
            smax = _stringify(maxs[i][0])
            out.write('%s,%s,,"%s",%s,%s\n'
                      % (filename, stype.code, colname, smin, smax))
            filename = os.path.join(dest, filename)
            core._column_save_to_disk(self, i, filename, _strategy)
1237254
def store_markerformat(rgbFore, rgbBack, marker, grbit, icvFore, icvBack, miSize)# :nodoc:
    record  = 0x1009     # Record identifier.
    length  = 0x0014     # Number of bytes to follow.
    # rgbFore            # Foreground RGB color.
    # rgbBack            # Background RGB color.
    # marker             # Type of marker.
    # grbit              # Format flags.
    # icvFore            # Color index marker border.
    # icvBack            # Color index marker fill.
    # miSize             # Size of line markers.

    header = [record, length].pack('vv')
    data  = [rgbFore].pack('V')
    data += [rgbBack].pack('V')
    data += [marker].pack('v')
    data += [grbit].pack('v')
    data += [icvFore].pack('v')
    data += [icvBack].pack('v')
    data += [miSize].pack('V')

    append(header, data)
  end
1359669
def to_frame(self, slot=SLOT.SCAN_MAP):
        
        payload = self.scanmap.ljust(64, b'\0')
        return yubikey_frame.YubiKeyFrame(command=slot, payload=payload)
326132
def frame_from_fsnative(arg):
    

    assert isinstance(arg, fsnative)

    text = fsn2text(arg, strict=True)
    if PY2:
        return text.encode("ascii")
    else:
        return text.encode("ascii").decode("ascii")
807290
def save(self, filename):
        
        aead_f = open(filename, "wb")
        fmt = "< B I %is %is" % (pyhsm.defines.YSM_AEAD_NONCE_SIZE, len(self.data))
        version = 1
        packed = struct.pack(fmt, version, self.key_handle, self.nonce, self.data)
        aead_f.write(YHSM_AEAD_File_Marker + packed)
        aead_f.close()
1282477
def save(self, fp, mode='wb'):
        
        if hasattr(fp, 'write'):
            self._record.write(fp)
        else:
            with open(fp, mode) as f:
                self._record.write(f)
364514
def write_data(self, offsets, data):
        # type: (Descriptor, Offsets, bytes) -> None
        
        if len(data) > 0:
            # offset from internal view
            pos = self.view.fd_start + offsets.fd_start
            with self.final_path.open('r+b') as fd:
                fd.seek(pos, 0)
                fd.write(data)
605107
def save(self, fname: str):
        
        mx.nd.save(fname, self.source + self.target + self.label)
1239842
def copy(self, dest):
        
        if os.path.isfile(self.path):
            shutil.copy2(self.path, dest)
        else:
            shutil.copytree(self.path, dest, symlinks=False, ignore=None)
519162
def save(self, cfg, filename, print_ir=False, format='dot', options=None):
        
        if options is None:
            options = {}

        try:
            dot_graph = Dot(**self.graph_format)

            # Add nodes.
            nodes = {}
            for bb in cfg.basic_blocks:
                nodes[bb.address] = self._create_node(bb, cfg.name, print_ir, options)

                dot_graph.add_node(nodes[bb.address])

            # Add edges.
            for bb_src in cfg.basic_blocks:
                for bb_dst_addr, branch_type in bb_src.branches:
                    if bb_dst_addr in nodes:
                        edge = self._create_edge(nodes[bb_src.address], nodes[bb_dst_addr], branch_type)

                        dot_graph.add_edge(edge)
                    else:
                        logger.warning("Destination basic block not found! (0x%x)", bb_dst_addr)

            # Save graph.
            dot_graph.write("{}.{}".format(filename, format), format=format)
        except Exception:
            logger.error("Failed to save basic block graph: %s (%s)", filename, format, exc_info=True)
341575
protected static void binaryToDef(GrayU8 binary , short[] desc ) {
		for (int i = 0; i < binary.data.length; i+=16) {
			int value = 0;
			for (int j = 0; j < 16; j++) {
				value |= binary.data[i+j] << j;
			}
			desc[i/16] = (short)value;
		}
	}
1247218
def store_frame(frame_type, grbit)   # :nodoc:
    record     = 0x1032     # Record identifier.
    length     = 0x0004     # Number of bytes to follow.
    # frame_type            # Frame type.
    # grbit                 # Option flags.

    store_simple(record, length, frame_type, grbit)
  end
676926
def write_short(self, n):
        """"""
        if n < 0 or n > 65535:
            raise FrameSyntaxError(
                'Octet {0!r} out of range 0..65535'.format(n))
        self._flushbits()
        self.out.write(pack('>H', int(n)))
630361
def _translate_src_mode_to_dst_mode(self, src_mode):
        # type: (SyncCopy, blobxfer.models.azure.StorageModes) -> bool
        
        if (self._spec.options.dest_mode ==
                blobxfer.models.azure.StorageModes.Auto):
            return src_mode
        else:
            return self._spec.options.dest_mode
278535
def write_frame(self, buf):
        '''
        
        '''
        writer = Writer(buf)

        writer.write_octet(self.type()).\
            write_short(self.channel_id).\
            write_long(len(self._payload)).\
            write(self._payload).\
            write_octet(0xce)
389091
def save(self, vs, filetype):
        ''

        # use NTF to generate filename and delete file on context exit
        with tempfile.NamedTemporaryFile(suffix='.'+filetype) as temp:
            saveSheets(temp.name, vs)
            sync(1)
            p = subprocess.Popen(
                self.command,
                stdin=open(temp.name, 'r', encoding=options.encoding),
                stdout=subprocess.DEVNULL,
                close_fds=True)
            p.communicate()
313507
public void writeDirect( byte[] b, int off, int len, int flags ) throws IOException {
        if( len <= 0 ) {
            return;
        }

        if( tmp == null ) {
            throw new IOException( "Bad file descriptor" );
        }
        ensureOpen();

        if( file.log.level >= 4 )
            file.log.println( "write: fid=" + file.fid + ",off=" + off + ",len=" + len );

        int w;
        do {
            w = len > writeSize ? writeSize : len;
            if( useNTSmbs ) {
                reqx.setParam( file.fid, fp, len - w, b, off, w );
if ((flags & 1) != 0) {
    reqx.setParam( file.fid, fp, len, b, off, w );
    reqx.writeMode = 0x8;
} else {
    reqx.writeMode = 0;
}
                file.send( reqx, rspx );
                fp += rspx.count;
                len -= rspx.count;
                off += rspx.count;
            } else {
                req.setParam( file.fid, fp, len - w, b, off, w );
                fp += rsp.count;
                len -= rsp.count;
                off += rsp.count;
                file.send( req, rsp );
            }
        } while( len > 0 );
    }