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: vl_nnpdist.m
    path of file: ./repos/2015_Face_Detection/matlab
    
    the code of the file until where you have to start completion: function y = vl_nnpdist(x, x0, p, varargin)
% VL_NNPDIST  CNN p-distance from target
%    VL_NNPDIST(X, X0, P) computes the P distance raised of each feature
%    vector in X to the corresponding feature vector in X0:
%
%      Y(i,j,1) = (SUM_d (X(i,j,d) - X0(i,j,d))^P)^1/P
%
%    X0 should have the same size as X; the outoput Y has the same
%    height and width as X, but depth equal to 1. Optionally, X0 can
%    be a 1 x 1 x D x N array, in which case the same target feature
%    vector in X0 is compared to all feature vectors in X.
%
%    Setting the `noRoot` option to `true` does not take the 1/P power
%    in the formula, computing instead
%
%      Y(i,j,1) = SUM_d (X(i,j,d) - X0(i,j,d))^P
%

    
function y = vl_nnpdist(x, x0, p, varargin)
% VL_NNPDIST  CNN p-distance from target
%    VL_NNPDIST(X, X0, P) computes the P distance raised of each feature
%    vector in X to the corresponding feature vector in X0:
%
%      Y(i,j,1) = (SUM_d (X(i,j,d) - X0(i,j,d))^P)^1/P
%
%    X0 should have the same size as X; the outoput Y has the same
%    height and width as X, but depth equal to 1. Optionally, X0 can
%    be a 1 x 1 x D x N array, in which case the same target feature
%    vector in X0 is compared to all feature vectors in X.
%
%    Setting the `noRoot` option to `true` does not take the 1/P power
%    in the formula, computing instead
%
%      Y(i,j,1) = SUM_d (X(i,j,d) - X0(i,j,d))^P
%
%    For example, `vn_nnpdist(x, x0, 2, 'noRoot', true)` computes the
%    squared L2 distance.
%
%    Options:
%
%    `NoRoot`:: `false`
%       If set to true, compute the P-distance to the P-th power.
%
%    `Epsilon`:: 1e-6
%       When computing derivatives, quantities that are divided in are
%       lower boudned by this value. For example, the L2 distance is
%       not smooth at the origin; this option prevents the
%       derivative from diverging.
%
%
%    DZDX = VL_NNPDISTP(X, X0, P, DZDY) computes the derivative.


% -------------------------------------------------------------------------
%                                                             Parse options
% -------------------------------------------------------------------------

opts.noRoot = false ;
opts.epsilon = 1e-6 ;
backMode = numel(varargin) > 0 && ~ischar(varargin{1}) ;
if backMode
  dzdy = varargin{1} ;
  opts = vl_argparse(opts, varargin(2:end