Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions language/cloud-client/v1beta2/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@
def run_quickstart():
# [START language_quickstart]
# Imports the Google Cloud client library
# [START beta_import_client]
# [START beta_import]
from google.cloud import language_v1beta2
from google.cloud.language_v1beta2 import enums
from google.cloud.language_v1beta2 import types
# [END beta_import]

# Instantiates a client with the v1beta2 version
client = language_v1beta2.LanguageServiceClient()
# [END beta_import_client]

# The text to analyze
text = u'Hallo Welt!'
Expand Down
4 changes: 4 additions & 0 deletions language/cloud-client/v1beta2/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
import argparse
import sys

# [START beta_import]
from google.cloud import language_v1beta2
from google.cloud.language_v1beta2 import enums
from google.cloud.language_v1beta2 import types
# [END beta_import]
import six


Expand Down Expand Up @@ -166,7 +168,9 @@ def syntax_file(gcs_uri):
# [START def_entity_sentiment_text]
def entity_sentiment_text(text):
"""Detects entity sentiment in the provided text."""
# [START beta_client]
client = language_v1beta2.LanguageServiceClient()
# [END beta_client]

if isinstance(text, six.binary_type):
text = text.decode('utf-8')
Expand Down