Move internal data from RAM to disk.
769566
def ram2disk(self):
        """"""
        values = self.series
        self.deactivate_ram()
        self.diskflag = True
        self._save_int(values)
        self.update_fastaccess()
598940
def _load_from_disk(self, dtype_out_time, dtype_out_vert=False,
                        region=False):
        """"""
        ds = xr.open_dataset(self.path_out[dtype_out_time])
        if region:
            arr = ds[region.name]
            # Use region-specific pressure values if available.
            if (self.dtype_in_vert == internal_names.ETA_STR
                    and not dtype_out_vert):
                reg_pfull_str = region.name + '_pressure'
                arr = arr.drop([r for r in arr.coords.iterkeys()
                                if r not in (internal_names.PFULL_STR,
                                             reg_pfull_str)])
                # Rename pfull to pfull_ref always.
                arr = arr.rename({internal_names.PFULL_STR:
                                  internal_names.PFULL_STR + '_ref'})
                # Rename region_pfull to pfull if its there.
                if hasattr(arr, reg_pfull_str):
                    return arr.rename({reg_pfull_str:
                                       internal_names.PFULL_STR})
                return arr
            return arr
        return ds[self.name]
531418
def db_export(schema, uuid, object_filter, export_format, filename, pretty, all_schemata, omit):
    """"""

    internal_backup(schema, uuid, object_filter, export_format, filename, pretty, all_schemata, omit)
268062
async def main():
    """"""
    async with aiohttp.ClientSession() as session:
        data = Glances(loop, session, version=VERSION)

        # Get the metrics for the memory
        await data.get_metrics('mem')

        # Print the values
        print("Memory values:", data.values)

        # Get the metrics about the disks
        await data.get_metrics('diskio')

        # Print the values
        print("Disk values:", data.values)
627864
def memory_pour(buffer_, *args, **kwargs):
    """"""

    def opener(archive_res):
        _LOGGER.debug("Opening from (%d) bytes (memory_pour).", len(buffer_))
        _archive_read_open_memory(archive_res, buffer_)

    return _pour(opener, *args, flags=0, **kwargs)
562362
def rm(filename, recursive=False, force=False):
    """"""
    return auto(remove_file, filename, recursive, force)
366706
def new_data(self, mem, addr, data):
        """"""
        done = False
        if mem.id == self.id:
            if addr == LocoMemory.MEM_LOCO_INFO:
                self.nr_of_anchors = data[0]
                if self.nr_of_anchors == 0:
                    done = True
                else:
                    self.anchor_data = \
                        [AnchorData() for _ in range(self.nr_of_anchors)]
                    self._request_page(0)
            else:
                page = int((addr - LocoMemory.MEM_LOCO_ANCHOR_BASE) /
                           LocoMemory.MEM_LOCO_ANCHOR_PAGE_SIZE)

                self.anchor_data[page].set_from_mem_data(data)

                next_page = page + 1
                if next_page < self.nr_of_anchors:
                    self._request_page(next_page)
                else:
                    done = True

        if done:
            self.valid = True
            if self._update_finished_cb:
                self._update_finished_cb(self)
                self._update_finished_cb = None
1076312
def write_data(self, write_finished_cb):
        """"""
        self._write_finished_cb = write_finished_cb
        data = bytearray()

        for poly4D in self.poly4Ds:
            data += struct.pack('<ffffffff', *poly4D.x.values)
            data += struct.pack('<ffffffff', *poly4D.y.values)
            data += struct.pack('<ffffffff', *poly4D.z.values)
            data += struct.pack('<ffffffff', *poly4D.yaw.values)
            data += struct.pack('<f', poly4D.duration)

        self.mem_handler.write(self, 0x00, data, flush_queue=True)
98208
def write_data(data, out_file):
    """"""
    with open(out_file, 'w') as handle_out:
        handle_out.write(json.dumps([data], skipkeys=True, indent=2))
201507
def _tofile(self, fh, pam=False):
        """"""
        fh.seek(0)
        fh.write(self._header(pam))
        data = self.asarray(copy=False)
        if self.maxval == 1:
            data = numpy.packbits(data, axis=-1)
        data.tofile(fh)
673989
def free_memory(self):
        """"""
        self.main.free_memory()
        QTimer.singleShot(self.INITIAL_FREE_MEMORY_TIME_TRIGGER,
                          lambda: self.main.free_memory())
        QTimer.singleShot(self.SECONDARY_FREE_MEMORY_TIME_TRIGGER,
                          lambda: self.main.free_memory())
66549
def _Write(self, data, length, progress_callback=None):
        """"""
        if progress_callback:
            progress = self._HandleProgress(length, progress_callback)
            next(progress)
        while length:
            tmp = data.read(self.chunk_kb * 1024)
            length -= len(tmp)
            self.usb.BulkWrite(tmp)

            if progress_callback and progress:
                progress.send(len(tmp))
206711
function (storeOrEditor, from, to) {
    debug('Performing inMemoryMove from ' + from + ' to ' + to);
    var store = (storeOrEditor && storeOrEditor.store ? storeOrEditor.store : storeOrEditor);
    var memFsEditor = require('mem-fs-editor').create(store);
    var fromLen = from.length;
    store.each(function (file) {
      var idx = file.path.indexOf(from);
      if (idx === 0 && file.contents !== null && file.state !== 'deleted') {
        var absTo = path.join(to, file.path.substr(fromLen));
        // exact match so we are copying a single file and not a folder
        if (fromLen === file.path.length) {
          absTo = path.join(to, path.basename(file.path));
        }
        debug('IN-MEMORY MOVING FROM: ' + file.path + ' TO: ' + absTo);
        memFsEditor.move(file.path, absTo);
      }
    });
  }
1370081
def to_cram(data):
    
    data = utils.to_single_data(data)
    cram_file = cram.compress(dd.get_work_bam(data) or dd.get_align_bam(data), data)
    out_key = "archive_bam" if cwlutils.is_cwl_run(data) else "work_bam"
    data[out_key] = cram_file
    return [[data]]
1322361
public void dumpMemory() {
    Double[] keys = memory.keySet().toArray(new Double[memory.keySet().size()]);
    Arrays.sort(keys);
    for (Double key : keys) {
      System.err.println(key + "\t" + memory.get(key));
    }
  }
318833
def bytes_to_file(input_data, output_file):
    """"""
    pathlib.Path(output_file.parent).mkdir(parents=True, exist_ok=True)

    with open(output_file, "wb") as file:
        file.write(input_data)
361360
def __alloc_raw_data(self, initial_values=None):
        """"""
        #allocate c_ubyte storage
        if self.__raw_data == None: #first time only, create storage
            raw_data_type = c_ubyte * self.__raw_report_size
            self.__raw_data = raw_data_type()
        elif initial_values == self.__raw_data:
            # already
            return
        else:
            #initialize
            ctypes.memset(self.__raw_data, 0, len(self.__raw_data))
        if initial_values:
            for index in range(len(initial_values)):
                self.__raw_data[index] = initial_values[index]