prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  </issue>
  <code>
  [start of IPython/utils/terminal.py]
  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 of IPython/utils/terminal.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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
  
verification_info: {"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"}]}