You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: set_blinks_saccades_to_nan.m
    path of file: ./repos/PsPM/src/backroom
    
    the code of the file until where you have to start completion: function data_mat = set_blinks_saccades_to_nan(data_mat, column_names, mask_chans, fn_is_left)
    % set_blinks_saccades_to_nan sets data rows corresponding to blink/saccade periods to NaN values.
    % This is performed for each eye separately. The function assumes that channel names for blink
    % channels contain 'blink' in them. Similarly, channel names for saccade channels must contain
    % 'saccade'.
    %
    % Inputs
    % ------
    % data_mat: Matrix containing both data and blink/saccade columns. All the columns in data_mat

    
function data_mat = set_blinks_saccades_to_nan(data_mat, column_names, mask_chans, fn_is_left)
    % set_blinks_saccades_to_nan sets data rows corresponding to blink/saccade periods to NaN values.
    % This is performed for each eye separately. The function assumes that channel names for blink
    % channels contain 'blink' in them. Similarly, channel names for saccade channels must contain
    % 'saccade'.
    %
    % Inputs
    % ------
    % data_mat: Matrix containing both data and blink/saccade columns. All the columns in data_mat
    %           are assumed to belong to either left or to right eye. Example columns are pupil_l,
    %           gaze_x_r, etc.
    % column_names: Name of each column in the input data_mat.
    % mask_chans: Names of blink and saccade channels.
    %
    % Optional Inputs
    % ---------------
    % fn_is_left: Function that takes a LOWERCASED channel name as input and returns true if the channel
    %             name belongs to left eye. Otherwise, it returns false. By default, this function checks
    %             if the channel name end