(self, attributes, class_vars, metas)
return Orange.data.Domain(attrs, cvars, mets)
Check for duplicate variable names in domain. If any, rename
        the variables, by replacing them with new ones (names are
        appended a number).
Check for duplicate variable names in domain. If any, rename
        the variables, by replacing them with new ones (names are
        appended a number).
Check for duplicate variable names in domain . If any rename the variables by replacing them with new ones ( names are appended a number ) .
def _domain_rename_duplicates(self, attributes, class_vars, metas):
        """Check for duplicate variable names in domain. If any, rename
        the variables, by replacing them with new ones (names are
        appended a number). """
        attrs, cvars, mets = [], [], []
        n_attrs, n_cvars, n_metas = len(attributes), len(class_vars), len(metas)
        lists = [attrs] * n_attrs + [cvars] * n_cvars + [mets] * n_metas

        all_vars = attributes + class_vars + metas
        proposed_names = [m.name for m in all_vars]
        unique_names = get_unique_names_duplicates(proposed_names)
        duplicates = set()
        for p_name, u_name, var, c in zip(proposed_names, unique_names,
                                          all_vars, lists):
            if p_name != u_name:
                duplicates.add(p_name)
                var = var.copy(name=u_name)
            c.append(var)
        if duplicates:
            self.Warning.renamed_vars(", ".join(duplicates))
        return Orange.data.Domain(attrs, cvars, mets)
def _domain_rename_duplicates ( self , attributes , class_vars , metas ) : attrs , cvars , mets = [ ] , [ ] , [ ] n_attrs , n_cvars , n_metas = len ( attributes ) , len ( class_vars ) , len ( metas ) lists = [ attrs ] * n_attrs + [ cvars ] * n_cvars + [ mets ] * n_metas all_vars = attributes + class_vars + metas proposed_names = [ m . name for m in all_vars ] unique_names = get_unique_names_duplicates ( proposed_names ) duplicates = set ( ) for p_name , u_name , var , c in zip ( proposed_names , unique_names , all_vars , lists ) : if p_name != u_name : duplicates . add ( p_name ) var = var . copy ( name = u_name ) c . append ( var ) if duplicates : self . Warning . renamed_vars ( ", " . join ( duplicates ) ) return Orange . data . Domain ( attrs , cvars , mets )