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: readepochindx.m
    path of file: ./repos/erplab/functions
    
    the code of the file until where you have to start completion: % - This function is part of ERPLAB Toolbox -
% PURPOSE: subroutine for pop_averager.m
%          gets epoch indices (per dataset) for selective averaging
%          either from a cell array or a list in a text file
%
%
%
% *** This function is part of ERPLAB Toolbox ***
% Author: Javier Lopez-Calderon
% Center for Mind a
    
function is part of ERPLAB Toolbox -
% PURPOSE: subroutine for pop_averager.m
%          gets epoch indices (per dataset) for selective averaging
%          either from a cell array or a list in a text file
%
%
%
% *** This function is part of ERPLAB Toolbox ***
% Author: Javier Lopez-Calderon
% Center for Mind and Brain
% University of California, Davis,
% Davis, CA
% 2012

function EPINDX = readepochindx(textarray, option)
if nargin<2
      option = 0; % read from file
end