def rename_variables(fstruct, vars=None, used_vars=(), new_vars=None, fs_class=u'default'):
 if (fs_class == u'default'):
  fs_class = _default_fs_class(fstruct)
 if (new_vars is None):
  new_vars = {}
 if (vars is None):
  vars = find_variables(fstruct, fs_class)
 else:
  vars = set(vars)
 used_vars = find_variables(fstruct, fs_class).union(used_vars)
 return _rename_variables(copy.deepcopy(fstruct), vars, used_vars, new_vars, fs_class, set())

def rename_variables ( fstruct , vars = None , used_vars = ( ) , new_vars = None , fs_class = u'default' ) : if ( fs_class == u'default' ) : fs_class = _default_fs_class ( fstruct ) if ( new_vars is None ) : new_vars = { } if ( vars is None ) : vars = find_variables ( fstruct , fs_class ) else : vars = set ( vars ) used_vars = find_variables ( fstruct , fs_class ) . union ( used_vars ) return _rename_variables ( copy . deepcopy ( fstruct ) , vars , used_vars , new_vars , fs_class , set ( ) )
return the feature structure that is obtained by replacing any of this feature structures variables that are in vars with new variables .