Read OPT record. This record may occur within DggContainer record or SpContainer
549584
private function _readOPT()
	{
		// offset: 0; size: 2; recVer and recInstance

		// bit: 4-15; mask: 0xFFF0; recInstance
		$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;

		$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
		$recordData = substr($this->_data, $this->_pos + 8, $length);

		// move stream pointer to next record
		$this->_pos += 8 + $length;

		$this->_readOfficeArtRGFOPTE($recordData, $recInstance);
	}
1063584
@Override
  @SuppressWarnings("unchecked")
  public D readRecord(@Deprecated D reuse) throws DataRecordException, IOException {
    try {
      if (this.recordReader.nextKeyValue()) {
        return this.readKeys ? (D) this.recordReader.getCurrentKey() : (D) this.recordReader.getCurrentValue();
      }
    } catch (InterruptedException ie) {
      throw new IOException(ie);
    }

    return null;
  }
1211142
def get_opts(opts):
    
    defaults = {
        'board': None,
        'terrain': Opt.random,
        'numbers': Opt.preset,
        'ports': Opt.preset,
        'pieces': Opt.preset,
        'players': Opt.preset,
    }
    _opts = defaults.copy()
    if opts is None:
        opts = dict()
    try:
        for key, val in opts.copy().items():
            if key == 'board':
                # board is a string, not a regular opt, and gets special handling
                # in _read_tiles_from_string
                continue
            opts[key] = Opt(val)
        _opts.update(opts)
    except Exception:
        raise ValueError('Invalid options={}'.format(opts))
    logging.debug('used defaults=\n{}\n on opts=\n{}\nreturned total opts=\n{}'.format(
        pprint.pformat(defaults),
        pprint.pformat(opts),
        pprint.pformat(_opts)))
    return _opts
1153270
def store_mso_opt_image(spid)   #:nodoc:
    type        = 0xF00B
    version     = 3
    instance    = 3
    data        = ''
    length      = nil

    data = [0x4104].pack('v') +
    [spid].pack('V')        +
    [0x01BF].pack('v')      +
    [0x00010000].pack('V')  +
    [0x03BF].pack( 'v')     +
    [0x00080000].pack( 'V')

    add_mso_generic(type, version, instance, data, length)
  end
1335110
def read  #:nodoc:
      form_ar_options
      use_default_or_unscoped do
        @resultset = if self.output_csv? || all_record_mode?
          relation = @relation
                     .includes(@ar_options[:include])
                     .joins(@ar_options[:joins])
                     .order(@ar_options[:order])
                     .group(@ar_options[:group])
                     .merge(@ar_options[:conditions])
          relation = add_references relation

          relation
        else
          # p @ar_options
          relation = @relation
                     .send(@options[:page_method_name], @ar_options[:page])
                     .per(@ar_options[:per_page])
                     .includes(@ar_options[:include])
                     .joins(@ar_options[:joins])
                     .order(@ar_options[:order])
                     .group(@ar_options[:group])
                     .merge(@ar_options[:conditions])

          relation = add_references relation

          relation
        end
      end
      invoke_resultset_callbacks
    end
34293
function read(fp, opts) {
  if (opts && opts.read) {
    return opts.read(fp, opts);
  }
  return readData.call(this, fp, opts);
}
1282906
@Override
    public Data readBackupData(Data key) {
        Record record = getRecord(key);

        if (record == null) {
            return null;
        } else {
            if (partitionService.isPartitionOwner(partitionId)) {
                // set last access time to prevent
                // premature removal of the entry because
                // of idleness based expiry
                record.setLastAccessTime(Clock.currentTimeMillis());
            }
        }

        Object value = record.getValue();
        mapServiceContext.interceptAfterGet(name, value);
        // this serialization step is needed not to expose the object, see issue 1292
        return mapServiceContext.toData(value);
    }
853109
function readData(fp, options) {
  // shallow clone options
  var opts = utils.extend({}, options);
  // get the loader for this file.
  var ext = opts.lang || path.extname(fp);
  if (ext && ext.charAt(0) !== '.') {
    ext = '.' + ext;
  }
  if (!this.dataLoaders.hasOwnProperty(ext)) {
    return this.dataLoader('read')(fp, opts);
  }
  return this.dataLoader(ext)(fp, opts);
}
43866
def _read_ipv4_options(self, size=None):
        
        counter = 0         # length of read option list
        optkind = list()    # option kind list
        options = dict()    # dict of option data

        while counter < size:
            # get option kind
            kind = self._read_unpack(1)

            # fetch corresponding option tuple
            opts = IPv4_OPT.get(kind)
            if opts is None:
                len_ = size - counter
                counter = size
                options['Unknown'] = self._read_fileng(len_)
                break

            # extract option
            dscp = OPT_TYPE.get(kind)
            desc = dscp.name
            if opts[0]:
                byte = self._read_unpack(1)
                if byte:    # check option process mode
                    data = process_opt[opts[2]](self, byte, kind)
                else:       # permission options (length is 2)
                    data = dict(
                        kind=kind,                          # option kind
                        type=self._read_opt_type(kind),     # option type info
                        length=2,                           # option length
                        flag=True,                          # permission flag
                    )
            else:           # 1-bytes options
                byte = 1

                data = dict(
                    kind=kind,                          # option kind
                    type=self._read_opt_type(kind),     # option type info
                    length=1,                           # option length
                )

            # record option data
            counter += byte
            if dscp in optkind:
                if isinstance(options[desc], tuple):
                    options[desc] += (Info(data),)
                else:
                    options[desc] = (Info(options[desc]), Info(data))
            else:
                optkind.append(dscp)
                options[desc] = data

            # break when eol triggered
            if not kind:
                break

        # get padding
        if counter < size:
            len_ = size - counter
            self._read_binary(len_)

        return tuple(optkind), options
269840
def _lookup_parameter(self, container, key, common_type=None):
        
        if not container.get('container', {}).get('docker', {}).get('parameters'):
            return
        params = container['container']['docker']['parameters']

        # Super hacky - log-opt is a sub option of the logging directive of everything else
        if key == 'log-driver':
            return [
                p
                for p
                in params
                if p['key'] in ['log-opt', 'log-driver']]

        matching_params = [
            p['value']
            for p
            in params
            if p['key'] == key]

        if matching_params:
            if common_type == list:
                return matching_params
            else:
                return matching_params[0]
280385
def read_record(fp, first_line=None):
    

    if first_line is None:
        first_line = fp.readline()

    if not first_line:
        raise EOFError()

    match = _START.match(first_line)
    if not match:
        raise Exception('Bad start of message', first_line)

    type = match.group(1)
    message = Message(type)

    while True:
        row = fp.readline()

        match = _MULTILINE_FIELD.match(row)
        if match:
            key = match.group(1)
            val = ""
            while row:
                pos = fp.tell()
                row = fp.readline()
                if row[0] in '.':
                    break
                elif row[0] in '{}':
                    fp.seek(pos)  # put the line back
                    break
                val += row
            message.contents.append((key, val, True))
            continue

        match = _FIELD.match(row)
        if match:
            key, val = match.group(1), match.group(2)
            message.contents.append((key, val, False))
            continue

        match = _START.match(row)
        if match:
            message.append(read_record(fp, row))
            continue

        if row[0] == '}':
            break

        raise Exception('Bad line', row)

    return message
900483
def read(opts = {})
      Jekyll.logger.debug "Reading:", relative_path

      if yaml_file?
        @data = SafeYAML.load_file(path)
      else
        begin
          merge_defaults
          read_content(opts)
          read_post_data
        rescue StandardError => e
          handle_read_error(e)
        end
      end
    end
843590
private function _readTertiaryOPT()
	{
		// offset: 0; size: 2; recVer and recInstance

		// bit: 4-15; mask: 0xFFF0; recInstance
		$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;

		$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
		$recordData = substr($this->_data, $this->_pos + 8, $length);

		// move stream pointer to next record
		$this->_pos += 8 + $length;
	}
293461
def _read_tcp_options(self, size):
        
        counter = 0         # length of read option list
        optkind = list()    # option kind list
        options = dict()    # dict of option data

        while counter < size:
            # get option kind
            kind = self._read_unpack(1)

            # fetch corresponding option tuple
            opts = TCP_OPT.get(kind)
            enum = OPT_TYPE.get(kind)
            if opts is None:
                len_ = size - counter
                counter = size
                optkind.append(enum)
                options[enum.name] = self._read_fileng(len_)
                break

            # extract option
            dscp = opts[1]
            if opts[0]:
                len_ = self._read_unpack(1)
                byte = opts[2](len_)
                if byte:    # check option process mode
                    data = process_opt[opts[3]](self, byte, kind)
                else:       # permission options (length is 2)
                    data = dict(
                        kind=kind,      # option kind
                        length=2,       # option length
                        flag=True,      # permission flag
                    )
            else:           # 1-bytes options
                len_ = 1
                data = dict(
                    kind=kind,      # option kind
                    length=1,       # option length
                )

            # record option data
            counter += len_
            if enum in optkind:
                if isinstance(options[dscp], tuple):
                    options[dscp] += (Info(data),)
                else:
                    options[dscp] = (Info(options[dscp]), Info(data))
            else:
                optkind.append(enum)
                options[dscp] = data

            # break when eol triggered
            if not kind:
                break

        # get padding
        if counter < size:
            len_ = size - counter
            options['padding'] = self._read_fileng(len_)

        return tuple(optkind), options
959571
function read (stream, opts, db, cb) {
  var schema = new exports.Schema;

  if (opts.onType) {
    schema.onType = opts.onType;
  }

  stream.once('error', function (err) {
    debug('aborting with error: ' + err);
    db.close(cb.bind(err));
  });

  stream.on('data', function (doc) {
    var err = schema.consume(doc);
    if (err) return abort(err, stream, db, cb);
  })

  stream.on('end', function () {
    debug('db closing');
    db.close(function () {
      debug('db closed');
      cb(null, schema);
    })
  })
}
167119
static Optional<Entity> getOpt(CheckedDatastoreReaderWriter datastore, Key key) throws IOException {
    return Optional.ofNullable(datastore.get(key));
  }
358967
private function _readDefault()
	{
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);
//		$recordData = substr($this->_data, $this->_pos + 4, $length);

		// move stream pointer to next record
		$this->_pos += 4 + $length;
	}