code: def unpack(n, r=32):
      
      if r < 1:
          raise ValueError('unpack needs r > 0')
  
      mask = (1 << r) - 1
  
      while n:
          yield n & mask
          n >>= r
docs: Yield r > 0 bit-length integers splitting n into chunks.
  
      >>> list(unpack(42, 1))
      [0, 1, 0, 1, 0, 1]
  
      >>> list(unpack(256, 8))
      [0, 1]
  
      >>> list(unpack(2, 0))
      Traceback (most recent call last):
          ...
      ValueError: unpack needs r > 0