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: download_stereo.m
    path of file: ./repos/SelfExSR/external/imrender/ojw
    
    the code of the file until where you have to start completion: function download_stereo(sequence)

    
function download_stereo(sequence)
%DOWNLOAD_STEREO  Downloads a stereo sequence from the Middlebury website
%
%   download_stereo(sequence)
%
% Downloads the named Middlebury stereo sequence from the Middlebury stereo
% website, into a subdirectory of the sme name, if the subdirectory doesn't
% already exist.
%
%IN:
%   sequence - string containing the sequence name, e.g. 'cones'.

% $Id: download_stereo.m,v 1.2 2008/11/17 11:27:35 ojw Exp $

% Check if the dataset exists
subdir = ['./' sequence '/'];
if isdir(subdir)
    return
end

% Load the sequence specific details
switch sequence
    case 'tsukuba'
        stereo_class = 2001; % Middlebury 2001 dataset
        inn = 5;
        disp_range = [0 15];
        disparity_factor = 16;
        imname = @(n) sprintf('scene1.row3.col%d.ppm', n);
        disp_ims = [3 4];
        dispname = @(n) sprintf('truedisp.row3.col%d.pgm', disp_ims(n));
    case 'map'
        stereo_class = 2001; % Middlebury 2001 dataset
        inn = 2;
        disp_range = [0 31];
        disparity_factor = 8;
        imname = @(n) sprintf('im%d.pgm', n-1);
        disp_ims = [1 2];
        dispname = @(n) sprintf('disp%d.pgm', disp_ims(n)-1);
    case {'sawtooth','venus','bull','poster','barn1','barn2'}
        stereo_class = 2001; % Middlebury 2001 dataset
        inn = 9;
        disp_range = [0 31];
        disparity_factor = 8;
        imname = @(n) sprintf('im%d.ppm', n-1);
        disp_ims = [3 7];
        dispname = @(n) sprintf('disp%d.pgm', disp_ims(n)-1);
    case {'teddy','cones'}
        stereo_class = 2003; % Middlebury 2003 dataset
        inn = 9;
        imname = @(n) sprintf('im%d.ppm', n-1);
        disp_range = [0 59];
        disparity_factor = 4;
        disp_ims = [3 7];
        dispname = @(n) sprintf('disp%d.pgm', disp_ims(n)-1);
    case {'dolls','art','books','moebius','laundry','reindeer','dwarves','drumsticks','computer'}
        stereo_class = 2005; % Middlebury 2005 dataset
    case {'aloe','baby1','baby2','baby3','bowling1','bowling2','cloth1','cloth2','cloth3','cloth4',...
          'flowerpots','lampshade1','lampshade2','midd1','midd2','monopoly','plastic','rocks1',...
          'rocks2','wood1','wood2'}
        stereo_class = 2006; % Middlebury 2006 dataset
    otherwise
        error('Sequence ''%s'' not recognised', sequence);
end

% Values for 2005 & 2006 datasets are the same.
if stereo_class >= 2005
    inn = 7;
    disp_range = [0 85];
    disparity_factor = 3;
    imname = @(n) sprintf('view%d.png', n-1);
    disp_ims = [2 6];
    dispname = @(n) sprintf('disp%d.png', disp_ims(n)-1);
    sequence = [upper(sequence(1)) sequence(2:end)];
end
if ~exist('im_space', 'var')
    im_space = diff(disp_ims);
end