def validate_preprocess_kwargs(preprocessing_kwargs):
    """
    Tests the arguments of preprocess function and raises errors for invalid arguments.

    Parameters
    ----------
    preprocessing_kwargs : dict-like or None or False
        A dictionary object to store keyword arguments for the preprocess function.
        It can also be None/False/{}/"".

    Returns
    -------
    valid_kwargs : dict-like or None
        The valid keyword arguments for the preprocess function.
        Returns None if the input preprocessing_kwargs is None/False/{}/"".

    Raises
    ------
    ValueError
        If preprocessing_kwargs is not dict-like or None.
        If gets invalid key(s) for preprocessing_kwargs.
        If gets invalid value(s) for preprocessing_kwargs['window'], preprocessing_kwargs['impute_method']
        preprocessing_kwargs['impute_direction'] and preprocessing_kwargs['add_noise'].

    """
    if preprocessing_kwargs:

        valid_preprocessing_kwargs_keys = {'window', 'impute_method', 'impute_direction', 'add_noise'}

        if not isinstance(preprocessing_kwargs,dict):
            raise ValueError("The parameter 'preprocessing_kwargs' is not dict like!")

        elif set(preprocessing_kwargs.keys()).issubset(valid_preprocessing_kwargs_keys):
            window = 4
            impute_method = 'mean'
            impute_direction = 'forward'
            add_noise = True
            methods = ['mean', 'median', 'min', 'max']
            directions = ['forward', 'fwd', 'f', 'backward', 'bwd', 'b']

            if 'window' in preprocessing_kwargs.keys():
                if not isinstance(preprocessing_kwargs['window'],int):
                    raise ValueError("The value for preprocessing_kwargs['window'] is not an integer!")
                window = preprocessing_kwargs['window']


            if 'impute_method' in preprocessing_kwargs.keys():
                if preprocessing_kwargs['impute_method'] not in methods:
                    raise ValueError('invalid imputation method! valid include options: ' + ', '.join(methods))
                impute_method = preprocessing_kwargs['impute_method']

            if 'impute_direction' in preprocessing_kwargs.keys():
                if preprocessing_kwargs['impute_direction'] not in directions:
                    raise ValueError('invalid imputation direction! valid include options: ' + ', '.join(directions))
                impute_direction = preprocessing_kwargs['impute_direction']

            if 'add_noise' in preprocessing_kwargs.keys():
                if not isinstance(preprocessing_kwargs['add_noise'],bool):
                    raise ValueError("The value for preprocessing_kwargs['add_noise'] is not a boolean value!")
                add_noise = preprocessing_kwargs['add_noise']

            valid_kwargs =  { 'window': window,
                              'impute_method': impute_method,
                              'impute_direction': impute_direction,
                              'add_noise': add_noise }
        else:
            raise ValueError('invalid key(s) for preprocessing_kwargs! '
                             'valid key(s) should include '+ str(valid_preprocessing_kwargs_keys))
    else:
        valid_kwargs = None

    return valid_kwargs