read <addr> <objid> <prop> [ <indx> ]
487557
def do_read(self, args):
        """"""
        args = args.split()
        if _debug: ReadPropertyConsoleCmd._debug("do_read %r", args)

        try:
            addr, obj_id, prop_id = args[:3]
            obj_id = ObjectIdentifier(obj_id).value

            datatype = get_datatype(obj_id[0], prop_id)
            if not datatype:
                raise ValueError("invalid property for object type")

            # build a request
            request = ReadPropertyRequest(
                objectIdentifier=obj_id,
                propertyIdentifier=prop_id,
                )
            request.pduDestination = Address(addr)

            if len(args) == 4:
                request.propertyArrayIndex = int(args[3])
            if _debug: ReadPropertyConsoleCmd._debug("    - request: %r", request)

            # make an IOCB
            iocb = IOCB(request)
            if _debug: ReadPropertyConsoleCmd._debug("    - iocb: %r", iocb)

            # give it to the application
            deferred(this_application.request_io, iocb)

            # wait for it to complete
            iocb.wait()

            # do something for success
            if iocb.ioResponse:
                apdu = iocb.ioResponse

                # should be an ack
                if not isinstance(apdu, ReadPropertyACK):
                    if _debug: ReadPropertyConsoleCmd._debug("    - not an ack")
                    return

                # find the datatype
                datatype = get_datatype(apdu.objectIdentifier[0], apdu.propertyIdentifier)
                if _debug: ReadPropertyConsoleCmd._debug("    - datatype: %r", datatype)
                if not datatype:
                    raise TypeError("unknown datatype")

                # special case for array parts, others are managed by cast_out
                if issubclass(datatype, Array) and (apdu.propertyArrayIndex is not None):
                    if apdu.propertyArrayIndex == 0:
                        value = apdu.propertyValue.cast_out(Unsigned)
                    else:
                        value = apdu.propertyValue.cast_out(datatype.subtype)
                else:
                    value = apdu.propertyValue.cast_out(datatype)
                if _debug: ReadPropertyConsoleCmd._debug("    - value: %r", value)

                sys.stdout.write(str(value) + '\n')
                if hasattr(value, 'debug_contents'):
                    value.debug_contents(file=sys.stdout)
                sys.stdout.flush()

            # do something for error/reject/abort
            if iocb.ioError:
                sys.stdout.write(str(iocb.ioError) + '\n')

        except Exception, error:
            ReadPropertyConsoleCmd._exception("exception: %r", error)
540385
public byte[] readPropertyDesc(Destination dst, int objIndex, int propID,
		int propIndex) throws KNXTimeoutException, KNXRemoteException,
		KNXDisconnectException, KNXLinkClosedException
	{
		if (objIndex < 0 || objIndex > 255 || propID < 0 || propID > 255 || propIndex < 0
			|| propIndex > 255)
			throw new KNXIllegalArgumentException("argument value out of range");
		final byte[] send =	DataUnitBuilder.createAPDU(PROPERTY_DESC_READ, new byte[] {
			(byte) objIndex, (byte) propID, (byte) (propID == 0 ? propIndex : 0) });
		final byte[] apdu = sendWait2(dst, priority, send, PROPERTY_DESC_RESPONSE, 7, 7);
		// max_nr_elem field is a 4bit exponent + 12bit unsigned
		// on problem this field is 0
		if (apdu[6] == 0 && apdu[7] == 0)
			throw new KNXRemoteException(
				"got no property description (object non-existant?)");
		return new byte[] { apdu[2], apdu[3], apdu[4], apdu[5], apdu[6], apdu[7], apdu[8] };
	}
369900
def read(self, obj):
        
        path, frag = [], obj
        for part in self.parts:
            path.append(part)
            if isinstance(frag, dict):
                try:
                    frag = frag[part]
                except KeyError as error:
                    raise NotFound(':'.join(path)) from error
            elif isinstance(frag, (list, tuple)):
                try:
                    frag = frag[int(part)]
                except IndexError as error:
                    raise NotFound(':'.join(path)) from error
                except ValueError as error:
                    raise WrongType(':'.join(path)) from error
            elif isinstance(frag, (str, int)):
                raise WrongType(':'.join(path))
            else:
                raise NotFound(':'.join(path))
        return frag
154204
def readinto(self, buf):
        """"""
        got = 0
        vbuf = memoryview(buf)
        while got < len(buf):
            # next vol needed?
            if self._cur_avail == 0:
                if not self._open_next():
                    break

            # length for next read
            cnt = len(buf) - got
            if cnt > self._cur_avail:
                cnt = self._cur_avail

            # read into temp view
            res = self._fd.readinto(vbuf[got : got + cnt])
            if not res:
                break
            self._md_context.update(vbuf[got : got + res])
            self._cur_avail -= res
            self._remain -= res
            got += res
        return got
341880
def oper(inst):
    
    i = inst.strip(' \t\n').split(' ')
    I = i[0].lower()  # Instruction
    i = ''.join(i[1:])

    op = i.split(',')
    if I in {'call', 'jp', 'jr'} and len(op) > 1:
        op = op[1:] + ['f']

    elif I == 'djnz':
        op.append('b')

    elif I in {'push', 'pop', 'call'}:
        op.append('sp')  # Sp is also affected by push, pop and call

    elif I in {'or', 'and', 'xor', 'neg', 'cpl', 'rrca', 'rlca'}:
        op.append('a')

    elif I in {'rra', 'rla'}:
        op.extend(['a', 'f'])

    elif I in ('rr', 'rl'):
        op.append('f')

    elif I in {'adc', 'sbc'}:
        if len(op) == 1:
            op = ['a', 'f'] + op

    elif I in {'add', 'sub'}:
        if len(op) == 1:
            op = ['a'] + op

    elif I in {'ldd', 'ldi', 'lddr', 'ldir'}:
        op = ['hl', 'de', 'bc']

    elif I in {'cpd', 'cpi', 'cpdr', 'cpir'}:
        op = ['a', 'hl', 'bc']

    elif I == 'exx':
        op = ['*', 'bc', 'de', 'hl', 'b', 'c', 'd', 'e', 'h', 'l']

    elif I in {'ret', 'reti', 'retn'}:
        op += ['sp']

    elif I == 'out':
        if len(op) and RE_OUTC.match(op[0]):
            op[0] = 'c'
        else:
            op.pop(0)

    elif I == 'in':
        if len(op) > 1 and RE_OUTC.match(op[1]):
            op[1] = 'c'
        else:
            op.pop(1)

    for i in range(len(op)):
        tmp = RE_INDIR16.match(op[i])
        if tmp is not None:
            op[i] = '(' + op[i].strip()[1:-1].strip().lower() + ')'  # '  (  dE )  ' => '(de)'

    return op
398391
def getextensibleindex(bunchdt, data, commdct, key, objname):
    """"""
    theobject = getobject(bunchdt, key, objname)
    if theobject == None:
        return None
    theidd = iddofobject(data, commdct, key)
    extensible_i = [
        i for i in range(len(theidd)) if 'begin-extensible' in theidd[i]]
    try:
        extensible_i = extensible_i[0]
    except IndexError:
        return theobject
89955
public byte[] getDescription(int objIndex, int pid, int propIndex)
		throws KNXException
	{
		return mc.readPropertyDesc(dst, objIndex, pid, propIndex);
	}
549530
function builtinRead(x) {
        if (Sk.builtinFiles === undefined || Sk.builtinFiles["files"][x] === undefined)
          throw "File not found: '" + x + "'";
        return Sk.builtinFiles["files"][x];
      }
775200
public void readCoordinate(int[] index, float[] dataR, float[] dataI)
            throws IOException {
        int size = index.length;
        if (size != dataR.length || size != dataI.length)
            throw new IllegalArgumentException(
                    "All arrays must be of the same size");
        for (int i = 0; i < size; ++i) {
            index[i] = getInt();
            dataR[i] = getFloat();
            dataI[i] = getFloat();
        }
    }
1238122
private void parseJITOnlyReads(Map<Object, Object> props) {
        Object value = props.get(HttpConfigConstants.PROPNAME_JIT_ONLY_READS);
        if (null != value) {
            this.bJITOnlyReads = convertBoolean(value);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Config: JIT only reads is " + isJITOnlyReads());
            }
        }
    }
650437
async def read(cls, id: int):
        """"""
        data = await cls._handler.read(id=id)
        return cls(data)
643624
private void registerObjectRead(Object obj, int handle, boolean unshared) throws IOException {
        if (unshared) {
            obj = UNSHARED_OBJ;
        }
        int index = handle - ObjectStreamConstants.baseWireHandle;
        int size = objectsRead.size();
        // ObjectOutputStream sometimes wastes a handle. I've compared hex dumps of the RI
        // and it seems like that's a 'feature'. Look for calls to objectsWritten.put that
        // are guarded by !unshared tests.
        while (index > size) {
            objectsRead.add(null);
            ++size;
        }
        if (index == size) {
            objectsRead.add(obj);
        } else {
            objectsRead.set(index, obj);
        }
    }
62909
def _read_register(self, reg):
        """"""
        self.buf[0] = reg
        with self.i2c_device as i2c:
            i2c.write(self.buf, end=1, stop=False)
            i2c.readinto(self.buf, end=2)
        return self.buf[0] << 8 | self.buf[1]
1118645
def peek(self):
        """"""
        info = self._registry.get(self)
        obj = info and info.weakref()
        if obj is not None:
            return (obj, info.func, info.args, info.kwargs or {})
1313553
def _read_mac_addr(self):
        """"""
        _byte = self._read_fileng(6)
        _addr = '-'.join(textwrap.wrap(_byte.hex(), 2))
        return _addr
578506
function(inst) {
                // `can.__reading` makes a note that `id` was just read.
                can.__reading(inst, inst.constructor.id);
                // Use `__get` instead of `attr` for performance. (But that means we have to remember to call `can.__reading`.)
                return inst.__get(inst.constructor.id);
            }
73065
function read (parser, type, key, limit = Infinity) {
  let count = 0

  pipeline(parser, new Writable({
    write (obj, enc, cb) {
      if (typeof type === 'string') key = type

      if (typeof type === 'number') {
        limit = type
        type = undefined
      }

      if (typeof key === 'number') {
        limit = key
        key = undefined
      }

      if (count >= limit) {
        return cb()
      }

      if (type instanceof Object && !(obj instanceof type)) {
        return cb()
      }

      dir(key ? obj[key] : obj, { colors: true })

      count++

      cb()
    },
    objectMode: true
  }), er => {
    log(er || 'ok')
    server.displayPrompt()
  })
}