def get_by_index(self, index):
        """
        Find a storage policy by its index.

        An index of None will be treated as 0.

        :param index: numeric index of the storage policy
        :returns: storage policy, or None if no such policy
        """
        # makes it easier for callers to just pass in a header value
        if ('', None) in index:
            index = 0
        else:
            try:
                index = int(index)
            except ValueError:
                return None
        return self.by_index.get(index)
dataset/ETHPy150Open openstack/swift/swift/common/storage_policy.py/StoragePolicyCollection.get_by_index/swapped operands of `in`