def METHOD_NAME(
    init_file_path: str, search_dirs: Optional[List[str]] = None, target_fmt: Optional[ConfigFormat] = None
) -> Tuple[Optional[ConfigFormat], Optional[str]]:
    """find the configuration format and the location (file_path) for given initial init_file_path and search directories.
        for example, the initial config file path given is config_client.json
        the search function will ignore the .json extension and search "config_client.xxx" in the given directory in
        specified extension search order. The first found file_path will be used as configuration.
        the ".xxx" is one of the extensions defined in the configuration format.
    Args:
        init_file_path: initial file_path for the configuration
        search_dirs: search directory. If none, the parent directory of init_file_path will be used as search dir
        target_fmt: (ConfigFormat) if specified, only this format searched, ignore all other formats.
    Returns:
        Tuple of None,None or ConfigFormat and real configuration file path
    """
    logger = ConfigFactory.logger
    if not search_dirs:  # empty or None
        parent_dir = pathlib.Path(init_file_path).parent
        search_dirs = [str(parent_dir)]
    target_exts = None
    if target_fmt:
        target_exts = ConfigFormat.extensions(target_fmt)
    # we ignore the original extension
    file_basename = ConfigFactory.get_file_basename(init_file_path)
    ext2fmt_map = ConfigFormat.config_ext_formats()
    extensions = target_exts if target_fmt else ext2fmt_map.keys()
    for search_dir in search_dirs:
        logger.debug(f"search file basename:'{file_basename}', search dirs = {search_dirs}")
        for ext in extensions:
            fmt = ext2fmt_map[ext]
            filename = f"{file_basename}{ext}"
            for root, dirs, files in os.walk(search_dir):
                if filename in files:
                    config_file = os.path.join(root, filename)
                    return fmt, config_file
    return None, None