7
7
import json
8
8
import logging
9
9
import os
10
+ import time
10
11
from typing import Any , Dict , List , Optional , Union
11
12
12
13
import aiohttp
15
16
import requests
16
17
import tqdm
17
18
import tqdm .notebook as tqdm_notebook
18
- import time
19
19
20
20
from nucleus .url_utils import sanitize_string_args
21
21
40
40
ERROR_ITEMS ,
41
41
ERROR_PAYLOAD ,
42
42
ERRORS_KEY ,
43
- JOB_ID_KEY ,
44
- JOB_LAST_KNOWN_STATUS_KEY ,
45
- JOB_TYPE_KEY ,
46
- JOB_CREATION_TIME_KEY ,
47
43
IMAGE_KEY ,
48
44
IMAGE_URL_KEY ,
49
45
INDEX_CONTINUOUS_ENABLE_KEY ,
50
46
ITEM_METADATA_SCHEMA_KEY ,
51
47
ITEMS_KEY ,
48
+ JOB_CREATION_TIME_KEY ,
49
+ JOB_ID_KEY ,
50
+ JOB_LAST_KNOWN_STATUS_KEY ,
51
+ JOB_TYPE_KEY ,
52
52
KEEP_HISTORY_KEY ,
53
53
MESSAGE_KEY ,
54
54
MODEL_RUN_ID_KEY ,
62
62
UPDATE_KEY ,
63
63
)
64
64
from .dataset import Dataset
65
- from .dataset_item import DatasetItem , CameraParams , Quaternion
65
+ from .dataset_item import CameraParams , DatasetItem , Quaternion
66
66
from .errors import (
67
67
DatasetItemRetrievalError ,
68
68
ModelCreationError ,
86
86
PolygonPrediction ,
87
87
SegmentationPrediction ,
88
88
)
89
+ from .scene import Frame , LidarScene
89
90
from .slice import Slice
90
91
from .upload_response import UploadResponse
91
- from .scene import Frame , LidarScene
92
92
93
93
# pylint: disable=E1101
94
94
# TODO: refactor to reduce this file to under 1000 lines.
@@ -515,7 +515,7 @@ async def _make_files_request(
515
515
content_type = file [1 ][2 ],
516
516
)
517
517
518
- for sleep_time in RetryStrategy .sleep_times + ["" ]:
518
+ for sleep_time in RetryStrategy .sleep_times + [- 1 ]:
519
519
async with session .post (
520
520
endpoint ,
521
521
data = form ,
@@ -533,7 +533,7 @@ async def _make_files_request(
533
533
data = await response .text ()
534
534
if (
535
535
response .status in RetryStrategy .statuses
536
- and sleep_time != ""
536
+ and sleep_time != - 1
537
537
):
538
538
time .sleep (sleep_time )
539
539
continue
0 commit comments