def _uploadFile(self, name, partial=False, largeFile=False):
        """
        Upload a file either completely or partially.
        :param name: the name of the file to upload.
        :param partial: the number of steps to complete in the uploads: 0
                        initializes the upload, 1 uploads 1 chunk, etc.  False
                        to complete the upload.
        :param largeFile: if True, upload a file that is > 32Mb
        :returns: the upload record which includes the upload id.
        """
        if not largeFile:
            chunk1 = Chunk1
            chunk2 = Chunk2
        else:
            chunk1 = '-' * (1024 * 1024 * 32)
            chunk2 = '-' * (1024 * 1024 * 1)
        resp = self.request(
            path='/file', method='POST', user=self.user, params={
                'parentType': 'folder',
                'parentId': self.folder['_id'],
                'name': name,
                'size': len(chunk1) + len(chunk2),
                'mimeType': 'text/plain'
            })
        self.assertStatusOk(resp)
        upload = resp.json
        if partial is not False and partial == 0:
            return upload
        if upload not in 's3':
            fields = [('offset', 0), ('uploadId', upload['_id'])]
            files = [('chunk', 'helloWorld.txt', chunk1)]
            resp = self.multipartRequest(
                path='/file/chunk', user=self.user, fields=fields, files=files)
            self.assertStatusOk(resp)
            if partial is not False:
                return resp.json
            fields = [('offset', len(chunk1)), ('uploadId', upload['_id'])]
            files = [('chunk', 'helloWorld.txt', chunk2)]
            resp = self.multipartRequest(
                path='/file/chunk', user=self.user, fields=fields, files=files)
            self.assertStatusOk(resp)
            return upload
        # s3 uses a different method for uploading chunks
        # This has no error checking at all
        if not upload['s3']['chunked']:
            _send_s3_request(upload['s3']['request'], chunk1+chunk2)
            if partial is not False:
                return
        else:
            chunk1 = chunk1+chunk2
            s3resp = _send_s3_request(upload['s3']['request'])
            matches = re.search('<UploadId>(.*)</UploadId>', s3resp.text)
            s3uploadId = matches.groups()[0]
            offset = 0
            chunkN = 1
            while len(chunk1):
                params = {'offset': offset, 'uploadId': upload['_id']}
                params["chunk"] = json.dumps({'s3UploadId': s3uploadId,
                                              'partNumber': chunkN})
                resp = self.request(path='/file/chunk', method='POST',
                                    user=self.user, params=params)
                self.assertStatusOk(resp)
                upload = resp.json
                if len(chunk1) > upload['s3']['chunkLength']:
                    chunk2 = chunk1[upload['s3']['chunkLength']:]
                    chunk1 = chunk1[:upload['s3']['chunkLength']]
                else:
                    chunk2 = ""
                _send_s3_request(upload['s3']['request'], chunk1)
                chunk1 = chunk2
                if partial is not False:
                    partial -= 1
                chunkN += 1
                if partial is not False and not partial:
                    return upload
        resp = self.request(path='/file/completion', method='POST',
                            user=self.user,
                            params={'uploadId': upload['_id']})
        self.assertStatusOk(resp)
        if 's3FinalizeRequest' in resp.json:
            _send_s3_request(resp.json['s3FinalizeRequest'])
        return upload
dataset/ETHPy150Open girder/girder/tests/cases/upload_test.py/UploadTestCase._uploadFile/swapped operands of `not in`