def is_multicast(text):
 try:
  first = ord(dns.ipv4.inet_aton(text)[0])
  return ((first >= 224) and (first <= 239))
 except:
  try:
   first = ord(dns.ipv6.inet_aton(text)[0])
   return (first == 255)
  except:
   raise ValueError

def is_multicast ( text ) : try : first = ord ( dns . ipv4 . inet_aton ( text ) [ 0 ] ) return ( ( first >= 224 ) and ( first <= 239 ) ) except : try : first = ord ( dns . ipv6 . inet_aton ( text ) [ 0 ] ) return ( first == 255 ) except : raise ValueError
is the textual-form network address a multicast address? .