original_docstring: 
          training_sample is expected to be of the format
          {
              "spark.sql.shuffle.partitions": 100,
              "spark.executor.memory": 5120,
              "spark.driver.memory": 1024,
              "spark.executor.cores": 4,
              .
              .
              .
          }
  
          Internally we will map config names to their corresponding Param objects
          
docstring: 
  
  Internally we will map config names to their corresponding Param objects
docstring_tokens: Internally we will map config names to their corresponding Param objects
code: def add_sample_to_train_data(self, training_sample, out):
          """
          training_sample is expected to be of the format
          {
              "spark.sql.shuffle.partitions": 100,
              "spark.executor.memory": 5120,
              "spark.driver.memory": 1024,
              "spark.executor.cores": 4,
              .
              .
              .
          }
  
          Internally we will map config names to their corresponding Param objects
          """
          valid_config_names = list(map(lambda x: x.get_name(), self.config_set.get_params()))
          if set(training_sample.keys()) != set(valid_config_names):
              raise Exception("Invalid config to be added as training data. Missing config: %s, "
                              "Extra config: %s" % (", ".join(list(set(valid_config_names)-set(training_sample.keys()))),
                                                    ", ".join(list(set(training_sample.keys())-set(valid_config_names)))))
          training_config = Config()
          # To maintain order to be same as the one in config_set(), iterate on valid_config_names instead of
          # training_sample.keys()
          for config_name in valid_config_names:
              training_config.add_param(self.get_param_object(config_name), training_sample[config_name])
          self.training_data.add_training_data(training_config, out)
code_tokens: def add_sample_to_train_data ( self , training_sample , out ) : valid_config_names = list ( map ( lambda x : x . get_name ( ) , self . config_set . get_params ( ) ) ) if set ( training_sample . keys ( ) ) != set ( valid_config_names ) : raise Exception ( "Invalid config to be added as training data. Missing config: %s, " "Extra config: %s" % ( ", " . join ( list ( set ( valid_config_names ) - set ( training_sample . keys ( ) ) ) ) , ", " . join ( list ( set ( training_sample . keys ( ) ) - set ( valid_config_names ) ) ) ) ) training_config = Config ( ) for config_name in valid_config_names : training_config . add_param ( self . get_param_object ( config_name ) , training_sample [ config_name ] ) self . training_data . add_training_data ( training_config , out )
short_docstring: training_sample is expected to be of the format
  {
  "spark.sql.shuffle.partitions": 100,
  "spark.executor.memory": 5120,
  "spark.driver.memory": 1024,
  "spark.executor.cores": 4,
  .
short_docstring_tokens: training_sample is expected to be of the format { " spark . sql . shuffle . partitions " : 100 " spark . executor . memory " : 5120 " spark . driver . memory " : 1024 " spark . executor . cores " : 4 .
comment: """
          training_sample is expected to be of the format
          {
              "spark.sql.shuffle.partitions": 100,
              "spark.executor.memory": 5120,
              "spark.driver.memory": 1024,
              "spark.executor.cores": 4,
              .
              .
              .
          }
  
          Internally we will map config names to their corresponding Param objects
          """$SEP$# To maintain order to be same as the one in config_set(), iterate on valid_config_names instead of$SEP$# training_sample.keys()