code: def samples_keep(self, index):
  
          
  
          try:
              if isinstance(index, (int, long)):
                  index = range(self.samples)[-index:]
          except(NameError):
              if isinstance(index,int):
                  index = range(self.samples)[-index:]            
          self.sampled_topics = np.take(self.sampled_topics, index, axis=0)
          self.tt = np.take(self.tt, index, axis=2)
          self.dt = np.take(self.dt, index, axis=2)
  
          self.samples = len(index)
docs: Keep subset of samples.  If index is an integer, keep last N=index
          samples.  If index is a list, keep the samples
          corresponding to the index values in the list.