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: mk_minimal_qmr_bnet.m
    path of file: ./repos/bnt/BNT/examples/static/Models
    
    the code of the file until where you have to start completion: function [bnet, vals] = mk_minimal_qmr_bnet(G, inhibit, leak, prior, pos, neg, pos_only)
% MK_MINIMAL_QMR_BNET Make a QMR model which only contains the observed findings
% [bnet, vals] = mk_minimal_qmr_bnet(G, inhibit, prior, leak, pos, neg)
%
% Input:
% G(i,j) = 1 iff there is an arc from disease i to finding j
% inhibit(i,j) = inhibition probability on i->j arc
% leak(j) = inhibition prob. on leak->j arc
% prior(i) = prob. disease i is on
% pos = list of leaves that have positive observations
% neg = list of leaves that have negative observations
% pos_only = 1 means only include positively observed leaves in the model - the negative
%   ones are absorbed into the prior terms
%
% Output:
% bnet
% vals is their value

if pos_only

    
function [bnet, vals] = mk_minimal_qmr_bnet(G, inhibit, leak, prior, pos, neg, pos_only)
% MK_MINIMAL_QMR_BNET Make a QMR model which only contains the observed findings
% [bnet, vals] = mk_minimal_qmr_bnet(G, inhibit, prior, leak, pos, neg)
%
% Input:
% G(i,j) = 1 iff there is an arc from disease i to finding j
% inhibit(i,j) = inhibition probability on i->j arc
% leak(j) = inhibition prob. on leak->j arc
% prior(i) = prob. disease i is on
% pos = list of leaves that have positive observations
% neg = list of leaves that have negative observations
% pos_only = 1 means only include positively observed leaves in the model - the negative
%   ones are absorbed into the prior terms
%
% Output:
% bnet
% vals is their value

if pos_only
    obs = pos;
else
    obs = myunion(pos, neg);
end