docstr: Generates samples.
  
  Parameters:
      n_samples - number of samples to generate
      log_p_function - a function that returns log density for a specific sample
      burn_in_steps - number of burn-in steps for sampling
  
  Returns a tuple of two array: (samples, log_p_function values for samples)
docstr_tok: ["Generates","samples",".","Parameters",":","n_samples","-","number","of","samples","to","generate","log_p_function","-","a","function","that","returns","log","density","for","a","specific","sample","burn_in_steps","-","number","of","burn-in","steps","for","sampling","Returns","a","tuple","of","two","array",":","(","samples",",","log_p_function","values","for","samples",")"]
code: def get_samples(self, n_samples, log_p_function, burn_in_steps=50):
      """
      Generates samples.
  
      Parameters:
          n_samples - number of samples to generate
          log_p_function - a function that returns log density for a specific sample
          burn_in_steps - number of burn-in steps for sampling
  
      Returns a tuple of two array: (samples, log_p_function values for samples)
      """
      restarts = initial_design("random", self.space, n_samples)
      sampler = emcee.EnsembleSampler(
          n_samples, self.space.input_dim(), log_p_function
      )
      samples, samples_log, _ = sampler.run_mcmc(
          restarts, burn_in_steps
      )
  
      # make sure we have an array of shape (n samples, space input dim)
      if len(samples.shape) == 1:
          samples = samples.reshape(-1, 1)
      samples_log = samples_log.reshape(-1, 1)
  
      return samples, samples_log
  
file_path: GPyOpt/GPyOpt/util/mcmc_sampler.py
imports: import emcee
  from ..experiment_design import initial_design
label_desc: Use image node_id 2 for calling the AffineInvariantEnsembleSampler obj's underlying member method code with example usage: obj.get_samples(n_samples, log_p_function, burn_in_steps) and returns: samples,  samples_log