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: spm_eeg_invert_classic_volumetric.m
    path of file: ./repos/spm
    
    the code of the file until where you have to start completion: function [D] = spm_eeg_invert_classic_volumetric(D,val)
%% Volumetric multiple sparse priors
% This version only handles single subject single modality data; the removal
% of many scaling factors makes it easier to compare between forward models
%
% Note also that this funtion performs a bit differently from the
% spm_eeg_invert and spm_eeg_invert_classic functions. Namely:
%
% 1) No temporal filtering is carried out to the data by default
% 2) By default, each lead field element has one associated
    
function [Qp, LQpL] = build_IID_source_priors(Ns, UL)
% create minimum norm prior
%------------------------------------------------------------------
Qp{1}   = speye(Ns,Ns);
LQpL{1} = UL*UL';

function [Qp, LQpL] = build_EBB_source_priors(Ns, AYYA, UL)
% create SMOOTH beamforming prior.
disp('NB  EBB algorithm, no smoothing !');
%------------------------------------------------------------------
QG=speye(Ns,Ns); %% was surface smoothing but not used in volumetric approach


InvCov = spm_inv(AYYA);
allsource = sparse(Ns,1);
Sourcepower = sparse(Ns,1);
for bk = 1:Ns
    q               = QG(:,bk);
    smthlead = UL*q;     %% THIS IS WHERE THE SMOOTHNESS GETS ADDED
    normpower = 1/(smthlead'*smthlead);
    Sourcepower(bk) = 1/(smthlead'*InvCov*smthlead);
    allsource(bk) = Sourcepower(bk)./normpower;
end