# Path: pyeapi/eapilib.py
# class CommandError(EapiError):
#     """Base exception raised for command errors
# 
#     The CommandError instance provides a custom exception that can be used
#     if the eAPI command(s) fail.  It provides some additional information
#     that can be used to understand what caused the exception.
# 
#     Args:
#         error_code (int): The error code returned from the eAPI call.
#         error_text (string): The error text message that coincides with the
#             error_code
#         commands (array): The list of commands that were sent to the node
#             that generated the error
#         message (string): The exception error message which is a concatenation
#             of the error_code and error_text
#     """
#     def __init__(self, code, message, **kwargs):
#         cmd_err = kwargs.get('command_error')
#         if int(code) in [1000, 1002, 1004]:
#             msg_fmt = 'Error [{}]: {} [{}]'.format(code, message, cmd_err)
#         else:
#             msg_fmt = 'Error [{}]: {}'.format(code, message)
# 
#         super(CommandError, self).__init__(msg_fmt)
#         self.error_code = code
#         self.error_text = message
#         self.command_error = cmd_err
#         self.commands = kwargs.get('commands')
#         self.output = kwargs.get('output')
#         self.message = msg_fmt
# 
#     @property
#     def trace(self):
#         return self.get_trace()
# 
#     def get_trace(self):
#         trace = list()
#         index = None
# 
#         for index, out in enumerate(self.output):
#             _entry = {'command': self.commands[index], 'output': out}
#             trace.append(_entry)
# 
#         if index:
#             index += 1
#             for cmd in self.commands[index:]:
#                 _entry = {'command': cmd, 'output': None}
#                 trace.append(_entry)
# 
#         return trace
# 
# class ConnectionError(EapiError):
#     """Base exception raised for connection errors
# 
#     Connection errors are raised when a connection object is unable to
#     connect to the node.  Typically these errors can result from using
#     the wrong transport type or not providing valid credentials.
# 
#     Args:
#         commands (array): The list of commands there were sent to the
#             node that when the exception was raised
#         connection_type (string): The string identifier for the connection
#             object that generate the error
#         message (string): The exception error message
#         response (string): The message generate from the response packet
# 
#     """
#     def __init__(self, connection_type, message, commands=None):
#         self.message = message
#         self.connection_type = connection_type
#         self.commands = commands
#         super(ConnectionError, self).__init__(message)
# 
# Path: pyeapi/utils.py
# def make_iterable(value):
#     """Converts the supplied value to a list object
# 
#     This function will inspect the supplied value and return an
#     iterable in the form of a list.
# 
#     Args:
#         value (object): An valid Python object
# 
#     Returns:
#         An iterable object of type list
#     """
#     if sys.version_info <= (3, 0):
#         # Convert unicode values to strings for Python 2
#         if isinstance(value, unicode):
#             value = str(value)
#     if isinstance(value, str) or isinstance(value, dict):
#         value = [value]
# 
#     if sys.version_info <= (3, 3):
#         if not isinstance(value, collections.Iterable):
#             raise TypeError('value must be an iterable object')
#     else:
#         if not isinstance(value, collections.abc.Iterable):
#             raise TypeError('value must be an iterable object')
# 
#     return value


from collections.abc import Callable, Mapping
from pyeapi.eapilib import CommandError, ConnectionError
from pyeapi.utils import make_iterable
        """
        try:
            parent = r'^%s$' % parent
            return self.node.section(parent, config=config)
        except TypeError:
            return None

    def configure(self, commands):
        """Sends the commands list to the node in config mode

        This method performs configuration the node using the array of
        commands specified.   This method wraps the configuration commands
        in a try/except block and stores any exceptions in the error
        property.

        Note:
            If the return from this method is False, use the error property
            to investigate the exception

        Args:
            commands (list): A list of commands to be sent to the node in
                config mode

        Returns:
            True if the commands are executed without exception otherwise
                False is returned
        """
        try:
            self.node.config(commands)
            return True

# Path: pyeapi/eapilib.py
# class CommandError(EapiError):
#     """Base exception raised for command errors
# 
#     The CommandError instance provides a custom exception that can be used
#     if the eAPI command(s) fail.  It provides some additional information
#     that can be used to understand what caused the exception.
# 
#     Args:
#         error_code (int): The error code returned from the eAPI call.
#         error_text (string): The error text message that coincides with the
#             error_code
#         commands (array): The list of commands that were sent to the node
#             that generated the error
#         message (string): The exception error message which is a concatenation
#             of the error_code and error_text
#     """
#     def __init__(self, code, message, **kwargs):
#         cmd_err = kwargs.get('command_error')
#         if int(code) in [1000, 1002, 1004]:
#             msg_fmt = 'Error [{}]: {} [{}]'.format(code, message, cmd_err)
#         else:
#             msg_fmt = 'Error [{}]: {}'.format(code, message)
# 
#         super(CommandError, self).__init__(msg_fmt)
#         self.error_code = code
#         self.error_text = message
#         self.command_error = cmd_err
#         self.commands = kwargs.get('commands')
#         self.output = kwargs.get('output')
#         self.message = msg_fmt
# 
#     @property
#     def trace(self):
#         return self.get_trace()
# 
#     def get_trace(self):
#         trace = list()
#         index = None
# 
#         for index, out in enumerate(self.output):
#             _entry = {'command': self.commands[index], 'output': out}
#             trace.append(_entry)
# 
#         if index:
#             index += 1
#             for cmd in self.commands[index:]:
#                 _entry = {'command': cmd, 'output': None}
#                 trace.append(_entry)
# 
#         return trace
# 
# class ConnectionError(EapiError):
#     """Base exception raised for connection errors
# 
#     Connection errors are raised when a connection object is unable to
#     connect to the node.  Typically these errors can result from using
#     the wrong transport type or not providing valid credentials.
# 
#     Args:
#         commands (array): The list of commands there were sent to the
#             node that when the exception was raised
#         connection_type (string): The string identifier for the connection
#             object that generate the error
#         message (string): The exception error message
#         response (string): The message generate from the response packet
# 
#     """
#     def __init__(self, connection_type, message, commands=None):
#         self.message = message
#         self.connection_type = connection_type
#         self.commands = commands
#         super(ConnectionError, self).__init__(message)
# 
# Path: pyeapi/utils.py
# def make_iterable(value):
#     """Converts the supplied value to a list object
# 
#     This function will inspect the supplied value and return an
#     iterable in the form of a list.
# 
#     Args:
#         value (object): An valid Python object
# 
#     Returns:
#         An iterable object of type list
#     """
#     if sys.version_info <= (3, 0):
#         # Convert unicode values to strings for Python 2
#         if isinstance(value, unicode):
#             value = str(value)
#     if isinstance(value, str) or isinstance(value, dict):
#         value = [value]
# 
#     if sys.version_info <= (3, 3):
#         if not isinstance(value, collections.Iterable):
#             raise TypeError('value must be an iterable object')
#     else:
#         if not isinstance(value, collections.abc.Iterable):
#             raise TypeError('value must be an iterable object')
# 
#     return value


# Path: pyeapi/api/abstract.py
from collections.abc import Callable, Mapping
from pyeapi.eapilib import CommandError, ConnectionError
from pyeapi.utils import make_iterable

        """
        try:
            parent = r'^%s$' % parent
            return self.node.section(parent, config=config)
        except TypeError:
            return None

    def configure(self, commands):
        """Sends the commands list to the node in config mode

        This method performs configuration the node using the array of
        commands specified.   This method wraps the configuration commands
        in a try/except block and stores any exceptions in the error
        property.

        Note:
            If the return from this method is False, use the error property
            to investigate the exception

        Args:
            commands (list): A list of commands to be sent to the node in
                config mode

        Returns:
            True if the commands are executed without exception otherwise
                False is returned
        """
        try:
            self.node.config(commands)
            return True

        except (CommandError):