# Path: orangengine/utils.py
# def is_ipv4(value):
#     """
#     return true if value is any kind of ipv4 address.
#     address, network, or range
#     """
#     try:
#         if '-' in value:
#             # try a range
#             addr_range = value.split('-')
#             IPRange(addr_range[0], addr_range[1])
#         else:
#             IPNetwork(value)
#     except Exception:
#         return False
#     return True


from lxml import etree as letree
from orangengine.utils import is_ipv4
# -*- coding: utf-8 -*-


"""
juniper driver specific utility functions
"""


# --- begin xml generation functions


def create_new_address(a_value):
    if isinstance(a_value, list):
        raise ValueError("Creating new address groups is not currently supported")
    address_element = create_element('address')

# Path: orangengine/utils.py
# def is_ipv4(value):
#     """
#     return true if value is any kind of ipv4 address.
#     address, network, or range
#     """
#     try:
#         if '-' in value:
#             # try a range
#             addr_range = value.split('-')
#             IPRange(addr_range[0], addr_range[1])
#         else:
#             IPNetwork(value)
#     except Exception:
#         return False
#     return True


# Path: orangengine/drivers/_juniper_utils.py
from lxml import etree as letree
from orangengine.utils import is_ipv4

# -*- coding: utf-8 -*-


"""
juniper driver specific utility functions
"""


# --- begin xml generation functions


def create_new_address(a_value):
    if isinstance(a_value, list):
        raise ValueError("Creating new address groups is not currently supported")
    address_element = create_element('address')

    if is_ipv4(a_value):