def _process_card_info(card):

    name = card.name

    # Sometimes we have a 1D array declared by element
    if card.index:
        index = card.index[0]-1

        # Strings go into lists, not arrays
        if isinstance(card[2], str):
            val = card[2:]
            value = ['']*(index+len(val))
            value[index:] = val
        else:
            val = array(card[2:])
            value = zeros(index+len(val),dtype=val.dtype)
            value[index:] = val

    # Alternate array specification
    elif card.dimension:
        dim = card.dimension
        value = zeros(dim)
        value.fill(card.value)

    # Comma-delimited arrays
    elif len(card) > 2:
        value = array(card[1:])
    else:
        value = card.value

    return name, value
Function to extract info from a card as returned from PyParsing a
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/util/namelist_util.py/_process_card_info