(self, columns)
return self
Expands the ``'...'`` item in the sequence into the appropriate column
        names that should be placed there.

        arguments:
            columns (list): list of column names.
        returns:
            The current instance.

        raises:
            `ValueError` if the sequence is invalid for the columns.
Expands the ``'...'`` item in the sequence into the appropriate column
        names that should be placed there.
Expands the ... item in the sequence into the appropriate column names that should be placed there .
def expand(self, columns):
        """
        Expands the ``'...'`` item in the sequence into the appropriate column
        names that should be placed there.

        arguments:
            columns (list): list of column names.
        returns:
            The current instance.

        raises:
            `ValueError` if the sequence is invalid for the columns.
        """
        ellipses = self.count("...")
        if ellipses > 1:
            raise ValueError("'...' must be used at most once in a sequence.")
        elif ellipses == 0:
            self.append("...")

        # everything looks good, let's expand the "..." item
        columns = list(columns)  # take a copy and exhaust the generator
        head = []
        tail = []
        target = head  # start by adding things to the head
        for name in self:
            if name == "...":
                # now we'll start adding elements to the tail
                target = tail
                continue
            target.append(name)
            if name in columns:
                columns.pop(columns.index(name))
        self[:] = chain(head, columns, tail)

        return self
def expand ( self , columns ) : ellipses = self . count ( "..." ) if ellipses > 1 : raise ValueError ( "'...' must be used at most once in a sequence." ) elif ellipses == 0 : self . append ( "..." ) # everything looks good, let's expand the "..." item columns = list ( columns ) # take a copy and exhaust the generator head = [ ] tail = [ ] target = head # start by adding things to the head for name in self : if name == "..." : # now we'll start adding elements to the tail target = tail continue target . append ( name ) if name in columns : columns . pop ( columns . index ( name ) ) self [ : ] = chain ( head , columns , tail ) return self