Writes bus data to an Excel spreadsheet.
160862
def write_bus_data(self, file):
        
        bus_sheet = self.book.add_sheet("Buses")

        for i, bus in enumerate(self.case.buses):
            for j, attr in enumerate(BUS_ATTRS):
                bus_sheet.write(i, j, getattr(bus, attr))
432329
protected function write()
    {
        $this->updateSize();
        $this->writeStatus($this->units, $this->total, $this->columns, $this->columns);
    }
529170
public AbstractExcelWriter<T> write(List<T> datas) throws WriteExcelException {
        this.initWrite(datas);
        this.validateDataPerWrite();
        for (T data : this.datas) {
            this.writePerData(data);
        }
        this.datas.clear();
        return this;
    }
688319
def write(self):
        
        # write data
        self.project_manager.writeInput(session=self.db_session,
                                        directory=self.project_directory,
                                        name=self.project_manager.name)
576854
def write(self, b: bytes) -> None:
        """"""
        if not isinstance(b, bytes):
            raise TypeError('a bytes-like object is required, not {}'.format(type(b)))
        if not self.std_sim_instance.pause_storage:
            self.byte_buf += b
        if self.std_sim_instance.echo:
            self.std_sim_instance.inner_stream.buffer.write(b)

            # Since StdSim wraps TextIO streams, we will flush the stream if line buffering is on
            # and the bytes being written contain a new line character. This is helpful when StdSim
            # is being used to capture output of a shell command because it causes the output to print
            # to the screen more often than if we waited for the stream to flush its buffer.
            if self.std_sim_instance.line_buffering:
                if any(newline in b for newline in ByteBuf.NEWLINES):
                    self.std_sim_instance.flush()
1104984
def write (self, data):
        """"""
        self.tmpbuf.append(data)
        self.pos += len(data)
379566
def _write_data(self, file):
        
        self.write_case_data(file)

        file.write("Bus Data\n")
        file.write("-" * 8 + "\n")
        self.write_bus_data(file)
        file.write("\n")

        file.write("Branch Data\n")
        file.write("-" * 11 + "\n")
        self.write_branch_data(file)
        file.write("\n")

        file.write("Generator Data\n")
        file.write("-" * 14 + "\n")
        self.write_generator_data(file)
        file.write("\n")
850047
def write (self, data):
        """"""
        assert isinstance(data, unicode)
        if self.closed:
            raise IOError("Write on closed I/O object")
        if data:
            self.buf.append(data)
450615
def Write(self, data):
        """"""
        self._Send(b'WRTE', arg0=self.local_id, arg1=self.remote_id, data=data)
        # Expect an ack in response.
        cmd, okay_data = self.ReadUntil(b'OKAY')
        if cmd != b'OKAY':
            if cmd == b'FAIL':
                raise usb_exceptions.AdbCommandFailureException(
                    'Command failed.', okay_data)
            raise InvalidCommandError(
                'Expected an OKAY in response to a WRITE, got %s (%s)',
                cmd, okay_data)
        return len(data)
925203
public void writeToExcel(List<? extends Object> datas, boolean hasTitle,
                             OutputStream outputStream, int inMemory,
                             boolean transverse) throws IOException {
        log.info("准备将数据写入excel");
        //这里使用SXSSFWorkbook而不是XSSFWorkbook，这样将会节省内存，但是内存中仅仅存在inMemory行数据，如果超出那么会将
        //index最小的刷新到本地，后续不能通过getRow方法获取到该行
        SXSSFWorkbook wb = new SXSSFWorkbook(inMemory);
        writeToExcel(datas, hasTitle, wb, transverse);
        log.info("数据写入excel完毕，准备写入本地文件");
        wb.write(outputStream);
        log.debug("删除临时文件，关闭Workbook");
        wb.dispose();
        wb.close();
    }
794106
public ExcelWriter writeRow(Map<?, ?> rowMap, boolean isWriteKeyAsHead) {
		Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
		if (MapUtil.isEmpty(rowMap)) {
			// 如果写出数据为null或空，跳过当前行
			return passCurrentRow();
		}

		final Map<?, ?> aliasMap = aliasMap(rowMap);

		if (isWriteKeyAsHead) {
			writeHeadRow(aliasMap.keySet());
		}
		writeRow(aliasMap.values());
		return this;
	}
1137668
def _writen(fd, data):
    """"""
    while data:
        n = os.write(fd, data)
        data = data[n:]
927641
def write_data(self, buf):
        
        if sys.version_info[0] < 3:
            str_buf = ''.join(map(chr, buf))
        else:
            str_buf = bytes(buf)
        result = self.dev.controlWrite(
            libusb1.LIBUSB_ENDPOINT_OUT | libusb1.LIBUSB_TYPE_CLASS |
            libusb1.LIBUSB_RECIPIENT_INTERFACE,
            libusb1.LIBUSB_REQUEST_SET_CONFIGURATION,
            0x200, 0, str_buf, timeout=50)
        if result != len(buf):
            raise IOError('pywws.device_libusb1.USBDevice.write_data failed')
        return True
782359
def connectivity(self, bus):
        """"""
        if not self.n:
            return
        n = self.nb
        fr = self.a1
        to = self.a2
        os = [0] * self.n

        # find islanded buses
        diag = list(
            matrix(
                spmatrix(self.u, to, os, (n, 1), 'd') +
                spmatrix(self.u, fr, os, (n, 1), 'd')))
        nib = bus.n_islanded_buses = diag.count(0)
        bus.islanded_buses = []
        for idx in range(n):
            if diag[idx] == 0:
                bus.islanded_buses.append(idx)

        # find islanded areas
        temp = spmatrix(
            list(self.u) * 4, fr + to + fr + to, to + fr + fr + to, (n, n),
            'd')
        cons = temp[0, :]
        nelm = len(cons.J)
        conn = spmatrix([], [], [], (1, n), 'd')
        bus.island_sets = []
        idx = islands = 0
        enum = 0

        while 1:
            while 1:
                cons = cons * temp
                cons = sparse(cons)  # remove zero values
                new_nelm = len(cons.J)
                if new_nelm == nelm:
                    break
                nelm = new_nelm
            if len(cons.J) == n:  # all buses are interconnected
                return
            bus.island_sets.append(list(cons.J))
            conn += cons
            islands += 1
            nconn = len(conn.J)
            if nconn >= (n - nib):
                bus.island_sets = [i for i in bus.island_sets if i != []]
                break

            for element in conn.J[idx:]:
                if not diag[idx]:
                    enum += 1  # skip islanded buses
                if element <= enum:
                    idx += 1
                    enum += 1
                else:
                    break

            cons = temp[enum, :]
23657
def on_bus(self, bus_idx):
        
        assert hasattr(self, 'bus')

        ret = []
        if isinstance(bus_idx, (int, float, str)):
            bus_idx = [bus_idx]

        for item in bus_idx:
            idx = []
            for e, b in enumerate(self.bus):
                if b == item:
                    idx.append(self.idx[e])
            if len(idx) == 1:
                idx = idx[0]
            elif len(idx) == 0:
                idx = None

            ret.append(idx)

        if len(ret) == 1:
            ret = ret[0]

        return ret
960642
def _write(self, cmd, *datas):
        """"""
        cmd = Command(write=cmd)
        cmd.write(self._transport, self._protocol, *datas)
999408
def write_data(self, buf):
        
        result = self.devh.controlMsg(
            usb.ENDPOINT_OUT + usb.TYPE_CLASS + usb.RECIP_INTERFACE,
            usb.REQ_SET_CONFIGURATION, buf, value=0x200, timeout=50)
        if result != len(buf):
            raise IOError('pywws.device_libusb.USBDevice.write_data failed')
        return True