(settings, names=None, none_placeholder=None)
Change variables stored as `(str, int)` to `(Variable, int)`.

    Args:
        settings (Context): context that is being migrated
        names (sequence): names of settings to be migrated. If omitted,
            all settings with values `(str, int)` are migrated.
Change variables stored as `(str, int)` to `(Variable, int)`.
Change variables stored as ( str int ) to ( Variable int ) .
def migrate_str_to_variable(settings, names=None, none_placeholder=None):
    """
    Change variables stored as `(str, int)` to `(Variable, int)`.

    Args:
        settings (Context): context that is being migrated
        names (sequence): names of settings to be migrated. If omitted,
            all settings with values `(str, int)` are migrated.
    """
    def _fix(name):
        var, vtype = settings.values[name]
        if 0 <= vtype <= 100:
            settings.values[name] = (var, 100 + vtype)
        elif var == none_placeholder and vtype == -2:
            settings.values[name] = None

    if names is None:
        for name, setting in settings.values.items():
            if DomainContextHandler.is_encoded_var(setting):
                _fix(name)
    elif isinstance(names, str):
        _fix(names)
    else:
        for name in names:
            _fix(name)
def migrate_str_to_variable ( settings , names = None , none_placeholder = None ) : def _fix ( name ) : var , vtype = settings . values [ name ] if 0 <= vtype <= 100 : settings . values [ name ] = ( var , 100 + vtype ) elif var == none_placeholder and vtype == - 2 : settings . values [ name ] = None if names is None : for name , setting in settings . values . items ( ) : if DomainContextHandler . is_encoded_var ( setting ) : _fix ( name ) elif isinstance ( names , str ) : _fix ( names ) else : for name in names : _fix ( name )