def _handle_generic_set_env_vars(non_default_options):
    if not hasattr(non_default_options, 'env_settings'):
        return non_default_options

    # Allow setting of arbitrary env keys.
    # This comes *before* the "specific" env_options so that those may
    # override these ones. Specific should override generic, if somebody
    # was silly enough to specify the same key in both places.
    # E.g. "fab --set shell=foo --shell=bar" should have env.shell set to
    # 'bar', not 'foo'.
    for pair in _escape_split(',', non_default_options.env_settings):
        pair = _escape_split('=', pair)
        # "--set x" => set env.x to True
        # "--set x=" => set env.x to ""
        key = pair[0]
        value = True
        if len(pair) == 2:
            try:
                value = _to_boolean(pair[1])
            except __HOLE__:
                value = pair[1]
        state.env[key] = value

    non_default_options_dict = vars(non_default_options)
    del non_default_options_dict['env_settings']
    return Values(non_default_options_dict)
dataset/ETHPy150Open prestodb/presto-admin/prestoadmin/main.py/_handle_generic_set_env_vars