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

% MEM 1gb
% WALLTIME 00:10:00
% DEPENDENCY ft_componentanalysis ft_rejectcomponent ft_megplanar ft_combineplanar ft_megrealign ft_datatype_sens
% DATA private


    
function test_bug1806

% MEM 1gb
% WALLTIME 00:10:00
% DEPENDENCY ft_componentanalysis ft_rejectcomponent ft_megplanar ft_combineplanar ft_megrealign ft_datatype_sens
% DATA private

ctf151_sens = ft_read_sens(dccnpath('/home/common/matlab/fieldtrip/data/test/latest/sens/ctf151.mat'));
ctf275_sens = ft_read_sens(dccnpath('/home/common/matlab/fieldtrip/data/test/latest/sens/ctf275.mat'));

cfg = [];
cfg.dataset = dccnpath('/home/common/matlab/fieldtrip/data/ftp/test/ctf/Subject01.ds');
cfg.trl = [1 900 0];
data = ft_preprocessing(cfg);
% the following applies since 30 October 2012
% the type will be added by ft_datatype_sens if not present
assert(strcmp(data.grad.type, 'ctf151'));

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% megplanar and combineplanar

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

cfg = [];
cfg.neighbours = neighbours;
data_p  = ft_megplanar(cfg,data);
if isfield(data_p.grad, 'type')
  % it should not be ctf151 any more
  assert(strcmp(data_p.grad.type, 'ctf151_planar'));
else
  warning('gradiometer type is missing')
  assert(ft_senstype(data_p.grad, 'ctf151_planar'));
end