def Init(self, params):
    """Initializes Config. This is a separate method as it raises an exception
    if there is a parse error."""
    generator_flags = params.get('generator_flags', {})
    config_path = generator_flags.get('config_path', None)
    if not config_path:
      return
    try:
      f = open(config_path, 'r')
      config = json.load(f)
      f.close()
    except IOError:
      raise Exception('Unable to open file ' + config_path)
    except ValueError as e:
      raise Exception('Unable to parse config file ' % config_path + str(e))
    if not isinstance(config, dict):
      raise Exception('config_path must be a JSON file containing a dictionary')
    self.files = config.get('files', [])
    if config.get('targets'):
      self.targets = set(config.get('targets'))
      self.deprecated_mode = True
    else:
      self.additional_compile_target_names = set(
        config.get('additional_compile_targets', []))
      self.test_target_names = set(config.get('test_targets', []))
dataset/ETHPy150Open adblockplus/gyp/pylib/gyp/generator/analyzer.py/Config.Init/operator `+` -> `%`