def __getitem__(self, key):
        """If key is a varname or expression, returns a list of all of the
        recorded values corresponding to that string. If key is an integer
        index 'i', returns a Case object containing the data for the i'th
        recorded case.
        """
        if isinstance(key, basestring):
            # return all of the values for the given name
            try:
                idx = self._names.index(key)
            except __HOLE__:
                raise KeyError("CaseSet has no input or outputs named %s" % key)
            return [lst[idx] for lst in self._values]
        else:  # key is the case number
            return self._case_from_values(self._values[key])
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/casehandlers/caseset.py/CaseArray.__getitem__