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: events_tsv.m
    path of file: ./repos/spm12/external/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function event = events_tsv(filename)


    
function event = events_tsv(filename)

% helper function to extract events from a BIDS events.tsv file

opts = detectImportOptions(filename,'filetype','text');

% this gets the numeric stuff as doubles right away, yet might erroneously
% typecast intend