'Discretizes continuous attributes.
Returns None when there is no data, no rows, or no discrete or continuous attributes.'

def _get_discrete_data(self, data):

    if ((data is None) or (not len(data)) or (not any(((attr.is_discrete or attr.is_continuous) for attr in chain(data.domain, data.domain.metas))))):
        return None
    elif any((attr.is_continuous for attr in data.domain)):
        return Discretize(method=EqualFreq(n=4), remove_const=False, discretize_classes=True, discretize_metas=True)(data)
    else:
        return data
