We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
IOError: [Errno 25] Inappropriate ioctl for device
Running in a docker container based on the DockerFile:

```
Traceback (most recent call last):
  File "/usr/src/app/pokecli.py", line 530, in <module>
    main()
  File "/usr/src/app/pokecli.py", line 96, in main
    bot.tick()
  File "/usr/src/app/pokemongo_bot/__init__.py", line 472, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "/usr/src/app/pokemongo_bot/cell_workers/catch_visible_pokemon.py", line 45, in work
    'expiration_timestamp_ms': pokemon['expiration_timestamp_ms'],
  File "/usr/src/app/pokemongo_bot/base_task.py", line 28, in emit_event
    data=data
  File "/usr/src/app/pokemongo_bot/event_manager.py", line 65, in emit
    handler.handle_event(event, sender, level, formatted_msg, data)
  File "/usr/src/app/pokemongo_bot/event_handlers/colored_logging_handler.py", line 130, in handle_event
    terminal_width = self._terminal_width()
  File "/usr/src/app/pokemongo_bot/event_handlers/colored_logging_handler.py", line 171, in _terminal_width
    struct.pack(str('HHHH'), 0, 0, 0, 0)))
IOError: [Errno 25] Inappropriate ioctl for device
```

Git Commit: 9ae1b785f0836d8769d011626d2bc071ed338bff

This happens after encountering a pokemon.
Looks like it is now having a problem printing colors to the screen.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pokemongo_bot/event_handlers/colored_logging_handler.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3 import time
4 import sys
5 import struct
6 
7 from pokemongo_bot.event_manager import EventHandler
8 
9 class ColoredLoggingHandler(EventHandler):
10     EVENT_COLOR_MAP = {
11         'api_error':                        'red',
12         'bot_exit':                         'red',
13         'bot_start':                        'green',
14         'config_error':                     'red',
15         'egg_already_incubating':           'yellow',
16         'egg_hatched':                      'green',
17         'future_pokemon_release':           'yellow',
18         'incubate':                         'green',
19         'incubator_already_used':           'yellow',
20         'inventory_full':                   'yellow',
21         'item_discard_fail':                'red',
22         'item_discarded':                   'green',
23         'keep_best_release':                'green',
24         'level_up':                         'green',
25         'level_up_reward':                  'green',
26         'location_cache_error':             'yellow',
27         'location_cache_ignored':           'yellow',
28         'login_failed':                     'red',
29         'login_successful':                 'green',
30         'lucky_egg_error':                  'red',
31         'move_to_map_pokemon_encounter':    'green',
32         'move_to_map_pokemon_fail':         'red',
33         'next_egg_incubates':               'yellow',
34         'next_sleep':                       'green',
35         'no_pokeballs':                     'red',
36         'pokemon_appeared':                 'yellow',
37         'pokemon_capture_failed':           'red',
38         'pokemon_caught':                   'blue',
39         'pokemon_evolved':                  'green',
40         'pokemon_fled':                     'red',
41         'pokemon_inventory_full':           'red',
42         'pokemon_nickname_invalid':         'red',
43         'pokemon_not_in_range':             'yellow',
44         'pokemon_release':                  'green',
45         'pokemon_vanished':                 'red',
46         'pokestop_empty':                   'yellow',
47         'pokestop_searching_too_often':     'yellow',
48         'rename_pokemon':                   'green',
49         'skip_evolve':                      'yellow',
50         'softban':                          'red',
51         'spun_pokestop':                    'cyan',
52         'threw_berry_failed':               'red',
53         'unknown_spin_result':              'red',
54         'unset_pokemon_nickname':           'red',
55         'vip_pokemon':                      'red',
56 
57         # event names for 'white' still here to remember that these events are already determined its color.
58         'arrived_at_cluster':                   'white',
59         'arrived_at_fort':                      'white',
60         'bot_sleep':                            'white',
61         'catchable_pokemon':                    'white',
62         'found_cluster':                        'white',
63         'incubate_try':                         'white',
64         'load_cached_location':                 'white',
65         'location_found':                       'white',
66         'login_started':                        'white',
67         'lured_pokemon_found':                  'white',
68         'move_to_map_pokemon_move_towards':     'white',
69         'move_to_map_pokemon_teleport_back':    'white',
70         'move_to_map_pokemon_updated_map':      'white',
71         'moving_to_fort':                       'white',
72         'moving_to_lured_fort':                 'white',
73         'pokemon_catch_rate':                   'white',
74         'pokemon_evolve_fail':                  'white',
75         'pokestop_on_cooldown':                 'white',
76         'pokestop_out_of_range':                'white',
77         'polyline_request':                     'white',
78         'position_update':                      'white',
79         'set_start_location':                   'white',
80         'softban_fix':                          'white',
81         'softban_fix_done':                     'white',
82         'spun_fort':                            'white',
83         'threw_berry':                          'white',
84         'threw_pokeball':                       'white',
85         'used_lucky_egg':                       'white'
86     }
87     CONTINUOUS_EVENT_NAMES = [
88         'catchable_pokemon',
89         'moving_to_lured_fort',
90         'spun_fort'
91     ]
92     COLOR_CODE = {
93         'red':      '91',
94         'green':    '92',
95         'yellow':   '93',
96         'blue':     '94',
97         'cyan':     '96'
98     }
99 
100     def __init__(self):
101         self._last_event = None
102         try:
103             # this `try ... except` is for ImportError on Windows
104             import fcntl
105             import termios
106             self._ioctl = fcntl.ioctl
107             self._TIOCGWINSZ = termios.TIOCGWINSZ
108         except ImportError:
109             self._ioctl = None
110             self._TIOCGWINSZ = None
111 
112     def handle_event(self, event, sender, level, formatted_msg, data):
113         # Prepare message string
114         message = None
115         if formatted_msg:
116             try:
117                 message = formatted_msg.decode('utf-8')
118             except UnicodeEncodeError:
119                 message = formatted_msg
120         else:
121             message = '{}'.format(str(data))
122 
123         # Replace message if necessary
124         if event == 'catchable_pokemon':
125             message = 'Something rustles nearby!'
126 
127         # Truncate previous line if same event continues
128         if event in ColoredLoggingHandler.CONTINUOUS_EVENT_NAMES and self._last_event == event:
129             # Filling with "' ' * terminal_width" in order to completely clear last line
130             terminal_width = self._terminal_width()
131             if terminal_width:
132                 sys.stdout.write('\r{}\r'.format(' ' * terminal_width))
133             else:
134                 sys.stdout.write('\r')
135         else:
136             sys.stdout.write("\n")
137 
138         color_name = None
139         if event in ColoredLoggingHandler.EVENT_COLOR_MAP:
140             color_name = ColoredLoggingHandler.EVENT_COLOR_MAP[event]
141 
142         # Change color if necessary
143         if event == 'egg_hatched' and data.get('pokemon', 'error') == 'error':
144             # `egg_hatched` event will be dispatched in both cases: hatched pokemon info is successfully taken or not.
145             # change color from 'green' to 'red' in case of error.
146             color_name = 'red'
147 
148         if color_name in ColoredLoggingHandler.COLOR_CODE:
149             sys.stdout.write(
150                 '[{time}] \033[{color}m{message}\033[0m'.format(
151                     time=time.strftime("%H:%M:%S"),
152                     color=ColoredLoggingHandler.COLOR_CODE[color_name],
153                     message=message
154                 )
155             )
156         else:
157             sys.stdout.write('[{time}] {message}'.format(
158                 time=time.strftime("%H:%M:%S"),
159                 message=message
160             ))
161 
162         sys.stdout.flush()
163         self._last_event = event
164 
165     def _terminal_width(self):
166         if self._ioctl is None or self._TIOCGWINSZ is None:
167             return None
168 
169         h, w, hp, wp = struct.unpack(str('HHHH'),
170             self._ioctl(0, self._TIOCGWINSZ,
171             struct.pack(str('HHHH'), 0, 0, 0, 0)))
172         return w
173
```
--- 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/pokemongo_bot/event_handlers/colored_logging_handler.py b/pokemongo_bot/event_handlers/colored_logging_handler.py
--- a/pokemongo_bot/event_handlers/colored_logging_handler.py
+++ b/pokemongo_bot/event_handlers/colored_logging_handler.py
@@ -125,7 +125,7 @@
             message = 'Something rustles nearby!'
 
         # Truncate previous line if same event continues
-        if event in ColoredLoggingHandler.CONTINUOUS_EVENT_NAMES and self._last_event == event:
+        if event in ColoredLoggingHandler.CONTINUOUS_EVENT_NAMES and self._last_event == event and sys.stdout.isatty():
             # Filling with "' ' * terminal_width" in order to completely clear last line
             terminal_width = self._terminal_width()
             if terminal_width:

{"golden_diff": "diff --git a/pokemongo_bot/event_handlers/colored_logging_handler.py b/pokemongo_bot/event_handlers/colored_logging_handler.py\n--- a/pokemongo_bot/event_handlers/colored_logging_handler.py\n+++ b/pokemongo_bot/event_handlers/colored_logging_handler.py\n@@ -125,7 +125,7 @@\n             message = 'Something rustles nearby!'\n \n         # Truncate previous line if same event continues\n-        if event in ColoredLoggingHandler.CONTINUOUS_EVENT_NAMES and self._last_event == event:\n+        if event in ColoredLoggingHandler.CONTINUOUS_EVENT_NAMES and self._last_event == event and sys.stdout.isatty():\n             # Filling with \"' ' * terminal_width\" in order to completely clear last line\n             terminal_width = self._terminal_width()\n             if terminal_width:\n", "issue": "IOError: [Errno 25] Inappropriate ioctl for device\nRunning in a docker container based on the DockerFile:\n\n```\nTraceback (most recent call last):\n  File \"/usr/src/app/pokecli.py\", line 530, in <module>\n    main()\n  File \"/usr/src/app/pokecli.py\", line 96, in main\n    bot.tick()\n  File \"/usr/src/app/pokemongo_bot/__init__.py\", line 472, in tick\n    if worker.work() == WorkerResult.RUNNING:\n  File \"/usr/src/app/pokemongo_bot/cell_workers/catch_visible_pokemon.py\", line 45, in work\n    'expiration_timestamp_ms': pokemon['expiration_timestamp_ms'],\n  File \"/usr/src/app/pokemongo_bot/base_task.py\", line 28, in emit_event\n    data=data\n  File \"/usr/src/app/pokemongo_bot/event_manager.py\", line 65, in emit\n    handler.handle_event(event, sender, level, formatted_msg, data)\n  File \"/usr/src/app/pokemongo_bot/event_handlers/colored_logging_handler.py\", line 130, in handle_event\n    terminal_width = self._terminal_width()\n  File \"/usr/src/app/pokemongo_bot/event_handlers/colored_logging_handler.py\", line 171, in _terminal_width\n    struct.pack(str('HHHH'), 0, 0, 0, 0)))\nIOError: [Errno 25] Inappropriate ioctl for device\n```\n\nGit Commit: 9ae1b785f0836d8769d011626d2bc071ed338bff\n\nThis happens after encountering a pokemon.\nLooks like it is now having a problem printing colors to the screen.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport time\nimport sys\nimport struct\n\nfrom pokemongo_bot.event_manager import EventHandler\n\nclass ColoredLoggingHandler(EventHandler):\n    EVENT_COLOR_MAP = {\n        'api_error':                        'red',\n        'bot_exit':                         'red',\n        'bot_start':                        'green',\n        'config_error':                     'red',\n        'egg_already_incubating':           'yellow',\n        'egg_hatched':                      'green',\n        'future_pokemon_release':           'yellow',\n        'incubate':                         'green',\n        'incubator_already_used':           'yellow',\n        'inventory_full':                   'yellow',\n        'item_discard_fail':                'red',\n        'item_discarded':                   'green',\n        'keep_best_release':                'green',\n        'level_up':                         'green',\n        'level_up_reward':                  'green',\n        'location_cache_error':             'yellow',\n        'location_cache_ignored':           'yellow',\n        'login_failed':                     'red',\n        'login_successful':                 'green',\n        'lucky_egg_error':                  'red',\n        'move_to_map_pokemon_encounter':    'green',\n        'move_to_map_pokemon_fail':         'red',\n        'next_egg_incubates':               'yellow',\n        'next_sleep':                       'green',\n        'no_pokeballs':                     'red',\n        'pokemon_appeared':                 'yellow',\n        'pokemon_capture_failed':           'red',\n        'pokemon_caught':                   'blue',\n        'pokemon_evolved':                  'green',\n        'pokemon_fled':                     'red',\n        'pokemon_inventory_full':           'red',\n        'pokemon_nickname_invalid':         'red',\n        'pokemon_not_in_range':             'yellow',\n        'pokemon_release':                  'green',\n        'pokemon_vanished':                 'red',\n        'pokestop_empty':                   'yellow',\n        'pokestop_searching_too_often':     'yellow',\n        'rename_pokemon':                   'green',\n        'skip_evolve':                      'yellow',\n        'softban':                          'red',\n        'spun_pokestop':                    'cyan',\n        'threw_berry_failed':               'red',\n        'unknown_spin_result':              'red',\n        'unset_pokemon_nickname':           'red',\n        'vip_pokemon':                      'red',\n\n        # event names for 'white' still here to remember that these events are already determined its color.\n        'arrived_at_cluster':                   'white',\n        'arrived_at_fort':                      'white',\n        'bot_sleep':                            'white',\n        'catchable_pokemon':                    'white',\n        'found_cluster':                        'white',\n        'incubate_try':                         'white',\n        'load_cached_location':                 'white',\n        'location_found':                       'white',\n        'login_started':                        'white',\n        'lured_pokemon_found':                  'white',\n        'move_to_map_pokemon_move_towards':     'white',\n        'move_to_map_pokemon_teleport_back':    'white',\n        'move_to_map_pokemon_updated_map':      'white',\n        'moving_to_fort':                       'white',\n        'moving_to_lured_fort':                 'white',\n        'pokemon_catch_rate':                   'white',\n        'pokemon_evolve_fail':                  'white',\n        'pokestop_on_cooldown':                 'white',\n        'pokestop_out_of_range':                'white',\n        'polyline_request':                     'white',\n        'position_update':                      'white',\n        'set_start_location':                   'white',\n        'softban_fix':                          'white',\n        'softban_fix_done':                     'white',\n        'spun_fort':                            'white',\n        'threw_berry':                          'white',\n        'threw_pokeball':                       'white',\n        'used_lucky_egg':                       'white'\n    }\n    CONTINUOUS_EVENT_NAMES = [\n        'catchable_pokemon',\n        'moving_to_lured_fort',\n        'spun_fort'\n    ]\n    COLOR_CODE = {\n        'red':      '91',\n        'green':    '92',\n        'yellow':   '93',\n        'blue':     '94',\n        'cyan':     '96'\n    }\n\n    def __init__(self):\n        self._last_event = None\n        try:\n            # this `try ... except` is for ImportError on Windows\n            import fcntl\n            import termios\n            self._ioctl = fcntl.ioctl\n            self._TIOCGWINSZ = termios.TIOCGWINSZ\n        except ImportError:\n            self._ioctl = None\n            self._TIOCGWINSZ = None\n\n    def handle_event(self, event, sender, level, formatted_msg, data):\n        # Prepare message string\n        message = None\n        if formatted_msg:\n            try:\n                message = formatted_msg.decode('utf-8')\n            except UnicodeEncodeError:\n                message = formatted_msg\n        else:\n            message = '{}'.format(str(data))\n\n        # Replace message if necessary\n        if event == 'catchable_pokemon':\n            message = 'Something rustles nearby!'\n\n        # Truncate previous line if same event continues\n        if event in ColoredLoggingHandler.CONTINUOUS_EVENT_NAMES and self._last_event == event:\n            # Filling with \"' ' * terminal_width\" in order to completely clear last line\n            terminal_width = self._terminal_width()\n            if terminal_width:\n                sys.stdout.write('\\r{}\\r'.format(' ' * terminal_width))\n            else:\n                sys.stdout.write('\\r')\n        else:\n            sys.stdout.write(\"\\n\")\n\n        color_name = None\n        if event in ColoredLoggingHandler.EVENT_COLOR_MAP:\n            color_name = ColoredLoggingHandler.EVENT_COLOR_MAP[event]\n\n        # Change color if necessary\n        if event == 'egg_hatched' and data.get('pokemon', 'error') == 'error':\n            # `egg_hatched` event will be dispatched in both cases: hatched pokemon info is successfully taken or not.\n            # change color from 'green' to 'red' in case of error.\n            color_name = 'red'\n\n        if color_name in ColoredLoggingHandler.COLOR_CODE:\n            sys.stdout.write(\n                '[{time}] \\033[{color}m{message}\\033[0m'.format(\n                    time=time.strftime(\"%H:%M:%S\"),\n                    color=ColoredLoggingHandler.COLOR_CODE[color_name],\n                    message=message\n                )\n            )\n        else:\n            sys.stdout.write('[{time}] {message}'.format(\n                time=time.strftime(\"%H:%M:%S\"),\n                message=message\n            ))\n\n        sys.stdout.flush()\n        self._last_event = event\n\n    def _terminal_width(self):\n        if self._ioctl is None or self._TIOCGWINSZ is None:\n            return None\n\n        h, w, hp, wp = struct.unpack(str('HHHH'),\n            self._ioctl(0, self._TIOCGWINSZ,\n            struct.pack(str('HHHH'), 0, 0, 0, 0)))\n        return w\n", "path": "pokemongo_bot/event_handlers/colored_logging_handler.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport time\nimport sys\nimport struct\n\nfrom pokemongo_bot.event_manager import EventHandler\n\nclass ColoredLoggingHandler(EventHandler):\n    EVENT_COLOR_MAP = {\n        'api_error':                        'red',\n        'bot_exit':                         'red',\n        'bot_start':                        'green',\n        'config_error':                     'red',\n        'egg_already_incubating':           'yellow',\n        'egg_hatched':                      'green',\n        'future_pokemon_release':           'yellow',\n        'incubate':                         'green',\n        'incubator_already_used':           'yellow',\n        'inventory_full':                   'yellow',\n        'item_discard_fail':                'red',\n        'item_discarded':                   'green',\n        'keep_best_release':                'green',\n        'level_up':                         'green',\n        'level_up_reward':                  'green',\n        'location_cache_error':             'yellow',\n        'location_cache_ignored':           'yellow',\n        'login_failed':                     'red',\n        'login_successful':                 'green',\n        'lucky_egg_error':                  'red',\n        'move_to_map_pokemon_encounter':    'green',\n        'move_to_map_pokemon_fail':         'red',\n        'next_egg_incubates':               'yellow',\n        'next_sleep':                       'green',\n        'no_pokeballs':                     'red',\n        'pokemon_appeared':                 'yellow',\n        'pokemon_capture_failed':           'red',\n        'pokemon_caught':                   'blue',\n        'pokemon_evolved':                  'green',\n        'pokemon_fled':                     'red',\n        'pokemon_inventory_full':           'red',\n        'pokemon_nickname_invalid':         'red',\n        'pokemon_not_in_range':             'yellow',\n        'pokemon_release':                  'green',\n        'pokemon_vanished':                 'red',\n        'pokestop_empty':                   'yellow',\n        'pokestop_searching_too_often':     'yellow',\n        'rename_pokemon':                   'green',\n        'skip_evolve':                      'yellow',\n        'softban':                          'red',\n        'spun_pokestop':                    'cyan',\n        'threw_berry_failed':               'red',\n        'unknown_spin_result':              'red',\n        'unset_pokemon_nickname':           'red',\n        'vip_pokemon':                      'red',\n\n        # event names for 'white' still here to remember that these events are already determined its color.\n        'arrived_at_cluster':                   'white',\n        'arrived_at_fort':                      'white',\n        'bot_sleep':                            'white',\n        'catchable_pokemon':                    'white',\n        'found_cluster':                        'white',\n        'incubate_try':                         'white',\n        'load_cached_location':                 'white',\n        'location_found':                       'white',\n        'login_started':                        'white',\n        'lured_pokemon_found':                  'white',\n        'move_to_map_pokemon_move_towards':     'white',\n        'move_to_map_pokemon_teleport_back':    'white',\n        'move_to_map_pokemon_updated_map':      'white',\n        'moving_to_fort':                       'white',\n        'moving_to_lured_fort':                 'white',\n        'pokemon_catch_rate':                   'white',\n        'pokemon_evolve_fail':                  'white',\n        'pokestop_on_cooldown':                 'white',\n        'pokestop_out_of_range':                'white',\n        'polyline_request':                     'white',\n        'position_update':                      'white',\n        'set_start_location':                   'white',\n        'softban_fix':                          'white',\n        'softban_fix_done':                     'white',\n        'spun_fort':                            'white',\n        'threw_berry':                          'white',\n        'threw_pokeball':                       'white',\n        'used_lucky_egg':                       'white'\n    }\n    CONTINUOUS_EVENT_NAMES = [\n        'catchable_pokemon',\n        'moving_to_lured_fort',\n        'spun_fort'\n    ]\n    COLOR_CODE = {\n        'red':      '91',\n        'green':    '92',\n        'yellow':   '93',\n        'blue':     '94',\n        'cyan':     '96'\n    }\n\n    def __init__(self):\n        self._last_event = None\n        try:\n            # this `try ... except` is for ImportError on Windows\n            import fcntl\n            import termios\n            self._ioctl = fcntl.ioctl\n            self._TIOCGWINSZ = termios.TIOCGWINSZ\n        except ImportError:\n            self._ioctl = None\n            self._TIOCGWINSZ = None\n\n    def handle_event(self, event, sender, level, formatted_msg, data):\n        # Prepare message string\n        message = None\n        if formatted_msg:\n            try:\n                message = formatted_msg.decode('utf-8')\n            except UnicodeEncodeError:\n                message = formatted_msg\n        else:\n            message = '{}'.format(str(data))\n\n        # Replace message if necessary\n        if event == 'catchable_pokemon':\n            message = 'Something rustles nearby!'\n\n        # Truncate previous line if same event continues\n        if event in ColoredLoggingHandler.CONTINUOUS_EVENT_NAMES and self._last_event == event and sys.stdout.isatty():\n            # Filling with \"' ' * terminal_width\" in order to completely clear last line\n            terminal_width = self._terminal_width()\n            if terminal_width:\n                sys.stdout.write('\\r{}\\r'.format(' ' * terminal_width))\n            else:\n                sys.stdout.write('\\r')\n        else:\n            sys.stdout.write(\"\\n\")\n\n        color_name = None\n        if event in ColoredLoggingHandler.EVENT_COLOR_MAP:\n            color_name = ColoredLoggingHandler.EVENT_COLOR_MAP[event]\n\n        # Change color if necessary\n        if event == 'egg_hatched' and data.get('pokemon', 'error') == 'error':\n            # `egg_hatched` event will be dispatched in both cases: hatched pokemon info is successfully taken or not.\n            # change color from 'green' to 'red' in case of error.\n            color_name = 'red'\n\n        if color_name in ColoredLoggingHandler.COLOR_CODE:\n            sys.stdout.write(\n                '[{time}] \\033[{color}m{message}\\033[0m'.format(\n                    time=time.strftime(\"%H:%M:%S\"),\n                    color=ColoredLoggingHandler.COLOR_CODE[color_name],\n                    message=message\n                )\n            )\n        else:\n            sys.stdout.write('[{time}] {message}'.format(\n                time=time.strftime(\"%H:%M:%S\"),\n                message=message\n            ))\n\n        sys.stdout.flush()\n        self._last_event = event\n\n    def _terminal_width(self):\n        if self._ioctl is None or self._TIOCGWINSZ is None:\n            return None\n\n        h, w, hp, wp = struct.unpack(str('HHHH'),\n            self._ioctl(0, self._TIOCGWINSZ,\n            struct.pack(str('HHHH'), 0, 0, 0, 0)))\n        return w\n", "path": "pokemongo_bot/event_handlers/colored_logging_handler.py"}]}