(domain, class_var)
return Orange.data.Domain(attrs, class_var)
Return a domain with class_var as output domain.class_var.

    If class_var is in the input domain's attributes it is removed from the
    output's domain.attributes.
Return a domain with class_var as output domain.class_var.
Return a domain with class_var as output domain . class_var .
def domain_with_class_var(domain, class_var):
    """
    Return a domain with class_var as output domain.class_var.

    If class_var is in the input domain's attributes it is removed from the
    output's domain.attributes.
    """
    if domain.class_var is class_var:
        return domain
    elif class_var in domain.attributes:
        attrs = [var for var in domain.attributes
                 if var is not class_var]
    else:
        attrs = domain.attributes
    return Orange.data.Domain(attrs, class_var)
def domain_with_class_var ( domain , class_var ) : if domain . class_var is class_var : return domain elif class_var in domain . attributes : attrs = [ var for var in domain . attributes if var is not class_var ] else : attrs = domain . attributes return Orange . data . Domain ( attrs , class_var )