import warnings


def _validate_config_file_contents(conf):
  """Validate the contents of a ComptoxAI config file.

  If anything doesn't pass the validations, a warning is displayed and this
  function returns False. Otherwise, no warning is given and the function
  returns True.
  """
  if 'neo4j' not in conf:
    warnings.warn("Warning: No `neo4j` block found in config file")
    return False

  for val in ['username', 'password', 'hostname', 'port']:
    if (val not in conf['neo4j']):
      warnings.warn("Warning: No value given for `{0}`".format(val))
      return False

  return True