We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Inexplicable test failures on 3.13.0+
I have a test that looks something like this:
```python
@given(s.data(), fs.finapps(store))
@settings(suppress_health_check=[HealthCheck.too_slow])
def test(data, finapp):
    pass
```
On Hypothesis 3.12.0 this works fine. On Hypothesis 3.13.0, every example is rejected, eventually hitting the timeout (if I turn up the verbosity, I see "Run complete after 288 examples (0 valid) and 0 shrinks").

However, if I change it to this, which seems like it should be identical, then the test works fine on both versions of Hypothesis:
```python
@given(s.data())
@settings(suppress_health_check=[HealthCheck.too_slow])
def test(data):
    finapp = data.draw(fs.finapps(store))
```

Unfortunately this codebase is proprietary, and `fs.finapps` is a pretty complex strategy, so I'm not sure exactly where to start tracking this down, and I haven't had any luck constructing a minimal reproducer yet.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/hypothesis/version.py`
Content:
```
1 # coding=utf-8
2 #
3 # This file is part of Hypothesis, which may be found at
4 # https://github.com/HypothesisWorks/hypothesis-python
5 #
6 # Most of this work is copyright (C) 2013-2017 David R. MacIver
7 # (david@drmaciver.com), but it contains contributions by others. See
8 # CONTRIBUTING.rst for a full list of people who may hold copyright, and
9 # consult the git log if you need to determine who owns an individual
10 # contribution.
11 #
12 # This Source Code Form is subject to the terms of the Mozilla Public License,
13 # v. 2.0. If a copy of the MPL was not distributed with this file, You can
14 # obtain one at http://mozilla.org/MPL/2.0/.
15 #
16 # END HEADER
17 
18 from __future__ import division, print_function, absolute_import
19 
20 __version_info__ = (3, 14, 0)
21 __version__ = '.'.join(map(str, __version_info__))
22
```

Path: `src/hypothesis/internal/conjecture/data.py`
Content:
```
1 # coding=utf-8
2 #
3 # This file is part of Hypothesis, which may be found at
4 # https://github.com/HypothesisWorks/hypothesis-python
5 #
6 # Most of this work is copyright (C) 2013-2017 David R. MacIver
7 # (david@drmaciver.com), but it contains contributions by others. See
8 # CONTRIBUTING.rst for a full list of people who may hold copyright, and
9 # consult the git log if you need to determine who owns an individual
10 # contribution.
11 #
12 # This Source Code Form is subject to the terms of the Mozilla Public License,
13 # v. 2.0. If a copy of the MPL was not distributed with this file, You can
14 # obtain one at http://mozilla.org/MPL/2.0/.
15 #
16 # END HEADER
17 
18 from __future__ import division, print_function, absolute_import
19 
20 from enum import IntEnum
21 
22 from hypothesis.errors import Frozen, InvalidArgument
23 from hypothesis.internal.compat import hbytes, hrange, text_type, \
24     int_to_bytes, benchmark_time, unicode_safe_repr
25 
26 
27 def uniform(random, n):
28     return int_to_bytes(random.getrandbits(n * 8), n)
29 
30 
31 class Status(IntEnum):
32     OVERRUN = 0
33     INVALID = 1
34     VALID = 2
35     INTERESTING = 3
36 
37 
38 class StopTest(BaseException):
39 
40     def __init__(self, testcounter):
41         super(StopTest, self).__init__(repr(testcounter))
42         self.testcounter = testcounter
43 
44 
45 global_test_counter = 0
46 
47 
48 MAX_DEPTH = 50
49 
50 
51 class ConjectureData(object):
52 
53     @classmethod
54     def for_buffer(self, buffer):
55         return ConjectureData(
56             max_length=len(buffer),
57             draw_bytes=lambda data, n, distribution:
58             hbytes(buffer[data.index:data.index + n])
59         )
60 
61     def __init__(self, max_length, draw_bytes):
62         self.max_length = max_length
63         self.is_find = False
64         self._draw_bytes = draw_bytes
65         self.overdraw = 0
66         self.level = 0
67         self.block_starts = {}
68         self.blocks = []
69         self.buffer = bytearray()
70         self.output = u''
71         self.status = Status.VALID
72         self.frozen = False
73         self.intervals_by_level = []
74         self.intervals = []
75         self.interval_stack = []
76         global global_test_counter
77         self.testcounter = global_test_counter
78         global_test_counter += 1
79         self.start_time = benchmark_time()
80         self.events = set()
81         self.bind_points = set()
82 
83     def __assert_not_frozen(self, name):
84         if self.frozen:
85             raise Frozen(
86                 'Cannot call %s on frozen ConjectureData' % (
87                     name,))
88 
89     @property
90     def depth(self):
91         return len(self.interval_stack)
92 
93     @property
94     def index(self):
95         return len(self.buffer)
96 
97     def note(self, value):
98         self.__assert_not_frozen('note')
99         if not isinstance(value, text_type):
100             value = unicode_safe_repr(value)
101         self.output += value
102 
103     def draw(self, strategy):
104         if self.depth >= MAX_DEPTH:
105             self.mark_invalid()
106 
107         if self.is_find and not strategy.supports_find:
108             raise InvalidArgument((
109                 'Cannot use strategy %r within a call to find (presumably '
110                 'because it would be invalid after the call had ended).'
111             ) % (strategy,))
112         self.start_example()
113         try:
114             return strategy.do_draw(self)
115         finally:
116             if not self.frozen:
117                 self.stop_example()
118 
119     def mark_bind(self):
120         """Marks a point as somewhere that a bind occurs - that is, data
121         drawn after this point may depend significantly on data drawn prior
122         to this point.
123 
124         Having points like this explicitly marked allows for better shrinking,
125         as we run a pass which tries to shrink the byte stream prior to a bind
126         point while rearranging what comes after somewhat to allow for more
127         flexibility. Trying that at every point in the data stream is
128         prohibitively expensive, but trying it at a couple dozen is basically
129         fine."""
130         self.bind_points.add(self.index)
131 
132     def start_example(self):
133         self.__assert_not_frozen('start_example')
134         self.interval_stack.append(self.index)
135         self.level += 1
136 
137     def stop_example(self):
138         self.__assert_not_frozen('stop_example')
139         self.level -= 1
140         while self.level >= len(self.intervals_by_level):
141             self.intervals_by_level.append([])
142         k = self.interval_stack.pop()
143         if k != self.index:
144             t = (k, self.index)
145             self.intervals_by_level[self.level].append(t)
146             if not self.intervals or self.intervals[-1] != t:
147                 self.intervals.append(t)
148 
149     def note_event(self, event):
150         self.events.add(event)
151 
152     def freeze(self):
153         if self.frozen:
154             assert isinstance(self.buffer, hbytes)
155             return
156         self.frozen = True
157         self.finish_time = benchmark_time()
158         # Intervals are sorted as longest first, then by interval start.
159         for l in self.intervals_by_level:
160             for i in hrange(len(l) - 1):
161                 if l[i][1] == l[i + 1][0]:
162                     self.intervals.append((l[i][0], l[i + 1][1]))
163         self.intervals = sorted(
164             set(self.intervals),
165             key=lambda se: (se[0] - se[1], se[0])
166         )
167         self.buffer = hbytes(self.buffer)
168         self.events = frozenset(self.events)
169         del self._draw_bytes
170 
171     def draw_bytes(self, n):
172         return self.draw_bytes_internal(n, uniform)
173 
174     def write(self, string):
175         assert isinstance(string, hbytes)
176 
177         def distribution(random, n):
178             assert n == len(string)
179             return string
180 
181         while True:
182             x = self.draw_bytes_internal(len(string), distribution)
183             if x == string:
184                 return
185 
186     def draw_bytes_internal(self, n, distribution):
187         if n == 0:
188             return hbytes(b'')
189         self.__assert_not_frozen('draw_bytes')
190         initial = self.index
191         if self.index + n > self.max_length:
192             self.overdraw = self.index + n - self.max_length
193             self.status = Status.OVERRUN
194             self.freeze()
195             raise StopTest(self.testcounter)
196         result = self._draw_bytes(self, n, distribution)
197         self.block_starts.setdefault(n, []).append(initial)
198         self.blocks.append((initial, initial + n))
199         assert len(result) == n
200         assert self.index == initial
201         self.buffer.extend(result)
202         self.intervals.append((initial, self.index))
203         return hbytes(result)
204 
205     def mark_interesting(self):
206         self.__assert_not_frozen('mark_interesting')
207         self.status = Status.INTERESTING
208         self.freeze()
209         raise StopTest(self.testcounter)
210 
211     def mark_invalid(self):
212         self.__assert_not_frozen('mark_invalid')
213         self.status = Status.INVALID
214         self.freeze()
215         raise StopTest(self.testcounter)
216
```
--- 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/src/hypothesis/internal/conjecture/data.py b/src/hypothesis/internal/conjecture/data.py
--- a/src/hypothesis/internal/conjecture/data.py
+++ b/src/hypothesis/internal/conjecture/data.py
@@ -45,7 +45,7 @@
 global_test_counter = 0
 
 
-MAX_DEPTH = 50
+MAX_DEPTH = 100
 
 
 class ConjectureData(object):
diff --git a/src/hypothesis/version.py b/src/hypothesis/version.py
--- a/src/hypothesis/version.py
+++ b/src/hypothesis/version.py
@@ -17,5 +17,5 @@
 
 from __future__ import division, print_function, absolute_import
 
-__version_info__ = (3, 14, 0)
+__version_info__ = (3, 14, 1)
 __version__ = '.'.join(map(str, __version_info__))

{"golden_diff": "diff --git a/src/hypothesis/internal/conjecture/data.py b/src/hypothesis/internal/conjecture/data.py\n--- a/src/hypothesis/internal/conjecture/data.py\n+++ b/src/hypothesis/internal/conjecture/data.py\n@@ -45,7 +45,7 @@\n global_test_counter = 0\n \n \n-MAX_DEPTH = 50\n+MAX_DEPTH = 100\n \n \n class ConjectureData(object):\ndiff --git a/src/hypothesis/version.py b/src/hypothesis/version.py\n--- a/src/hypothesis/version.py\n+++ b/src/hypothesis/version.py\n@@ -17,5 +17,5 @@\n \n from __future__ import division, print_function, absolute_import\n \n-__version_info__ = (3, 14, 0)\n+__version_info__ = (3, 14, 1)\n __version__ = '.'.join(map(str, __version_info__))\n", "issue": "Inexplicable test failures on 3.13.0+\nI have a test that looks something like this:\r\n```python\r\n@given(s.data(), fs.finapps(store))\r\n@settings(suppress_health_check=[HealthCheck.too_slow])\r\ndef test(data, finapp):\r\n    pass\r\n```\r\nOn Hypothesis 3.12.0 this works fine. On Hypothesis 3.13.0, every example is rejected, eventually hitting the timeout (if I turn up the verbosity, I see \"Run complete after 288 examples (0 valid) and 0 shrinks\").\r\n\r\nHowever, if I change it to this, which seems like it should be identical, then the test works fine on both versions of Hypothesis:\r\n```python\r\n@given(s.data())\r\n@settings(suppress_health_check=[HealthCheck.too_slow])\r\ndef test(data):\r\n    finapp = data.draw(fs.finapps(store))\r\n```\r\n\r\nUnfortunately this codebase is proprietary, and `fs.finapps` is a pretty complex strategy, so I'm not sure exactly where to start tracking this down, and I haven't had any luck constructing a minimal reproducer yet.\n", "before_files": [{"content": "# coding=utf-8\n#\n# This file is part of Hypothesis, which may be found at\n# https://github.com/HypothesisWorks/hypothesis-python\n#\n# Most of this work is copyright (C) 2013-2017 David R. MacIver\n# (david@drmaciver.com), but it contains contributions by others. See\n# CONTRIBUTING.rst for a full list of people who may hold copyright, and\n# consult the git log if you need to determine who owns an individual\n# contribution.\n#\n# This Source Code Form is subject to the terms of the Mozilla Public License,\n# v. 2.0. If a copy of the MPL was not distributed with this file, You can\n# obtain one at http://mozilla.org/MPL/2.0/.\n#\n# END HEADER\n\nfrom __future__ import division, print_function, absolute_import\n\n__version_info__ = (3, 14, 0)\n__version__ = '.'.join(map(str, __version_info__))\n", "path": "src/hypothesis/version.py"}, {"content": "# coding=utf-8\n#\n# This file is part of Hypothesis, which may be found at\n# https://github.com/HypothesisWorks/hypothesis-python\n#\n# Most of this work is copyright (C) 2013-2017 David R. MacIver\n# (david@drmaciver.com), but it contains contributions by others. See\n# CONTRIBUTING.rst for a full list of people who may hold copyright, and\n# consult the git log if you need to determine who owns an individual\n# contribution.\n#\n# This Source Code Form is subject to the terms of the Mozilla Public License,\n# v. 2.0. If a copy of the MPL was not distributed with this file, You can\n# obtain one at http://mozilla.org/MPL/2.0/.\n#\n# END HEADER\n\nfrom __future__ import division, print_function, absolute_import\n\nfrom enum import IntEnum\n\nfrom hypothesis.errors import Frozen, InvalidArgument\nfrom hypothesis.internal.compat import hbytes, hrange, text_type, \\\n    int_to_bytes, benchmark_time, unicode_safe_repr\n\n\ndef uniform(random, n):\n    return int_to_bytes(random.getrandbits(n * 8), n)\n\n\nclass Status(IntEnum):\n    OVERRUN = 0\n    INVALID = 1\n    VALID = 2\n    INTERESTING = 3\n\n\nclass StopTest(BaseException):\n\n    def __init__(self, testcounter):\n        super(StopTest, self).__init__(repr(testcounter))\n        self.testcounter = testcounter\n\n\nglobal_test_counter = 0\n\n\nMAX_DEPTH = 50\n\n\nclass ConjectureData(object):\n\n    @classmethod\n    def for_buffer(self, buffer):\n        return ConjectureData(\n            max_length=len(buffer),\n            draw_bytes=lambda data, n, distribution:\n            hbytes(buffer[data.index:data.index + n])\n        )\n\n    def __init__(self, max_length, draw_bytes):\n        self.max_length = max_length\n        self.is_find = False\n        self._draw_bytes = draw_bytes\n        self.overdraw = 0\n        self.level = 0\n        self.block_starts = {}\n        self.blocks = []\n        self.buffer = bytearray()\n        self.output = u''\n        self.status = Status.VALID\n        self.frozen = False\n        self.intervals_by_level = []\n        self.intervals = []\n        self.interval_stack = []\n        global global_test_counter\n        self.testcounter = global_test_counter\n        global_test_counter += 1\n        self.start_time = benchmark_time()\n        self.events = set()\n        self.bind_points = set()\n\n    def __assert_not_frozen(self, name):\n        if self.frozen:\n            raise Frozen(\n                'Cannot call %s on frozen ConjectureData' % (\n                    name,))\n\n    @property\n    def depth(self):\n        return len(self.interval_stack)\n\n    @property\n    def index(self):\n        return len(self.buffer)\n\n    def note(self, value):\n        self.__assert_not_frozen('note')\n        if not isinstance(value, text_type):\n            value = unicode_safe_repr(value)\n        self.output += value\n\n    def draw(self, strategy):\n        if self.depth >= MAX_DEPTH:\n            self.mark_invalid()\n\n        if self.is_find and not strategy.supports_find:\n            raise InvalidArgument((\n                'Cannot use strategy %r within a call to find (presumably '\n                'because it would be invalid after the call had ended).'\n            ) % (strategy,))\n        self.start_example()\n        try:\n            return strategy.do_draw(self)\n        finally:\n            if not self.frozen:\n                self.stop_example()\n\n    def mark_bind(self):\n        \"\"\"Marks a point as somewhere that a bind occurs - that is, data\n        drawn after this point may depend significantly on data drawn prior\n        to this point.\n\n        Having points like this explicitly marked allows for better shrinking,\n        as we run a pass which tries to shrink the byte stream prior to a bind\n        point while rearranging what comes after somewhat to allow for more\n        flexibility. Trying that at every point in the data stream is\n        prohibitively expensive, but trying it at a couple dozen is basically\n        fine.\"\"\"\n        self.bind_points.add(self.index)\n\n    def start_example(self):\n        self.__assert_not_frozen('start_example')\n        self.interval_stack.append(self.index)\n        self.level += 1\n\n    def stop_example(self):\n        self.__assert_not_frozen('stop_example')\n        self.level -= 1\n        while self.level >= len(self.intervals_by_level):\n            self.intervals_by_level.append([])\n        k = self.interval_stack.pop()\n        if k != self.index:\n            t = (k, self.index)\n            self.intervals_by_level[self.level].append(t)\n            if not self.intervals or self.intervals[-1] != t:\n                self.intervals.append(t)\n\n    def note_event(self, event):\n        self.events.add(event)\n\n    def freeze(self):\n        if self.frozen:\n            assert isinstance(self.buffer, hbytes)\n            return\n        self.frozen = True\n        self.finish_time = benchmark_time()\n        # Intervals are sorted as longest first, then by interval start.\n        for l in self.intervals_by_level:\n            for i in hrange(len(l) - 1):\n                if l[i][1] == l[i + 1][0]:\n                    self.intervals.append((l[i][0], l[i + 1][1]))\n        self.intervals = sorted(\n            set(self.intervals),\n            key=lambda se: (se[0] - se[1], se[0])\n        )\n        self.buffer = hbytes(self.buffer)\n        self.events = frozenset(self.events)\n        del self._draw_bytes\n\n    def draw_bytes(self, n):\n        return self.draw_bytes_internal(n, uniform)\n\n    def write(self, string):\n        assert isinstance(string, hbytes)\n\n        def distribution(random, n):\n            assert n == len(string)\n            return string\n\n        while True:\n            x = self.draw_bytes_internal(len(string), distribution)\n            if x == string:\n                return\n\n    def draw_bytes_internal(self, n, distribution):\n        if n == 0:\n            return hbytes(b'')\n        self.__assert_not_frozen('draw_bytes')\n        initial = self.index\n        if self.index + n > self.max_length:\n            self.overdraw = self.index + n - self.max_length\n            self.status = Status.OVERRUN\n            self.freeze()\n            raise StopTest(self.testcounter)\n        result = self._draw_bytes(self, n, distribution)\n        self.block_starts.setdefault(n, []).append(initial)\n        self.blocks.append((initial, initial + n))\n        assert len(result) == n\n        assert self.index == initial\n        self.buffer.extend(result)\n        self.intervals.append((initial, self.index))\n        return hbytes(result)\n\n    def mark_interesting(self):\n        self.__assert_not_frozen('mark_interesting')\n        self.status = Status.INTERESTING\n        self.freeze()\n        raise StopTest(self.testcounter)\n\n    def mark_invalid(self):\n        self.__assert_not_frozen('mark_invalid')\n        self.status = Status.INVALID\n        self.freeze()\n        raise StopTest(self.testcounter)\n", "path": "src/hypothesis/internal/conjecture/data.py"}], "after_files": [{"content": "# coding=utf-8\n#\n# This file is part of Hypothesis, which may be found at\n# https://github.com/HypothesisWorks/hypothesis-python\n#\n# Most of this work is copyright (C) 2013-2017 David R. MacIver\n# (david@drmaciver.com), but it contains contributions by others. See\n# CONTRIBUTING.rst for a full list of people who may hold copyright, and\n# consult the git log if you need to determine who owns an individual\n# contribution.\n#\n# This Source Code Form is subject to the terms of the Mozilla Public License,\n# v. 2.0. If a copy of the MPL was not distributed with this file, You can\n# obtain one at http://mozilla.org/MPL/2.0/.\n#\n# END HEADER\n\nfrom __future__ import division, print_function, absolute_import\n\n__version_info__ = (3, 14, 1)\n__version__ = '.'.join(map(str, __version_info__))\n", "path": "src/hypothesis/version.py"}, {"content": "# coding=utf-8\n#\n# This file is part of Hypothesis, which may be found at\n# https://github.com/HypothesisWorks/hypothesis-python\n#\n# Most of this work is copyright (C) 2013-2017 David R. MacIver\n# (david@drmaciver.com), but it contains contributions by others. See\n# CONTRIBUTING.rst for a full list of people who may hold copyright, and\n# consult the git log if you need to determine who owns an individual\n# contribution.\n#\n# This Source Code Form is subject to the terms of the Mozilla Public License,\n# v. 2.0. If a copy of the MPL was not distributed with this file, You can\n# obtain one at http://mozilla.org/MPL/2.0/.\n#\n# END HEADER\n\nfrom __future__ import division, print_function, absolute_import\n\nfrom enum import IntEnum\n\nfrom hypothesis.errors import Frozen, InvalidArgument\nfrom hypothesis.internal.compat import hbytes, hrange, text_type, \\\n    int_to_bytes, benchmark_time, unicode_safe_repr\n\n\ndef uniform(random, n):\n    return int_to_bytes(random.getrandbits(n * 8), n)\n\n\nclass Status(IntEnum):\n    OVERRUN = 0\n    INVALID = 1\n    VALID = 2\n    INTERESTING = 3\n\n\nclass StopTest(BaseException):\n\n    def __init__(self, testcounter):\n        super(StopTest, self).__init__(repr(testcounter))\n        self.testcounter = testcounter\n\n\nglobal_test_counter = 0\n\n\nMAX_DEPTH = 100\n\n\nclass ConjectureData(object):\n\n    @classmethod\n    def for_buffer(self, buffer):\n        return ConjectureData(\n            max_length=len(buffer),\n            draw_bytes=lambda data, n, distribution:\n            hbytes(buffer[data.index:data.index + n])\n        )\n\n    def __init__(self, max_length, draw_bytes):\n        self.max_length = max_length\n        self.is_find = False\n        self._draw_bytes = draw_bytes\n        self.overdraw = 0\n        self.level = 0\n        self.block_starts = {}\n        self.blocks = []\n        self.buffer = bytearray()\n        self.output = u''\n        self.status = Status.VALID\n        self.frozen = False\n        self.intervals_by_level = []\n        self.intervals = []\n        self.interval_stack = []\n        global global_test_counter\n        self.testcounter = global_test_counter\n        global_test_counter += 1\n        self.start_time = benchmark_time()\n        self.events = set()\n        self.bind_points = set()\n\n    def __assert_not_frozen(self, name):\n        if self.frozen:\n            raise Frozen(\n                'Cannot call %s on frozen ConjectureData' % (\n                    name,))\n\n    @property\n    def depth(self):\n        return len(self.interval_stack)\n\n    @property\n    def index(self):\n        return len(self.buffer)\n\n    def note(self, value):\n        self.__assert_not_frozen('note')\n        if not isinstance(value, text_type):\n            value = unicode_safe_repr(value)\n        self.output += value\n\n    def draw(self, strategy):\n        if self.depth >= MAX_DEPTH:\n            self.mark_invalid()\n\n        if self.is_find and not strategy.supports_find:\n            raise InvalidArgument((\n                'Cannot use strategy %r within a call to find (presumably '\n                'because it would be invalid after the call had ended).'\n            ) % (strategy,))\n        self.start_example()\n        try:\n            return strategy.do_draw(self)\n        finally:\n            if not self.frozen:\n                self.stop_example()\n\n    def mark_bind(self):\n        \"\"\"Marks a point as somewhere that a bind occurs - that is, data\n        drawn after this point may depend significantly on data drawn prior\n        to this point.\n\n        Having points like this explicitly marked allows for better shrinking,\n        as we run a pass which tries to shrink the byte stream prior to a bind\n        point while rearranging what comes after somewhat to allow for more\n        flexibility. Trying that at every point in the data stream is\n        prohibitively expensive, but trying it at a couple dozen is basically\n        fine.\"\"\"\n        self.bind_points.add(self.index)\n\n    def start_example(self):\n        self.__assert_not_frozen('start_example')\n        self.interval_stack.append(self.index)\n        self.level += 1\n\n    def stop_example(self):\n        self.__assert_not_frozen('stop_example')\n        self.level -= 1\n        while self.level >= len(self.intervals_by_level):\n            self.intervals_by_level.append([])\n        k = self.interval_stack.pop()\n        if k != self.index:\n            t = (k, self.index)\n            self.intervals_by_level[self.level].append(t)\n            if not self.intervals or self.intervals[-1] != t:\n                self.intervals.append(t)\n\n    def note_event(self, event):\n        self.events.add(event)\n\n    def freeze(self):\n        if self.frozen:\n            assert isinstance(self.buffer, hbytes)\n            return\n        self.frozen = True\n        self.finish_time = benchmark_time()\n        # Intervals are sorted as longest first, then by interval start.\n        for l in self.intervals_by_level:\n            for i in hrange(len(l) - 1):\n                if l[i][1] == l[i + 1][0]:\n                    self.intervals.append((l[i][0], l[i + 1][1]))\n        self.intervals = sorted(\n            set(self.intervals),\n            key=lambda se: (se[0] - se[1], se[0])\n        )\n        self.buffer = hbytes(self.buffer)\n        self.events = frozenset(self.events)\n        del self._draw_bytes\n\n    def draw_bytes(self, n):\n        return self.draw_bytes_internal(n, uniform)\n\n    def write(self, string):\n        assert isinstance(string, hbytes)\n\n        def distribution(random, n):\n            assert n == len(string)\n            return string\n\n        while True:\n            x = self.draw_bytes_internal(len(string), distribution)\n            if x == string:\n                return\n\n    def draw_bytes_internal(self, n, distribution):\n        if n == 0:\n            return hbytes(b'')\n        self.__assert_not_frozen('draw_bytes')\n        initial = self.index\n        if self.index + n > self.max_length:\n            self.overdraw = self.index + n - self.max_length\n            self.status = Status.OVERRUN\n            self.freeze()\n            raise StopTest(self.testcounter)\n        result = self._draw_bytes(self, n, distribution)\n        self.block_starts.setdefault(n, []).append(initial)\n        self.blocks.append((initial, initial + n))\n        assert len(result) == n\n        assert self.index == initial\n        self.buffer.extend(result)\n        self.intervals.append((initial, self.index))\n        return hbytes(result)\n\n    def mark_interesting(self):\n        self.__assert_not_frozen('mark_interesting')\n        self.status = Status.INTERESTING\n        self.freeze()\n        raise StopTest(self.testcounter)\n\n    def mark_invalid(self):\n        self.__assert_not_frozen('mark_invalid')\n        self.status = Status.INVALID\n        self.freeze()\n        raise StopTest(self.testcounter)\n", "path": "src/hypothesis/internal/conjecture/data.py"}]}