We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bug in `mac_platform_token`
* Faker version: Latest
* OS: Any

`mac_platform_token` generates a MacOS platform token used in user agent strings. However, during https://github.com/joke2k/faker/commit/da1ae11a06a8f64bd4b0f7d1391d7661521e4caf#diff-7d7f34af58b0ae686b413e6ed3463229243aacfb0891fbc544cb951224c5af97L220, looks like it got missing underscore. Now, it generates `Macintosh; PPC Mac OS X 10 6_5` where as it should be `Macintosh; PPC Mac OS X 10_6_5`

### Expected behavior

Output of `mac_platform_token` should be `Macintosh; PPC Mac OS X 10_6_5`

### Actual behavior
`Macintosh; PPC Mac OS X 10 6_5`


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `faker/providers/user_agent/__init__.py`
Content:
```
1 import string
2 
3 from datetime import datetime
4 
5 from .. import BaseProvider
6 
7 
8 class Provider(BaseProvider):
9     """Implement default user agent provider for Faker."""
10 
11     user_agents = (
12         'chrome', 'firefox', 'internet_explorer', 'opera', 'safari',
13     )
14 
15     windows_platform_tokens = (
16         'Windows 95', 'Windows 98', 'Windows 98; Win 9x 4.90', 'Windows CE',
17         'Windows NT 4.0', 'Windows NT 5.0', 'Windows NT 5.01',
18         'Windows NT 5.1', 'Windows NT 5.2', 'Windows NT 6.0', 'Windows NT 6.1',
19         'Windows NT 6.2', 'Windows NT 10.0',
20     )
21 
22     linux_processors = ('i686', 'x86_64')
23 
24     mac_processors = ('Intel', 'PPC', 'U; Intel', 'U; PPC')
25 
26     android_versions = (
27         '1.0', '1.1', '1.5', '1.6', '2.0', '2.0.1', '2.1', '2.2', '2.2.1', '2.2.2', '2.2.3', '2.3', '2.3.1', '2.3.2',
28         '2.3.3', '2.3.4', '2.3.5', '2.3.6', '2.3.7', '3.0', '3.1', '3.2', '3.2.1', '3.2.2', '3.2.3', '3.2.4', '3.2.5',
29         '3.2.6', '4.0', '4.0.1', '4.0.2', '4.0.3', '4.0.4', '4.1', '4.1.1', '4.1.2', '4.2', '4.2.1', '4.2.2', '4.3',
30         '4.3.1', '4.4', '4.4.1', '4.4.2', '4.4.3', '4.4.4', '5.0', '5.0.1', '5.0.2', '5.1', '5.1.1', '6.0', '6.0.1',
31         '7.0', '7.1', '7.1.1', '7.1.2', '8.0.0', '8.1.0', '9', '10', '11',
32     )
33 
34     apple_devices = ('iPhone', 'iPad')
35 
36     ios_versions = (
37         '3.1.3', '4.2.1', '5.1.1', '6.1.6', '7.1.2', '9.3.5', '9.3.6', '10.3.3', '10.3.4', '12.4.8', '14.2', '14.2.1',
38     )
39 
40     def mac_processor(self):
41         """Generate a MacOS processor token used in user agent strings."""
42         return self.random_element(self.mac_processors)
43 
44     def linux_processor(self):
45         """Generate a Linux processor token used in user agent strings."""
46         return self.random_element(self.linux_processors)
47 
48     def user_agent(self):
49         """Generate a random web browser user agent string."""
50         name = self.random_element(self.user_agents)
51         return getattr(self, name)()
52 
53     def chrome(self, version_from=13, version_to=63,
54                build_from=800, build_to=899):
55         """Generate a Chrome web browser user agent string."""
56         saf = f'{self.generator.random.randint(531, 536)}.{self.generator.random.randint(0, 2)}'
57         bld = self.lexify(self.numerify('##?###'), string.ascii_uppercase)
58         tmplt = '({0}) AppleWebKit/{1} (KHTML, like Gecko)' \
59                 ' Chrome/{2}.0.{3}.0 Safari/{4}'
60         tmplt_ios = '({0}) AppleWebKit/{1} (KHTML, like Gecko)' \
61                     ' CriOS/{2}.0.{3}.0 Mobile/{4} Safari/{1}'
62         platforms = (
63             tmplt.format(self.linux_platform_token(),
64                          saf,
65                          self.generator.random.randint(version_from, version_to),
66                          self.generator.random.randint(build_from, build_to),
67                          saf),
68             tmplt.format(self.windows_platform_token(),
69                          saf,
70                          self.generator.random.randint(version_from, version_to),
71                          self.generator.random.randint(build_from, build_to),
72                          saf),
73             tmplt.format(self.mac_platform_token(),
74                          saf,
75                          self.generator.random.randint(version_from, version_to),
76                          self.generator.random.randint(build_from, build_to),
77                          saf),
78             tmplt.format('Linux; {}'.format(self.android_platform_token()),
79                          saf,
80                          self.generator.random.randint(version_from, version_to),
81                          self.generator.random.randint(build_from, build_to),
82                          saf),
83             tmplt_ios.format(self.ios_platform_token(),
84                              saf,
85                              self.generator.random.randint(version_from, version_to),
86                              self.generator.random.randint(build_from, build_to),
87                              bld),
88         )
89 
90         return 'Mozilla/5.0 ' + self.random_element(platforms)
91 
92     def firefox(self):
93         """Generate a Mozilla Firefox web browser user agent string."""
94         ver = (
95             (f'Gecko/{self.generator.date_time_between(datetime(2011, 1, 1))} '
96              f'Firefox/{self.generator.random.randint(4, 15)}.0'),
97             (f'Gecko/{self.generator.date_time_between(datetime(2010, 1, 1))} '
98              f'Firefox/3.6.{self.generator.random.randint(1, 20)}'),
99             f'Gecko/{self.generator.date_time_between(datetime(2010, 1, 1))} Firefox/3.8',
100         )
101         tmplt_win = '({0}; {1}; rv:1.9.{2}.20) {3}'
102         tmplt_lin = '({0}; rv:1.9.{1}.20) {2}'
103         tmplt_mac = '({0}; rv:1.9.{1}.20) {2}'
104         tmplt_and = '({0}; Mobile; rv:{1}.0) Gecko/{1}.0 Firefox/{1}.0'
105         tmplt_ios = '({0}) AppleWebKit/{1} (KHTML, like Gecko) FxiOS/{2}.{3}.0 Mobile/{4} Safari/{1}'
106         saf = '{}.{}'.format(self.generator.random.randint(531, 536),
107                              self.generator.random.randint(0, 2))
108         bld = self.lexify(self.numerify('##?###'), string.ascii_uppercase)
109         bld2 = self.lexify(self.numerify('#?####'), string.ascii_lowercase)
110         platforms = (
111             tmplt_win.format(self.windows_platform_token(),
112                              self.generator.locale().replace('_', '-'),
113                              self.generator.random.randint(0, 2),
114                              self.generator.random.choice(ver)),
115             tmplt_lin.format(self.linux_platform_token(),
116                              self.generator.random.randint(5, 7),
117                              self.generator.random.choice(ver)),
118             tmplt_mac.format(self.mac_platform_token(),
119                              self.generator.random.randint(2, 6),
120                              self.generator.random.choice(ver)),
121             tmplt_and.format(self.android_platform_token(),
122                              self.generator.random.randint(5, 68)),
123             tmplt_ios.format(self.ios_platform_token(),
124                              saf,
125                              self.generator.random.randint(9, 18),
126                              bld2,
127                              bld),
128         )
129 
130         return 'Mozilla/5.0 ' + self.random_element(platforms)
131 
132     def safari(self):
133         """Generate a Safari web browser user agent string."""
134         saf = (f'{self.generator.random.randint(531, 535)}.'
135                f'{self.generator.random.randint(1, 50)}.'
136                f'{self.generator.random.randint(1, 7)}')
137         if not self.generator.random.getrandbits(1):
138             ver = f'{self.generator.random.randint(4, 5)}.{self.generator.random.randint(0, 1)}'
139         else:
140             ver = f'{self.generator.random.randint(4, 5)}.0.{self.generator.random.randint(1, 5)}'
141         tmplt_win = '(Windows; U; {0}) AppleWebKit/{1} (KHTML, like Gecko)' \
142                     ' Version/{2} Safari/{3}'
143         tmplt_mac = '({0} rv:{1}.0; {2}) AppleWebKit/{3} (KHTML, like Gecko)' \
144                     ' Version/{4} Safari/{5}'
145         tmplt_ipod = '(iPod; U; CPU iPhone OS {0}_{1} like Mac OS X; {2})' \
146                      ' AppleWebKit/{3} (KHTML, like Gecko) Version/{4}.0.5' \
147                      ' Mobile/8B{5} Safari/6{6}'
148         locale = self.generator.locale().replace('_', '-')
149         platforms = (
150             tmplt_win.format(self.windows_platform_token(),
151                              saf,
152                              ver,
153                              saf),
154             tmplt_mac.format(self.mac_platform_token(),
155                              self.generator.random.randint(2, 6),
156                              locale,
157                              saf,
158                              ver,
159                              saf),
160             tmplt_ipod.format(self.generator.random.randint(3, 4),
161                               self.generator.random.randint(0, 3),
162                               locale,
163                               saf,
164                               self.generator.random.randint(3, 4),
165                               self.generator.random.randint(111, 119),
166                               saf),
167         )
168 
169         return 'Mozilla/5.0 ' + self.random_element(platforms)
170 
171     def opera(self):
172         """Generate an Opera web browser user agent string."""
173         token = self.linux_platform_token() if self.generator.random.getrandbits(1) else self.windows_platform_token()
174         locale = self.generator.locale().replace('_', '-')
175         platform = (f'({token}; {locale}) Presto/2.9.{self.generator.random.randint(160, 190)} '
176                     f'Version/{self.generator.random.randint(10, 12)}.00')
177         return f'Opera/{self.generator.random.randint(8, 9)}.{self.generator.random.randint(10, 99)}.{platform}'
178 
179     def internet_explorer(self):
180         """Generate an IE web browser user agent string."""
181         return (f'Mozilla/5.0 (compatible; MSIE {self.generator.random.randint(5, 9)}.0; '
182                 f'{self.windows_platform_token()}; '
183                 f'Trident/{self.generator.random.randint(3, 5)}.{self.generator.random.randint(0, 1)})')
184 
185     def windows_platform_token(self):
186         """Generate a Windows platform token used in user agent strings."""
187         return self.random_element(self.windows_platform_tokens)
188 
189     def linux_platform_token(self):
190         """Generate a Linux platform token used in user agent strings."""
191         return f'X11; Linux {self.random_element(self.linux_processors)}'
192 
193     def mac_platform_token(self):
194         """Generate a MacOS platform token used in user agent strings."""
195         return (f'Macintosh; {self.random_element(self.mac_processors)} Mac OS X 10 '
196                 f'{self.generator.random.randint(5, 12)}_{self.generator.random.randint(0, 9)}')
197 
198     def android_platform_token(self):
199         """Generate an Android platform token used in user agent strings."""
200         return f'Android {self.random_element(self.android_versions)}'
201 
202     def ios_platform_token(self):
203         """Generate an iOS platform token used in user agent strings."""
204         apple_device = self.random_element(self.apple_devices)
205         return (f'{apple_device}; CPU {apple_device} '
206                 f'OS {self.random_element(self.ios_versions).replace(".", "_")} like Mac OS X')
207
```
--- 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/faker/providers/user_agent/__init__.py b/faker/providers/user_agent/__init__.py
--- a/faker/providers/user_agent/__init__.py
+++ b/faker/providers/user_agent/__init__.py
@@ -192,7 +192,7 @@
 
     def mac_platform_token(self):
         """Generate a MacOS platform token used in user agent strings."""
-        return (f'Macintosh; {self.random_element(self.mac_processors)} Mac OS X 10 '
+        return (f'Macintosh; {self.random_element(self.mac_processors)} Mac OS X 10_'
                 f'{self.generator.random.randint(5, 12)}_{self.generator.random.randint(0, 9)}')
 
     def android_platform_token(self):

{"golden_diff": "diff --git a/faker/providers/user_agent/__init__.py b/faker/providers/user_agent/__init__.py\n--- a/faker/providers/user_agent/__init__.py\n+++ b/faker/providers/user_agent/__init__.py\n@@ -192,7 +192,7 @@\n \n     def mac_platform_token(self):\n         \"\"\"Generate a MacOS platform token used in user agent strings.\"\"\"\n-        return (f'Macintosh; {self.random_element(self.mac_processors)} Mac OS X 10 '\n+        return (f'Macintosh; {self.random_element(self.mac_processors)} Mac OS X 10_'\n                 f'{self.generator.random.randint(5, 12)}_{self.generator.random.randint(0, 9)}')\n \n     def android_platform_token(self):\n", "issue": "Bug in `mac_platform_token`\n* Faker version: Latest\r\n* OS: Any\r\n\r\n`mac_platform_token` generates a MacOS platform token used in user agent strings. However, during https://github.com/joke2k/faker/commit/da1ae11a06a8f64bd4b0f7d1391d7661521e4caf#diff-7d7f34af58b0ae686b413e6ed3463229243aacfb0891fbc544cb951224c5af97L220, looks like it got missing underscore. Now, it generates `Macintosh; PPC Mac OS X 10 6_5` where as it should be `Macintosh; PPC Mac OS X 10_6_5`\r\n\r\n### Expected behavior\r\n\r\nOutput of `mac_platform_token` should be `Macintosh; PPC Mac OS X 10_6_5`\r\n\r\n### Actual behavior\r\n`Macintosh; PPC Mac OS X 10 6_5`\r\n\n", "before_files": [{"content": "import string\n\nfrom datetime import datetime\n\nfrom .. import BaseProvider\n\n\nclass Provider(BaseProvider):\n    \"\"\"Implement default user agent provider for Faker.\"\"\"\n\n    user_agents = (\n        'chrome', 'firefox', 'internet_explorer', 'opera', 'safari',\n    )\n\n    windows_platform_tokens = (\n        'Windows 95', 'Windows 98', 'Windows 98; Win 9x 4.90', 'Windows CE',\n        'Windows NT 4.0', 'Windows NT 5.0', 'Windows NT 5.01',\n        'Windows NT 5.1', 'Windows NT 5.2', 'Windows NT 6.0', 'Windows NT 6.1',\n        'Windows NT 6.2', 'Windows NT 10.0',\n    )\n\n    linux_processors = ('i686', 'x86_64')\n\n    mac_processors = ('Intel', 'PPC', 'U; Intel', 'U; PPC')\n\n    android_versions = (\n        '1.0', '1.1', '1.5', '1.6', '2.0', '2.0.1', '2.1', '2.2', '2.2.1', '2.2.2', '2.2.3', '2.3', '2.3.1', '2.3.2',\n        '2.3.3', '2.3.4', '2.3.5', '2.3.6', '2.3.7', '3.0', '3.1', '3.2', '3.2.1', '3.2.2', '3.2.3', '3.2.4', '3.2.5',\n        '3.2.6', '4.0', '4.0.1', '4.0.2', '4.0.3', '4.0.4', '4.1', '4.1.1', '4.1.2', '4.2', '4.2.1', '4.2.2', '4.3',\n        '4.3.1', '4.4', '4.4.1', '4.4.2', '4.4.3', '4.4.4', '5.0', '5.0.1', '5.0.2', '5.1', '5.1.1', '6.0', '6.0.1',\n        '7.0', '7.1', '7.1.1', '7.1.2', '8.0.0', '8.1.0', '9', '10', '11',\n    )\n\n    apple_devices = ('iPhone', 'iPad')\n\n    ios_versions = (\n        '3.1.3', '4.2.1', '5.1.1', '6.1.6', '7.1.2', '9.3.5', '9.3.6', '10.3.3', '10.3.4', '12.4.8', '14.2', '14.2.1',\n    )\n\n    def mac_processor(self):\n        \"\"\"Generate a MacOS processor token used in user agent strings.\"\"\"\n        return self.random_element(self.mac_processors)\n\n    def linux_processor(self):\n        \"\"\"Generate a Linux processor token used in user agent strings.\"\"\"\n        return self.random_element(self.linux_processors)\n\n    def user_agent(self):\n        \"\"\"Generate a random web browser user agent string.\"\"\"\n        name = self.random_element(self.user_agents)\n        return getattr(self, name)()\n\n    def chrome(self, version_from=13, version_to=63,\n               build_from=800, build_to=899):\n        \"\"\"Generate a Chrome web browser user agent string.\"\"\"\n        saf = f'{self.generator.random.randint(531, 536)}.{self.generator.random.randint(0, 2)}'\n        bld = self.lexify(self.numerify('##?###'), string.ascii_uppercase)\n        tmplt = '({0}) AppleWebKit/{1} (KHTML, like Gecko)' \\\n                ' Chrome/{2}.0.{3}.0 Safari/{4}'\n        tmplt_ios = '({0}) AppleWebKit/{1} (KHTML, like Gecko)' \\\n                    ' CriOS/{2}.0.{3}.0 Mobile/{4} Safari/{1}'\n        platforms = (\n            tmplt.format(self.linux_platform_token(),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt.format(self.windows_platform_token(),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt.format(self.mac_platform_token(),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt.format('Linux; {}'.format(self.android_platform_token()),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt_ios.format(self.ios_platform_token(),\n                             saf,\n                             self.generator.random.randint(version_from, version_to),\n                             self.generator.random.randint(build_from, build_to),\n                             bld),\n        )\n\n        return 'Mozilla/5.0 ' + self.random_element(platforms)\n\n    def firefox(self):\n        \"\"\"Generate a Mozilla Firefox web browser user agent string.\"\"\"\n        ver = (\n            (f'Gecko/{self.generator.date_time_between(datetime(2011, 1, 1))} '\n             f'Firefox/{self.generator.random.randint(4, 15)}.0'),\n            (f'Gecko/{self.generator.date_time_between(datetime(2010, 1, 1))} '\n             f'Firefox/3.6.{self.generator.random.randint(1, 20)}'),\n            f'Gecko/{self.generator.date_time_between(datetime(2010, 1, 1))} Firefox/3.8',\n        )\n        tmplt_win = '({0}; {1}; rv:1.9.{2}.20) {3}'\n        tmplt_lin = '({0}; rv:1.9.{1}.20) {2}'\n        tmplt_mac = '({0}; rv:1.9.{1}.20) {2}'\n        tmplt_and = '({0}; Mobile; rv:{1}.0) Gecko/{1}.0 Firefox/{1}.0'\n        tmplt_ios = '({0}) AppleWebKit/{1} (KHTML, like Gecko) FxiOS/{2}.{3}.0 Mobile/{4} Safari/{1}'\n        saf = '{}.{}'.format(self.generator.random.randint(531, 536),\n                             self.generator.random.randint(0, 2))\n        bld = self.lexify(self.numerify('##?###'), string.ascii_uppercase)\n        bld2 = self.lexify(self.numerify('#?####'), string.ascii_lowercase)\n        platforms = (\n            tmplt_win.format(self.windows_platform_token(),\n                             self.generator.locale().replace('_', '-'),\n                             self.generator.random.randint(0, 2),\n                             self.generator.random.choice(ver)),\n            tmplt_lin.format(self.linux_platform_token(),\n                             self.generator.random.randint(5, 7),\n                             self.generator.random.choice(ver)),\n            tmplt_mac.format(self.mac_platform_token(),\n                             self.generator.random.randint(2, 6),\n                             self.generator.random.choice(ver)),\n            tmplt_and.format(self.android_platform_token(),\n                             self.generator.random.randint(5, 68)),\n            tmplt_ios.format(self.ios_platform_token(),\n                             saf,\n                             self.generator.random.randint(9, 18),\n                             bld2,\n                             bld),\n        )\n\n        return 'Mozilla/5.0 ' + self.random_element(platforms)\n\n    def safari(self):\n        \"\"\"Generate a Safari web browser user agent string.\"\"\"\n        saf = (f'{self.generator.random.randint(531, 535)}.'\n               f'{self.generator.random.randint(1, 50)}.'\n               f'{self.generator.random.randint(1, 7)}')\n        if not self.generator.random.getrandbits(1):\n            ver = f'{self.generator.random.randint(4, 5)}.{self.generator.random.randint(0, 1)}'\n        else:\n            ver = f'{self.generator.random.randint(4, 5)}.0.{self.generator.random.randint(1, 5)}'\n        tmplt_win = '(Windows; U; {0}) AppleWebKit/{1} (KHTML, like Gecko)' \\\n                    ' Version/{2} Safari/{3}'\n        tmplt_mac = '({0} rv:{1}.0; {2}) AppleWebKit/{3} (KHTML, like Gecko)' \\\n                    ' Version/{4} Safari/{5}'\n        tmplt_ipod = '(iPod; U; CPU iPhone OS {0}_{1} like Mac OS X; {2})' \\\n                     ' AppleWebKit/{3} (KHTML, like Gecko) Version/{4}.0.5' \\\n                     ' Mobile/8B{5} Safari/6{6}'\n        locale = self.generator.locale().replace('_', '-')\n        platforms = (\n            tmplt_win.format(self.windows_platform_token(),\n                             saf,\n                             ver,\n                             saf),\n            tmplt_mac.format(self.mac_platform_token(),\n                             self.generator.random.randint(2, 6),\n                             locale,\n                             saf,\n                             ver,\n                             saf),\n            tmplt_ipod.format(self.generator.random.randint(3, 4),\n                              self.generator.random.randint(0, 3),\n                              locale,\n                              saf,\n                              self.generator.random.randint(3, 4),\n                              self.generator.random.randint(111, 119),\n                              saf),\n        )\n\n        return 'Mozilla/5.0 ' + self.random_element(platforms)\n\n    def opera(self):\n        \"\"\"Generate an Opera web browser user agent string.\"\"\"\n        token = self.linux_platform_token() if self.generator.random.getrandbits(1) else self.windows_platform_token()\n        locale = self.generator.locale().replace('_', '-')\n        platform = (f'({token}; {locale}) Presto/2.9.{self.generator.random.randint(160, 190)} '\n                    f'Version/{self.generator.random.randint(10, 12)}.00')\n        return f'Opera/{self.generator.random.randint(8, 9)}.{self.generator.random.randint(10, 99)}.{platform}'\n\n    def internet_explorer(self):\n        \"\"\"Generate an IE web browser user agent string.\"\"\"\n        return (f'Mozilla/5.0 (compatible; MSIE {self.generator.random.randint(5, 9)}.0; '\n                f'{self.windows_platform_token()}; '\n                f'Trident/{self.generator.random.randint(3, 5)}.{self.generator.random.randint(0, 1)})')\n\n    def windows_platform_token(self):\n        \"\"\"Generate a Windows platform token used in user agent strings.\"\"\"\n        return self.random_element(self.windows_platform_tokens)\n\n    def linux_platform_token(self):\n        \"\"\"Generate a Linux platform token used in user agent strings.\"\"\"\n        return f'X11; Linux {self.random_element(self.linux_processors)}'\n\n    def mac_platform_token(self):\n        \"\"\"Generate a MacOS platform token used in user agent strings.\"\"\"\n        return (f'Macintosh; {self.random_element(self.mac_processors)} Mac OS X 10 '\n                f'{self.generator.random.randint(5, 12)}_{self.generator.random.randint(0, 9)}')\n\n    def android_platform_token(self):\n        \"\"\"Generate an Android platform token used in user agent strings.\"\"\"\n        return f'Android {self.random_element(self.android_versions)}'\n\n    def ios_platform_token(self):\n        \"\"\"Generate an iOS platform token used in user agent strings.\"\"\"\n        apple_device = self.random_element(self.apple_devices)\n        return (f'{apple_device}; CPU {apple_device} '\n                f'OS {self.random_element(self.ios_versions).replace(\".\", \"_\")} like Mac OS X')\n", "path": "faker/providers/user_agent/__init__.py"}], "after_files": [{"content": "import string\n\nfrom datetime import datetime\n\nfrom .. import BaseProvider\n\n\nclass Provider(BaseProvider):\n    \"\"\"Implement default user agent provider for Faker.\"\"\"\n\n    user_agents = (\n        'chrome', 'firefox', 'internet_explorer', 'opera', 'safari',\n    )\n\n    windows_platform_tokens = (\n        'Windows 95', 'Windows 98', 'Windows 98; Win 9x 4.90', 'Windows CE',\n        'Windows NT 4.0', 'Windows NT 5.0', 'Windows NT 5.01',\n        'Windows NT 5.1', 'Windows NT 5.2', 'Windows NT 6.0', 'Windows NT 6.1',\n        'Windows NT 6.2', 'Windows NT 10.0',\n    )\n\n    linux_processors = ('i686', 'x86_64')\n\n    mac_processors = ('Intel', 'PPC', 'U; Intel', 'U; PPC')\n\n    android_versions = (\n        '1.0', '1.1', '1.5', '1.6', '2.0', '2.0.1', '2.1', '2.2', '2.2.1', '2.2.2', '2.2.3', '2.3', '2.3.1', '2.3.2',\n        '2.3.3', '2.3.4', '2.3.5', '2.3.6', '2.3.7', '3.0', '3.1', '3.2', '3.2.1', '3.2.2', '3.2.3', '3.2.4', '3.2.5',\n        '3.2.6', '4.0', '4.0.1', '4.0.2', '4.0.3', '4.0.4', '4.1', '4.1.1', '4.1.2', '4.2', '4.2.1', '4.2.2', '4.3',\n        '4.3.1', '4.4', '4.4.1', '4.4.2', '4.4.3', '4.4.4', '5.0', '5.0.1', '5.0.2', '5.1', '5.1.1', '6.0', '6.0.1',\n        '7.0', '7.1', '7.1.1', '7.1.2', '8.0.0', '8.1.0', '9', '10', '11',\n    )\n\n    apple_devices = ('iPhone', 'iPad')\n\n    ios_versions = (\n        '3.1.3', '4.2.1', '5.1.1', '6.1.6', '7.1.2', '9.3.5', '9.3.6', '10.3.3', '10.3.4', '12.4.8', '14.2', '14.2.1',\n    )\n\n    def mac_processor(self):\n        \"\"\"Generate a MacOS processor token used in user agent strings.\"\"\"\n        return self.random_element(self.mac_processors)\n\n    def linux_processor(self):\n        \"\"\"Generate a Linux processor token used in user agent strings.\"\"\"\n        return self.random_element(self.linux_processors)\n\n    def user_agent(self):\n        \"\"\"Generate a random web browser user agent string.\"\"\"\n        name = self.random_element(self.user_agents)\n        return getattr(self, name)()\n\n    def chrome(self, version_from=13, version_to=63,\n               build_from=800, build_to=899):\n        \"\"\"Generate a Chrome web browser user agent string.\"\"\"\n        saf = f'{self.generator.random.randint(531, 536)}.{self.generator.random.randint(0, 2)}'\n        bld = self.lexify(self.numerify('##?###'), string.ascii_uppercase)\n        tmplt = '({0}) AppleWebKit/{1} (KHTML, like Gecko)' \\\n                ' Chrome/{2}.0.{3}.0 Safari/{4}'\n        tmplt_ios = '({0}) AppleWebKit/{1} (KHTML, like Gecko)' \\\n                    ' CriOS/{2}.0.{3}.0 Mobile/{4} Safari/{1}'\n        platforms = (\n            tmplt.format(self.linux_platform_token(),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt.format(self.windows_platform_token(),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt.format(self.mac_platform_token(),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt.format('Linux; {}'.format(self.android_platform_token()),\n                         saf,\n                         self.generator.random.randint(version_from, version_to),\n                         self.generator.random.randint(build_from, build_to),\n                         saf),\n            tmplt_ios.format(self.ios_platform_token(),\n                             saf,\n                             self.generator.random.randint(version_from, version_to),\n                             self.generator.random.randint(build_from, build_to),\n                             bld),\n        )\n\n        return 'Mozilla/5.0 ' + self.random_element(platforms)\n\n    def firefox(self):\n        \"\"\"Generate a Mozilla Firefox web browser user agent string.\"\"\"\n        ver = (\n            (f'Gecko/{self.generator.date_time_between(datetime(2011, 1, 1))} '\n             f'Firefox/{self.generator.random.randint(4, 15)}.0'),\n            (f'Gecko/{self.generator.date_time_between(datetime(2010, 1, 1))} '\n             f'Firefox/3.6.{self.generator.random.randint(1, 20)}'),\n            f'Gecko/{self.generator.date_time_between(datetime(2010, 1, 1))} Firefox/3.8',\n        )\n        tmplt_win = '({0}; {1}; rv:1.9.{2}.20) {3}'\n        tmplt_lin = '({0}; rv:1.9.{1}.20) {2}'\n        tmplt_mac = '({0}; rv:1.9.{1}.20) {2}'\n        tmplt_and = '({0}; Mobile; rv:{1}.0) Gecko/{1}.0 Firefox/{1}.0'\n        tmplt_ios = '({0}) AppleWebKit/{1} (KHTML, like Gecko) FxiOS/{2}.{3}.0 Mobile/{4} Safari/{1}'\n        saf = '{}.{}'.format(self.generator.random.randint(531, 536),\n                             self.generator.random.randint(0, 2))\n        bld = self.lexify(self.numerify('##?###'), string.ascii_uppercase)\n        bld2 = self.lexify(self.numerify('#?####'), string.ascii_lowercase)\n        platforms = (\n            tmplt_win.format(self.windows_platform_token(),\n                             self.generator.locale().replace('_', '-'),\n                             self.generator.random.randint(0, 2),\n                             self.generator.random.choice(ver)),\n            tmplt_lin.format(self.linux_platform_token(),\n                             self.generator.random.randint(5, 7),\n                             self.generator.random.choice(ver)),\n            tmplt_mac.format(self.mac_platform_token(),\n                             self.generator.random.randint(2, 6),\n                             self.generator.random.choice(ver)),\n            tmplt_and.format(self.android_platform_token(),\n                             self.generator.random.randint(5, 68)),\n            tmplt_ios.format(self.ios_platform_token(),\n                             saf,\n                             self.generator.random.randint(9, 18),\n                             bld2,\n                             bld),\n        )\n\n        return 'Mozilla/5.0 ' + self.random_element(platforms)\n\n    def safari(self):\n        \"\"\"Generate a Safari web browser user agent string.\"\"\"\n        saf = (f'{self.generator.random.randint(531, 535)}.'\n               f'{self.generator.random.randint(1, 50)}.'\n               f'{self.generator.random.randint(1, 7)}')\n        if not self.generator.random.getrandbits(1):\n            ver = f'{self.generator.random.randint(4, 5)}.{self.generator.random.randint(0, 1)}'\n        else:\n            ver = f'{self.generator.random.randint(4, 5)}.0.{self.generator.random.randint(1, 5)}'\n        tmplt_win = '(Windows; U; {0}) AppleWebKit/{1} (KHTML, like Gecko)' \\\n                    ' Version/{2} Safari/{3}'\n        tmplt_mac = '({0} rv:{1}.0; {2}) AppleWebKit/{3} (KHTML, like Gecko)' \\\n                    ' Version/{4} Safari/{5}'\n        tmplt_ipod = '(iPod; U; CPU iPhone OS {0}_{1} like Mac OS X; {2})' \\\n                     ' AppleWebKit/{3} (KHTML, like Gecko) Version/{4}.0.5' \\\n                     ' Mobile/8B{5} Safari/6{6}'\n        locale = self.generator.locale().replace('_', '-')\n        platforms = (\n            tmplt_win.format(self.windows_platform_token(),\n                             saf,\n                             ver,\n                             saf),\n            tmplt_mac.format(self.mac_platform_token(),\n                             self.generator.random.randint(2, 6),\n                             locale,\n                             saf,\n                             ver,\n                             saf),\n            tmplt_ipod.format(self.generator.random.randint(3, 4),\n                              self.generator.random.randint(0, 3),\n                              locale,\n                              saf,\n                              self.generator.random.randint(3, 4),\n                              self.generator.random.randint(111, 119),\n                              saf),\n        )\n\n        return 'Mozilla/5.0 ' + self.random_element(platforms)\n\n    def opera(self):\n        \"\"\"Generate an Opera web browser user agent string.\"\"\"\n        token = self.linux_platform_token() if self.generator.random.getrandbits(1) else self.windows_platform_token()\n        locale = self.generator.locale().replace('_', '-')\n        platform = (f'({token}; {locale}) Presto/2.9.{self.generator.random.randint(160, 190)} '\n                    f'Version/{self.generator.random.randint(10, 12)}.00')\n        return f'Opera/{self.generator.random.randint(8, 9)}.{self.generator.random.randint(10, 99)}.{platform}'\n\n    def internet_explorer(self):\n        \"\"\"Generate an IE web browser user agent string.\"\"\"\n        return (f'Mozilla/5.0 (compatible; MSIE {self.generator.random.randint(5, 9)}.0; '\n                f'{self.windows_platform_token()}; '\n                f'Trident/{self.generator.random.randint(3, 5)}.{self.generator.random.randint(0, 1)})')\n\n    def windows_platform_token(self):\n        \"\"\"Generate a Windows platform token used in user agent strings.\"\"\"\n        return self.random_element(self.windows_platform_tokens)\n\n    def linux_platform_token(self):\n        \"\"\"Generate a Linux platform token used in user agent strings.\"\"\"\n        return f'X11; Linux {self.random_element(self.linux_processors)}'\n\n    def mac_platform_token(self):\n        \"\"\"Generate a MacOS platform token used in user agent strings.\"\"\"\n        return (f'Macintosh; {self.random_element(self.mac_processors)} Mac OS X 10_'\n                f'{self.generator.random.randint(5, 12)}_{self.generator.random.randint(0, 9)}')\n\n    def android_platform_token(self):\n        \"\"\"Generate an Android platform token used in user agent strings.\"\"\"\n        return f'Android {self.random_element(self.android_versions)}'\n\n    def ios_platform_token(self):\n        \"\"\"Generate an iOS platform token used in user agent strings.\"\"\"\n        apple_device = self.random_element(self.apple_devices)\n        return (f'{apple_device}; CPU {apple_device} '\n                f'OS {self.random_element(self.ios_versions).replace(\".\", \"_\")} like Mac OS X')\n", "path": "faker/providers/user_agent/__init__.py"}]}