class_docstr: A singleton application with full configuration support.
class_docstr_tok: ["A","singleton","application","with","full","configuration","support","."]
docstr: Load config files (py,json) by filename and path.
  
  yield each config object in turn.
code: def _load_config_files(
      cls,
      basefilename,
      path=None,
      log=None,
      raise_config_file_errors=False,
  ):
      """Load config files (py,json) by filename and path.
  
      yield each config object in turn.
      """
  
      if not isinstance(path, list):
          path = [path]
      for path in path[::-1]:
          # path list is in descending priority order, so load files backwards:
          pyloader = cls.python_config_loader_class(
              basefilename + ".py", path=path, log=log
          )
          if log:
              log.debug(
                  "Looking for %s in %s",
                  basefilename,
                  path or os.getcwd(),
              )
          jsonloader = cls.json_config_loader_class(
              basefilename + ".json", path=path, log=log
          )
          loaded = []
          filenames = []
          for loader in [pyloader, jsonloader]:
              config = None
              try:
                  config = loader.load_config()
              except ConfigFileNotFound:
                  pass
              except Exception:
                  # try to get the full filename, but it will be empty in the
                  # unlikely event that the error raised before filefind finished
                  filename = loader.full_filename or basefilename
                  # problem while running the file
                  if raise_config_file_errors:
                      raise
                  if log:
                      log.error(
                          "Exception while loading config file %s",
                          filename,
                          exc_info=True,
                      )
              else:
                  if log:
                      log.debug(
                          "Loaded config file: %s", loader.full_filename
                      )
              if config:
                  for filename, earlier_config in zip(
                      filenames, loaded
                  ):
                      collisions = earlier_config.collisions(config)
                      if collisions and log:
                          log.warning(
                              "Collisions detected in {0} and {1} config files."
                              " {1} has higher priority: {2}".format(
                                  filename,
                                  loader.full_filename,
                                  json.dumps(collisions, indent=2),
                              )
                          )
                  yield (config, loader.full_filename)
                  loaded.append(config)
                  filenames.append(loader.full_filename)
  
imports: from __future__ import print_function
  from copy import deepcopy
  import json
  import logging
  import os
  import re
  import sys
  from collections import defaultdict, OrderedDict
  from decorator import decorator
  from traitlets.config.configurable import Configurable, SingletonConfigurable
  from traitlets.config.loader import KVArgParseConfigLoader, PyFileConfigLoader, Config, ArgumentError, ConfigFileNotFound, JSONFileConfigLoader
  from traitlets.traitlets import Bool, Unicode, List, Enum, Dict, Instance, TraitError, observe, observe_compat, default
  from ipython_genutils.importstring import import_item
  from ipython_genutils.text import indent, wrap_paragraphs, dedent
  from ipython_genutils import py3compat
  import six
label_desc: Use image node_id 22 for calling the Application obj's underlying member method code with example usage: obj._load_config_files(cls, basefilename, path, log, raise_config_file_errors) without return types