Skip to content

Commit

Permalink
docs: add comments to the sample code about getting AccessKey
Browse files Browse the repository at this point in the history
PR Closed: #1228
  • Loading branch information
graczhual committed Mar 17, 2022
1 parent 66b7ac9 commit 0e24c28
Show file tree
Hide file tree
Showing 26 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/code/BSTLD.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"""Authorize a Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")


""""""

"""Create Dataset"""
Expand Down
1 change: 1 addition & 0 deletions docs/code/CADC.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from tensorbay import GAS
from tensorbay.dataset import FusionDataset

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
""""""

Expand Down
1 change: 1 addition & 0 deletions docs/code/DogsVsCats.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Authorize a Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
""""""

Expand Down
1 change: 1 addition & 0 deletions docs/code/LeedsSportsPose.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Authorize a Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
""""""

Expand Down
1 change: 1 addition & 0 deletions docs/code/NeolixOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Authorize a Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
""""""

Expand Down
1 change: 1 addition & 0 deletions docs/code/Newsgroups20.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Authorize a Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
""""""

Expand Down
1 change: 1 addition & 0 deletions docs/code/THCHS30.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Authorize a Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
""""""

Expand Down
1 change: 1 addition & 0 deletions docs/code/VOC2012Segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""Authorize a Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
""""""

Expand Down
1 change: 1 addition & 0 deletions docs/code/basic_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Authorize a Dataset Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("<DATASET_NAME>")

Expand Down
1 change: 1 addition & 0 deletions docs/code/branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"""Authorize a Dataset Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("<DATASET_NAME>")
dataset_client.create_draft("draft-1")
Expand Down
1 change: 1 addition & 0 deletions docs/code/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from tensorbay import GAS
from tensorbay.dataset import Dataset

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset = Dataset("<DATASET_NAME>", gas)
""""""
Expand Down
1 change: 1 addition & 0 deletions docs/code/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"""Authorize a Dataset Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("<DATASET_NAME>")
dataset_client.create_draft("draft-1")
Expand Down
1 change: 1 addition & 0 deletions docs/code/draft_and_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"""Authorize a Dataset Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("<DATASET_NAME>")
""""""
Expand Down
1 change: 1 addition & 0 deletions docs/code/merge_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"""Create Target Dataset"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("mergedDataset")
dataset_client.create_draft("merge dataset")
Expand Down
1 change: 1 addition & 0 deletions docs/code/request_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
config.timeout = 40
config.max_retries = 4

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")

# The configs will apply to all the requests sent by TensorBay SDK.
Expand Down
1 change: 1 addition & 0 deletions docs/code/search_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Obtain a SearchResult Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.get_dataset("<DATASET_NAME>")

Expand Down
2 changes: 2 additions & 0 deletions docs/code/sextant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Get sextant client"""
from tensorbay.apps.sextant import Sextant

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
sextant = Sextant("<YOUR_ACCESSKEY>")
""""""

Expand All @@ -28,6 +29,7 @@
"""Create evaluation"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.get_dataset("<DATASET_NAME>")
dataset_client.checkout(revision="<branch/tag/commitId>")
Expand Down
1 change: 1 addition & 0 deletions docs/code/squash_and_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Authorize a Dataset Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("<DATASET_NAME>")

Expand Down
1 change: 1 addition & 0 deletions docs/code/storage_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""Get cloud client"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
cloud_client = gas.get_cloud_client("<CONFIG_NAME>")
""""""
Expand Down
1 change: 1 addition & 0 deletions docs/code/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Authorize a Dataset Client Instance"""
from tensorbay import GAS

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("<DATASET_NAME>")
dataset_client.create_draft("draft-1")
Expand Down
1 change: 1 addition & 0 deletions docs/code/update_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Upload Images to the Dataset"""
from tensorbay.dataset import Dataset

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset = Dataset("<DATASET_NAME>")
""""""
Expand Down
1 change: 1 addition & 0 deletions docs/code/use_dataset_in_paddlepaddle.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __getitem__(self, idx):


"""Build a dataloader and run it"""
# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
ACCESS_KEY = "<YOUR_ACCESSKEY>"

to_tensor = transforms.ToTensor()
Expand Down
1 change: 1 addition & 0 deletions docs/code/use_dataset_in_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __getitem__(self, idx):


"""Build a dataloader and run it"""
# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
ACCESS_KEY = "<YOUR_ACCESSKEY>"

to_tensor = transforms.ToTensor()
Expand Down
1 change: 1 addition & 0 deletions docs/code/use_dataset_in_tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __call__(self):


"""Build a tensorflow dataset and run it"""
# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
ACCESS_KEY = "<YOUR_ACCESSKEY>"

dataset = Dataset.from_generator(
Expand Down
1 change: 1 addition & 0 deletions docs/code/use_internal_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# Set is_internal to True for using internal endpoint.
config.is_internal = True

# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")

# Organize the local dataset by the "Dataset" class before uploading.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The code below checkouts to the first commit and check the data amount.
from tensorbay import GAS
from tensorbay.dataset import Dataset
# Please visit `https://gas.graviti.cn/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
commits = dataset_client.list_commits()
Expand Down

0 comments on commit 0e24c28

Please sign in to comment.