'Convert domain into variable representation used by
the VarTableModel.
Parameters
domain : the domain to convert
Returns
list of [variable_name, var_type, place, values, can_be_numeric] lists.'

@staticmethod
def parse_domain(domain):

    if (domain is None):
        return []
    def may_be_numeric(var):
        if var.is_continuous:
            return True
        if var.is_discrete:
            try:
                sum((float(x) for x in var.values))
                return True
            except ValueError:
                return False
        return False
    def discrete_value_display(value_list):
        result = ',    '.join((str(v) for v in value_list[:VarTableModel.DISCRETE_VALUE_DISPLAY_LIMIT]))
        if (len(value_list) > VarTableModel.DISCRETE_VALUE_DISPLAY_LIMIT):
            result += ',    ...'
        return result
    return [[var.name, type(var), place, (discrete_value_display(var.values) if var.is_discrete else ''), may_be_numeric(var)] for (place, vars) in enumerate((domain.attributes, domain.class_vars, domain.metas)) for var in vars]
