class_docstr: A class that encodes trial index information.  It has a list of
  model names and a list of test segment names and a matrix
  indicating which combinations of model and test segment are
  trials of interest.
  
  Arguments
  ---------
  modelset : list
      List of unique models in a ndarray.
  segset : list
      List of unique test segments in a ndarray.
  trialmask : 2D ndarray of bool.
      Rows correspond to the models and columns to the test segments. True, if the trial is of interest.
docstr: Checks that an object of type Ndx obeys certain rules that
  must always be true. Returns a boolean value indicating whether the object is valid
docstr_tok: ["Checks","that","an","object","of","type","Ndx","obeys","certain","rules","that","must","always","be","true",".","Returns","a","boolean","value","indicating","whether","the","object","is","valid"]
code: def validate(self):
      """Checks that an object of type Ndx obeys certain rules that
      must always be true. Returns a boolean value indicating whether the object is valid
      """
      ok = isinstance(self.modelset, numpy.ndarray)
      ok &= isinstance(self.segset, numpy.ndarray)
      ok &= isinstance(self.trialmask, numpy.ndarray)
  
      ok &= self.modelset.ndim == 1
      ok &= self.segset.ndim == 1
      ok &= self.trialmask.ndim == 2
  
      ok &= self.trialmask.shape == (
          self.modelset.shape[0],
          self.segset.shape[0],
      )
      return ok
  
imports: import numpy
  import copy
  import pickle
  from scipy import linalg
label_desc: Use image node_id 4 for calling the Ndx obj's underlying member method code with example usage: obj.validate() and returns: ok