<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def channel_names(self, usecols=None):
 """Attempt to extract the channel names from the data file. Return a list with names. Return None on failed attempt. usecols: A list with columns to use. If present, the returned list will include only names for columns requested. It will align with the columns returned by numpys loadtxt by using the same keyword (usecols). """


        # Search from [rts - 1] and up (last row before data). Split respective
        # row on datdel. Accept consecutive elements starting with alphas
        # character after strip. If the count of elements equals the data count
        # on row rts + 1, accept it as the channel names.

        if self.decdel == '.':
            datcnt = self.matches_p[self.rts]
        elif self.decdel == ',':
            datcnt = self.matches_c[self.rts]

        if usecols and max(usecols) >= datcnt:
            mess = ' Max column index is '
            raise IndexError(str(usecols) + mess + str(datcnt - 1))

        names = None
        if not self.rts:                        # Only data.
            return None

        # From last row before data and up.
        for row in self.rows[self.rts - 1::-1]:
            # datdel might be None, (whitespace)
            splitlist = row.split(self.datdel)
            for i, word in enumerate(splitlist):
                if not word.strip().startswith(ALPHAS):
                    break
                elif i + 1 == datcnt:  # Accept
                    names = [ch.strip() for ch in splitlist[:datcnt]]
                    break
            if names:
                break

        if usecols:
            names = [names[i] for i in sorted(usecols)]

        return names