

def _SetValues(self, values):
    "Set values from supplied dictionary or list.\n\n    Args:\n      values: A Row, dict indexed by column name, or list.\n\n    Raises:\n      TypeError: Argument is not a list or dict, or list is not equal row\n      length or dictionary keys don't match.\n    "

    def _ToStr(value):
        'Convert individul list entries to string.'
        if isinstance(value, (list, tuple)):
            result = []
            for val in value:
                result.append(str(val))
            return result
        else:
            return str(value)
    if isinstance(values, Row):
        if (self._keys != values.header):
            raise TypeError('Attempt to append row with mismatched header.')
        self._values = copy.deepcopy(values.values)
    elif isinstance(values, dict):
        for key in self._keys:
            if (key not in values):
                raise TypeError('Dictionary key mismatch with row.')
        for key in self._keys:
            self[key] = _ToStr(values[key])
    elif (isinstance(values, list) or isinstance(values, tuple)):
        if (len(values) != len(self._values)):
            raise TypeError('Supplied list length != row length')
        for (index, value) in enumerate(values):
            self._values[index] = _ToStr(value)
    else:
        raise TypeError('Supplied argument must be Row, dict or list, not %s', type(values))

dataset/ETHPy150Open google/textfsm/texttable.py Row._SetValues/original