original_docstring: Return a batch tuple of (data, covariate)
docstring: Return a batch tuple of (data, covariate)
docstring_tokens: Return a batch tuple of ( data covariate )
code: def next_batch(self, batch_size):
          """Return a batch tuple of (data, covariate)"""
          if batch_size:
              idx = np.random.choice(self.Z.shape[0], batch_size)
          else:
              idx = range(self.Z.shape[0])
  
          if 'cond_length' in self.config and 'pred_length' in self.config and 'test_length' in self.config:
              start_t = np.random.choice(
                  self.Z.shape[1] - self.config.cond_length - self.config.pred_length - self.config.test_length)
              end_t = start_t + self.config.cond_length + self.config.pred_length
          else:
              start_t = 0
              end_t = start_t + self.T
          if self.config['num_cov']:
              yield (self.Z[idx, start_t:end_t], self.X[idx, start_t:end_t])
          else:
              yield (self.Z[idx, start_t:end_t], None)
code_tokens: def next_batch ( self , batch_size ) : if batch_size : idx = np . random . choice ( self . Z . shape [ 0 ] , batch_size ) else : idx = range ( self . Z . shape [ 0 ] ) if 'cond_length' in self . config and 'pred_length' in self . config and 'test_length' in self . config : start_t = np . random . choice ( self . Z . shape [ 1 ] - self . config . cond_length - self . config . pred_length - self . config . test_length ) end_t = start_t + self . config . cond_length + self . config . pred_length else : start_t = 0 end_t = start_t + self . T if self . config [ 'num_cov' ] : yield ( self . Z [ idx , start_t : end_t ] , self . X [ idx , start_t : end_t ] ) else : yield ( self . Z [ idx , start_t : end_t ] , None )
short_docstring: Return a batch tuple of (data, covariate)
short_docstring_tokens: Return a batch tuple of ( data covariate )
comment: """Return a batch tuple of (data, covariate)"""