code: def samples(self, gp, Y_metadata):
          
          N1, N2 = gp.shape
          Ysim = np.zeros((N1,N2))
          ind = Y_metadata['output_index'].flatten()
          for j in np.unique(ind):
              flt = ind==j
              gp_filtered = gp[flt,:]
              n1 = gp_filtered.shape[0]
              lik = self.likelihoods_list[j]
              _ysim = np.array([np.random.normal(lik.gp_link.transf(gpj), scale=np.sqrt(lik.variance), size=1) for gpj in gp_filtered.flatten()])
              Ysim[flt,:] = _ysim.reshape(n1,N2)
          return Ysim
docs: Returns a set of samples of observations based on a given value of the latent variable.
  
          :param gp: latent variable