Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.requests_kwargs = requests_kwargs or {}
self.headers = {
"User-Agent": user_agent or options.default_user_agent,
'Content-Type': 'application/json'
}
try:
self.headers.update(self.requests_kwargs['headers'])
except KeyError:
pass
self.requests_kwargs['headers'] = self.headers
self.timeout = timeout if timeout != DEFAULT else options.default_timeout
self.requests_kwargs['timeout'] = self.timeout
self.proxies = self.requests_kwargs.get('proxies') or options.default_proxies
if self.proxies:
self.requests_kwargs['proxies'] = self.proxies
self._req = None
on HTTP 429, but instead jitter a sleeping timer to pause between
requests until HTTP 200 or retry_timeout is reached.
:type retry_over_query_limit: bool
:param skip_api_error: Continue with batch processing if a :class:`routingpy.exceptions.RouterApiError` is
encountered (e.g. no route found). If False, processing will discontinue and raise an error. Default False.
:type skip_api_error: bool
"""
self._session = requests.Session()
self.base_url = base_url
self.retry_over_query_limit = retry_over_query_limit if retry_over_query_limit is False else options.default_retry_over_query_limit
self.retry_timeout = timedelta(seconds=retry_timeout or options.default_retry_timeout)
self.skip_api_error = skip_api_error or options.default_skip_api_error
self.requests_kwargs = requests_kwargs or {}
self.headers = {
"User-Agent": user_agent or options.default_user_agent,
'Content-Type': 'application/json'
}
try:
self.headers.update(self.requests_kwargs['headers'])
except KeyError:
pass
self.requests_kwargs['headers'] = self.headers
self.timeout = timeout if timeout != DEFAULT else options.default_timeout
self.requests_kwargs['timeout'] = self.timeout
:param retry_over_query_limit: If True, client will not raise an exception
on HTTP 429, but instead jitter a sleeping timer to pause between
requests until HTTP 200 or retry_timeout is reached.
:type retry_over_query_limit: bool
:param skip_api_error: Continue with batch processing if a :class:`routingpy.exceptions.RouterApiError` is
encountered (e.g. no route found). If False, processing will discontinue and raise an error. Default False.
:type skip_api_error: bool
"""
self._session = requests.Session()
self.base_url = base_url
self.retry_over_query_limit = retry_over_query_limit if retry_over_query_limit is False else options.default_retry_over_query_limit
self.retry_timeout = timedelta(seconds=retry_timeout or options.default_retry_timeout)
self.skip_api_error = skip_api_error or options.default_skip_api_error
self.requests_kwargs = requests_kwargs or {}
self.headers = {
"User-Agent": user_agent or options.default_user_agent,
'Content-Type': 'application/json'
}
try:
self.headers.update(self.requests_kwargs['headers'])
except KeyError:
pass
self.requests_kwargs['headers'] = self.headers
self.timeout = timeout if timeout != DEFAULT else options.default_timeout
:type requests_kwargs: dict
:param retry_over_query_limit: If True, client will not raise an exception
on HTTP 429, but instead jitter a sleeping timer to pause between
requests until HTTP 200 or retry_timeout is reached.
:type retry_over_query_limit: bool
:param skip_api_error: Continue with batch processing if a :class:`routingpy.exceptions.RouterApiError` is
encountered (e.g. no route found). If False, processing will discontinue and raise an error. Default False.
:type skip_api_error: bool
"""
self._session = requests.Session()
self.base_url = base_url
self.retry_over_query_limit = retry_over_query_limit if retry_over_query_limit is False else options.default_retry_over_query_limit
self.retry_timeout = timedelta(seconds=retry_timeout or options.default_retry_timeout)
self.skip_api_error = skip_api_error or options.default_skip_api_error
self.requests_kwargs = requests_kwargs or {}
self.headers = {
"User-Agent": user_agent or options.default_user_agent,
'Content-Type': 'application/json'
}
try:
self.headers.update(self.requests_kwargs['headers'])
except KeyError:
pass
self.requests_kwargs['headers'] = self.headers
:param skip_api_error: Continue with batch processing if a :class:`routingpy.exceptions.RouterApiError` is
encountered (e.g. no route found). If False, processing will discontinue and raise an error. Default False.
:type skip_api_error: bool
"""
self._session = requests.Session()
self.base_url = base_url
self.retry_over_query_limit = retry_over_query_limit if retry_over_query_limit is False else options.default_retry_over_query_limit
self.retry_timeout = timedelta(seconds=retry_timeout or options.default_retry_timeout)
self.skip_api_error = skip_api_error or options.default_skip_api_error
self.requests_kwargs = requests_kwargs or {}
self.headers = {
"User-Agent": user_agent or options.default_user_agent,
'Content-Type': 'application/json'
}
try:
self.headers.update(self.requests_kwargs['headers'])
except KeyError:
pass
self.requests_kwargs['headers'] = self.headers
self.timeout = timeout if timeout != DEFAULT else options.default_timeout
self.requests_kwargs['timeout'] = self.timeout
self.proxies = self.requests_kwargs.get('proxies') or options.default_proxies
if self.proxies:
self.requests_kwargs['proxies'] = self.proxies
self.skip_api_error = skip_api_error or options.default_skip_api_error
self.requests_kwargs = requests_kwargs or {}
self.headers = {
"User-Agent": user_agent or options.default_user_agent,
'Content-Type': 'application/json'
}
try:
self.headers.update(self.requests_kwargs['headers'])
except KeyError:
pass
self.requests_kwargs['headers'] = self.headers
self.timeout = timeout if timeout != DEFAULT else options.default_timeout
self.requests_kwargs['timeout'] = self.timeout
self.proxies = self.requests_kwargs.get('proxies') or options.default_proxies
if self.proxies:
self.requests_kwargs['proxies'] = self.proxies
self._req = None