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: pspm_get_timing.m
    path of file: ./repos/PsPM/src
    
    the code of the file until where you have to start completion: function [sts, outtiming] = pspm_get_timing(varargin)
% ● Description
%   pspm_get_timing is a shared function to read timing information from
%   different formats and align with a number of files. Time units (seconds,
%   samples, markers) are not changed.
% ● Format
%   [sts, multi]  = pspm_get_timing('onsets', intiming, timeunits)
%   [sts, epochs] = pspm_get_timing('epochs', epochs, timeunits)
%   [sts, events] = pspm_get_timing('events', events)
%   [sts, epochs] = pspm_get_timing('missing', epochs, timeunits)
%   for recursive calls also:
%   [sts, epochs] = pspm_get_timing('file', filename)
% ● Arguments
%   onsets and timeunits are 'seconds', 'samples' or 'markers':
%      for defining event onsets for multiple conditions (e. g. GLM)
%      intiming is - a multiple condition file name (single session) OR
%                  - a cell array of multiple condition file names OR
%                  - a struct (single session) with fields .names, .onsets,
%                       and (optional) .durations and .pmod
%                  - a cell array of struct
%                  - a struct with fields 'markerinfos', 'markervalues,
%                   'names' OR
%                  - a cell array of struct
%
%      if timeunits are 'samples' or 'markers', all onsets must be integer
%
%   onsets and timeunits are 'markervalues':
%      for defining onsets for multiple conditions (e.g. GLM) from
%      entries in markerinfos:
%      intiming:  - a struct with fields 'markerinfos', 'markervalues,
%                   'names' OR
%                 - a cell array of struct
%                    - markerinfos as loaded from a marker channel
%                    - if markervalues is a vector of numeric, it creates
%                      conditions from the entries in markerinfos.value
%                    - if markervalues is a cell array of char, it creates
%                      conditions from the entries in markerinfos.name
%                    - names: cell array of condition names
%

    
function [sts, outtiming] = pspm_get_timing(varargin)
% ● Description
%   pspm_get_timing is a shared function to read timing information from
%   different formats and align with a number of files. Time units (seconds,
%   samples, markers) are not changed.
% ● Format
%   [sts, multi]  = pspm_get_timing('onsets', intiming, timeunits)
%   [sts, epochs] = pspm_get_timing('epochs', epochs, timeunits)
%   [sts, events] = pspm_get_timing('events', events)
%   [sts, epochs] = pspm_get_timing('missing', epochs, timeunits)
%   for recursive calls also:
%   [sts, epochs] = pspm_get_timing('file', filename)
% ● Arguments
%   onsets and timeunits are 'seconds', 'samples' or 'markers':
%      for defining event onsets for multiple conditions (e. g. GLM)
%      intiming is - a multiple condition file name (single session) OR
%                  - a cell array of multiple condition file names OR
%                  - a struct (single session) with fields .names, .onsets,
%                       and (optional) .durations and .pmod
%                  - a cell array of struct
%                  - a struct with fields 'markerinfos', 'markervalues,
%                   'names' OR
%                  - a cell array of struct
%
%      if timeunits are 'samples' or 'markers', all onsets must be integer
%
%   onsets and timeunits are 'markervalues':
%      for defining onsets for multiple conditions (e.g. GLM) from
%      entries in markerinfos:
%      intiming:  - a struct with fields 'markerinfos', 'markervalues,
%                   'names' OR
%                 - a cell array of struct
%                    - markerinfos as loaded from a marker channel
%                    - if markervalues is a vector of numeric, it creates
%                      conditions from the entries in markerinfos.value
%                    - if markervalues is a cell array of char, it creates
%                      conditions from the entries in markerinfos.name
%                    - names: cell array of condition names
%
%     epochs: for defining data epochs (e. g. analysis of SF, missing epochs in
%             GLM). epochs can be one of the following
%             - an SPM style onset file with two event types: onset & offset
%               (names are ignored)
%             - a two-column text file with on/offsets
%             - a .mat file with a variable 'epochs' (see below)
%             - e x 2 matrix of epoch on- and offsets (e: number of epochs)
%     events: for defining events and event windows (e. g. in DCM), events can
%             be either a variable that is, or a file name that contains a
%             variable. 'events' that is
%             - a .mat file with a variable 'events' (see below)
%             - a cell array with multiple one and two column vectors for fully
%               flexible DCMs that must all have the same number of rows.
% ● Developer's Notes
%   Differences in GLM multiple condition definitions between SPM and PsPM
%   (1) 'durations' is optional - default is 0
%   (2) 'durations' must be 0 if onsets are specified by markers
%   (3) 'poly' is an optional field in pmods - default is 1. Polynomial
%       values larger than 1 are expanded here and returned as additional cells
%       for 'param'
% ● History
%   Introduced in PsPM 3.0
%   Written in 2009-2015 by Dominik R Bach (WTCN, UZH)
%   Maintained in 2022 by Teddy Chao (UCL)

%% Initialise
global settings
if isempty(settings)
  pspm_init;
end