prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fix simple typo: whith -> with
  There is a small typo in obspy/io/gcf/core.py.
  Should read `with` rather than `whith`.
  
  
  
  </issue>
  <code>
  [start of obspy/io/gcf/core.py]
  1 # -*- coding: utf-8 -*-
  2 """
  3 GCF bindings to ObsPy core module.
  4 """
  5 from __future__ import (absolute_import, division, print_function,
  6                         unicode_literals)
  7 from future.builtins import *  # NOQA
  8 
  9 from obspy import Stream, Trace, UTCDateTime
  10 
  11 from . import libgcf
  12 
  13 
  14 def merge_gcf_stream(st):
  15     """
  16     Merges GCF stream (replacing Stream.merge(-1) for headonly=True)
  17 
  18     :type st: :class:`~obspy.core.stream.Stream`
  19     :param st: GCF Stream object whith no data
  20     :rtype: :class:`~obspy.core.stream.Stream`
  21     :returns: Stream object containing header and data.
  22     """
  23     traces = []
  24     for tr in st:
  25         delta = tr.stats.delta
  26         starttime = tr.stats.starttime
  27         endtime = tr.stats.endtime
  28         for trace in traces:
  29             if tr.id == trace.id and delta == trace.stats.delta \
  30                and not starttime == trace.stats.starttime:
  31                 if 0 < starttime - trace.stats.endtime <= delta:
  32                     trace.stats.npts += tr.stats.npts
  33                     break
  34                 elif 0 < trace.stats.starttime - endtime <= delta:
  35                     trace.stats.starttime = UTCDateTime(starttime)
  36                     trace.stats.npts += tr.stats.npts
  37                     break
  38         else:
  39             traces.append(tr)
  40     return Stream(traces=traces)
  41 
  42 
  43 def _is_gcf(filename):
  44     """
  45     Checks whether a file is GCF or not.
  46 
  47     :type filename: str
  48     :param filename: GCF file to be checked.
  49     :rtype: bool
  50     :return: ``True`` if a GCF file.
  51     """
  52     try:
  53         with open(filename, 'rb') as f:
  54             libgcf.is_gcf(f)
  55     except Exception:
  56         return False
  57     return True
  58 
  59 
  60 def _read_gcf(filename, headonly=False, **kwargs):  # @UnusedVariable
  61     """
  62     Reads a GCF file and returns a Stream object.
  63 
  64     only GCF files containing data records are supported.
  65 
  66     .. warning::
  67         This function should NOT be called directly, it registers via the
  68         ObsPy :func:`~obspy.core.stream.read` function, call this instead.
  69 
  70     :type filename: str
  71     :param filename: GCF file to be read.
  72     :type headonly: bool, optional
  73     :param headonly: If True read only head of GCF file.
  74     :type channel_prefix: str, optional
  75     :param channel_prefix: Channel band and instrument codes.
  76         Defaults to ``HH``.
  77     :rtype: :class:`~obspy.core.stream.Stream`
  78     :returns: Stream object containing header and data.
  79 
  80     .. rubric:: Example
  81     >>> from obspy import read
  82     >>> st = read("/path/to/20160603_1955n.gcf", format="GCF")
  83     """
  84     traces = []
  85     with open(filename, 'rb') as f:
  86         while True:
  87             try:
  88                 if headonly:
  89                     header = libgcf.read_header(f, **kwargs)
  90                     if header:
  91                         traces.append(Trace(header=header))
  92                 else:
  93                     hd = libgcf.read(f, **kwargs)
  94                     if hd:
  95                         traces.append(Trace(header=hd[0], data=hd[1]))
  96             except EOFError:
  97                 break
  98     st = Stream(traces=traces)
  99     if headonly:
  100         st = merge_gcf_stream(st)
  101     else:
  102         st.merge(-1)
  103     return st
  104
  [end of obspy/io/gcf/core.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/obspy/io/gcf/core.py b/obspy/io/gcf/core.py
  --- a/obspy/io/gcf/core.py
  +++ b/obspy/io/gcf/core.py
  @@ -16,7 +16,7 @@
       Merges GCF stream (replacing Stream.merge(-1) for headonly=True)
   
       :type st: :class:`~obspy.core.stream.Stream`
  -    :param st: GCF Stream object whith no data
  +    :param st: GCF Stream object with no data
       :rtype: :class:`~obspy.core.stream.Stream`
       :returns: Stream object containing header and data.
       """
  
verification_info: {"golden_diff": "diff --git a/obspy/io/gcf/core.py b/obspy/io/gcf/core.py\n--- a/obspy/io/gcf/core.py\n+++ b/obspy/io/gcf/core.py\n@@ -16,7 +16,7 @@\n     Merges GCF stream (replacing Stream.merge(-1) for headonly=True)\n \n     :type st: :class:`~obspy.core.stream.Stream`\n-    :param st: GCF Stream object whith no data\n+    :param st: GCF Stream object with no data\n     :rtype: :class:`~obspy.core.stream.Stream`\n     :returns: Stream object containing header and data.\n     \"\"\"\n", "issue": "Fix simple typo: whith -> with\nThere is a small typo in obspy/io/gcf/core.py.\nShould read `with` rather than `whith`.\n\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nGCF bindings to ObsPy core module.\n\"\"\"\nfrom __future__ import (absolute_import, division, print_function,\n                        unicode_literals)\nfrom future.builtins import *  # NOQA\n\nfrom obspy import Stream, Trace, UTCDateTime\n\nfrom . import libgcf\n\n\ndef merge_gcf_stream(st):\n    \"\"\"\n    Merges GCF stream (replacing Stream.merge(-1) for headonly=True)\n\n    :type st: :class:`~obspy.core.stream.Stream`\n    :param st: GCF Stream object whith no data\n    :rtype: :class:`~obspy.core.stream.Stream`\n    :returns: Stream object containing header and data.\n    \"\"\"\n    traces = []\n    for tr in st:\n        delta = tr.stats.delta\n        starttime = tr.stats.starttime\n        endtime = tr.stats.endtime\n        for trace in traces:\n            if tr.id == trace.id and delta == trace.stats.delta \\\n               and not starttime == trace.stats.starttime:\n                if 0 < starttime - trace.stats.endtime <= delta:\n                    trace.stats.npts += tr.stats.npts\n                    break\n                elif 0 < trace.stats.starttime - endtime <= delta:\n                    trace.stats.starttime = UTCDateTime(starttime)\n                    trace.stats.npts += tr.stats.npts\n                    break\n        else:\n            traces.append(tr)\n    return Stream(traces=traces)\n\n\ndef _is_gcf(filename):\n    \"\"\"\n    Checks whether a file is GCF or not.\n\n    :type filename: str\n    :param filename: GCF file to be checked.\n    :rtype: bool\n    :return: ``True`` if a GCF file.\n    \"\"\"\n    try:\n        with open(filename, 'rb') as f:\n            libgcf.is_gcf(f)\n    except Exception:\n        return False\n    return True\n\n\ndef _read_gcf(filename, headonly=False, **kwargs):  # @UnusedVariable\n    \"\"\"\n    Reads a GCF file and returns a Stream object.\n\n    only GCF files containing data records are supported.\n\n    .. warning::\n        This function should NOT be called directly, it registers via the\n        ObsPy :func:`~obspy.core.stream.read` function, call this instead.\n\n    :type filename: str\n    :param filename: GCF file to be read.\n    :type headonly: bool, optional\n    :param headonly: If True read only head of GCF file.\n    :type channel_prefix: str, optional\n    :param channel_prefix: Channel band and instrument codes.\n        Defaults to ``HH``.\n    :rtype: :class:`~obspy.core.stream.Stream`\n    :returns: Stream object containing header and data.\n\n    .. rubric:: Example\n    >>> from obspy import read\n    >>> st = read(\"/path/to/20160603_1955n.gcf\", format=\"GCF\")\n    \"\"\"\n    traces = []\n    with open(filename, 'rb') as f:\n        while True:\n            try:\n                if headonly:\n                    header = libgcf.read_header(f, **kwargs)\n                    if header:\n                        traces.append(Trace(header=header))\n                else:\n                    hd = libgcf.read(f, **kwargs)\n                    if hd:\n                        traces.append(Trace(header=hd[0], data=hd[1]))\n            except EOFError:\n                break\n    st = Stream(traces=traces)\n    if headonly:\n        st = merge_gcf_stream(st)\n    else:\n        st.merge(-1)\n    return st\n", "path": "obspy/io/gcf/core.py"}]}