Skip to content

Commit

Permalink
chore: some lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Matsuo committed May 13, 2020
1 parent 3a2654b commit 3231bc5
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
# limitations under the License.

import os
import pytest
import uuid
import translate_v3_batch_translate_text_with_model

from google.cloud import storage
import pytest

import translate_v3_batch_translate_text_with_model


PROJECT_ID = os.environ["GCLOUD_PROJECT"]
MODEL_ID = "TRL3128559826197068699"
Expand Down
7 changes: 5 additions & 2 deletions translate/cloud-client/beta_snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
# limitations under the License.

import os
import pytest
import uuid
import beta_snippets

from google.cloud import storage
import pytest

import beta_snippets


PROJECT_ID = os.environ['GCLOUD_PROJECT']

Expand Down
4 changes: 2 additions & 2 deletions translate/cloud-client/hybrid_glossaries/hybrid_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@


# [START translate_hybrid_imports]
import html
import io
import os
import html

# Imports the Google Cloud client libraries
from google.api_core.exceptions import AlreadyExists
from google.cloud import texttospeech
from google.cloud import translate_v3beta1 as translate
from google.cloud import vision
from google.cloud import texttospeech
# [END translate_hybrid_imports]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import os
import sys

from hybrid_tutorial import pic_to_text
from hybrid_tutorial import create_glossary
from hybrid_tutorial import translate_text
from hybrid_tutorial import pic_to_text
from hybrid_tutorial import text_to_speech
from hybrid_tutorial import translate_text


PROJECT_ID = os.environ['GCLOUD_PROJECT']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
import os
import uuid

import pytest

from google.cloud import storage
import pytest

import translate_v3_batch_translate_text

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
import uuid

import backoff
import pytest

from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
from google.cloud.exceptions import NotFound
from google.cloud import storage
from google.cloud.exceptions import NotFound
import pytest

import translate_v3_batch_translate_text_with_glossary
import translate_v3_create_glossary
Expand Down
3 changes: 1 addition & 2 deletions translate/cloud-client/translate_v3_create_glossary_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
import uuid

import backoff
import pytest

from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
from google.cloud.exceptions import NotFound
import pytest

import translate_v3_create_glossary
import translate_v3_delete_glossary
Expand Down
2 changes: 2 additions & 0 deletions translate/cloud-client/translate_v3_detect_language_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.

import os

import translate_v3_detect_language


PROJECT_ID = os.environ["GCLOUD_PROJECT"]


Expand Down
3 changes: 1 addition & 2 deletions translate/cloud-client/translate_v3_get_glossary_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
import uuid

import backoff
import pytest

from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
from google.cloud.exceptions import NotFound
import pytest

import translate_v3_create_glossary
import translate_v3_delete_glossary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.

import os

import translate_v3_get_supported_languages


PROJECT_ID = os.environ["GCLOUD_PROJECT"]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.

import os

import translate_v3_get_supported_languages_with_target as get_supported_langs


PROJECT_ID = os.environ["GCLOUD_PROJECT"]


Expand Down
3 changes: 1 addition & 2 deletions translate/cloud-client/translate_v3_list_glossary_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
import uuid

import backoff
import pytest

from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
from google.cloud.exceptions import NotFound
import pytest

import translate_v3_create_glossary
import translate_v3_delete_glossary
Expand Down
2 changes: 2 additions & 0 deletions translate/cloud-client/translate_v3_translate_text_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
# limitations under the License.

import os

import translate_v3_translate_text


PROJECT_ID = os.environ["GCLOUD_PROJECT"]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
import uuid

import backoff
import pytest

from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
from google.cloud.exceptions import NotFound
import pytest

import translate_v3_create_glossary
import translate_v3_delete_glossary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
# limitations under the License.

import os

import translate_v3_translate_text_with_model


PROJECT_ID = os.environ["GCLOUD_PROJECT"]
MODEL_ID = "TRL3128559826197068699"

Expand Down
4 changes: 3 additions & 1 deletion video/cloud-client/analyze/beta_snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from six.moves.urllib.request import urlopen
import os
import uuid

from google.cloud import storage
import pytest
from six.moves.urllib.request import urlopen

import beta_snippets


POSSIBLE_TEXTS = [
"Google",
"SUR",
Expand Down Expand Up @@ -129,6 +130,7 @@ def test_detect_text_gcs(capsys):
out, _ = capsys.readouterr()
assert 'Text' in out


# Flaky InvalidArgument
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_track_objects(capsys):
Expand Down
1 change: 1 addition & 0 deletions video/cloud-client/analyze/video_detect_faces_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# [START video_detect_faces_beta]
import io

from google.cloud import videointelligence_v1p3beta1 as videointelligence


Expand Down
1 change: 1 addition & 0 deletions video/cloud-client/analyze/video_detect_person_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# [START video_detect_person_beta]
import io

from google.cloud import videointelligence_v1p3beta1 as videointelligence


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
"""

import argparse

# [START automl_vision_edge_container_predict]

import base64
import io
import json

import requests


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
import os
import subprocess
import time
import automl_vision_edge_container_predict as predict

import pytest

import automl_vision_edge_container_predict as predict # noqa


# The absolute path of the current file. This will locate the model_path when
# run docker containers.
Expand Down
3 changes: 2 additions & 1 deletion vision/cloud-client/detect/vision_batch_annotate_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

# [START vision_batch_annotate_files]

import io

from google.cloud import vision_v1
from google.cloud.vision_v1 import enums
import io


def sample_batch_annotate_files(file_path="path/to/your/document.pdf"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
import os
import uuid

import pytest

from google.cloud import storage
import pytest

from import_product_sets import import_product_sets
from product_in_product_set_management import list_products_in_product_set
Expand Down

0 comments on commit 3231bc5

Please sign in to comment.