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: test_bug2232.m
    path of file: ./repos/fieldtrip/test
    
    the code of the file until where you have to start completion: function test_bug2232

% MEM 1gb
% WALLTIME 00:10:00
% DEPENDENCY gifti ft_read_headshape ft_read_atlas
% DATA private

ft_hastoolbox('gifti', 1);

datadir = dccnpath('/home/common/matlab/fieldtrip/data/test/bug2232');
d       = dir(datadir);
subdir  = {d.name}';
sel     = cellfun(@numel, subdir)>2;
subdir  = subdir(sel);

    
function test_bug2232

% MEM 1gb
% WALLTIME 00:10:00
% DEPENDENCY gifti ft_read_headshape ft_read_atlas
% DATA private

ft_hastoolbox('gifti', 1);

datadir = dccnpath('/home/common/matlab/fieldtrip/data/test/bug2232');
d       = dir(datadir);
subdir  = {d.name}';
sel     = cellfun(@numel, subdir)>2;
subdir  = subdir(sel);

% check whether we can read *.surf.gii
for k = 1:numel(subdir)
  d = dir(fullfile(datadir,subdir{k},'*surf*'));
  if ~isempty(d)
    for m = 1:numel(d)
      fprintf('reading %s\n',d(m).name);
      bnd = ft_read_headshape(fullfile(datadir, subdir{k}, d(m).name));
      assert(isfield(bnd, 'pos') && isfield(bnd, 'tri'));
      
      hemi = strfind(d(m).name, '.L.');
      if ~isempty(hemi)
        hemi = '.L.';
      else
        hemi = '.R.';
      end