Skip to content

Commit 7fb5eb5

Browse files
author
Jon Wayne Parrott
committed
Fix more lint issues
Change-Id: I49d4f063d210629346d8d8390c9eaec261c4e519
1 parent 799711c commit 7fb5eb5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

samples/snippets/sentiment/sentiment_analysis.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14-
'''Demonstrates how to make a simple call to the Natural Language API'''
14+
"""Demonstrates how to make a simple call to the Natural Language API."""
1515

1616
import argparse
17+
1718
from googleapiclient import discovery
1819
from oauth2client.client import GoogleCredentials
1920

2021

2122
def main(movie_review_filename):
22-
'''Run a sentiment analysis request on text within a passed filename.'''
23+
"""Run a sentiment analysis request on text within a passed filename."""
2324

2425
credentials = GoogleCredentials.get_application_default()
2526
service = discovery.build('language', 'v1', credentials=credentials)
@@ -41,13 +42,10 @@ def main(movie_review_filename):
4142
for i, sentence in enumerate(response['sentences']):
4243
sentence_sentiment = sentence['sentiment']['score']
4344
print('Sentence {} has a sentiment score of {}'.format(
44-
i,
45-
sentence_sentiment))
45+
i, sentence_sentiment))
4646

4747
print('Overall Sentiment: score of {} with magnitude of {}'.format(
48-
score,
49-
magnitude)
50-
)
48+
score, magnitude))
5149
return 0
5250

5351
print('Sentiment: score of {} with magnitude of {}'.format(

samples/snippets/sentiment/sentiment_analysis_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# limitations under the License.
1313

1414
import re
15+
1516
from sentiment_analysis import main
1617

1718

0 commit comments

Comments
 (0)