def _ValidateProjectClassifierConfig(project_classifier_config):
  """Checks that a project_classifier_config dict is properly formatted.

  Args:
    project_classifier_config (dict): A dictionary that provides mapping from
      project to its function patterns, path patterns and its host_directories,
      and some other settings.
      For example:
      {
          'project_path_function_hosts': [
              ['android_os', ['googleplex-android/'], ['android.'], None],
              ['chromium', None, ['org.chromium'],
               ['src/chrome/browser/resources/',
                'src/chrome/test/data/layout_tests/',
                'src/media/']]
          ],
          'non_chromium_project_rank_priority': {
              'android_os': '-1',
              'others': '-2',
          },
          'top_n': 4
      }

  Returns:
    True if ``project_classifier_config`` is properly formatted, False
    otherwise.
  """
  if not isinstance(project_classifier_config, dict):
    return False

  project_path_function_hosts = project_classifier_config.get(
      'project_path_function_hosts')
  if not isinstance(project_path_function_hosts, list):
    return False

  non_chromium_project_rank_priority = project_classifier_config.get(
      'non_chromium_project_rank_priority')
  if not isinstance(non_chromium_project_rank_priority, dict):
    return False

  top_n = project_classifier_config.get('top_n')
  if not isinstance(top_n, int):
    return False

  return True