(channel_names)
return channel_list_to_return
Converts a comma-delimited list of channel names to a list of names.

    You can use this method to convert a comma-delimited list or range of
    physical or virtual channels into a list of physical or virtual channel
    names.

    Args:
        channel_names (str): The list or range of physical or virtual channels.
        
    Returns:
        List[str]: 
        
        The list of physical or virtual channel names. Each element of the 
        list contains a single channel.
Converts a comma-delimited list of channel names to a list of names.
Converts a comma - delimited list of channel names to a list of names .
def unflatten_channel_string(channel_names):
    """
    Converts a comma-delimited list of channel names to a list of names.

    You can use this method to convert a comma-delimited list or range of
    physical or virtual channels into a list of physical or virtual channel
    names.

    Args:
        channel_names (str): The list or range of physical or virtual channels.
        
    Returns:
        List[str]: 
        
        The list of physical or virtual channel names. Each element of the 
        list contains a single channel.
    """
    channel_list_to_return = []
    channel_list = [c for c in channel_names.strip().split(',') if c]

    for channel in channel_list:
        channel = channel.strip()
        colon_index = channel.find(':')

        if colon_index == -1:
            channel_list_to_return.append(channel)
        else:
            before = channel[:colon_index]
            after = channel[colon_index+1:]

            m_before = re.match('(.*?)([0-9]+)$', before)
            m_after = re.match('(.*?)([0-9]+)$', after)

            if not m_before or not m_after:
                raise DaqError(_invalid_range_syntax_message,
                                       error_code=-200498)

            if m_after.group(1) and (
                m_before.group(1).lower() != m_after.group(1).lower()):
                raise DaqError(_invalid_range_syntax_message,
                               error_code=-200498)

            num_before = int(m_before.group(2))
            num_after = int(m_after.group(2))
            num_max = max([num_before, num_after])
            num_min = min([num_before, num_after])
            number_of_channels = (num_max - num_min) + 1

            if number_of_channels >= 15000:
                raise DaqError(_invalid_range_syntax_message,
                                       error_code=-200498)

            colon_expanded_channel = []
            for i in range(number_of_channels):
                colon_expanded_channel.append(
                    '{0}{1}'.format(m_before.group(1), num_min + i))

            if num_after < num_before:
                colon_expanded_channel.reverse()

            channel_list_to_return.extend(colon_expanded_channel)

    return channel_list_to_return
def unflatten_channel_string ( channel_names ) : channel_list_to_return = [ ] channel_list = [ c for c in channel_names . strip ( ) . split ( ',' ) if c ] for channel in channel_list : channel = channel . strip ( ) colon_index = channel . find ( ':' ) if colon_index == - 1 : channel_list_to_return . append ( channel ) else : before = channel [ : colon_index ] after = channel [ colon_index + 1 : ] m_before = re . match ( '(.*?)([0-9]+)$' , before ) m_after = re . match ( '(.*?)([0-9]+)$' , after ) if not m_before or not m_after : raise DaqError ( _invalid_range_syntax_message , error_code = - 200498 ) if m_after . group ( 1 ) and ( m_before . group ( 1 ) . lower ( ) != m_after . group ( 1 ) . lower ( ) ) : raise DaqError ( _invalid_range_syntax_message , error_code = - 200498 ) num_before = int ( m_before . group ( 2 ) ) num_after = int ( m_after . group ( 2 ) ) num_max = max ( [ num_before , num_after ] ) num_min = min ( [ num_before , num_after ] ) number_of_channels = ( num_max - num_min ) + 1 if number_of_channels >= 15000 : raise DaqError ( _invalid_range_syntax_message , error_code = - 200498 ) colon_expanded_channel = [ ] for i in range ( number_of_channels ) : colon_expanded_channel . append ( '{0}{1}' . format ( m_before . group ( 1 ) , num_min + i ) ) if num_after < num_before : colon_expanded_channel . reverse ( ) channel_list_to_return . extend ( colon_expanded_channel ) return channel_list_to_return