<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_channel_names(self, names):
 """ Set self.chnames. Custom channel names that can be used in calls on this object and in condition strings. names: list or None It is the callers responsibility to make sure the list is in column order. self.chnames will be a dict with channel integer indexes as keys. If names is None, self.chnames will be None. """

        if not names:
            self.chnames = None
            return

        if len(names) != len(self.keys):
            raise ValueError('len(names) != len(self.D.keys())')

        self.chnames = dict(zip(self.keys, names))