code: def parse(raw_config):
      
  
      # Convert any applicable dictionaries back into lists
      # This is necessary due to the move from lists for these top level config
      # values to either lists or OrderedDicts.
      # Eventually we should probably just make them OrderedDicts only.
      config_dict = yaml_to_ordered_dict(raw_config)
      if config_dict:
          for top_level_key in ['stacks', 'pre_build', 'post_build',
                                'pre_destroy', 'post_destroy']:
              top_level_value = config_dict.get(top_level_key)
              if isinstance(top_level_value, dict):
                  tmp_list = []
                  for key, value in top_level_value.items():
                      tmp_dict = copy.deepcopy(value)
                      if top_level_key == 'stacks':
                          tmp_dict['name'] = key
                      tmp_list.append(tmp_dict)
                  config_dict[top_level_key] = tmp_list
  
      # Top-level excess keys are removed by Config._convert, so enabling strict
      # mode is fine here.
      try:
          return Config(config_dict, strict=True)
      except SchematicsError as e:
          raise exceptions.InvalidConfig(e.errors)
docs: Parse a raw yaml formatted stacker config.
  
      Args:
          raw_config (str): the raw stacker configuration string in yaml format.
  
      Returns:
          :class:`Config`: the parsed stacker config.