code: def locate_config(confname, app_name,
                    location=None, prefix='etc', verbose=False):
      
      candidates = []
      if location:
          candidate = os.path.normpath(os.path.join(location, confname))
          if os.path.isfile(candidate):
              candidates += [candidate]
      candidate = os.path.normpath(os.path.join(
          os.path.dirname(os.path.dirname(sys.executable)),
          prefix, app_name, confname))
      if os.path.isfile(candidate):
          candidates += [candidate]
      candidate = os.path.normpath('/%s/%s/%s' % (prefix, app_name, confname))
      if os.path.isfile(candidate):
          candidates += [candidate]
      candidate = os.path.normpath(os.path.join(os.getcwd(), confname))
      if os.path.isfile(candidate):
          candidates += [candidate]
      if candidates:
          if verbose:
              LOGGER.info("config loaded from '%s'", candidates[0])
          return candidates[0]
      else:
          LOGGER.warning("config '%s' was not found.", confname)
      return None
docs: Returns absolute path on the filesystem to a config file named *confname*.