We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
remove usage of backports.shutil_get_terminal_size
This is for pre-3.3 Python.

Pretty easy it should only require deleting lines. 
Maybe a few need to be dedented.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `IPython/utils/terminal.py`
Content:
```
1 # encoding: utf-8
2 """
3 Utilities for working with terminals.
4 
5 Authors:
6 
7 * Brian E. Granger
8 * Fernando Perez
9 * Alexander Belchenko (e-mail: bialix AT ukr.net)
10 """
11 
12 # Copyright (c) IPython Development Team.
13 # Distributed under the terms of the Modified BSD License.
14 
15 import os
16 import sys
17 import warnings
18 try:
19     from shutil import get_terminal_size as _get_terminal_size
20 except ImportError:
21     # use backport on Python 2
22     from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size
23 
24 from . import py3compat
25 
26 #-----------------------------------------------------------------------------
27 # Code
28 #-----------------------------------------------------------------------------
29 
30 # This variable is part of the expected API of the module:
31 ignore_termtitle = True
32 
33 
34 
35 if os.name == 'posix':
36     def _term_clear():
37         os.system('clear')
38 elif sys.platform == 'win32':
39     def _term_clear():
40         os.system('cls')
41 else:
42     def _term_clear():
43         pass
44 
45 
46 
47 def toggle_set_term_title(val):
48     """Control whether set_term_title is active or not.
49 
50     set_term_title() allows writing to the console titlebar.  In embedded
51     widgets this can cause problems, so this call can be used to toggle it on
52     or off as needed.
53 
54     The default state of the module is for the function to be disabled.
55 
56     Parameters
57     ----------
58       val : bool
59         If True, set_term_title() actually writes to the terminal (using the
60         appropriate platform-specific module).  If False, it is a no-op.
61     """
62     global ignore_termtitle
63     ignore_termtitle = not(val)
64 
65 
66 def _set_term_title(*args,**kw):
67     """Dummy no-op."""
68     pass
69 
70 
71 def _set_term_title_xterm(title):
72     """ Change virtual terminal title in xterm-workalikes """
73     sys.stdout.write('\033]0;%s\007' % title)
74 
75 if os.name == 'posix':
76     TERM = os.environ.get('TERM','')
77     if TERM.startswith('xterm'):
78         _set_term_title = _set_term_title_xterm
79 elif sys.platform == 'win32':
80     try:
81         import ctypes
82 
83         SetConsoleTitleW = ctypes.windll.kernel32.SetConsoleTitleW
84         SetConsoleTitleW.argtypes = [ctypes.c_wchar_p]
85     
86         def _set_term_title(title):
87             """Set terminal title using ctypes to access the Win32 APIs."""
88             SetConsoleTitleW(title)
89     except ImportError:
90         def _set_term_title(title):
91             """Set terminal title using the 'title' command."""
92             global ignore_termtitle
93 
94             try:
95                 # Cannot be on network share when issuing system commands
96                 curr = os.getcwd()
97                 os.chdir("C:")
98                 ret = os.system("title " + title)
99             finally:
100                 os.chdir(curr)
101             if ret:
102                 # non-zero return code signals error, don't try again
103                 ignore_termtitle = True
104 
105 
106 def set_term_title(title):
107     """Set terminal title using the necessary platform-dependent calls."""
108     if ignore_termtitle:
109         return
110     _set_term_title(title)
111 
112 
113 def freeze_term_title():
114     warnings.warn("This function is deprecated, use toggle_set_term_title()")
115     global ignore_termtitle
116     ignore_termtitle = True
117 
118 
119 def get_terminal_size(defaultx=80, defaulty=25):
120     return _get_terminal_size((defaultx, defaulty))
121
```
--- 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/IPython/utils/terminal.py b/IPython/utils/terminal.py
--- a/IPython/utils/terminal.py
+++ b/IPython/utils/terminal.py
@@ -15,11 +15,7 @@
 import os
 import sys
 import warnings
-try:
-    from shutil import get_terminal_size as _get_terminal_size
-except ImportError:
-    # use backport on Python 2
-    from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size
+from shutil import get_terminal_size as _get_terminal_size
 
 from . import py3compat

{"golden_diff": "diff --git a/IPython/utils/terminal.py b/IPython/utils/terminal.py\n--- a/IPython/utils/terminal.py\n+++ b/IPython/utils/terminal.py\n@@ -15,11 +15,7 @@\n import os\n import sys\n import warnings\n-try:\n-    from shutil import get_terminal_size as _get_terminal_size\n-except ImportError:\n-    # use backport on Python 2\n-    from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size\n+from shutil import get_terminal_size as _get_terminal_size\n \n from . import py3compat\n", "issue": "remove usage of backports.shutil_get_terminal_size\nThis is for pre-3.3 Python.\r\n\r\nPretty easy it should only require deleting lines. \r\nMaybe a few need to be dedented.\n", "before_files": [{"content": "# encoding: utf-8\n\"\"\"\nUtilities for working with terminals.\n\nAuthors:\n\n* Brian E. Granger\n* Fernando Perez\n* Alexander Belchenko (e-mail: bialix AT ukr.net)\n\"\"\"\n\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nimport os\nimport sys\nimport warnings\ntry:\n    from shutil import get_terminal_size as _get_terminal_size\nexcept ImportError:\n    # use backport on Python 2\n    from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size\n\nfrom . import py3compat\n\n#-----------------------------------------------------------------------------\n# Code\n#-----------------------------------------------------------------------------\n\n# This variable is part of the expected API of the module:\nignore_termtitle = True\n\n\n\nif os.name == 'posix':\n    def _term_clear():\n        os.system('clear')\nelif sys.platform == 'win32':\n    def _term_clear():\n        os.system('cls')\nelse:\n    def _term_clear():\n        pass\n\n\n\ndef toggle_set_term_title(val):\n    \"\"\"Control whether set_term_title is active or not.\n\n    set_term_title() allows writing to the console titlebar.  In embedded\n    widgets this can cause problems, so this call can be used to toggle it on\n    or off as needed.\n\n    The default state of the module is for the function to be disabled.\n\n    Parameters\n    ----------\n      val : bool\n        If True, set_term_title() actually writes to the terminal (using the\n        appropriate platform-specific module).  If False, it is a no-op.\n    \"\"\"\n    global ignore_termtitle\n    ignore_termtitle = not(val)\n\n\ndef _set_term_title(*args,**kw):\n    \"\"\"Dummy no-op.\"\"\"\n    pass\n\n\ndef _set_term_title_xterm(title):\n    \"\"\" Change virtual terminal title in xterm-workalikes \"\"\"\n    sys.stdout.write('\\033]0;%s\\007' % title)\n\nif os.name == 'posix':\n    TERM = os.environ.get('TERM','')\n    if TERM.startswith('xterm'):\n        _set_term_title = _set_term_title_xterm\nelif sys.platform == 'win32':\n    try:\n        import ctypes\n\n        SetConsoleTitleW = ctypes.windll.kernel32.SetConsoleTitleW\n        SetConsoleTitleW.argtypes = [ctypes.c_wchar_p]\n    \n        def _set_term_title(title):\n            \"\"\"Set terminal title using ctypes to access the Win32 APIs.\"\"\"\n            SetConsoleTitleW(title)\n    except ImportError:\n        def _set_term_title(title):\n            \"\"\"Set terminal title using the 'title' command.\"\"\"\n            global ignore_termtitle\n\n            try:\n                # Cannot be on network share when issuing system commands\n                curr = os.getcwd()\n                os.chdir(\"C:\")\n                ret = os.system(\"title \" + title)\n            finally:\n                os.chdir(curr)\n            if ret:\n                # non-zero return code signals error, don't try again\n                ignore_termtitle = True\n\n\ndef set_term_title(title):\n    \"\"\"Set terminal title using the necessary platform-dependent calls.\"\"\"\n    if ignore_termtitle:\n        return\n    _set_term_title(title)\n\n\ndef freeze_term_title():\n    warnings.warn(\"This function is deprecated, use toggle_set_term_title()\")\n    global ignore_termtitle\n    ignore_termtitle = True\n\n\ndef get_terminal_size(defaultx=80, defaulty=25):\n    return _get_terminal_size((defaultx, defaulty))\n", "path": "IPython/utils/terminal.py"}], "after_files": [{"content": "# encoding: utf-8\n\"\"\"\nUtilities for working with terminals.\n\nAuthors:\n\n* Brian E. Granger\n* Fernando Perez\n* Alexander Belchenko (e-mail: bialix AT ukr.net)\n\"\"\"\n\n# Copyright (c) IPython Development Team.\n# Distributed under the terms of the Modified BSD License.\n\nimport os\nimport sys\nimport warnings\nfrom shutil import get_terminal_size as _get_terminal_size\n\nfrom . import py3compat\n\n#-----------------------------------------------------------------------------\n# Code\n#-----------------------------------------------------------------------------\n\n# This variable is part of the expected API of the module:\nignore_termtitle = True\n\n\n\nif os.name == 'posix':\n    def _term_clear():\n        os.system('clear')\nelif sys.platform == 'win32':\n    def _term_clear():\n        os.system('cls')\nelse:\n    def _term_clear():\n        pass\n\n\n\ndef toggle_set_term_title(val):\n    \"\"\"Control whether set_term_title is active or not.\n\n    set_term_title() allows writing to the console titlebar.  In embedded\n    widgets this can cause problems, so this call can be used to toggle it on\n    or off as needed.\n\n    The default state of the module is for the function to be disabled.\n\n    Parameters\n    ----------\n      val : bool\n        If True, set_term_title() actually writes to the terminal (using the\n        appropriate platform-specific module).  If False, it is a no-op.\n    \"\"\"\n    global ignore_termtitle\n    ignore_termtitle = not(val)\n\n\ndef _set_term_title(*args,**kw):\n    \"\"\"Dummy no-op.\"\"\"\n    pass\n\n\ndef _set_term_title_xterm(title):\n    \"\"\" Change virtual terminal title in xterm-workalikes \"\"\"\n    sys.stdout.write('\\033]0;%s\\007' % title)\n\nif os.name == 'posix':\n    TERM = os.environ.get('TERM','')\n    if TERM.startswith('xterm'):\n        _set_term_title = _set_term_title_xterm\nelif sys.platform == 'win32':\n    try:\n        import ctypes\n\n        SetConsoleTitleW = ctypes.windll.kernel32.SetConsoleTitleW\n        SetConsoleTitleW.argtypes = [ctypes.c_wchar_p]\n    \n        def _set_term_title(title):\n            \"\"\"Set terminal title using ctypes to access the Win32 APIs.\"\"\"\n            SetConsoleTitleW(title)\n    except ImportError:\n        def _set_term_title(title):\n            \"\"\"Set terminal title using the 'title' command.\"\"\"\n            global ignore_termtitle\n\n            try:\n                # Cannot be on network share when issuing system commands\n                curr = os.getcwd()\n                os.chdir(\"C:\")\n                ret = os.system(\"title \" + title)\n            finally:\n                os.chdir(curr)\n            if ret:\n                # non-zero return code signals error, don't try again\n                ignore_termtitle = True\n\n\ndef set_term_title(title):\n    \"\"\"Set terminal title using the necessary platform-dependent calls.\"\"\"\n    if ignore_termtitle:\n        return\n    _set_term_title(title)\n\n\ndef freeze_term_title():\n    warnings.warn(\"This function is deprecated, use toggle_set_term_title()\")\n    global ignore_termtitle\n    ignore_termtitle = True\n\n\ndef get_terminal_size(defaultx=80, defaulty=25):\n    return _get_terminal_size((defaultx, defaulty))\n", "path": "IPython/utils/terminal.py"}]}