@_hidden<EOL><INDENT>def subspaces(self, expressions_list=None, dimensions=None, exclude=None, **kwargs):<DEDENT>
if dimensions is not None:<EOL><INDENT>expressions_list = list(itertools.combinations(self.get_column_names(), dimensions))<EOL>if exclude is not None:<EOL><INDENT>import six<EOL>def excluded(expressions):<EOL><INDENT>if callable(exclude):<EOL><INDENT>return exclude(expressions)<EOL><DEDENT>elif isinstance(exclude, six.string_types):<EOL><INDENT>return exclude in expressions<EOL><DEDENT>elif isinstance(exclude, (list, tuple)):<EOL><INDENT>for e in exclude:<EOL><INDENT>if isinstance(e, six.string_types):<EOL><INDENT>if e in expressions:<EOL><INDENT>return True<EOL><DEDENT><DEDENT>elif isinstance(e, (list, tuple)):<EOL><INDENT>if set(e).issubset(expressions):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return False<EOL><DEDENT>expressions_list = [expr for expr in expressions_list if not excluded(expr)]<EOL><DEDENT>logger.debug("<STR_LIT>", expressions_list)<EOL><DEDENT>import vaex.legacy<EOL>return vaex.legacy.Subspaces([self(*expressions, **kwargs) for expressions in expressions_list])<EOL>
Generate a Subspaces object, based on a custom list of expressions or all possible combinations based on
        dimension

        :param expressions_list: list of list of expressions, where the inner list defines the subspace
        :param dimensions: if given, generates a subspace with all possible combinations for that dimension
        :param exclude: list of