We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Error in NL API, 'Sentiment' object has no attribute 'score'
Upon executing the following code on GCE & locally I'm getting 'score' not found error locally while it works on GCE.

```
def analyze_text(text):
    language_client = language.Client()
    document = language_client.document_from_text(text)
    annotations = document.annotate_text(include_sentiment=True)
    print(annotations.sentiment.score)
    print (annotations.sentiment.magnitude)
```

Only difference I can find is on GCE, the gcloud version is different than the local
**GCE gcloud**
gcloud --version
Google Cloud SDK 145.0.0
alpha 2017.02.21
app-engine-python 1.9.50
beta 2017.02.21
bq 2.0.24
bq-nix 2.0.24
core 2017.02.21
core-nix 2017.02.21
gcloud 
gcloud-deps 2017.02.21
gcloud-deps-linux-x86_64 2017.02.21
gsutil 4.22
gsutil-nix 4.22

**Local gcloud**
gcloud --version
Google Cloud SDK 148.0.1
bq 2.0.24
bq-nix 2.0.24
core 2017.03.24
core-nix 2016.11.07
gcloud 
gcloud-deps 2017.03.17
gcloud-deps-darwin-x86_64 2017.02.21
gsutil 4.23
gsutil-nix 4.19

Debugging locally, the response from NL API consist of polarity property and not score.

<img width="761" alt="image" src="https://cloud.githubusercontent.com/assets/1888535/24331449/62cbdbee-1252-11e7-9d29-8699df078fcf.png">



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `language/google/cloud/language/sentiment.py`
Content:
```
1 # Copyright 2016 Google Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 """Definition for Google Cloud Natural Language API sentiment.
16 
17 Sentiment is the response to an ``analyzeSentiment`` request.
18 """
19 
20 
21 class Sentiment(object):
22     """A Google Cloud Natural Language API sentiment object.
23 
24     .. _Sentiment message: https://cloud.google.com/natural-language/\
25                            reference/rest/v1/Sentiment
26     .. _Sentiment basics: https://cloud.google.com/natural-language/\
27                           docs/basics#sentiment-analysis-values
28 
29     See `Sentiment message`_ and `Sentiment basics`_.
30 
31     :type score: float
32     :param score: Score of the sentiment in the ``[-1.0, 1.0]`` range.
33                      Larger numbers represent more positive sentiments.
34 
35     :type magnitude: float
36     :param magnitude: A non-negative number in the ``[0, +inf)`` range, which
37                       represents the absolute magnitude of sentiment
38                       regardless of score (positive or negative).
39     """
40 
41     def __init__(self, score, magnitude):
42         self.score = score
43         self.magnitude = magnitude
44 
45     @classmethod
46     def from_api_repr(cls, payload):
47         """Convert a Sentiment from the JSON API into a :class:`Sentiment`.
48 
49         :param payload: dict
50         :type payload: The value from the backend.
51 
52         :rtype: :class:`Sentiment`
53         :returns: The sentiment parsed from the API representation.
54         """
55         score = payload['score']
56         magnitude = payload['magnitude']
57         return cls(score, magnitude)
58
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/language/google/cloud/language/sentiment.py b/language/google/cloud/language/sentiment.py
--- a/language/google/cloud/language/sentiment.py
+++ b/language/google/cloud/language/sentiment.py
@@ -52,6 +52,6 @@
         :rtype: :class:`Sentiment`
         :returns: The sentiment parsed from the API representation.
         """
-        score = payload['score']
+        score = payload.get('score', None)
         magnitude = payload['magnitude']
         return cls(score, magnitude)

{"golden_diff": "diff --git a/language/google/cloud/language/sentiment.py b/language/google/cloud/language/sentiment.py\n--- a/language/google/cloud/language/sentiment.py\n+++ b/language/google/cloud/language/sentiment.py\n@@ -52,6 +52,6 @@\n         :rtype: :class:`Sentiment`\n         :returns: The sentiment parsed from the API representation.\n         \"\"\"\n-        score = payload['score']\n+        score = payload.get('score', None)\n         magnitude = payload['magnitude']\n         return cls(score, magnitude)\n", "issue": "Error in NL API, 'Sentiment' object has no attribute 'score'\nUpon executing the following code on GCE & locally I'm getting 'score' not found error locally while it works on GCE.\r\n\r\n```\r\ndef analyze_text(text):\r\n    language_client = language.Client()\r\n    document = language_client.document_from_text(text)\r\n    annotations = document.annotate_text(include_sentiment=True)\r\n    print(annotations.sentiment.score)\r\n    print (annotations.sentiment.magnitude)\r\n```\r\n\r\nOnly difference I can find is on GCE, the gcloud version is different than the local\r\n**GCE gcloud**\r\ngcloud --version\r\nGoogle Cloud SDK 145.0.0\r\nalpha 2017.02.21\r\napp-engine-python 1.9.50\r\nbeta 2017.02.21\r\nbq 2.0.24\r\nbq-nix 2.0.24\r\ncore 2017.02.21\r\ncore-nix 2017.02.21\r\ngcloud \r\ngcloud-deps 2017.02.21\r\ngcloud-deps-linux-x86_64 2017.02.21\r\ngsutil 4.22\r\ngsutil-nix 4.22\r\n\r\n**Local gcloud**\r\ngcloud --version\r\nGoogle Cloud SDK 148.0.1\r\nbq 2.0.24\r\nbq-nix 2.0.24\r\ncore 2017.03.24\r\ncore-nix 2016.11.07\r\ngcloud \r\ngcloud-deps 2017.03.17\r\ngcloud-deps-darwin-x86_64 2017.02.21\r\ngsutil 4.23\r\ngsutil-nix 4.19\r\n\r\nDebugging locally, the response from NL API consist of polarity property and not score.\r\n\r\n<img width=\"761\" alt=\"image\" src=\"https://cloud.githubusercontent.com/assets/1888535/24331449/62cbdbee-1252-11e7-9d29-8699df078fcf.png\">\r\n\r\n\n", "before_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Definition for Google Cloud Natural Language API sentiment.\n\nSentiment is the response to an ``analyzeSentiment`` request.\n\"\"\"\n\n\nclass Sentiment(object):\n    \"\"\"A Google Cloud Natural Language API sentiment object.\n\n    .. _Sentiment message: https://cloud.google.com/natural-language/\\\n                           reference/rest/v1/Sentiment\n    .. _Sentiment basics: https://cloud.google.com/natural-language/\\\n                          docs/basics#sentiment-analysis-values\n\n    See `Sentiment message`_ and `Sentiment basics`_.\n\n    :type score: float\n    :param score: Score of the sentiment in the ``[-1.0, 1.0]`` range.\n                     Larger numbers represent more positive sentiments.\n\n    :type magnitude: float\n    :param magnitude: A non-negative number in the ``[0, +inf)`` range, which\n                      represents the absolute magnitude of sentiment\n                      regardless of score (positive or negative).\n    \"\"\"\n\n    def __init__(self, score, magnitude):\n        self.score = score\n        self.magnitude = magnitude\n\n    @classmethod\n    def from_api_repr(cls, payload):\n        \"\"\"Convert a Sentiment from the JSON API into a :class:`Sentiment`.\n\n        :param payload: dict\n        :type payload: The value from the backend.\n\n        :rtype: :class:`Sentiment`\n        :returns: The sentiment parsed from the API representation.\n        \"\"\"\n        score = payload['score']\n        magnitude = payload['magnitude']\n        return cls(score, magnitude)\n", "path": "language/google/cloud/language/sentiment.py"}], "after_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Definition for Google Cloud Natural Language API sentiment.\n\nSentiment is the response to an ``analyzeSentiment`` request.\n\"\"\"\n\n\nclass Sentiment(object):\n    \"\"\"A Google Cloud Natural Language API sentiment object.\n\n    .. _Sentiment message: https://cloud.google.com/natural-language/\\\n                           reference/rest/v1/Sentiment\n    .. _Sentiment basics: https://cloud.google.com/natural-language/\\\n                          docs/basics#sentiment-analysis-values\n\n    See `Sentiment message`_ and `Sentiment basics`_.\n\n    :type score: float\n    :param score: Score of the sentiment in the ``[-1.0, 1.0]`` range.\n                     Larger numbers represent more positive sentiments.\n\n    :type magnitude: float\n    :param magnitude: A non-negative number in the ``[0, +inf)`` range, which\n                      represents the absolute magnitude of sentiment\n                      regardless of score (positive or negative).\n    \"\"\"\n\n    def __init__(self, score, magnitude):\n        self.score = score\n        self.magnitude = magnitude\n\n    @classmethod\n    def from_api_repr(cls, payload):\n        \"\"\"Convert a Sentiment from the JSON API into a :class:`Sentiment`.\n\n        :param payload: dict\n        :type payload: The value from the backend.\n\n        :rtype: :class:`Sentiment`\n        :returns: The sentiment parsed from the API representation.\n        \"\"\"\n        score = payload.get('score', None)\n        magnitude = payload['magnitude']\n        return cls(score, magnitude)\n", "path": "language/google/cloud/language/sentiment.py"}]}