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: bivariate_common.m
    path of file: ./repos/fieldtrip/private
    
    the code of the file until where you have to start completion: function [varargout] = bivariate_common(cfg, varargin)

% BIVARIATE_COMMON makes a selection for a specific reference channel from a
% bivariate (i.e. connectivity) dataset and returns that selection as a univariate

    
function [varargout] = bivariate_common(cfg, varargin)

% BIVARIATE_COMMON makes a selection for a specific reference channel from a
% bivariate (i.e. connectivity) dataset and returns that selection as a univariate
% dataset. This is used in singleplot/multiplot/topoplot for both ER and TFR data.
%
% Use as
%   [varargout] = bivariate_common(cfg, varargin)
%
% See also TOPOPLOT_COMMON

% reference channel is required
if ~isfield(cfg, 'refchannel') || isempty(cfg.refchannel)
  ft_error('no reference channel is specified');
end