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: convert_event.m
    path of file: ./repos/spm12/external/fieldtrip/private
    
    the code of the file until where you have to start completion: function [obj] = convert_event(obj, target, varargin)

% CONVERT_EVENT converts between the different representations of events, 
% which can be
%   1) event structure, see FT_READ_EVENT

    
function [obj] = convert_event(obj, target, varargin)

% CONVERT_EVENT converts between the different representations of events, 
% which can be
%   1) event structure, see FT_READ_EVENT
%   2) matrix representation as in trl (Nx3), see FT_DEFINETRIAL
%   3) matrix representation as in artifact (Nx2), see FT_ARTIFACT_xxx
%   4) boolean vector representation with 1 for samples containing trial/artifact
%
% Use as
%   [object] = convert_event(object, target, ....)
%
% Possible input objects types are
%   event structure
%   Nx3 trl matrix, or cell-array of multiple trl definitions
%   Nx2 artifact matrix, or cell-array of multiple artifact definitions
%   boolean vector, or matrix with multiple vectors as rows
%
% Possible targets are 'event', 'trl', 'artifact', 'boolvec'
%
% Additional options should be specified in key-value pairs and can be
%   'end