code: def return_dat(self, chan, begsam, endsam):
          
          ext = splitext(self.filename)[1]
          if ext == '.nev':
              raise TypeError('NEV contains only header info, not data')
  
          data = _read_nsx(self.filename, self.BOData, self.sess_begin,
                           self.sess_end, self.factor, begsam, endsam)
  
          return data[chan, :]
docs: Return the data as 2D numpy.ndarray.
  
          Parameters
          ----------
          chan : int or list
              index (indices) of the channels to read
          begsam : int
              index of the first sample
          endsam : int
              index of the last sample
  
          Returns
          -------
          numpy.ndarray
              A 2d matrix, with dimension chan X samples