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: get_bnet.m
    path of file: ./repos/bnt/Utils/utils
    
    the code of the file until where you have to start completion: function bnet = get_bnet(data,dag,cpd_name)

% this function can get a bnet from data and dag
%
% bnet = get_bnet(data,dag,cpd_name)
%

    
function bnet = get_bnet(data,dag,cpd_name)

% this function can get a bnet from data and dag
%
% bnet = get_bnet(data,dag,cpd_name)
%
% input:
%     data: a matrix data，just support num
%     dag: a dag
%     cpd_name: CPD，tabular means discrete distribution and gaussian means
%               gaussian distribution.
% output:
%     bnet
%
% if you find bug, you can send