execute

        High-level api: The fact that most connection classes implement
        execute method lead us to add this method here as well.
        Supported operations are get, get_config, get_schema, dispatch,
        edit_config, copy_config, validate, commit, discard_changes,
        delete_config, lock, unlock, close_session, kill_session,
        poweroff_machine and reboot_machine. Refer to ncclient document for
        more details.

def execute(self, operation, *args, **kwargs):
        '''execute

        High-level api: The fact that most connection classes implement
        execute method lead us to add this method here as well.
        Supported operations are get, get_config, get_schema, dispatch,
        edit_config, copy_config, validate, commit, discard_changes,
        delete_config, lock, unlock, close_session, kill_session,
        poweroff_machine and reboot_machine. Refer to ncclient document for
        more details.
        '''

        # allow for operation string type
        if type(operation) is str:
            try:
                cls = manager.OPERATIONS[operation]
            except KeyError:
                raise ValueError('No such operation "%s".\n'
                                 'Supported operations are: %s' %
                                 (operation, list(manager.OPERATIONS.keys())))
        else:
            cls = operation

        return super().execute(cls, *args, **kwargs)