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: compute_kernel.m
    path of file: ./repos/scGEAToolbox/+ten
    
    the code of the file until where you have to start completion: function K = compute_kernel(data, varargin)
% K = computer_alpha_kernel_sparse(data, varargin)
% Computes sparse alpha-decay kernel
% varargin:
%   'npca' (default = [], no PCA)
%       Perform fast random PCA before computing distances
%   'k' (default = 5)
%       k for the knn distances for the locally adaptive bandwidth
%   'a' (default = 10)
%       The alpha exponent in the alpha-decaying kernel

    
function K = compute_kernel(data, varargin)
% K = computer_alpha_kernel_sparse(data, varargin)
% Computes sparse alpha-decay kernel
% varargin:
%   'npca' (default = [], no PCA)
%       Perform fast random PCA before computing distances
%   'k' (default = 5)
%       k for the knn distances for the locally adaptive bandwidth
%   'a' (default = 10)
%       The alpha exponent in the alpha-decaying kernel
%   'distfun' (default = 'euclidean')
%       Input distance function
k = 5;
a = 10;
npca = [];
distfun = 'euclidean';
% get the input parameters
if ~isempty(varargin)
    for j = 1:length(varargin)
        % k nearest neighbora
        if strcmp(varargin{j}, 'k')
            k = varargin{j+1};
        end