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_get_dataset.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function spm_get_dataset(repo, name, rev, outdir)
% Download a dataset from an online repository
% FORMAT spm_get_dataset(repo, name, outdir)
% repo   - name of repository, one of ['spm', 'openfmri']
% name   - name of dataset, e.g. 'auditory' or 'ds000117'
% rev    - revision of dataset [default: '']
% outdir - output directory [default: pwd]
%__________________________________________________________________________

% Guillaume Flandin
% Copyright (C) 2017-2022 Wellcome Centre for Human Neuroimaging


spm('FnBanner', mfilename);

if nargin < 1, error('A repository name is mandatory.'); end
if nargin < 2, error('A dataset name is mandatory.');    end
if nargin < 3, rev = '';     end
if nargin < 4, outdir = pwd; end

    
function spm_get_dataset(repo, name, rev, outdir)
% Download a dataset from an online repository
% FORMAT spm_get_dataset(repo, name, outdir)
% repo   - name of repository, one of ['spm', 'openfmri']
% name   - name of dataset, e.g. 'auditory' or 'ds000117'
% rev    - revision of dataset [default: '']
% outdir - output directory [default: pwd]
%__________________________________________________________________________

% Guillaume Flandin
% Copyright (C) 2017-2022 Wellcome Centre for Human Neuroimaging


spm('FnBanner', mfilename);

if nargin < 1, error('A repository name is mandatory.'); end
if nargin < 2, error('A dataset name is mandatory.');    end
if nargin < 3, rev = '';     end
if nargin < 4, outdir = pwd; end

%-Options
%--------------------------------------------------------------------------
timeout = [];
delraw  = true;

%-Get download URL from data repository
%--------------------------------------------------------------------------
switch lower(repo)
    case 'spm'
        base = 'http://www.fil.ion.ucl.ac.uk/spm/download/data/';
        switch lower(name)
            case 'auditory'
                url = fullfile(base,'MoAEpilot','MoAEpilot.zip');
            case 'attention'
                url = fullfile(base,'attention','attention.zip');
            case 'face_rep'
                url = fullfile(base,'face_rep','face_rep.zip');
            case 'face_rfx'
                url = fullfile(base,'face_rfx','face_rfx.zip');
            case 'eeg_mmn'
                url{1} = fullfile(base,'eeg_mmn','subject1.bdf');
                url{2} = fullfile(base,'eeg_mmn','sensors.pol');
            case 'spdcm'
                url = fullfile(base,'spDCM','spDCM.zip');
            otherwise
                error('Unknown dataset "%s" in repository "%s".',name,repo);
        end