def __init__(self, outkey, min_part_size=S3_MIN_PART_SIZE, **kw):
        if not hasattr(outkey, "bucket") and not hasattr(outkey, "name"):
            raise TypeError("can only process S3 keys")

        self.outkey = outkey
        self.min_part_size = min_part_size

        if min_part_size < 5 * 1024 ** 2:
            logger.warning("S3 requires minimum part size >= 5MB; multipart upload may fail")

        # initialize mulitpart upload
        self.mp = self.outkey.bucket.initiate_multipart_upload(self.outkey, **kw)

        # initialize stats
        self.lines = []
        self.total_size = 0
        self.chunk_bytes = 0
        self.parts = 0
Streamed input is uploaded in chunks, as soon as `min_part_size` bytes are
dataset/ETHPy150Open piskvorky/smart_open/smart_open/smart_open_lib.py/S3OpenWrite.__init__