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: spm_eeg_detect_eyeblinks.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/toolbox/MEEGtools
    
    the code of the file until where you have to start completion: function D = spm_eeg_detect_eyeblinks(S)
% Detects eyeblinks in spm continuous data file
% FORMAT  D = spm_eeg_detect_eyeblinks(S)
%

    
function D = spm_eeg_detect_eyeblinks(S)
% Detects eyeblinks in spm continuous data file
% FORMAT  D = spm_eeg_detect_eyeblinks(S)
%
% S                    - input structure (optional)
% (optional) fields of S:
%          .stdthresh  - threshold to reject things that look like
%                         eye-blinks but probably aren't (default: 3)
%          .overwrite  - 1 - replace previous eybelink events (default)
%                        0 - append