def _ip_range_splitter(ips, block_size=256):
 out = []
 count = 0
 for ip in ips:
  out.append(ip['address'])
  count += 1
  if (count > (block_size - 1)):
   (yield out)
   out = []
   count = 0
 if out:
  (yield out)

def _ip_range_splitter ( ips , block_size = 256 ) : out = [ ] count = 0 for ip in ips : out . append ( ip [ 'address' ] ) count += 1 if ( count > ( block_size - 1 ) ) : ( yield out ) out = [ ] count = 0 if out : ( yield out )
yields blocks of ips no more than block_size elements long .