We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix simple typo: whith -> with
There is a small typo in obspy/io/gcf/core.py.
Should read `with` rather than `whith`.



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `obspy/io/gcf/core.py`
Content:
```
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 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/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.
     """

{"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"}], "after_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 with 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"}]}