def CheckConfiguration(self, config, structure, max_recursion_depth=30):
    """Recursively checks the sanity and structure of the configuration.

    This method checks the sanity of the configuration structure for Definate
    and raises a DefinateConfigError if the configuration is not sane.

    Args:
      config: Dictionary generated from the YAML configuration file which should
        be checked.
      structure: Structure of the configuration against which should be checked.
      max_recursion_depth: Defines the maximum amount of recursion cycles before
        checking is aborted. Default is 30.

    Raises:
      DefinateConfigError: The configuration is not sane.
    """
    max_depth = max_recursion_depth - 1
    if max_depth <= 0:
      raise DefinateConfigError('Maximum recursion depth reached. Please check '
                                'configuration manually.')
    if [dict, list] in type(structure):
      for item in structure:
        value = item
        if type(structure) is dict:
          value = structure[item]

        self.CheckConfigurationItem(config, item, typ=type(value))
        if type(value) is dict:
          self.CheckConfiguration(config[item], value, max_depth)
        elif type(value) is list:
          for (i, list_value) in enumerate(value):
            self.CheckConfiguration(config[item][i], list_value, max_depth)
    elif type(structure) is type(config):
      return
    else:
      raise DefinateConfigError('Type of "%s" is %s, expected %s.' % (
          config, str(type(config)), str(structure)))
dataset/ETHPy150Open google/capirca/definate/yaml_validator.py/YamlValidator.CheckConfiguration/swapped operands of `in`