def cidr_to_netmask(bits):
 v = ((1 << bits) - 1)
 v = (v << (32 - bits))
 return IPAddr(v, networkOrder=False)

def cidr_to_netmask ( bits ) : v = ( ( 1 << bits ) - 1 ) v = ( v << ( 32 - bits ) ) return IPAddr ( v , networkOrder = False )
takes a number of network bits .