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: threshold_connectivity.m
    path of file: ./repos/CanlabCore/CanlabCore/@brainpathway
    
    the code of the file until where you have to start completion: function threshold_connectivity(b_para, varargin)
% Threshold connnectivity matrices stored within a brainpathways object
%
% :Usage:
% ::
%
%     threshold_connectivity(b_para, [optional inputs])
%
% For objects: Type methods(object_name) for a list of object methods
% This is a handle object, so operations here modify the object in the
% workspace without passing it out.
%
%
% :Inputs:
%
%   **b_para:**
%        A brainpathway object
%
% :Optional Inputs:
%   **method:**
%        Correction method:
%        'fdr'  [default]
%        'unc'  uncorrected
%        'bonf' bonferroni based on num elements
%
%   **target:**
%       Which matrix to apply the threshold to:
%       'regions' [default]
%       'nodes'
%
%   **threshold:**
%       p or q-value threshold, numeric
%

    
function threshold_connectivity(b_para, varargin)
% Threshold connnectivity matrices stored within a brainpathways object
%
% :Usage:
% ::
%
%     threshold_connectivity(b_para, [optional inputs])
%
% For objects: Type methods(object_name) for a list of object methods
% This is a handle object, so operations here modify the object in the
% workspace without passing it out.
%
%
% :Inputs:
%
%   **b_para:**
%        A brainpathway object
%
% :Optional Inputs:
%   **method:**
%        Correction method:
%        'fdr'  [default]
%        'unc'  uncorrected
%        'bonf' bonferroni based on num elements
%
%   **target:**
%       Which matrix to apply the threshold to:
%       'regions' [default]
%       'nodes'
%
%   **threshold:**
%       p or q-value threshold, numeric
%
% :Outputs:
%
%   b_para.connectivity fields are updated
%   e.g., b_para.connectivity.regions by default, unless you specify
%   'nodes'
% 
%   Arguments/threshold values are saved in:
%   b_para.connectivity.regions.r_thr_args
%   the equiv_p_threshold field is the P-value threshold after correcting
%   (FDR or bonf)
%
% :Examples:
% ::
%
%   Threshold at q < 0.05 FDR
%   threshold_connectivity(b_para)
%
%   Threshold at q < 0.01 FDR
%   threshold_connectivity(b_para, 'threshold', .01)
%
%   Threshold at p < 0.05 Bonferroni 
%   threshold_connectivity(b_para, 'method', 'bonf')
%
%   Threshold at p < 0.001 uncorrected 
%   threshold_connectivity(b_para, 'method', 'unc', 'threshold', .001)
%
%   Create a graph object from this and plot:
%   G = graph(b_para.connectivity.regions.r_thr, b_para.region_atlas.labels, 'upper', 'OmitSelfLoops');
%   figure; plot(G);
%
% ..
%     Author and copyright information:
%
%     Copyright (C) 2020 Tor Wager
%
%     This program is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     (at your option) any later version.
%
%     This program is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%     GNU General Public License for more details.
%
%     You should have received a copy of the GNU General Public License
%     along with this program.  If not, see <http://www.gnu.org/licenses/>.
% ..

% ----------------------------------------------------------------------
% Set defaults and parse inputs
% ----------------------------------------------------------------------
ARGS = parse_inputs(varargin{:});

% Logical flags
% ----------------------------------------------------------------------
if any(strcmp(varargin, 'noverbose')), doverbose = false; end