We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Guardian: Fix failing tests on Travis
<!--
This is an issue template. Please fill in the relevant details in the
sections below.
-->

##### Text version
<!-- From menu _Options→Add-ons→Orange3-Text_ or code `orangecontrib.text.version.full_version` -->
0.3.0

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.15.dev

##### Expected behavior
Tests pass.


##### Actual behavior
Guardian tests is failing.


##### Steps to reproduce the behavior



##### Additional info (worksheets, data, screenshots, ...)
Fix tests.



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `orangecontrib/text/guardian.py`
Content:
```
1 """ This module fetches data from The Guardian API.
2 
3 To use first create :class:`TheGuardianCredentials`:
4 
5     >>> from orangecontrib.text.guardian import TheGuardianCredentials
6     >>> credentials = TheGuardianCredentials('<your-api-key>')
7 
8 Then create :class:`TheGuardianAPI` object and use it for searching:
9 
10     >>> from orangecontrib.text.guardian import TheGuardianAPI
11     >>> api = TheGuardianAPI(credentials)
12     >>> corpus = api.search('Slovenia', max_documents=10)
13     >>> len(corpus)
14     10
15 
16 """
17 
18 import requests
19 import math
20 import json
21 
22 from Orange import data
23 
24 from orangecontrib.text.corpus import Corpus
25 
26 
27 BASE_URL = 'http://content.guardianapis.com/search'
28 ARTICLES_PER_PAGE = 10
29 
30 
31 class TheGuardianCredentials:
32     """ The Guardian API credentials. """
33     def __init__(self, key):
34         """
35         Args:
36             key (str): The Guardian API key. Use `test` for testing purposes.
37         """
38         self.key = key
39 
40     @property
41     def valid(self):
42         """ Check if given API key is valid. """
43         response = requests.get(BASE_URL, {'api-key': self.key})
44         return response.status_code != 403      # 403 == Forbidden
45 
46     def __eq__(self, other):
47         return self.key == other.key
48 
49 
50 class TheGuardianAPI:
51     attributes = []
52 
53     class_vars = [
54         (data.DiscreteVariable('Section'), lambda doc: doc['sectionName']),
55     ]
56 
57     tv = data.TimeVariable('Publication Date')
58     metas = [
59         (data.StringVariable('Headline'), lambda doc: doc['fields']['headline']),
60         (data.StringVariable('Content'), lambda doc: doc['fields']['bodyText']),
61         (data.StringVariable('Trail Text'), lambda doc: doc['fields']['trailText']),
62         (data.StringVariable('HTML'), lambda doc: doc['fields']['body']),
63         (tv, lambda doc: TheGuardianAPI.tv.parse(doc['webPublicationDate'])),
64         (data.DiscreteVariable('Type'), lambda doc: doc['type']),
65         (data.DiscreteVariable('Language'), lambda doc: doc['fields']['lang']),
66         (data.StringVariable('Tags'),
67             lambda doc: ', '.join(tag['webTitle'] for tag in doc['tags'])),
68         (data.StringVariable('URL'), lambda doc: doc['webUrl']),
69         (data.ContinuousVariable('Word Count', number_of_decimals=0),
70             lambda doc: doc['fields']['wordcount']),
71     ]
72 
73     text_features = [metas[0][0], metas[1][0]]  # Headline + Content
74     title_indices = [-1]    # Headline
75 
76     def __init__(self, credentials, on_progress=None, should_break=None):
77         """
78         Args:
79             credentials (:class:`TheGuardianCredentials`): The Guardian Creentials.
80             on_progress (callable): Function for progress reporting.
81             should_break (callable): Function for early stopping.
82         """
83         self.per_page = ARTICLES_PER_PAGE
84         self.pages = 0
85         self.credentials = credentials
86         self.on_progress = on_progress or (lambda x, y: None)
87         self.should_break = should_break or (lambda: False)
88 
89         self.results = []
90 
91     def _search(self, query, from_date, to_date, page=1):
92         data = self._build_query(query, from_date, to_date, page)
93 
94         response = requests.get(BASE_URL, data)
95         parsed = json.loads(response.text)
96 
97         if page == 1:   # store number of pages
98             self.pages = parsed['response']['pages']
99 
100         self.results.extend(parsed['response']['results'])
101 
102     def _build_query(self, query, from_date=None, to_date=None, page=1):
103         data = {
104             'q': query,
105             'api-key': self.credentials.key,
106             'page': str(page),
107             'show-fields': 'headline,trailText,body,bodyText,lang,wordcount',
108             'show-tags': 'all',
109         }
110         if from_date is not None:
111             data['from-date'] = from_date
112         if to_date is not None:
113             data['to-date'] = to_date
114 
115         return data
116 
117     def search(self, query, from_date=None, to_date=None, max_documents=None,
118                accumulate=False):
119         """
120         Search The Guardian API for articles.
121 
122         Args:
123             query (str): A query for searching the articles by
124             from_date (str): Search only articles newer than the date provided.
125                 Date should be in ISO format; e.g. '2016-12-31'.
126             to_date (str): Search only articles older than the date provided.
127                 Date should be in ISO format; e.g. '2016-12-31'.
128             max_documents (int): Maximum number of documents to retrieve.
129                 When not given, retrieve all documents.
130             accumulate (bool): A flag indicating whether to accumulate results
131                 of multiple consequent search calls.
132 
133         Returns:
134             :ref:`Corpus`
135         """
136         if not accumulate:
137             self.results = []
138 
139         self._search(query, from_date, to_date)
140 
141         pages = math.ceil(max_documents/self.per_page) if max_documents else self.pages
142         self.on_progress(self.per_page, pages * self.per_page)
143 
144         for p in range(2, pages+1):     # to one based
145             if self.should_break():
146                 break
147             self._search(query, from_date, to_date, p)
148             self.on_progress(p*self.per_page, pages * self.per_page)
149 
150         c = Corpus.from_documents(
151             self.results, 'The Guardian', self.attributes, self.class_vars,
152             self.metas, title_indices=self.title_indices)
153         c.text_features = self.text_features
154         return c
155 
156 
157 if __name__ == '__main__':
158     credentials = TheGuardianCredentials('')
159     print(credentials.valid)
160     api = TheGuardianAPI(credentials=credentials)
161     c = api.search('refugees', max_documents=10)
162     print(c)
163
```
--- 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/orangecontrib/text/guardian.py b/orangecontrib/text/guardian.py
--- a/orangecontrib/text/guardian.py
+++ b/orangecontrib/text/guardian.py
@@ -155,7 +155,7 @@
 
 
 if __name__ == '__main__':
-    credentials = TheGuardianCredentials('')
+    credentials = TheGuardianCredentials('test')
     print(credentials.valid)
     api = TheGuardianAPI(credentials=credentials)
     c = api.search('refugees', max_documents=10)

{"golden_diff": "diff --git a/orangecontrib/text/guardian.py b/orangecontrib/text/guardian.py\n--- a/orangecontrib/text/guardian.py\n+++ b/orangecontrib/text/guardian.py\n@@ -155,7 +155,7 @@\n \n \n if __name__ == '__main__':\n-    credentials = TheGuardianCredentials('')\n+    credentials = TheGuardianCredentials('test')\n     print(credentials.valid)\n     api = TheGuardianAPI(credentials=credentials)\n     c = api.search('refugees', max_documents=10)\n", "issue": "Guardian: Fix failing tests on Travis\n<!--\r\nThis is an issue template. Please fill in the relevant details in the\r\nsections below.\r\n-->\r\n\r\n##### Text version\r\n<!-- From menu _Options\u2192Add-ons\u2192Orange3-Text_ or code `orangecontrib.text.version.full_version` -->\r\n0.3.0\r\n\r\n##### Orange version\r\n<!-- From menu _Help\u2192About\u2192Version_ or code `Orange.version.full_version` -->\r\n3.15.dev\r\n\r\n##### Expected behavior\r\nTests pass.\r\n\r\n\r\n##### Actual behavior\r\nGuardian tests is failing.\r\n\r\n\r\n##### Steps to reproduce the behavior\r\n\r\n\r\n\r\n##### Additional info (worksheets, data, screenshots, ...)\r\nFix tests.\r\n\r\n\n", "before_files": [{"content": "\"\"\" This module fetches data from The Guardian API.\n\nTo use first create :class:`TheGuardianCredentials`:\n\n    >>> from orangecontrib.text.guardian import TheGuardianCredentials\n    >>> credentials = TheGuardianCredentials('<your-api-key>')\n\nThen create :class:`TheGuardianAPI` object and use it for searching:\n\n    >>> from orangecontrib.text.guardian import TheGuardianAPI\n    >>> api = TheGuardianAPI(credentials)\n    >>> corpus = api.search('Slovenia', max_documents=10)\n    >>> len(corpus)\n    10\n\n\"\"\"\n\nimport requests\nimport math\nimport json\n\nfrom Orange import data\n\nfrom orangecontrib.text.corpus import Corpus\n\n\nBASE_URL = 'http://content.guardianapis.com/search'\nARTICLES_PER_PAGE = 10\n\n\nclass TheGuardianCredentials:\n    \"\"\" The Guardian API credentials. \"\"\"\n    def __init__(self, key):\n        \"\"\"\n        Args:\n            key (str): The Guardian API key. Use `test` for testing purposes.\n        \"\"\"\n        self.key = key\n\n    @property\n    def valid(self):\n        \"\"\" Check if given API key is valid. \"\"\"\n        response = requests.get(BASE_URL, {'api-key': self.key})\n        return response.status_code != 403      # 403 == Forbidden\n\n    def __eq__(self, other):\n        return self.key == other.key\n\n\nclass TheGuardianAPI:\n    attributes = []\n\n    class_vars = [\n        (data.DiscreteVariable('Section'), lambda doc: doc['sectionName']),\n    ]\n\n    tv = data.TimeVariable('Publication Date')\n    metas = [\n        (data.StringVariable('Headline'), lambda doc: doc['fields']['headline']),\n        (data.StringVariable('Content'), lambda doc: doc['fields']['bodyText']),\n        (data.StringVariable('Trail Text'), lambda doc: doc['fields']['trailText']),\n        (data.StringVariable('HTML'), lambda doc: doc['fields']['body']),\n        (tv, lambda doc: TheGuardianAPI.tv.parse(doc['webPublicationDate'])),\n        (data.DiscreteVariable('Type'), lambda doc: doc['type']),\n        (data.DiscreteVariable('Language'), lambda doc: doc['fields']['lang']),\n        (data.StringVariable('Tags'),\n            lambda doc: ', '.join(tag['webTitle'] for tag in doc['tags'])),\n        (data.StringVariable('URL'), lambda doc: doc['webUrl']),\n        (data.ContinuousVariable('Word Count', number_of_decimals=0),\n            lambda doc: doc['fields']['wordcount']),\n    ]\n\n    text_features = [metas[0][0], metas[1][0]]  # Headline + Content\n    title_indices = [-1]    # Headline\n\n    def __init__(self, credentials, on_progress=None, should_break=None):\n        \"\"\"\n        Args:\n            credentials (:class:`TheGuardianCredentials`): The Guardian Creentials.\n            on_progress (callable): Function for progress reporting.\n            should_break (callable): Function for early stopping.\n        \"\"\"\n        self.per_page = ARTICLES_PER_PAGE\n        self.pages = 0\n        self.credentials = credentials\n        self.on_progress = on_progress or (lambda x, y: None)\n        self.should_break = should_break or (lambda: False)\n\n        self.results = []\n\n    def _search(self, query, from_date, to_date, page=1):\n        data = self._build_query(query, from_date, to_date, page)\n\n        response = requests.get(BASE_URL, data)\n        parsed = json.loads(response.text)\n\n        if page == 1:   # store number of pages\n            self.pages = parsed['response']['pages']\n\n        self.results.extend(parsed['response']['results'])\n\n    def _build_query(self, query, from_date=None, to_date=None, page=1):\n        data = {\n            'q': query,\n            'api-key': self.credentials.key,\n            'page': str(page),\n            'show-fields': 'headline,trailText,body,bodyText,lang,wordcount',\n            'show-tags': 'all',\n        }\n        if from_date is not None:\n            data['from-date'] = from_date\n        if to_date is not None:\n            data['to-date'] = to_date\n\n        return data\n\n    def search(self, query, from_date=None, to_date=None, max_documents=None,\n               accumulate=False):\n        \"\"\"\n        Search The Guardian API for articles.\n\n        Args:\n            query (str): A query for searching the articles by\n            from_date (str): Search only articles newer than the date provided.\n                Date should be in ISO format; e.g. '2016-12-31'.\n            to_date (str): Search only articles older than the date provided.\n                Date should be in ISO format; e.g. '2016-12-31'.\n            max_documents (int): Maximum number of documents to retrieve.\n                When not given, retrieve all documents.\n            accumulate (bool): A flag indicating whether to accumulate results\n                of multiple consequent search calls.\n\n        Returns:\n            :ref:`Corpus`\n        \"\"\"\n        if not accumulate:\n            self.results = []\n\n        self._search(query, from_date, to_date)\n\n        pages = math.ceil(max_documents/self.per_page) if max_documents else self.pages\n        self.on_progress(self.per_page, pages * self.per_page)\n\n        for p in range(2, pages+1):     # to one based\n            if self.should_break():\n                break\n            self._search(query, from_date, to_date, p)\n            self.on_progress(p*self.per_page, pages * self.per_page)\n\n        c = Corpus.from_documents(\n            self.results, 'The Guardian', self.attributes, self.class_vars,\n            self.metas, title_indices=self.title_indices)\n        c.text_features = self.text_features\n        return c\n\n\nif __name__ == '__main__':\n    credentials = TheGuardianCredentials('')\n    print(credentials.valid)\n    api = TheGuardianAPI(credentials=credentials)\n    c = api.search('refugees', max_documents=10)\n    print(c)\n", "path": "orangecontrib/text/guardian.py"}], "after_files": [{"content": "\"\"\" This module fetches data from The Guardian API.\n\nTo use first create :class:`TheGuardianCredentials`:\n\n    >>> from orangecontrib.text.guardian import TheGuardianCredentials\n    >>> credentials = TheGuardianCredentials('<your-api-key>')\n\nThen create :class:`TheGuardianAPI` object and use it for searching:\n\n    >>> from orangecontrib.text.guardian import TheGuardianAPI\n    >>> api = TheGuardianAPI(credentials)\n    >>> corpus = api.search('Slovenia', max_documents=10)\n    >>> len(corpus)\n    10\n\n\"\"\"\n\nimport requests\nimport math\nimport json\n\nfrom Orange import data\n\nfrom orangecontrib.text.corpus import Corpus\n\n\nBASE_URL = 'http://content.guardianapis.com/search'\nARTICLES_PER_PAGE = 10\n\n\nclass TheGuardianCredentials:\n    \"\"\" The Guardian API credentials. \"\"\"\n    def __init__(self, key):\n        \"\"\"\n        Args:\n            key (str): The Guardian API key. Use `test` for testing purposes.\n        \"\"\"\n        self.key = key\n\n    @property\n    def valid(self):\n        \"\"\" Check if given API key is valid. \"\"\"\n        response = requests.get(BASE_URL, {'api-key': self.key})\n        return response.status_code != 403      # 403 == Forbidden\n\n    def __eq__(self, other):\n        return self.key == other.key\n\n\nclass TheGuardianAPI:\n    attributes = []\n\n    class_vars = [\n        (data.DiscreteVariable('Section'), lambda doc: doc['sectionName']),\n    ]\n\n    tv = data.TimeVariable('Publication Date')\n    metas = [\n        (data.StringVariable('Headline'), lambda doc: doc['fields']['headline']),\n        (data.StringVariable('Content'), lambda doc: doc['fields']['bodyText']),\n        (data.StringVariable('Trail Text'), lambda doc: doc['fields']['trailText']),\n        (data.StringVariable('HTML'), lambda doc: doc['fields']['body']),\n        (tv, lambda doc: TheGuardianAPI.tv.parse(doc['webPublicationDate'])),\n        (data.DiscreteVariable('Type'), lambda doc: doc['type']),\n        (data.DiscreteVariable('Language'), lambda doc: doc['fields']['lang']),\n        (data.StringVariable('Tags'),\n            lambda doc: ', '.join(tag['webTitle'] for tag in doc['tags'])),\n        (data.StringVariable('URL'), lambda doc: doc['webUrl']),\n        (data.ContinuousVariable('Word Count', number_of_decimals=0),\n            lambda doc: doc['fields']['wordcount']),\n    ]\n\n    text_features = [metas[0][0], metas[1][0]]  # Headline + Content\n    title_indices = [-1]    # Headline\n\n    def __init__(self, credentials, on_progress=None, should_break=None):\n        \"\"\"\n        Args:\n            credentials (:class:`TheGuardianCredentials`): The Guardian Creentials.\n            on_progress (callable): Function for progress reporting.\n            should_break (callable): Function for early stopping.\n        \"\"\"\n        self.per_page = ARTICLES_PER_PAGE\n        self.pages = 0\n        self.credentials = credentials\n        self.on_progress = on_progress or (lambda x, y: None)\n        self.should_break = should_break or (lambda: False)\n\n        self.results = []\n\n    def _search(self, query, from_date, to_date, page=1):\n        data = self._build_query(query, from_date, to_date, page)\n\n        response = requests.get(BASE_URL, data)\n        parsed = json.loads(response.text)\n\n        if page == 1:   # store number of pages\n            self.pages = parsed['response']['pages']\n\n        self.results.extend(parsed['response']['results'])\n\n    def _build_query(self, query, from_date=None, to_date=None, page=1):\n        data = {\n            'q': query,\n            'api-key': self.credentials.key,\n            'page': str(page),\n            'show-fields': 'headline,trailText,body,bodyText,lang,wordcount',\n            'show-tags': 'all',\n        }\n        if from_date is not None:\n            data['from-date'] = from_date\n        if to_date is not None:\n            data['to-date'] = to_date\n\n        return data\n\n    def search(self, query, from_date=None, to_date=None, max_documents=None,\n               accumulate=False):\n        \"\"\"\n        Search The Guardian API for articles.\n\n        Args:\n            query (str): A query for searching the articles by\n            from_date (str): Search only articles newer than the date provided.\n                Date should be in ISO format; e.g. '2016-12-31'.\n            to_date (str): Search only articles older than the date provided.\n                Date should be in ISO format; e.g. '2016-12-31'.\n            max_documents (int): Maximum number of documents to retrieve.\n                When not given, retrieve all documents.\n            accumulate (bool): A flag indicating whether to accumulate results\n                of multiple consequent search calls.\n\n        Returns:\n            :ref:`Corpus`\n        \"\"\"\n        if not accumulate:\n            self.results = []\n\n        self._search(query, from_date, to_date)\n\n        pages = math.ceil(max_documents/self.per_page) if max_documents else self.pages\n        self.on_progress(self.per_page, pages * self.per_page)\n\n        for p in range(2, pages+1):     # to one based\n            if self.should_break():\n                break\n            self._search(query, from_date, to_date, p)\n            self.on_progress(p*self.per_page, pages * self.per_page)\n\n        c = Corpus.from_documents(\n            self.results, 'The Guardian', self.attributes, self.class_vars,\n            self.metas, title_indices=self.title_indices)\n        c.text_features = self.text_features\n        return c\n\n\nif __name__ == '__main__':\n    credentials = TheGuardianCredentials('test')\n    print(credentials.valid)\n    api = TheGuardianAPI(credentials=credentials)\n    c = api.search('refugees', max_documents=10)\n    print(c)\n", "path": "orangecontrib/text/guardian.py"}]}