def _make_ctx_options(ctx_options, config_cls=ContextOptions):
if not ctx_options:<EOL><INDENT>return None<EOL><DEDENT>for key in list(ctx_options):<EOL><INDENT>translation = _OPTION_TRANSLATIONS.get(key)<EOL>if translation:<EOL><INDENT>if translation in ctx_options:<EOL><INDENT>raise ValueError('<STR_LIT>' %<EOL>(key, translation))<EOL><DEDENT>ctx_options[translation] = ctx_options.pop(key)<EOL><DEDENT><DEDENT>return config_cls(**ctx_options)<EOL>
Helper to construct a ContextOptions object from keyword arguments.

    Args:
      ctx_options: A dict of keyword arguments.
      config_cls: Optional Configuration class to use, default ContextOptions.

    Note that either 'options' or 'config' can be used to pass another
    Configuration object, but not both.  If another Configuration
    object is given it provides default values.

    Returns:
      A Configuration object, or None if ctx_options is empty.