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

% MEM 1gb
% WALLTIME 00:10:00
% DEPENDENCY ft_channelrepair ft_datatype_sens fixsens ft_prepare_neighbours
% DATA private

datainfo = ref_datasets;

% get an MEG and an EEG set (hard-coded
eeginfo = datainfo(3);
meginfo = datainfo(7);

% do the MEG processing
fname = fullfile(meginfo.origdir,'latest', 'raw',meginfo.type,['preproc_' meginfo.datatype]);

    
function test_ft_channelrepair

% MEM 1gb
% WALLTIME 00:10:00
% DEPENDENCY ft_channelrepair ft_datatype_sens fixsens ft_prepare_neighbours
% DATA private

datainfo = ref_datasets;

% get an MEG and an EEG set (hard-coded
eeginfo = datainfo(3);
meginfo = datainfo(7);

% do the MEG processing
fname = fullfile(meginfo.origdir,'latest', 'raw',meginfo.type,['preproc_' meginfo.datatype]);
load(fname);

cfg = [];
cfg.method = 'triangulation';
neighbours = ft_prepare_neighbours(cfg, data);

cfg = [];
cfg.badchannel = data.label(100);
cfg.neighbours = neighbours;
newdata = ft_channelrepair(cfg, data);

% now, also check whether an absent sensor array description works, as per
% issue 1774 it doesn't
try
  newdata = ft_channelrepair(cfg, removefields(data, {'elec', 'grad'}));
catch
  fprintf('running a ''weighted'' interpolation without sensor info does not work\n');
end