Initialize the CEMI frame for a group write operation.
974956
def init_group_write(self, dst_addr=1, data=None, dptsize=0):
        """"""
        self.init_group(dst_addr)

        # unnumbered data packet, group write
        self.tpci_apci = 0x00 * 256 + 0x80

        self.dptsize = dptsize
        if data is None:
            self.data = [0]
        else:
            self.data = data
1099231
@SuppressWarnings("resource")
	private void initializeContentBuffer() throws IOException {
		this.tempFile = File.createTempFile("shapeWriter", ".sh_");  //$NON-NLS-1$//$NON-NLS-2$
		this.tempFile.deleteOnExit();
		this.tempStream = Channels.newChannel(new FileOutputStream(this.tempFile));
		this.buffer = ByteBuffer.allocate(BLOCK_SIZE);
		this.bufferPosition = 0;
	}
1036650
def _init_cgroups(self):
        
        self.cgroups = find_my_cgroups()

        for subsystem in self._cgroup_subsystems:
            self.cgroups.require_subsystem(subsystem)
            if subsystem not in self.cgroups:
                sys.exit('Required cgroup subsystem "{}" is missing.'.format(subsystem))

        # Feature is still experimental, do not warn loudly
        self.cgroups.require_subsystem(BLKIO, log_method=logging.debug)
        if BLKIO not in self.cgroups:
            logging.debug('Cannot measure I/O without blkio cgroup.')

        self.cgroups.require_subsystem(CPUACCT)
        if CPUACCT not in self.cgroups:
            logging.warning('Without cpuacct cgroups, cputime measurement and limit '
                            'might not work correctly if subprocesses are started.')

        self.cgroups.require_subsystem(FREEZER)
        if FREEZER not in self.cgroups:
            if self._user is not None:
                # In sudo mode, we absolutely need at least one cgroup subsystem
                # to be able to find the process where we need to send signals to
                sys.exit('Cannot reliably kill sub-processes without freezer cgroup,'
                         + ' this is necessary if --user is specified.'
                         + ' Please enable this cgroup or do not specify --user.')
            else:
                logging.warning('Cannot reliably kill sub-processes without freezer cgroup.')

        self.cgroups.require_subsystem(MEMORY)
        if MEMORY not in self.cgroups:
            logging.warning('Cannot measure memory consumption without memory cgroup.')
        else:
            if systeminfo.has_swap() and (
                    not self.cgroups.has_value(MEMORY, 'memsw.max_usage_in_bytes')):
                logging.warning(
                    'Kernel misses feature for accounting swap memory, but machine has swap. '
                    'Memory usage may be measured inaccurately. '
                    'Please set swapaccount=1 on your kernel command line or disable swap with '
                    '"sudo swapoff -a".')

        self.cgroups.require_subsystem(CPUSET)
        self.cpus = None # to indicate that we cannot limit cores
        self.memory_nodes = None # to indicate that we cannot limit cores
        if CPUSET in self.cgroups:
            # Read available cpus/memory nodes:
            try:
                self.cpus = util.parse_int_list(self.cgroups.get_value(CPUSET, 'cpus'))
            except ValueError as e:
                logging.warning("Could not read available CPU cores from kernel: %s", e.strerror)
            logging.debug("List of available CPU cores is %s.", self.cpus)

            try:
                self.memory_nodes = util.parse_int_list(self.cgroups.get_value(CPUSET, 'mems'))
            except ValueError as e:
                logging.warning("Could not read available memory nodes from kernel: %s",
                                e.strerror)
            logging.debug("List of available memory nodes is %s.", self.memory_nodes)
550267
def _init_threads(self):
        """"""
        if self._io_thread is None:
            self._io_thread = Thread(target=self._select)
            self._io_thread.start()

        if self._writer_thread is None:
            self._writer_thread = Thread(target=self._writer)
            self._writer_thread.start()
1315138
def write_frame(self, channel_id, frame_out):
        
        frame_data = pamqp_frame.marshal(frame_out, channel_id)
        self.heartbeat.register_write()
        self._io.write_to_socket(frame_data)
772293
def _init_file(self):
        """"""
        header_length = 2*SECTOR_LENGTH
        if self.size > header_length:
            self.file.truncate(header_length)
        self.file.seek(0)
        self.file.write(header_length*b'\x00')
        self.size = header_length
691234
def set_initial_state(self, initial_state, initial_frames):
    """"""
    self._initial_state = initial_state
    self._initial_frames = initial_frames[:, -1, ...]
    self._should_preprocess_on_reset = False
1115830
public void initTimer(){
		stopTimer();
		if(this.WRITE_CACHE_ENABLED) {
			logger.debug("configuring write cache with defaults");
			timerWriteCache = new TripleWriteCache(this);
			writeTimer = new Timer();
			writeTimer.scheduleAtFixedRate(timerWriteCache, TripleWriteCache.DEFAULT_INITIAL_DELAY, TripleWriteCache.DEFAULT_CACHE_MILLIS);
		}
		if(this.DELETE_CACHE_ENABLED) {
			logger.debug("configuring delete cache with defaults");
			timerDeleteCache = new TripleDeleteCache(this);
			deleteTimer = new Timer();
			deleteTimer.scheduleAtFixedRate(timerDeleteCache, TripleDeleteCache.DEFAULT_INITIAL_DELAY, TripleDeleteCache.DEFAULT_CACHE_MILLIS);
		}
	}
377909
def write_frame(self, buf):
        '''
        
        '''
        writer = Writer(buf)
        writer.write_octet(self.type())
        writer.write_short(self.channel_id)

        # Track the position where we're going to write the total length
        # of the frame arguments.
        stream_args_len_pos = len(buf)
        writer.write_long(0)

        stream_method_pos = len(buf)

        writer.write_short(self._class_id)
        writer.write_short(self._weight)
        writer.write_longlong(self._size)

        # Like frame parsing, branch to faster code for default properties
        if self.DEFAULT_PROPERTIES:
            # Track the position where we're going to write the flags.
            flags_pos = len(buf)
            writer.write_short(0)
            flag_bits = 0
            for key, proptype, rfunc, wfunc, mask in self.PROPERTIES:
                val = self._properties.get(key, None)
                if val is not None:
                    flag_bits |= mask
                    wfunc(writer, val)
            writer.write_short_at(flag_bits, flags_pos)
        else:
            shift = 15
            flag_bits = 0
            flags = []
            stack = deque()
            for key, proptype, rfunc, wfunc, mask in self.PROPERTIES:
                val = self._properties.get(key, None)
                if val is not None:
                    if shift == 0:
                        flags.append(flag_bits)
                        flag_bits = 0
                        shift = 15

                    flag_bits |= (1 << shift)
                    stack.append((wfunc, val))

                shift -= 1

            flags.append(flag_bits)
            for flag_bits in flags:
                writer.write_short(flag_bits)
            for method, val in stack:
                method(writer, val)

        # Write the total length back at the beginning of the frame
        stream_len = len(buf) - stream_method_pos
        writer.write_long_at(stream_len, stream_args_len_pos)

        writer.write_octet(0xce)
1291624
@Override
    public void initialize(ExtensionContext context) {
        SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME, JGroupsModel.CURRENT.getVersion());

        registration.registerSubsystemModel(new JGroupsSubsystemResourceDefinition(context.isRuntimeOnlyRegistrationValid()));
        registration.registerXMLElementWriter(new JGroupsSubsystemXMLWriter());
    }
372476
def write(self, group_id, handle):
        '''
        '''
        name = self.name.encode('utf-8')
        desc = self.desc.encode('utf-8')
        handle.write(struct.pack('bb', len(name), -group_id))
        handle.write(name)
        handle.write(struct.pack('<h', 3 + len(desc)))
        handle.write(struct.pack('B', len(desc)))
        handle.write(desc)
        for param in self.params.values():
            param.write(group_id, handle)
1086617
def write_to(self, group):
        
        # The HDF5 group where to write data
        items_group = group[self.name]

        nitems = items_group.shape[0]
        items_group.resize((nitems + len(self.data),))
        items_group[nitems:] = self.data
48722
private void init(SessionConfig config) {
        mEncodedFirstFrame = false;
        mReadyForFrames = false;
        mRecording = false;
        mEosRequested = false;

        mCurrentCamera = -1;
        mDesiredCamera = Camera.CameraInfo.CAMERA_FACING_BACK;

        mCurrentFlash = Parameters.FLASH_MODE_OFF;
        mDesiredFlash = null;

        mCurrentFilter = -1;
        mNewFilter = Filters.FILTER_NONE;

        mThumbnailRequested = false;
        mThumbnailRequestedOnFrame = -1;

        mSessionConfig = checkNotNull(config);
    }
873068
@Override
    public void init(TCPWriteRequestContext x, H2MuxTCPWriteCallback c) {
        writeReqContext = x;
        muxCallback = c;

        // callback will need to know how to get back to this write queue.
        // This means one and only one H2WriteTree per H2InboundLink which has just one true TCP Channel facing write callback
        muxCallback.setH2WorkQ(this);

        tree = new Tree();

    }
1099208
public function init()
	{
		if($this->data===null)
			throw new CException(Yii::t('zii','Please specify the "data" property.'));
		if($this->attributes===null)
		{
			if($this->data instanceof CModel)
				$this->attributes=$this->data->attributeNames();
			elseif(is_array($this->data))
				$this->attributes=array_keys($this->data);
			else
				throw new CException(Yii::t('zii','Please specify the "attributes" property.'));
		}
		if($this->nullDisplay===null)
			$this->nullDisplay='<span class="null">'.Yii::t('zii','Not set').'</span>';
		if(isset($this->htmlOptions['id']))
			$this->id=$this->htmlOptions['id'];
		else
			$this->htmlOptions['id']=$this->id;

		if($this->baseScriptUrl===null)
			$this->baseScriptUrl=Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('zii.widgets.assets')).'/detailview';

		if($this->cssFile!==false)
		{
			if($this->cssFile===null)
				$this->cssFile=$this->baseScriptUrl.'/styles.css';
			Yii::app()->getClientScript()->registerCssFile($this->cssFile);
		}
	}
505635
def _write_frame(self, frame_out):
        
        self._connection.write_frame(0, frame_out)
        LOGGER.debug('Frame Sent: %s', frame_out.name)
1252445
def write_frames(self, channel_id, frames_out):
        
        data_out = EMPTY_BUFFER
        for single_frame in frames_out:
            data_out += pamqp_frame.marshal(single_frame, channel_id)
        self.heartbeat.register_write()
        self._io.write_to_socket(data_out)