docstr: Function to sample a new configuration
  
  This function is called inside Hyperband to query a new configuration
  
  
  Parameters:
  -----------
  budget: float
          the budget for which this configuration is scheduled
  
  returns: config
          should return a valid configuration
code: def get_config(self, budget):
      """
      Function to sample a new configuration
  
      This function is called inside Hyperband to query a new configuration
  
  
      Parameters:
      -----------
      budget: float
              the budget for which this configuration is scheduled
  
      returns: config
              should return a valid configuration
  
      """
      # No observations available for this budget sample from the prior
      if len(self.kde_models.keys()) == 0:
          return (
              self.configspace.sample_configuration().get_dictionary()
          )
      # If we haven't seen anything with this budget, we sample from the kde trained on the highest budget
      if budget not in self.kde_models.keys():
          budget = sorted(self.kde_models.keys())[-1]
      # TODO: This only works in continuous space and with gaussian kernels
      kde = self.kde_models[budget]
      idx = np.random.randint(0, len(self.kde_models[budget].data))
  
      vector = [
          sps.truncnorm.rvs(-m / bw, (1 - m) / bw, loc=m, scale=bw)
          for m, bw in zip(self.kde_models[budget].data[idx], kde.bw)
      ]
  
      if np.any(np.array(vector) > 1) or np.any(np.array(vector) < 0):
          raise RuntimeError("truncated normal sampling problems!")
  
      sample = ConfigSpace.Configuration(
          self.configspace, vector=vector
      )
      return sample.get_dictionary(), {}
  
file_path: auptimizer/src/aup/Proposer/hpbandster/optimizers/config_generators/kde.py
imports: import ConfigSpace
  import numpy
  import scipy.stats
  import statsmodels.api
  from hpbandster.config_generators.base import base_config_generator
label_desc: Use image node_id 2 for calling the KernelDensityEstimator obj's underlying member method code with example usage: obj.get_config(budget) and returns: sample,  dict, self