'Compute and apply discretization of the given data. Returns a new
data table.
Parameters
data : Orange.data.Table
A data table to be discretized.'

def __call__(self, data):

    def transform(var):
        if var.is_continuous:
            new_var = method(data, var)
            if ((new_var is not None) and ((len(new_var.values) >= 2) or (not self.remove_const))):
                return new_var
            else:
                return None
        else:
            return var
    def discretized(vars, do_discretize):
        if do_discretize:
            vars = (transform(var) for var in vars)
            vars = [var for var in vars if (var is not None)]
        return vars
    method = (self.method or discretize.EqualFreq())
    domain = Orange.data.Domain(discretized(data.domain.attributes, True), discretized(data.domain.class_vars, self.discretize_classes), discretized(data.domain.metas, self.discretize_metas))
    return data.transform(domain)
