def is_valid_ipv4_prefix(ipv4_prefix):
 if (not isinstance(ipv4_prefix, str)):
  return False
 tokens = ipv4_prefix.split('/')
 if (len(tokens) != 2):
  return False
 return (is_valid_ipv4(tokens[0]) and is_valid_ip_prefix(tokens[1], 32))

def is_valid_ipv4_prefix ( ipv4_prefix ) : if ( not isinstance ( ipv4_prefix , str ) ) : return False tokens = ipv4_prefix . split ( '/' ) if ( len ( tokens ) != 2 ) : return False return ( is_valid_ipv4 ( tokens [ 0 ] ) and is_valid_ip_prefix ( tokens [ 1 ] , 32 ) )
returns true if *ipv4_prefix* is a valid prefix with mask .