def _is_identical(self, chunk_data, path):
        try:
            fp = open(path, 'rb')
        except __HOLE__:
            return False

        with fp:
            for chunk in chunk_data:
                to_read = chunk['bytes']
                md5sum = md5()
                while to_read:
                    data = fp.read(min(65536, to_read))
                    if not data:
                        return False
                    md5sum.update(data)
                    to_read -= len(data)
                if md5sum.hexdigest() != chunk['hash']:
                    return False
            # Each chunk is verified; check that we're at the end of the file
            return not fp.read(1)
dataset/ETHPy150Open openstack/python-swiftclient/swiftclient/service.py/SwiftService._is_identical