77import json
88import logging
99import os
10+ import time
1011from typing import Any , Dict , List , Optional , Union
1112
1213import aiohttp
1516import requests
1617import tqdm
1718import tqdm .notebook as tqdm_notebook
18- import time
1919
2020from nucleus .url_utils import sanitize_string_args
2121
4040 ERROR_ITEMS ,
4141 ERROR_PAYLOAD ,
4242 ERRORS_KEY ,
43- JOB_ID_KEY ,
44- JOB_LAST_KNOWN_STATUS_KEY ,
45- JOB_TYPE_KEY ,
46- JOB_CREATION_TIME_KEY ,
4743 IMAGE_KEY ,
4844 IMAGE_URL_KEY ,
4945 INDEX_CONTINUOUS_ENABLE_KEY ,
5046 ITEM_METADATA_SCHEMA_KEY ,
5147 ITEMS_KEY ,
48+ JOB_CREATION_TIME_KEY ,
49+ JOB_ID_KEY ,
50+ JOB_LAST_KNOWN_STATUS_KEY ,
51+ JOB_TYPE_KEY ,
5252 KEEP_HISTORY_KEY ,
5353 MESSAGE_KEY ,
5454 MODEL_RUN_ID_KEY ,
6262 UPDATE_KEY ,
6363)
6464from .dataset import Dataset
65- from .dataset_item import DatasetItem , CameraParams , Quaternion
65+ from .dataset_item import CameraParams , DatasetItem , Quaternion
6666from .errors import (
6767 DatasetItemRetrievalError ,
6868 ModelCreationError ,
8686 PolygonPrediction ,
8787 SegmentationPrediction ,
8888)
89+ from .scene import Frame , LidarScene
8990from .slice import Slice
9091from .upload_response import UploadResponse
91- from .scene import Frame , LidarScene
9292
9393# pylint: disable=E1101
9494# TODO: refactor to reduce this file to under 1000 lines.
@@ -515,7 +515,7 @@ async def _make_files_request(
515515 content_type = file [1 ][2 ],
516516 )
517517
518- for sleep_time in RetryStrategy .sleep_times + ["" ]:
518+ for sleep_time in RetryStrategy .sleep_times + [- 1 ]:
519519 async with session .post (
520520 endpoint ,
521521 data = form ,
@@ -533,7 +533,7 @@ async def _make_files_request(
533533 data = await response .text ()
534534 if (
535535 response .status in RetryStrategy .statuses
536- and sleep_time != ""
536+ and sleep_time != - 1
537537 ):
538538 time .sleep (sleep_time )
539539 continue
0 commit comments