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: sort.m
    path of file: ./repos/VINS/libraries/@DataIO
    
    the code of the file until where you have to start completion: function sort(varargin)
% ArgIn: (obj, 0:sortcols or 1:sortrows, sort_by_row/col_no)
if nargin == 1
    temp_data = varargin{1}.data';
elseif nargin > 1
    if varargin{2} == 1
        temp_data = varargin{1}.data;
    elseif varargin{2} == 0
        temp_data = varargin{1}.data';
    else
        warning("Invalid argument. Sorting columns");
        temp_data = varargin{1}.data';
    end
end

    
function sort(varargin)
% ArgIn: (obj, 0:sortcols or 1:sortrows, sort_by_row/col_no)
if nargin == 1
    temp_data = varargin{1}.data';
elseif nargin > 1
    if varargin{2} == 1
        temp_data = varargin{1}.data;
    elseif varargin{2} == 0
        temp_data = varargin{1}.data';
    else
        warning("Invalid argument. Sorting columns");
        temp_data = varargin{1}.data';
    end
end

if nargin == 3
    try
        temp_data = sortrows(temp_data, varargin{3});
    catch
        warning("Index exceeds dimension. Not Sorting!");
    end