code: def parse_directive_list(
      s, relaxed_bool=False, ignore_unknown=False, current_settings=None
  ):
      """
      Parses a comma-separated list of pragma options. Whitespace
      is not considered.
  
      >>> parse_directive_list('      ')
      {}
      >>> (parse_directive_list('boundscheck=True') ==
      ... {'boundscheck': True})
      True
      >>> parse_directive_list('  asdf')
      Traceback (most recent call last):
         ...
      ValueError: Expected "=" in option "asdf"
      >>> parse_directive_list('boundscheck=hey')
      Traceback (most recent call last):
         ...
      ValueError: boundscheck directive must be set to True or False, got 'hey'
      >>> parse_directive_list('unknown=True')
      Traceback (most recent call last):
         ...
      ValueError: Unknown option: "unknown"
      >>> warnings = parse_directive_list('warn.all=True')
      >>> len(warnings) > 1
      True
      >>> sum(warnings.values()) == len(warnings)  # all true.
      True
      """
      if current_settings is None:
          result = {}
      else:
          result = current_settings
      for item in s.split(","):
          item = item.strip()
          if not item:
              continue
          if "=" not in item:
              raise ValueError('Expected "=" in option "%s"' % item)
          name, value = [s.strip() for s in item.strip().split("=", 1)]
          if name not in _directive_defaults:
              found = False
              if name.endswith(".all"):
                  prefix = name[:-3]
                  for directive in _directive_defaults:
                      if directive.startswith(prefix):
                          found = True
                          parsed_value = parse_directive_value(
                              directive,
                              value,
                              relaxed_bool=relaxed_bool,
                          )
                          result[directive] = parsed_value
              if not found and not ignore_unknown:
                  raise ValueError('Unknown option: "%s"' % name)
          else:
              parsed_value = parse_directive_value(
                  name, value, relaxed_bool=relaxed_bool
              )
              result[name] = parsed_value
      return result
  
file_path: catboost/contrib/tools/cython/Cython/Compiler/Options.py
imports: from __future__ import absolute_import
label_desc: Use image node_id 5 for calling a global function with example usage: parse_directive_list(s, relaxed_bool, ignore_unknown, current_settings) and returns: result