code: def configs_for_writer(writer=None, ppp_config_dir=None):
      
      search_paths = (ppp_config_dir,) if ppp_config_dir else tuple()
      if writer is not None:
          if not isinstance(writer, (list, tuple)):
              writer = [writer]
          # given a config filename or writer name
          config_files = [w if w.endswith('.yaml') else w + '.yaml' for w in writer]
      else:
          writer_configs = glob_config(os.path.join('writers', '*.yaml'),
                                       *search_paths)
          config_files = set(writer_configs)
  
      for config_file in config_files:
          config_basename = os.path.basename(config_file)
          writer_configs = config_search_paths(
              os.path.join("writers", config_basename), *search_paths)
  
          if not writer_configs:
              LOG.warning("No writer configs found for '%s'", writer)
              continue
  
          yield writer_configs
docs: Generator of writer configuration files for one or more writers
  
      Args:
          writer (Optional[str]): Yield configs only for this writer
          ppp_config_dir (Optional[str]): Additional configuration directory
              to search for writer configuration files.
  
      Returns: Generator of lists of configuration files