def sendFile(self, path, name = ''):
        if name != '':
          file_name = name
        else:
          import ntpath
          file_name = ntpath.basename(path)
        message = Message(to=self.id, text=None)
        message.contentType = 14
        message.contentPreview = None
        file_size = len(open(path, 'rb').read())
        message.contentMetadata = {
            'FILE_NAME': str(file_name),
            'FILE_SIZE': str(file_size),
        }

        message_id = self._client.sendMessage(message).id
        files = {
            'file': open(path, 'rb'),
        }
        params = {
            'name': file_name,
            'oid': message_id,
            'size': file_size,
            'type': 'file',
            'ver': '1.0',
        }
        data = {
            'params': json.dumps(params)
        }
        r = self._client.post_content('https://os.line.naver.jp/talk/m/upload.nhn', data=data, files=files)
        if r.status_code != 201:
            raise Exception('Upload File failure.')
        #r.content
        return True
This is a very flexible function for transforming arrays of start_times and end_times
dataset/ETHPy150Open carpedm20/LINE/line/models.py/LineBase.sendFile--crossover with--dataset/ETHPy150Open CamDavidsonPilon/lifelines/lifelines/utils/__init__.py/datetimes_to_durations