<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def inspect(mode='all', priority=19, **kwargs):
    '''
    Start node inspection and save the data to the database for further query.

    Parameters:

    * **mode**: Clarify inspection mode: configuration, payload, all (default)

      payload
        * **filter**: Comma-separated directories to track payload.

    * **priority**: (advanced) Set priority of the inspection. Default is low priority.



    CLI Example:

    .. code-block:: bash

        salt '*' inspector.inspect
        salt '*' inspector.inspect configuration
        salt '*' inspector.inspect payload filter=/opt,/ext/oracle
    '''
    collector = _("collector")
    try:
        return collector.Inspector(cachedir=__opts__['cachedir'],
                                   piddir=os.path.dirname(__opts__['pidfile']))\
            .request_snapshot(mode, priority=priority, **kwargs)
    except InspectorSnapshotException as ex:
        raise CommandExecutionError(ex)
    except Exception as ex:
        log.error(_get_error_message(ex))
        raise Exception(ex)