def _get_address_binary(address):
 if is_valid_ipv4_address(address):
  return ''.join([_get_binary(int(octet), 8) for octet in address.split('.')])
 elif is_valid_ipv6_address(address):
  address = expand_ipv6_address(address)
  return ''.join([_get_binary(int(grouping, 16), 16) for grouping in address.split(':')])
 else:
  raise ValueError(("'%s' is neither an IPv4 or IPv6 address" % address))

def _get_address_binary ( address ) : if is_valid_ipv4_address ( address ) : return '' . join ( [ _get_binary ( int ( octet ) , 8 ) for octet in address . split ( '.' ) ] ) elif is_valid_ipv6_address ( address ) : address = expand_ipv6_address ( address ) return '' . join ( [ _get_binary ( int ( grouping , 16 ) , 16 ) for grouping in address . split ( ':' ) ] ) else : raise ValueError ( ( "'%s' is neither an IPv4 or IPv6 address" % address ) )
provides the binary value for an ipv4 or ipv6 address .