Skip to content

Commit 496f50e

Browse files
committed
docstring fmt
1 parent e1c30db commit 496f50e

File tree

1 file changed

+36
-18
lines changed

1 file changed

+36
-18
lines changed

src/oxylabs/proxy/proxy.py

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ def get(
4848
4949
Args:
5050
url (str): The URL to send the GET request to.
51-
request_timeout (Optional[int]): The request timeout in seconds. Defaults to None (no timeout).
51+
request_timeout (Optional[int]): The request timeout in seconds.
52+
Defaults to None (no timeout).
5253
5354
Returns:
54-
Optional[requests.Response]: The response object returned by the GET request, or None if an error occurred.
55+
Optional[requests.Response]: The response object returned by the
56+
GET request, or None if an error occurred.
5557
"""
5658
try:
5759
config = prepare_config(request_timeout=request_timeout)
@@ -73,22 +75,33 @@ def get(
7375
def add_user_agent_header(self, user_agent_type: str) -> None:
7476
"""
7577
Adds a user agent header to the session headers.
76-
There is no way to indicate a specific User-Agent, but you can let us know which user-agent type you would like us to use.
78+
There is no way to indicate a specific User-Agent, but you can let us
79+
know which user-agent type you would like us to use.
7780
7881
Args:
79-
user_agent_type (str): The user agent to add. Must be one of the following:
82+
user_agent_type (str): The user agent to add. Must be one of the
83+
following:
8084
- "desktop" - A User-Agent of a desktop browser.
81-
- "desktop_chrome" - A User-Agent of one of the latest versions of a desktop Chrome browser.
82-
- "desktop_edge" - A User-Agent of one of the latest versions of a desktop Edge browser.
83-
- "desktop_firefox" - A User-Agent of one of the latest versions of a desktop Firefox browser.
84-
- "desktop_opera" - A User-Agent of one of the latest versions of a desktop Opera browser.
85-
- "desktop_safari" - A User-Agent of one of the latest versions of a desktop Safari browser.
85+
- "desktop_chrome" - A User-Agent of one of the latest versions of
86+
a desktop Chrome browser.
87+
- "desktop_edge" - A User-Agent of one of the latest versions of
88+
a desktop Edge browser.
89+
- "desktop_firefox" - A User-Agent of one of the latest versions of
90+
a desktop Firefox browser.
91+
- "desktop_opera" - A User-Agent of one of the latest versions of
92+
a desktop Opera browser.
93+
- "desktop_safari" - A User-Agent of one of the latest versions of
94+
a desktop Safari browser.
8695
- "mobile" - A User-Agent of a mobile browser.
87-
- "mobile_android" - A User-Agent of one of the latest versions of an Android mobile browser.
88-
- "mobile_ios" - A User-Agent of one of the latest versions of an iOS mobile browser.
96+
- "mobile_android" - A User-Agent of one of the latest versions of
97+
an Android mobile browser.
98+
- "mobile_ios" - A User-Agent of one of the latest versions of
99+
an iOS mobile browser.
89100
- "tablet" - A User-Agent of a tablet browser.
90-
- "tablet_android" - A User-Agent of one of the latest versions of an Android tablet browser.
91-
- "tablet_ios" - A User-Agent of one of the latest versions of an iOS tablet browser.
101+
- "tablet_android" - A User-Agent of one of the latest versions of
102+
an Android tablet browser.
103+
- "tablet_ios" - A User-Agent of one of the latest versions of
104+
an iOS tablet browser.
92105
93106
Returns:
94107
None
@@ -116,8 +129,10 @@ def add_parse_header(
116129
Adds a parse header to the session headers.
117130
118131
Args:
119-
parse (bool, optional): Whether to enable parsing. Defaults to False.
120-
parsing_instructions (dict, optional): Instructions for parsing. Defaults to None.
132+
parse (bool, optional): Whether to enable parsing. Defaults to
133+
False.
134+
parsing_instructions (dict, optional): Instructions for parsing.
135+
Defaults to None.
121136
122137
Returns:
123138
None
@@ -139,7 +154,8 @@ def _is_universal_source(self) -> bool:
139154
Checks if the URL to scrape belongs to a universal source.
140155
141156
Returns:
142-
bool: True if the URL belongs to a universal source, False otherwise.
157+
bool: True if the URL belongs to a universal source, False
158+
otherwise.
143159
"""
144160
parsed_url = urlparse(self._url_to_scrape)
145161
if any(
@@ -153,10 +169,12 @@ def _is_universal_source(self) -> bool:
153169
def add_geo_location_header(self, geo_location: str) -> None:
154170
"""
155171
Adds a geo location header to the session headers.
156-
In some cases, you may need to indicate the geographical location that the result should be adapted for.
172+
In some cases, you may need to indicate the geographical location that
173+
the result should be adapted for.
157174
158175
Args:
159-
geo_location (str): The geo location to add. Accepted values depend on the URL you would like us to scrape.
176+
geo_location (str): The geo location to add. Accepted values depend
177+
on the URL you would like us to scrape.
160178
161179
Returns:
162180
None

0 commit comments

Comments
 (0)