A generator that returns the SDR list. Starting with ID=0x0000 and
        end when ID=0xffff is returned.
170458
def device_sdr_entries(self):
        
        reservation_id = self.reserve_device_sdr_repository()
        record_id = 0

        while True:
            record = self.get_device_sdr(record_id, reservation_id)
            yield record
            if record.next_id == 0xffff:
                break
            record_id = record.next_id
856525
def get_sensor_data(self):
        
        self.init_sdr()
        for sensor in self._sdr.get_sensor_numbers():
            rsp = self.raw_command(command=0x2d, netfn=4, data=(sensor,))
            if 'error' in rsp:
                if rsp['code'] == 203:  # Sensor does not exist, optional dev
                    continue
                raise exc.IpmiException(rsp['error'], code=rsp['code'])
            yield self._sdr.sensors[sensor].decode_sensor_reading(rsp['data'])
        self.oem_init()
        for reading in self._oem.get_sensor_data():
            yield reading
376384
def pad_decr(ids):
  """"""
  if len(ids) < 1:
    return list(ids)
  if not any(ids):
    return []  # all padding.
  idx = -1
  while not ids[idx]:
    idx -= 1
  if idx == -1:
    ids = ids
  else:
    ids = ids[:idx + 1]
  return [i - 1 for i in ids]
728449
def generateSequences(n=2048, w=40, sequenceLength=5, sequenceCount=2,
                      sharedRange=None, seed=42):
  
  # Lots of room for noise sdrs
  patternAlphabetSize = 10*(sequenceLength * sequenceCount)
  patternMachine = PatternMachine(n, w, patternAlphabetSize, seed)
  sequenceMachine = SequenceMachine(patternMachine, seed)
  numbers = sequenceMachine.generateNumbers(sequenceCount, sequenceLength,
                                            sharedRange=sharedRange )
  generatedSequences = sequenceMachine.generateFromNumbers(numbers)

  return sequenceMachine, generatedSequences, numbers
190807
def resource_list(cls):
        
        items = cls.list()
        ret = [vlan['name'] for vlan in items]
        ret.extend([str(vlan['id']) for vlan in items])
        return ret
330329
def get_symbols_list(self):
        ''''''
        slist = []
        rc, nSymb, nElem = gdxcc.gdxSystemInfo(self.gdx_handle)
        assert rc, 'Unable to retrieve "%s" info' % self.filename
        self.number_symbols = nSymb
        self.number_elements = nElem
        slist = [None]*(nSymb+1)
        for j in range(0,nSymb+1):
            sinfo = self.get_sid_info(j)
            if j==0:
                sinfo['name'] = 'universal_set'
            slist[j] = GdxSymb(self,sinfo)
        return slist
783302
def identify_denonavr_receivers():
    
    # Sending SSDP broadcast message to get devices
    devices = send_ssdp_broadcast()

    # Check which responding device is a DenonAVR device and prepare output
    receivers = []
    for device in devices:
        try:
            receiver = evaluate_scpd_xml(device["URL"])
        except ConnectionError:
            continue
        if receiver:
            receivers.append(receiver)

    return receivers
124502
def decode(self, descriptor):
        
        i = iter(descriptor)
        n = len(self._schema)

        # Add the name key to our schema
        schema = self._schema + ('name',)
        # For each dimensions, generator takes n items off iterator
        # wrapping the descriptor, making a tuple with the dimension
        # name appended
        tuple_gen = (tuple(itertools.islice(i, n)) + (d, )
            for d in self._dimensions)

        # Generate dictionary by mapping schema keys to generated tuples
        return [{ k: v for k, v in zip(schema, t) } for t in tuple_gen]
626923
def _prototype_to_generator(descriptor, cls):
    ''
    _fd = D.FieldDescriptor
    generator = None

    ints32 = [_fd.TYPE_INT32, _fd.TYPE_UINT32, _fd.TYPE_FIXED32,
              _fd.TYPE_SFIXED32, _fd.TYPE_SINT32]
    ints64 = [_fd.TYPE_INT64, _fd.TYPE_UINT64, _fd.TYPE_FIXED64,
              _fd.TYPE_SFIXED64, _fd.TYPE_SINT64]
    ints_signed = [_fd.TYPE_INT32, _fd.TYPE_SFIXED32, _fd.TYPE_SINT32,
                   _fd.TYPE_INT64, _fd.TYPE_SFIXED64, _fd.TYPE_SINT64]

    if descriptor.type in ints32+ints64:
        bitwidth = [32, 64][descriptor.type in ints64]
        unsigned = descriptor.type not in ints_signed
        generator = _int_generator(descriptor, bitwidth, unsigned)
    elif descriptor.type == _fd.TYPE_DOUBLE:
        generator = _float_generator(descriptor, 64)
    elif descriptor.type == _fd.TYPE_FLOAT:
        generator = _float_generator(descriptor, 32)
    elif descriptor.type == _fd.TYPE_STRING:
        generator = _string_generator(descriptor)
    elif descriptor.type == _fd.TYPE_BYTES:
        generator = _bytes_generator(descriptor)
    elif descriptor.type == _fd.TYPE_BOOL:
        generator = gen.IterValueGenerator(descriptor.name, [True, False])
    elif descriptor.type == _fd.TYPE_ENUM:
        generator = _enum_generator(descriptor)
    elif descriptor.type == _fd.TYPE_MESSAGE:
        generator = descriptor_to_generator(descriptor.message_type, cls)
        generator.set_name(descriptor.name)
    else:
        raise RuntimeError("type {} unsupported".format(descriptor.type))

    return generator
1346505
def init_sdr(self):
        
        # For now, return current sdr if it exists and still connected
        # future, check SDR timestamp for continued relevance
        # further future, optionally support a cache directory/file
        # to store cached copies for given device id, product id, mfg id,
        # sdr timestamp, our data version revision, aux firmware revision,
        # and oem defined field
        if self._sdr is None:
            self._sdr = sdr.SDR(self, self._sdrcachedir)
        return self._sdr
199751
def get(self, start, end):
        
        return [self.read_byte(addr) for addr in xrange(start, end)]
1032248
def _get_receivers(self, sender):
        '''  '''
        key = _make_id(sender)
        receivers = []
        for (receiver_key, sender_key), receiver in self.receivers.items():
            if sender_key == key:
                receivers.append(receiver)
        return receivers
713771
def bytes()
			return [
				(@addr >> 56 & 0xff).to_s(16).rjust(2, "0"),
				(@addr >> 48 & 0xff).to_s(16).rjust(2, "0"),
				(@addr >> 40 & 0xff).to_s(16).rjust(2, "0"),
				(@addr >> 32 & 0xff).to_s(16).rjust(2, "0"),
				(@addr >> 24 & 0xff).to_s(16).rjust(2, "0"),
				(@addr >> 16 & 0xff).to_s(16).rjust(2, "0"),
				(@addr >> 8 & 0xff).to_s(16).rjust(2, "0"),
				(@addr & 0xff).to_s(16).rjust(2, "0"),
				]
		end
470343
def _GetSubFileEntries(self):
    
    tar_file = self._file_system.GetTARFile()

    if self._directory is None:
      self._directory = self._GetDirectory()

    if self._directory and tar_file:
      for path_spec in self._directory.entries:
        location = getattr(path_spec, 'location', None)
        if location is None:
          continue

        kwargs = {}
        try:
          kwargs['tar_info'] = tar_file.getmember(location[1:])
        except KeyError:
          kwargs['is_virtual'] = True

        yield TARFileEntry(
            self._resolver_context, self._file_system, path_spec, **kwargs)
162423
private String getOldCodeId(FileStatus srcStat ) throws IOException {
    if (codec.id.equals("xor") || codec.id.equals("rs")) {
      return codec.id;
    } else {
      // Search for xor/rs parity files
      if (ParityFilePair.getParityFile(
        Codec.getCodec("xor"), srcStat, this.conf) != null)
        return "xor";
      if (ParityFilePair.getParityFile(
        Codec.getCodec("rs"), srcStat, this.conf) != null)
        return "rs";
    }
    return null;
  }
9591
def xdr(self):
        
        tx = Xdr.StellarXDRPacker()
        tx.pack_Transaction(self.to_xdr_object())
        return base64.b64encode(tx.get_buffer())
416826
def _generate_identifier():
    
    bit_length = 64
    byte_length = int(bit_length / 8)
    identifier = os.urandom(byte_length)
    return hexlify(identifier).decode('ascii')