parameters: (self, addr, byte)
docstring: Set byte at address.
docstring_summary: Set byte at address.
docstring_tokens: Set byte at address .
function: def __setitem__(self, addr, byte):
          """Set byte at address."""
          t = type(addr)
          if t in IntTypes:
              if addr < 0:
                  raise TypeError('Address should be >= 0.')
              self._buf[addr] = byte
          elif t == slice:
              if not isinstance(byte, (list, tuple)):
                  raise ValueError('Slice operation expects sequence of bytes')
              start = addr.start
              stop = addr.stop
              step = addr.step or 1
              if None not in (start, stop):
                  ra = range_l(start, stop, step)
                  if len(ra) != len(byte):
                      raise ValueError('Length of bytes sequence does not match '
                          'address range')
              elif (start, stop) == (None, None):
                  raise TypeError('Unsupported address range')
              elif start is None:
                  start = stop - len(byte)
              elif stop is None:
                  stop = start + len(byte)
              if start < 0:
                  raise TypeError('start address cannot be negative')
              if stop < 0:
                  raise TypeError('stop address cannot be negative')
              j = 0
              for i in range_g(start, stop, step):
                  self._buf[i] = byte[j]
                  j += 1
          else:
              raise TypeError('Address has unsupported type: %s' % t)
function_tokens: def __setitem__ ( self , addr , byte ) : t = type ( addr ) if t in IntTypes : if addr < 0 : raise TypeError ( 'Address should be >= 0.' ) self . _buf [ addr ] = byte elif t == slice : if not isinstance ( byte , ( list , tuple ) ) : raise ValueError ( 'Slice operation expects sequence of bytes' ) start = addr . start stop = addr . stop step = addr . step or 1 if None not in ( start , stop ) : ra = range_l ( start , stop , step ) if len ( ra ) != len ( byte ) : raise ValueError ( 'Length of bytes sequence does not match ' 'address range' ) elif ( start , stop ) == ( None , None ) : raise TypeError ( 'Unsupported address range' ) elif start is None : start = stop - len ( byte ) elif stop is None : stop = start + len ( byte ) if start < 0 : raise TypeError ( 'start address cannot be negative' ) if stop < 0 : raise TypeError ( 'stop address cannot be negative' ) j = 0 for i in range_g ( start , stop , step ) : self . _buf [ i ] = byte [ j ] j += 1 else : raise TypeError ( 'Address has unsupported type: %s' % t )