def rpad_ipv4_network(ip):
 return '.'.join(itertools.islice(itertools.chain(ip.split('.'), '0000'), 0, 4))

def rpad_ipv4_network ( ip ) : return '.' . join ( itertools . islice ( itertools . chain ( ip . split ( '.' ) , '0000' ) , 0 , 4 ) )
returns an ip network address padded with zeros .