def _ipVersionToLen(version):
 if (version == 4):
  return 32
 elif (version == 6):
  return 128
 else:
  raise ValueError('only IPv4 and IPv6 supported')

def _ipVersionToLen ( version ) : if ( version == 4 ) : return 32 elif ( version == 6 ) : return 128 else : raise ValueError ( 'only IPv4 and IPv6 supported' )
return number of bits in address for a certain ip version .