Skip to content

Commit 9292a17

Browse files
author
Matt Sokoloff
committed
yapf
1 parent 88a2b34 commit 9292a17

File tree

17 files changed

+88
-86
lines changed

17 files changed

+88
-86
lines changed

examples/basics/basics.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"if COLAB:\n",
7272
" !pip install colab-env -qU\n",
7373
" from colab_env import envvar_handler\n",
74-
" envvar_handler.envload() \n",
74+
" envvar_handler.envload()\n",
7575
"\n",
7676
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
7777
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",
@@ -304,8 +304,8 @@
304304
"datasets = client.get_datasets(where=Dataset.name == DATASET_NAME)\n",
305305
"\n",
306306
"projects = client.get_projects(\n",
307-
" where=((Project.name == PROJECT_NAME)\n",
308-
" & (Project.description == \"new description field\")))\n",
307+
" where=((Project.name == PROJECT_NAME) &\n",
308+
" (Project.description == \"new description field\")))\n",
309309
"\n",
310310
"# The above two queries return PaginatedCollections because the filter parameters aren't guarenteed to be unique.\n",
311311
"# So even if there is one element returned it is in a paginatedCollection.\n",

examples/basics/data_rows.ipynb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"if COLAB:\n",
6060
" !pip install colab-env -qU\n",
6161
" from colab_env import envvar_handler\n",
62-
" envvar_handler.envload() \n",
62+
" envvar_handler.envload()\n",
6363
"\n",
6464
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
6565
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",
@@ -220,11 +220,9 @@
220220
"source": [
221221
"# Bulk create data_rows\n",
222222
"task1 = dataset.create_data_rows([{\n",
223-
" DataRow.row_data:\n",
224-
" \"https://picsum.photos/200/300\"\n",
223+
" DataRow.row_data: \"https://picsum.photos/200/300\"\n",
225224
"}, {\n",
226-
" DataRow.row_data:\n",
227-
" \"https://picsum.photos/200/300\"\n",
225+
" DataRow.row_data: \"https://picsum.photos/200/300\"\n",
228226
"}])"
229227
]
230228
},
@@ -252,8 +250,7 @@
252250
"source": [
253251
"# You can mix local files with urls\n",
254252
"task3 = dataset.create_data_rows([{\n",
255-
" DataRow.row_data:\n",
256-
" \"https://picsum.photos/200/300\"\n",
253+
" DataRow.row_data: \"https://picsum.photos/200/300\"\n",
257254
"}, local_data_path])"
258255
]
259256
},
@@ -346,7 +343,7 @@
346343
"source": [
347344
"# We can also attach metadata (See metadata tutorial for more)\n",
348345
"# Metadata is visible for all projects with this data_row attached\n",
349-
"data_row.create_metadata(meta_type = \"TEXT\", meta_value = \"LABELERS WILL SEE THIS \")\n",
346+
"data_row.create_metadata(meta_type=\"TEXT\", meta_value=\"LABELERS WILL SEE THIS \")\n",
350347
"# See more information here:\n",
351348
"# https://docs.labelbox.com/en/import-data/attachments\n",
352349
"# Note that meta_value must always be a string (url to a video/image or a text value to display)"

examples/basics/datasets.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"if COLAB:\n",
5858
" !pip install colab-env -qU\n",
5959
" from colab_env import envvar_handler\n",
60-
" envvar_handler.envload() \n",
60+
" envvar_handler.envload()\n",
6161
"\n",
6262
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
6363
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",
@@ -84,7 +84,7 @@
8484
"# Pick a dataset that has attached data_rows\n",
8585
"DATASET_ID = \"ckm4xyfua04cf0z7a3wz58kgj\"\n",
8686
"# Only update this if you have an on-prem deployment\n",
87-
"ENDPOINT = \"https://api.labelbox.com/graphql\" "
87+
"ENDPOINT = \"https://api.labelbox.com/graphql\""
8888
]
8989
},
9090
{
@@ -94,7 +94,7 @@
9494
"metadata": {},
9595
"outputs": [],
9696
"source": [
97-
"client = Client(api_key = API_KEY, endpoint = ENDPOINT)"
97+
"client = Client(api_key=API_KEY, endpoint=ENDPOINT)"
9898
]
9999
},
100100
{

examples/basics/labels.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"if COLAB:\n",
5353
" !pip install colab-env -qU\n",
5454
" from colab_env import envvar_handler\n",
55-
" envvar_handler.envload() \n",
55+
" envvar_handler.envload()\n",
5656
"\n",
5757
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
5858
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",

examples/basics/ontologies.ipynb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"if COLAB:\n",
5151
" !pip install colab-env -qU\n",
5252
" from colab_env import envvar_handler\n",
53-
" envvar_handler.envload() \n",
53+
" envvar_handler.envload()\n",
5454
"\n",
5555
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
5656
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",
@@ -313,13 +313,11 @@
313313
"# Classifications can belong to the full data_row (image,text, or video classification)\n",
314314
"# Or they can be subclasses to a tool (ie dog bounding box, with a breed classification)\n",
315315
"\n",
316-
"text_classification = Classification(\n",
317-
" class_type=Classification.Type.TEXT,\n",
318-
" instructions=\"dog_name\")\n",
319-
"radio_classification = Classification(\n",
320-
" class_type=Classification.Type.CHECKLIST,\n",
321-
" instructions=\"dog_breed\",\n",
322-
" options=[Option(\"poodle\")])\n",
316+
"text_classification = Classification(class_type=Classification.Type.TEXT,\n",
317+
" instructions=\"dog_name\")\n",
318+
"radio_classification = Classification(class_type=Classification.Type.CHECKLIST,\n",
319+
" instructions=\"dog_breed\",\n",
320+
" options=[Option(\"poodle\")])\n",
323321
"dropdown_classification = Classification(\n",
324322
" class_type=Classification.Type.DROPDOWN,\n",
325323
" instructions=\"dog_features\",\n",

examples/basics/projects.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"if COLAB:\n",
5858
" !pip install colab-env -qU\n",
5959
" from colab_env import envvar_handler\n",
60-
" envvar_handler.envload() \n",
60+
" envvar_handler.envload()\n",
6161
"\n",
6262
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
6363
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",

examples/label_export/images.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"if COLAB:\n",
5656
" !pip install colab-env -qU\n",
5757
" from colab_env import envvar_handler\n",
58-
" envvar_handler.envload() \n",
58+
" envvar_handler.envload()\n",
5959
"\n",
6060
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
6161
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",
@@ -169,6 +169,7 @@
169169
"source": [
170170
"# First annotation in first data row\n",
171171
"exports[0][\"Label\"][\"objects\"][0]\n",
172+
"\n",
172173
"# If the number of annotations is 0\n",
173174
"# Or if this example does not have any annotations, then this will throw a KeyError"
174175
]

examples/label_export/text.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"if COLAB:\n",
4949
" !pip install colab-env -qU\n",
5050
" from colab_env import envvar_handler\n",
51-
" envvar_handler.envload() \n",
51+
" envvar_handler.envload()\n",
5252
"\n",
5353
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
5454
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",

examples/label_export/video.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"if COLAB:\n",
6161
" !pip install colab-env -qU\n",
6262
" from colab_env import envvar_handler\n",
63-
" envvar_handler.envload() \n",
63+
" envvar_handler.envload()\n",
6464
"\n",
6565
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
6666
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",

examples/model_assisted_labeling/debugging_mal.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"if COLAB:\n",
103103
" !pip install colab-env -qU\n",
104104
" from colab_env import envvar_handler\n",
105-
" envvar_handler.envload() \n",
105+
" envvar_handler.envload()\n",
106106
"\n",
107107
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
108108
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",
@@ -171,12 +171,12 @@
171171
"source": [
172172
"poly_example = {\n",
173173
" \"uuid\":\n",
174-
" \"1b5762e9-416c-44cf-9a5f-07effb51f863\",\n",
174+
" \"1b5762e9-416c-44cf-9a5f-07effb51f863\",\n",
175175
" \"schemaId\":\n",
176-
" ontology.tools[0].feature_schema_id,\n",
176+
" ontology.tools[0].feature_schema_id,\n",
177177
" \"dataRow\": {\n",
178178
" \"id\":\n",
179-
" \"cjxav4aa07r1g0dsq70t9eveg\" #Invalid (not attached to this project) data_row.uid\n",
179+
" \"cjxav4aa07r1g0dsq70t9eveg\" #Invalid (not attached to this project) data_row.uid\n",
180180
" },\n",
181181
" \"polygon\": [{\n",
182182
" \"x\": 2,\n",

0 commit comments

Comments
 (0)