def __getitem__(self, element_name):
        '''
        Return the condition matching the given element name.
        Raises AttributeError if there is no matching condition.

        '''
        try:
            return next(item for item in self.conditions if item.element_name == element_name)
        except __HOLE__:
            raise AttributeError('No matching condition')
dataset/ETHPy150Open bodylabs/drf-to-s3/drf_to_s3/models.py/Policy.__getitem__