Browse Source

updated project

Médéric Hurier 2 months ago
parent
commit
96ca5a9100

+ 1
- 0
.coveragerc View File

@@ -0,0 +1 @@
1
+covers/coverage.ini

+ 1
- 0
.ctags View File

@@ -0,0 +1 @@
1
+pytags/ctags

+ 1
- 1
.python-version View File

@@ -1 +1 @@
1
-3.7.0
1
+3.7.1

+ 10
- 11
Makefile View File

@@ -1,18 +1,17 @@
1
-export PYTHONPATH=${PWD}
1
+include */Makefile
2 2
 
3
-MKFILES = $(wildcard */Makefile)
3
+MAKEFLAGS += --silent
4
+MAKECONFS += $(wildcard */Makefile)
5
+MAKEREPOS += $(subst /,, $(dir ${MAKECONFS}))
4 6
 
5 7
 .venv:
6
-	python -m venv .venv --clear
8
+	python -m venv .venv --clear --symlinks
7 9
 
8
-init: .venv
9
-	@for MK in ${MKFILES}; do make --no-print-directory -f $$MK init-$$(dirname $$MK); done
10
+init:
11
+	@for dir in ${MAKEREPOS} ; do make init-$$dir ; done
10 12
 
11 13
 clean:
12
-	@for MK in ${MKFILES}; do make --no-print-directory -f $$MK clean-$$(dirname $$MK); done
13
-
14
-commit: .venv
15
-	@set -e; \
16
-	for MK in ${MKFILES}; do make --no-print-directory -f $$MK commit-$$(dirname $$MK); done
14
+	@for dir in ${MAKEREPOS} ; do make clean-$$dir ; done
17 15
 
18
-include */Makefile
16
+commit:
17
+	@for dir in ${MAKEREPOS} ; do make commit-$$dir ; done

+ 1
- 0
black.ini View File

@@ -0,0 +1 @@
1
+formats/black.ini

+ 10
- 6
covers/Makefile View File

@@ -1,17 +1,21 @@
1
-.PHONY: cover
2
-
3 1
 NAME = $(shell .venv/bin/python setup.py --name)
4 2
 
5 3
 init-covers: .venv
6 4
 	.venv/bin/pip install '.[covers]'
5
+	ln -fs 'covers/coverage.ini' '.coveragerc'
7 6
 
8 7
 clean-covers:
9
-	find . -name '.mypy_cache' -exec rm -fr {} +
8
+	rm -rf "covers/htmlcov"
9
+	find . -name '.coverage' -exec rm -fr {} +
10 10
 
11
-commit-covers: report;
11
+commit-covers: htmlcov
12
+	git add --all 'covers/htmlcov/'
12 13
 
13 14
 cover: .venv
14
-	.venv/bin/coverage run --rcfile="covers/coverage.ini" --source ${NAME} -m pytest --doctest-modules -q
15
+	.venv/bin/coverage run --source ${NAME} -m pytest -q
15 16
 
16 17
 report: .venv cover
17
-	.venv/bin/coverage report --rcfile="covers/coverage.ini"
18
+	.venv/bin/coverage report
19
+
20
+htmlcov: .venv cover
21
+	.venv/bin/coverage html --directory="covers/htmlcov"

+ 584
- 0
covers/htmlcov/coverage_html.js View File

@@ -0,0 +1,584 @@
1
+// Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2
+// For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
3
+
4
+// Coverage.py HTML report browser code.
5
+/*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */
6
+/*global coverage: true, document, window, $ */
7
+
8
+coverage = {};
9
+
10
+// Find all the elements with shortkey_* class, and use them to assign a shortcut key.
11
+coverage.assign_shortkeys = function () {
12
+    $("*[class*='shortkey_']").each(function (i, e) {
13
+        $.each($(e).attr("class").split(" "), function (i, c) {
14
+            if (/^shortkey_/.test(c)) {
15
+                $(document).bind('keydown', c.substr(9), function () {
16
+                    $(e).click();
17
+                });
18
+            }
19
+        });
20
+    });
21
+};
22
+
23
+// Create the events for the help panel.
24
+coverage.wire_up_help_panel = function () {
25
+    $("#keyboard_icon").click(function () {
26
+        // Show the help panel, and position it so the keyboard icon in the
27
+        // panel is in the same place as the keyboard icon in the header.
28
+        $(".help_panel").show();
29
+        var koff = $("#keyboard_icon").offset();
30
+        var poff = $("#panel_icon").position();
31
+        $(".help_panel").offset({
32
+            top: koff.top-poff.top,
33
+            left: koff.left-poff.left
34
+        });
35
+    });
36
+    $("#panel_icon").click(function () {
37
+        $(".help_panel").hide();
38
+    });
39
+};
40
+
41
+// Create the events for the filter box.
42
+coverage.wire_up_filter = function () {
43
+    // Cache elements.
44
+    var table = $("table.index");
45
+    var table_rows = table.find("tbody tr");
46
+    var table_row_names = table_rows.find("td.name a");
47
+    var no_rows = $("#no_rows");
48
+
49
+    // Create a duplicate table footer that we can modify with dynamic summed values.
50
+    var table_footer = $("table.index tfoot tr");
51
+    var table_dynamic_footer = table_footer.clone();
52
+    table_dynamic_footer.attr('class', 'total_dynamic hidden');
53
+    table_footer.after(table_dynamic_footer);
54
+
55
+    // Observe filter keyevents.
56
+    $("#filter").on("keyup change", $.debounce(150, function (event) {
57
+        var filter_value = $(this).val();
58
+
59
+        if (filter_value === "") {
60
+            // Filter box is empty, remove all filtering.
61
+            table_rows.removeClass("hidden");
62
+
63
+            // Show standard footer, hide dynamic footer.
64
+            table_footer.removeClass("hidden");
65
+            table_dynamic_footer.addClass("hidden");
66
+
67
+            // Hide placeholder, show table.
68
+            if (no_rows.length > 0) {
69
+                no_rows.hide();
70
+            }
71
+            table.show();
72
+
73
+        }
74
+        else {
75
+            // Filter table items by value.
76
+            var hidden = 0;
77
+            var shown = 0;
78
+
79
+            // Hide / show elements.
80
+            $.each(table_row_names, function () {
81
+                var element = $(this).parents("tr");
82
+
83
+                if ($(this).text().indexOf(filter_value) === -1) {
84
+                    // hide
85
+                    element.addClass("hidden");
86
+                    hidden++;
87
+                }
88
+                else {
89
+                    // show
90
+                    element.removeClass("hidden");
91
+                    shown++;
92
+                }
93
+            });
94
+
95
+            // Show placeholder if no rows will be displayed.
96
+            if (no_rows.length > 0) {
97
+                if (shown === 0) {
98
+                    // Show placeholder, hide table.
99
+                    no_rows.show();
100
+                    table.hide();
101
+                }
102
+                else {
103
+                    // Hide placeholder, show table.
104
+                    no_rows.hide();
105
+                    table.show();
106
+                }
107
+            }
108
+
109
+            // Manage dynamic header:
110
+            if (hidden > 0) {
111
+                // Calculate new dynamic sum values based on visible rows.
112
+                for (var column = 2; column < 20; column++) {
113
+                    // Calculate summed value.
114
+                    var cells = table_rows.find('td:nth-child(' + column + ')');
115
+                    if (!cells.length) {
116
+                        // No more columns...!
117
+                        break;
118
+                    }
119
+
120
+                    var sum = 0, numer = 0, denom = 0;
121
+                    $.each(cells.filter(':visible'), function () {
122
+                        var ratio = $(this).data("ratio");
123
+                        if (ratio) {
124
+                            var splitted = ratio.split(" ");
125
+                            numer += parseInt(splitted[0], 10);
126
+                            denom += parseInt(splitted[1], 10);
127
+                        }
128
+                        else {
129
+                            sum += parseInt(this.innerHTML, 10);
130
+                        }
131
+                    });
132
+
133
+                    // Get footer cell element.
134
+                    var footer_cell = table_dynamic_footer.find('td:nth-child(' + column + ')');
135
+
136
+                    // Set value into dynamic footer cell element.
137
+                    if (cells[0].innerHTML.indexOf('%') > -1) {
138
+                        // Percentage columns use the numerator and denominator,
139
+                        // and adapt to the number of decimal places.
140
+                        var match = /\.([0-9]+)/.exec(cells[0].innerHTML);
141
+                        var places = 0;
142
+                        if (match) {
143
+                            places = match[1].length;
144
+                        }
145
+                        var pct = numer * 100 / denom;
146
+                        footer_cell.text(pct.toFixed(places) + '%');
147
+                    }
148
+                    else {
149
+                        footer_cell.text(sum);
150
+                    }
151
+                }
152
+
153
+                // Hide standard footer, show dynamic footer.
154
+                table_footer.addClass("hidden");
155
+                table_dynamic_footer.removeClass("hidden");
156
+            }
157
+            else {
158
+                // Show standard footer, hide dynamic footer.
159
+                table_footer.removeClass("hidden");
160
+                table_dynamic_footer.addClass("hidden");
161
+            }
162
+        }
163
+    }));
164
+
165
+    // Trigger change event on setup, to force filter on page refresh
166
+    // (filter value may still be present).
167
+    $("#filter").trigger("change");
168
+};
169
+
170
+// Loaded on index.html
171
+coverage.index_ready = function ($) {
172
+    // Look for a cookie containing previous sort settings:
173
+    var sort_list = [];
174
+    var cookie_name = "COVERAGE_INDEX_SORT";
175
+    var i;
176
+
177
+    // This almost makes it worth installing the jQuery cookie plugin:
178
+    if (document.cookie.indexOf(cookie_name) > -1) {
179
+        var cookies = document.cookie.split(";");
180
+        for (i = 0; i < cookies.length; i++) {
181
+            var parts = cookies[i].split("=");
182
+
183
+            if ($.trim(parts[0]) === cookie_name && parts[1]) {
184
+                sort_list = eval("[[" + parts[1] + "]]");
185
+                break;
186
+            }
187
+        }
188
+    }
189
+
190
+    // Create a new widget which exists only to save and restore
191
+    // the sort order:
192
+    $.tablesorter.addWidget({
193
+        id: "persistentSort",
194
+
195
+        // Format is called by the widget before displaying:
196
+        format: function (table) {
197
+            if (table.config.sortList.length === 0 && sort_list.length > 0) {
198
+                // This table hasn't been sorted before - we'll use
199
+                // our stored settings:
200
+                $(table).trigger('sorton', [sort_list]);
201
+            }
202
+            else {
203
+                // This is not the first load - something has
204
+                // already defined sorting so we'll just update
205
+                // our stored value to match:
206
+                sort_list = table.config.sortList;
207
+            }
208
+        }
209
+    });
210
+
211
+    // Configure our tablesorter to handle the variable number of
212
+    // columns produced depending on report options:
213
+    var headers = [];
214
+    var col_count = $("table.index > thead > tr > th").length;
215
+
216
+    headers[0] = { sorter: 'text' };
217
+    for (i = 1; i < col_count-1; i++) {
218
+        headers[i] = { sorter: 'digit' };
219
+    }
220
+    headers[col_count-1] = { sorter: 'percent' };
221
+
222
+    // Enable the table sorter:
223
+    $("table.index").tablesorter({
224
+        widgets: ['persistentSort'],
225
+        headers: headers
226
+    });
227
+
228
+    coverage.assign_shortkeys();
229
+    coverage.wire_up_help_panel();
230
+    coverage.wire_up_filter();
231
+
232
+    // Watch for page unload events so we can save the final sort settings:
233
+    $(window).unload(function () {
234
+        document.cookie = cookie_name + "=" + sort_list.toString() + "; path=/";
235
+    });
236
+};
237
+
238
+// -- pyfile stuff --
239
+
240
+coverage.pyfile_ready = function ($) {
241
+    // If we're directed to a particular line number, highlight the line.
242
+    var frag = location.hash;
243
+    if (frag.length > 2 && frag[1] === 'n') {
244
+        $(frag).addClass('highlight');
245
+        coverage.set_sel(parseInt(frag.substr(2), 10));
246
+    }
247
+    else {
248
+        coverage.set_sel(0);
249
+    }
250
+
251
+    $(document)
252
+        .bind('keydown', 'j', coverage.to_next_chunk_nicely)
253
+        .bind('keydown', 'k', coverage.to_prev_chunk_nicely)
254
+        .bind('keydown', '0', coverage.to_top)
255
+        .bind('keydown', '1', coverage.to_first_chunk)
256
+        ;
257
+
258
+    $(".button_toggle_run").click(function (evt) {coverage.toggle_lines(evt.target, "run");});
259
+    $(".button_toggle_exc").click(function (evt) {coverage.toggle_lines(evt.target, "exc");});
260
+    $(".button_toggle_mis").click(function (evt) {coverage.toggle_lines(evt.target, "mis");});
261
+    $(".button_toggle_par").click(function (evt) {coverage.toggle_lines(evt.target, "par");});
262
+
263
+    coverage.assign_shortkeys();
264
+    coverage.wire_up_help_panel();
265
+
266
+    coverage.init_scroll_markers();
267
+
268
+    // Rebuild scroll markers after window high changing
269
+    $(window).resize(coverage.resize_scroll_markers);
270
+};
271
+
272
+coverage.toggle_lines = function (btn, cls) {
273
+    btn = $(btn);
274
+    var hide = "hide_"+cls;
275
+    if (btn.hasClass(hide)) {
276
+        $("#source ."+cls).removeClass(hide);
277
+        btn.removeClass(hide);
278
+    }
279
+    else {
280
+        $("#source ."+cls).addClass(hide);
281
+        btn.addClass(hide);
282
+    }
283
+};
284
+
285
+// Return the nth line div.
286
+coverage.line_elt = function (n) {
287
+    return $("#t" + n);
288
+};
289
+
290
+// Return the nth line number div.
291
+coverage.num_elt = function (n) {
292
+    return $("#n" + n);
293
+};
294
+
295
+// Return the container of all the code.
296
+coverage.code_container = function () {
297
+    return $(".linenos");
298
+};
299
+
300
+// Set the selection.  b and e are line numbers.
301
+coverage.set_sel = function (b, e) {
302
+    // The first line selected.
303
+    coverage.sel_begin = b;
304
+    // The next line not selected.
305
+    coverage.sel_end = (e === undefined) ? b+1 : e;
306
+};
307
+
308
+coverage.to_top = function () {
309
+    coverage.set_sel(0, 1);
310
+    coverage.scroll_window(0);
311
+};
312
+
313
+coverage.to_first_chunk = function () {
314
+    coverage.set_sel(0, 1);
315
+    coverage.to_next_chunk();
316
+};
317
+
318
+coverage.is_transparent = function (color) {
319
+    // Different browsers return different colors for "none".
320
+    return color === "transparent" || color === "rgba(0, 0, 0, 0)";
321
+};
322
+
323
+coverage.to_next_chunk = function () {
324
+    var c = coverage;
325
+
326
+    // Find the start of the next colored chunk.
327
+    var probe = c.sel_end;
328
+    var color, probe_line;
329
+    while (true) {
330
+        probe_line = c.line_elt(probe);
331
+        if (probe_line.length === 0) {
332
+            return;
333
+        }
334
+        color = probe_line.css("background-color");
335
+        if (!c.is_transparent(color)) {
336
+            break;
337
+        }
338
+        probe++;
339
+    }
340
+
341
+    // There's a next chunk, `probe` points to it.
342
+    var begin = probe;
343
+
344
+    // Find the end of this chunk.
345
+    var next_color = color;
346
+    while (next_color === color) {
347
+        probe++;
348
+        probe_line = c.line_elt(probe);
349
+        next_color = probe_line.css("background-color");
350
+    }
351
+    c.set_sel(begin, probe);
352
+    c.show_selection();
353
+};
354
+
355
+coverage.to_prev_chunk = function () {
356
+    var c = coverage;
357
+
358
+    // Find the end of the prev colored chunk.
359
+    var probe = c.sel_begin-1;
360
+    var probe_line = c.line_elt(probe);
361
+    if (probe_line.length === 0) {
362
+        return;
363
+    }
364
+    var color = probe_line.css("background-color");
365
+    while (probe > 0 && c.is_transparent(color)) {
366
+        probe--;
367
+        probe_line = c.line_elt(probe);
368
+        if (probe_line.length === 0) {
369
+            return;
370
+        }
371
+        color = probe_line.css("background-color");
372
+    }
373
+
374
+    // There's a prev chunk, `probe` points to its last line.
375
+    var end = probe+1;
376
+
377
+    // Find the beginning of this chunk.
378
+    var prev_color = color;
379
+    while (prev_color === color) {
380
+        probe--;
381
+        probe_line = c.line_elt(probe);
382
+        prev_color = probe_line.css("background-color");
383
+    }
384
+    c.set_sel(probe+1, end);
385
+    c.show_selection();
386
+};
387
+
388
+// Return the line number of the line nearest pixel position pos
389
+coverage.line_at_pos = function (pos) {
390
+    var l1 = coverage.line_elt(1),
391
+        l2 = coverage.line_elt(2),
392
+        result;
393
+    if (l1.length && l2.length) {
394
+        var l1_top = l1.offset().top,
395
+            line_height = l2.offset().top - l1_top,
396
+            nlines = (pos - l1_top) / line_height;
397
+        if (nlines < 1) {
398
+            result = 1;
399
+        }
400
+        else {
401
+            result = Math.ceil(nlines);
402
+        }
403
+    }
404
+    else {
405
+        result = 1;
406
+    }
407
+    return result;
408
+};
409
+
410
+// Returns 0, 1, or 2: how many of the two ends of the selection are on
411
+// the screen right now?
412
+coverage.selection_ends_on_screen = function () {
413
+    if (coverage.sel_begin === 0) {
414
+        return 0;
415
+    }
416
+
417
+    var top = coverage.line_elt(coverage.sel_begin);
418
+    var next = coverage.line_elt(coverage.sel_end-1);
419
+
420
+    return (
421
+        (top.isOnScreen() ? 1 : 0) +
422
+        (next.isOnScreen() ? 1 : 0)
423
+    );
424
+};
425
+
426
+coverage.to_next_chunk_nicely = function () {
427
+    coverage.finish_scrolling();
428
+    if (coverage.selection_ends_on_screen() === 0) {
429
+        // The selection is entirely off the screen: select the top line on
430
+        // the screen.
431
+        var win = $(window);
432
+        coverage.select_line_or_chunk(coverage.line_at_pos(win.scrollTop()));
433
+    }
434
+    coverage.to_next_chunk();
435
+};
436
+
437
+coverage.to_prev_chunk_nicely = function () {
438
+    coverage.finish_scrolling();
439
+    if (coverage.selection_ends_on_screen() === 0) {
440
+        var win = $(window);
441
+        coverage.select_line_or_chunk(coverage.line_at_pos(win.scrollTop() + win.height()));
442
+    }
443
+    coverage.to_prev_chunk();
444
+};
445
+
446
+// Select line number lineno, or if it is in a colored chunk, select the
447
+// entire chunk
448
+coverage.select_line_or_chunk = function (lineno) {
449
+    var c = coverage;
450
+    var probe_line = c.line_elt(lineno);
451
+    if (probe_line.length === 0) {
452
+        return;
453
+    }
454
+    var the_color = probe_line.css("background-color");
455
+    if (!c.is_transparent(the_color)) {
456
+        // The line is in a highlighted chunk.
457
+        // Search backward for the first line.
458
+        var probe = lineno;
459
+        var color = the_color;
460
+        while (probe > 0 && color === the_color) {
461
+            probe--;
462
+            probe_line = c.line_elt(probe);
463
+            if (probe_line.length === 0) {
464
+                break;
465
+            }
466
+            color = probe_line.css("background-color");
467
+        }
468
+        var begin = probe + 1;
469
+
470
+        // Search forward for the last line.
471
+        probe = lineno;
472
+        color = the_color;
473
+        while (color === the_color) {
474
+            probe++;
475
+            probe_line = c.line_elt(probe);
476
+            color = probe_line.css("background-color");
477
+        }
478
+
479
+        coverage.set_sel(begin, probe);
480
+    }
481
+    else {
482
+        coverage.set_sel(lineno);
483
+    }
484
+};
485
+
486
+coverage.show_selection = function () {
487
+    var c = coverage;
488
+
489
+    // Highlight the lines in the chunk
490
+    c.code_container().find(".highlight").removeClass("highlight");
491
+    for (var probe = c.sel_begin; probe > 0 && probe < c.sel_end; probe++) {
492
+        c.num_elt(probe).addClass("highlight");
493
+    }
494
+
495
+    c.scroll_to_selection();
496
+};
497
+
498
+coverage.scroll_to_selection = function () {
499
+    // Scroll the page if the chunk isn't fully visible.
500
+    if (coverage.selection_ends_on_screen() < 2) {
501
+        // Need to move the page. The html,body trick makes it scroll in all
502
+        // browsers, got it from http://stackoverflow.com/questions/3042651
503
+        var top = coverage.line_elt(coverage.sel_begin);
504
+        var top_pos = parseInt(top.offset().top, 10);
505
+        coverage.scroll_window(top_pos - 30);
506
+    }
507
+};
508
+
509
+coverage.scroll_window = function (to_pos) {
510
+    $("html,body").animate({scrollTop: to_pos}, 200);
511
+};
512
+
513
+coverage.finish_scrolling = function () {
514
+    $("html,body").stop(true, true);
515
+};
516
+
517
+coverage.init_scroll_markers = function () {
518
+    var c = coverage;
519
+    // Init some variables
520
+    c.lines_len = $('td.text p').length;
521
+    c.body_h = $('body').height();
522
+    c.header_h = $('div#header').height();
523
+    c.missed_lines = $('td.text p.mis, td.text p.par');
524
+
525
+    // Build html
526
+    c.resize_scroll_markers();
527
+};
528
+
529
+coverage.resize_scroll_markers = function () {
530
+    var c = coverage,
531
+        min_line_height = 3,
532
+        max_line_height = 10,
533
+        visible_window_h = $(window).height();
534
+
535
+    $('#scroll_marker').remove();
536
+    // Don't build markers if the window has no scroll bar.
537
+    if (c.body_h <= visible_window_h) {
538
+        return;
539
+    }
540
+
541
+    $("body").append("<div id='scroll_marker'>&nbsp;</div>");
542
+    var scroll_marker = $('#scroll_marker'),
543
+        marker_scale = scroll_marker.height() / c.body_h,
544
+        line_height = scroll_marker.height() / c.lines_len;
545
+
546
+    // Line height must be between the extremes.
547
+    if (line_height > min_line_height) {
548
+        if (line_height > max_line_height) {
549
+            line_height = max_line_height;
550
+        }
551
+    }
552
+    else {
553
+        line_height = min_line_height;
554
+    }
555
+
556
+    var previous_line = -99,
557
+        last_mark,
558
+        last_top;
559
+
560
+    c.missed_lines.each(function () {
561
+        var line_top = Math.round($(this).offset().top * marker_scale),
562
+            id_name = $(this).attr('id'),
563
+            line_number = parseInt(id_name.substring(1, id_name.length));
564
+
565
+        if (line_number === previous_line + 1) {
566
+            // If this solid missed block just make previous mark higher.
567
+            last_mark.css({
568
+                'height': line_top + line_height - last_top
569
+            });
570
+        }
571
+        else {
572
+            // Add colored line in scroll_marker block.
573
+            scroll_marker.append('<div id="m' + line_number + '" class="marker"></div>');
574
+            last_mark = $('#m' + line_number);
575
+            last_mark.css({
576
+                'height': line_height,
577
+                'top': line_top
578
+            });
579
+            last_top = line_top;
580
+        }
581
+
582
+        previous_line = line_number;
583
+    });
584
+};

+ 91
- 0
covers/htmlcov/funpy___init___py.html View File

@@ -0,0 +1,91 @@
1
+
2
+
3
+
4
+<!DOCTYPE html>
5
+<html>
6
+<head>
7
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8
+    
9
+    
10
+    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
11
+    <title>Coverage for funpy/__init__.py: 100%</title>
12
+    <link rel="stylesheet" href="style.css" type="text/css">
13
+    
14
+    <script type="text/javascript" src="jquery.min.js"></script>
15
+    <script type="text/javascript" src="jquery.hotkeys.js"></script>
16
+    <script type="text/javascript" src="jquery.isonscreen.js"></script>
17
+    <script type="text/javascript" src="coverage_html.js"></script>
18
+    <script type="text/javascript">
19
+        jQuery(document).ready(coverage.pyfile_ready);
20
+    </script>
21
+</head>
22
+<body class="pyfile">
23
+
24
+<div id="header">
25
+    <div class="content">
26
+        <h1>Coverage for <b>funpy/__init__.py</b> :
27
+            <span class="pc_cov">100%</span>
28
+        </h1>
29
+
30
+        <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" />
31
+
32
+        <h2 class="stats">
33
+            0 statements &nbsp;
34
+            <span class="run hide_run shortkey_r button_toggle_run">0 run</span>
35
+            <span class="mis shortkey_m button_toggle_mis">0 missing</span>
36
+            <span class="exc shortkey_x button_toggle_exc">0 excluded</span>
37
+
38
+            
39
+                <span class="par run hide_run shortkey_p button_toggle_par">0 partial</span>
40
+            
41
+        </h2>
42
+    </div>
43
+</div>
44
+
45
+<div class="help_panel">
46
+    <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" />
47
+    <p class="legend">Hot-keys on this page</p>
48
+    <div>
49
+    <p class="keyhelp">
50
+        <span class="key">r</span>
51
+        <span class="key">m</span>
52
+        <span class="key">x</span>
53
+        <span class="key">p</span> &nbsp; toggle line displays
54
+    </p>
55
+    <p class="keyhelp">
56
+        <span class="key">j</span>
57
+        <span class="key">k</span> &nbsp; next/prev highlighted chunk
58
+    </p>
59
+    <p class="keyhelp">
60
+        <span class="key">0</span> &nbsp; (zero) top of page
61
+    </p>
62
+    <p class="keyhelp">
63
+        <span class="key">1</span> &nbsp; (one) first highlighted chunk
64
+    </p>
65
+    </div>
66
+</div>
67
+
68
+<div id="source">
69
+    <table>
70
+        <tr>
71
+            <td class="linenos">
72
+
73
+            </td>
74
+            <td class="text">
75
+
76
+            </td>
77
+        </tr>
78
+    </table>
79
+</div>
80
+
81
+<div id="footer">
82
+    <div class="content">
83
+        <p>
84
+            <a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io">coverage.py v4.5.2</a>,
85
+            created at 2018-12-07 21:39
86
+        </p>
87
+    </div>
88
+</div>
89
+
90
+</body>
91
+</html>

+ 689
- 0
covers/htmlcov/funpy_fn_py.html View File

@@ -0,0 +1,689 @@
1
+
2
+
3
+
4
+<!DOCTYPE html>
5
+<html>
6
+<head>
7
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8
+    
9
+    
10
+    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
11
+    <title>Coverage for funpy/fn.py: 100%</title>
12
+    <link rel="stylesheet" href="style.css" type="text/css">
13
+    
14
+    <script type="text/javascript" src="jquery.min.js"></script>
15
+    <script type="text/javascript" src="jquery.hotkeys.js"></script>
16
+    <script type="text/javascript" src="jquery.isonscreen.js"></script>
17
+    <script type="text/javascript" src="coverage_html.js"></script>
18
+    <script type="text/javascript">
19
+        jQuery(document).ready(coverage.pyfile_ready);
20
+    </script>
21
+</head>
22
+<body class="pyfile">
23
+
24
+<div id="header">
25
+    <div class="content">
26
+        <h1>Coverage for <b>funpy/fn.py</b> :
27
+            <span class="pc_cov">100%</span>
28
+        </h1>
29
+
30
+        <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" />
31
+
32
+        <h2 class="stats">
33
+            84 statements &nbsp;
34
+            <span class="run hide_run shortkey_r button_toggle_run">84 run</span>
35
+            <span class="mis shortkey_m button_toggle_mis">0 missing</span>
36
+            <span class="exc shortkey_x button_toggle_exc">0 excluded</span>
37
+
38
+            
39
+                <span class="par run hide_run shortkey_p button_toggle_par">0 partial</span>
40
+            
41
+        </h2>
42
+    </div>
43
+</div>
44
+
45
+<div class="help_panel">
46
+    <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" />
47
+    <p class="legend">Hot-keys on this page</p>
48
+    <div>
49
+    <p class="keyhelp">
50
+        <span class="key">r</span>
51
+        <span class="key">m</span>
52
+        <span class="key">x</span>
53
+        <span class="key">p</span> &nbsp; toggle line displays
54
+    </p>
55
+    <p class="keyhelp">
56
+        <span class="key">j</span>
57
+        <span class="key">k</span> &nbsp; next/prev highlighted chunk
58
+    </p>
59
+    <p class="keyhelp">
60
+        <span class="key">0</span> &nbsp; (zero) top of page
61
+    </p>
62
+    <p class="keyhelp">
63
+        <span class="key">1</span> &nbsp; (one) first highlighted chunk
64
+    </p>
65
+    </div>
66
+</div>
67
+
68
+<div id="source">
69
+    <table>
70
+        <tr>
71
+            <td class="linenos">
72
+<p id="n1" class="pln"><a href="#n1">1</a></p>
73
+<p id="n2" class="pln"><a href="#n2">2</a></p>
74
+<p id="n3" class="stm run hide_run"><a href="#n3">3</a></p>
75
+<p id="n4" class="stm run hide_run"><a href="#n4">4</a></p>
76
+<p id="n5" class="pln"><a href="#n5">5</a></p>
77
+<p id="n6" class="pln"><a href="#n6">6</a></p>
78
+<p id="n7" class="stm run hide_run"><a href="#n7">7</a></p>
79
+<p id="n8" class="pln"><a href="#n8">8</a></p>
80
+<p id="n9" class="stm run hide_run"><a href="#n9">9</a></p>
81
+<p id="n10" class="pln"><a href="#n10">10</a></p>
82
+<p id="n11" class="stm run hide_run"><a href="#n11">11</a></p>
83
+<p id="n12" class="stm run hide_run"><a href="#n12">12</a></p>
84
+<p id="n13" class="stm run hide_run"><a href="#n13">13</a></p>
85
+<p id="n14" class="pln"><a href="#n14">14</a></p>
86
+<p id="n15" class="pln"><a href="#n15">15</a></p>
87
+<p id="n16" class="pln"><a href="#n16">16</a></p>
88
+<p id="n17" class="stm run hide_run"><a href="#n17">17</a></p>
89
+<p id="n18" class="pln"><a href="#n18">18</a></p>
90
+<p id="n19" class="pln"><a href="#n19">19</a></p>
91
+<p id="n20" class="pln"><a href="#n20">20</a></p>
92
+<p id="n21" class="pln"><a href="#n21">21</a></p>
93
+<p id="n22" class="pln"><a href="#n22">22</a></p>
94
+<p id="n23" class="pln"><a href="#n23">23</a></p>
95
+<p id="n24" class="pln"><a href="#n24">24</a></p>
96
+<p id="n25" class="pln"><a href="#n25">25</a></p>
97
+<p id="n26" class="stm run hide_run"><a href="#n26">26</a></p>
98
+<p id="n27" class="pln"><a href="#n27">27</a></p>
99
+<p id="n28" class="pln"><a href="#n28">28</a></p>
100
+<p id="n29" class="stm run hide_run"><a href="#n29">29</a></p>
101
+<p id="n30" class="pln"><a href="#n30">30</a></p>
102
+<p id="n31" class="pln"><a href="#n31">31</a></p>
103
+<p id="n32" class="pln"><a href="#n32">32</a></p>
104
+<p id="n33" class="pln"><a href="#n33">33</a></p>
105
+<p id="n34" class="pln"><a href="#n34">34</a></p>
106
+<p id="n35" class="pln"><a href="#n35">35</a></p>
107
+<p id="n36" class="pln"><a href="#n36">36</a></p>
108
+<p id="n37" class="stm run hide_run"><a href="#n37">37</a></p>
109
+<p id="n38" class="pln"><a href="#n38">38</a></p>
110
+<p id="n39" class="stm run hide_run"><a href="#n39">39</a></p>
111
+<p id="n40" class="stm run hide_run"><a href="#n40">40</a></p>
112
+<p id="n41" class="pln"><a href="#n41">41</a></p>
113
+<p id="n42" class="pln"><a href="#n42">42</a></p>
114
+<p id="n43" class="pln"><a href="#n43">43</a></p>
115
+<p id="n44" class="pln"><a href="#n44">44</a></p>
116
+<p id="n45" class="stm run hide_run"><a href="#n45">45</a></p>
117
+<p id="n46" class="pln"><a href="#n46">46</a></p>
118
+<p id="n47" class="stm run hide_run"><a href="#n47">47</a></p>
119
+<p id="n48" class="pln"><a href="#n48">48</a></p>
120
+<p id="n49" class="stm run hide_run"><a href="#n49">49</a></p>
121
+<p id="n50" class="pln"><a href="#n50">50</a></p>
122
+<p id="n51" class="pln"><a href="#n51">51</a></p>
123
+<p id="n52" class="stm run hide_run"><a href="#n52">52</a></p>
124
+<p id="n53" class="pln"><a href="#n53">53</a></p>
125
+<p id="n54" class="pln"><a href="#n54">54</a></p>
126
+<p id="n55" class="pln"><a href="#n55">55</a></p>
127
+<p id="n56" class="pln"><a href="#n56">56</a></p>
128
+<p id="n57" class="pln"><a href="#n57">57</a></p>
129
+<p id="n58" class="pln"><a href="#n58">58</a></p>
130
+<p id="n59" class="stm run hide_run"><a href="#n59">59</a></p>
131
+<p id="n60" class="pln"><a href="#n60">60</a></p>
132
+<p id="n61" class="stm run hide_run"><a href="#n61">61</a></p>
133
+<p id="n62" class="pln"><a href="#n62">62</a></p>
134
+<p id="n63" class="stm run hide_run"><a href="#n63">63</a></p>
135
+<p id="n64" class="pln"><a href="#n64">64</a></p>
136
+<p id="n65" class="pln"><a href="#n65">65</a></p>
137
+<p id="n66" class="stm run hide_run"><a href="#n66">66</a></p>
138
+<p id="n67" class="pln"><a href="#n67">67</a></p>
139
+<p id="n68" class="pln"><a href="#n68">68</a></p>
140
+<p id="n69" class="pln"><a href="#n69">69</a></p>
141
+<p id="n70" class="pln"><a href="#n70">70</a></p>
142
+<p id="n71" class="pln"><a href="#n71">71</a></p>
143
+<p id="n72" class="stm run hide_run"><a href="#n72">72</a></p>
144
+<p id="n73" class="pln"><a href="#n73">73</a></p>
145
+<p id="n74" class="pln"><a href="#n74">74</a></p>
146
+<p id="n75" class="pln"><a href="#n75">75</a></p>
147
+<p id="n76" class="pln"><a href="#n76">76</a></p>
148
+<p id="n77" class="stm run hide_run"><a href="#n77">77</a></p>
149
+<p id="n78" class="pln"><a href="#n78">78</a></p>
150
+<p id="n79" class="pln"><a href="#n79">79</a></p>
151
+<p id="n80" class="pln"><a href="#n80">80</a></p>
152
+<p id="n81" class="pln"><a href="#n81">81</a></p>
153
+<p id="n82" class="pln"><a href="#n82">82</a></p>
154
+<p id="n83" class="pln"><a href="#n83">83</a></p>
155
+<p id="n84" class="pln"><a href="#n84">84</a></p>
156
+<p id="n85" class="pln"><a href="#n85">85</a></p>
157
+<p id="n86" class="pln"><a href="#n86">86</a></p>
158
+<p id="n87" class="stm run hide_run"><a href="#n87">87</a></p>
159
+<p id="n88" class="pln"><a href="#n88">88</a></p>
160
+<p id="n89" class="pln"><a href="#n89">89</a></p>
161
+<p id="n90" class="stm run hide_run"><a href="#n90">90</a></p>
162
+<p id="n91" class="pln"><a href="#n91">91</a></p>
163
+<p id="n92" class="pln"><a href="#n92">92</a></p>
164
+<p id="n93" class="pln"><a href="#n93">93</a></p>
165
+<p id="n94" class="pln"><a href="#n94">94</a></p>
166
+<p id="n95" class="pln"><a href="#n95">95</a></p>
167
+<p id="n96" class="pln"><a href="#n96">96</a></p>
168
+<p id="n97" class="stm run hide_run"><a href="#n97">97</a></p>
169
+<p id="n98" class="stm run hide_run"><a href="#n98">98</a></p>
170
+<p id="n99" class="pln"><a href="#n99">99</a></p>
171
+<p id="n100" class="stm run hide_run"><a href="#n100">100</a></p>
172
+<p id="n101" class="pln"><a href="#n101">101</a></p>
173
+<p id="n102" class="pln"><a href="#n102">102</a></p>
174
+<p id="n103" class="pln"><a href="#n103">103</a></p>
175
+<p id="n104" class="pln"><a href="#n104">104</a></p>
176
+<p id="n105" class="stm run hide_run"><a href="#n105">105</a></p>
177
+<p id="n106" class="pln"><a href="#n106">106</a></p>
178
+<p id="n107" class="pln"><a href="#n107">107</a></p>
179
+<p id="n108" class="pln"><a href="#n108">108</a></p>
180
+<p id="n109" class="pln"><a href="#n109">109</a></p>
181
+<p id="n110" class="pln"><a href="#n110">110</a></p>
182
+<p id="n111" class="pln"><a href="#n111">111</a></p>
183
+<p id="n112" class="stm run hide_run"><a href="#n112">112</a></p>
184
+<p id="n113" class="stm run hide_run"><a href="#n113">113</a></p>
185
+<p id="n114" class="pln"><a href="#n114">114</a></p>
186
+<p id="n115" class="stm run hide_run"><a href="#n115">115</a></p>
187
+<p id="n116" class="pln"><a href="#n116">116</a></p>
188
+<p id="n117" class="pln"><a href="#n117">117</a></p>
189
+<p id="n118" class="stm run hide_run"><a href="#n118">118</a></p>
190
+<p id="n119" class="pln"><a href="#n119">119</a></p>
191
+<p id="n120" class="pln"><a href="#n120">120</a></p>
192
+<p id="n121" class="pln"><a href="#n121">121</a></p>
193
+<p id="n122" class="pln"><a href="#n122">122</a></p>
194
+<p id="n123" class="pln"><a href="#n123">123</a></p>
195
+<p id="n124" class="pln"><a href="#n124">124</a></p>
196
+<p id="n125" class="pln"><a href="#n125">125</a></p>
197
+<p id="n126" class="pln"><a href="#n126">126</a></p>
198
+<p id="n127" class="pln"><a href="#n127">127</a></p>
199
+<p id="n128" class="pln"><a href="#n128">128</a></p>
200
+<p id="n129" class="pln"><a href="#n129">129</a></p>
201
+<p id="n130" class="stm run hide_run"><a href="#n130">130</a></p>
202
+<p id="n131" class="stm run hide_run"><a href="#n131">131</a></p>
203
+<p id="n132" class="pln"><a href="#n132">132</a></p>
204
+<p id="n133" class="stm run hide_run"><a href="#n133">133</a></p>
205
+<p id="n134" class="pln"><a href="#n134">134</a></p>
206
+<p id="n135" class="pln"><a href="#n135">135</a></p>
207
+<p id="n136" class="stm run hide_run"><a href="#n136">136</a></p>
208
+<p id="n137" class="pln"><a href="#n137">137</a></p>
209
+<p id="n138" class="pln"><a href="#n138">138</a></p>
210
+<p id="n139" class="pln"><a href="#n139">139</a></p>
211
+<p id="n140" class="pln"><a href="#n140">140</a></p>
212
+<p id="n141" class="pln"><a href="#n141">141</a></p>
213
+<p id="n142" class="pln"><a href="#n142">142</a></p>
214
+<p id="n143" class="pln"><a href="#n143">143</a></p>
215
+<p id="n144" class="pln"><a href="#n144">144</a></p>
216
+<p id="n145" class="pln"><a href="#n145">145</a></p>
217
+<p id="n146" class="pln"><a href="#n146">146</a></p>
218
+<p id="n147" class="pln"><a href="#n147">147</a></p>
219
+<p id="n148" class="stm run hide_run"><a href="#n148">148</a></p>
220
+<p id="n149" class="stm run hide_run"><a href="#n149">149</a></p>
221
+<p id="n150" class="pln"><a href="#n150">150</a></p>
222
+<p id="n151" class="stm run hide_run"><a href="#n151">151</a></p>
223
+<p id="n152" class="stm run hide_run"><a href="#n152">152</a></p>
224
+<p id="n153" class="pln"><a href="#n153">153</a></p>
225
+<p id="n154" class="stm run hide_run"><a href="#n154">154</a></p>
226
+<p id="n155" class="pln"><a href="#n155">155</a></p>
227
+<p id="n156" class="pln"><a href="#n156">156</a></p>
228
+<p id="n157" class="pln"><a href="#n157">157</a></p>
229
+<p id="n158" class="pln"><a href="#n158">158</a></p>
230
+<p id="n159" class="stm run hide_run"><a href="#n159">159</a></p>
231
+<p id="n160" class="pln"><a href="#n160">160</a></p>
232
+<p id="n161" class="stm run hide_run"><a href="#n161">161</a></p>
233
+<p id="n162" class="pln"><a href="#n162">162</a></p>
234
+<p id="n163" class="stm run hide_run"><a href="#n163">163</a></p>
235
+<p id="n164" class="pln"><a href="#n164">164</a></p>
236
+<p id="n165" class="stm run hide_run"><a href="#n165">165</a></p>
237
+<p id="n166" class="pln"><a href="#n166">166</a></p>
238
+<p id="n167" class="pln"><a href="#n167">167</a></p>
239
+<p id="n168" class="stm run hide_run"><a href="#n168">168</a></p>
240
+<p id="n169" class="pln"><a href="#n169">169</a></p>
241
+<p id="n170" class="pln"><a href="#n170">170</a></p>
242
+<p id="n171" class="pln"><a href="#n171">171</a></p>
243
+<p id="n172" class="pln"><a href="#n172">172</a></p>
244
+<p id="n173" class="pln"><a href="#n173">173</a></p>
245
+<p id="n174" class="pln"><a href="#n174">174</a></p>
246
+<p id="n175" class="pln"><a href="#n175">175</a></p>
247
+<p id="n176" class="pln"><a href="#n176">176</a></p>
248
+<p id="n177" class="pln"><a href="#n177">177</a></p>
249
+<p id="n178" class="stm run hide_run"><a href="#n178">178</a></p>
250
+<p id="n179" class="pln"><a href="#n179">179</a></p>
251
+<p id="n180" class="stm run hide_run"><a href="#n180">180</a></p>
252
+<p id="n181" class="pln"><a href="#n181">181</a></p>
253
+<p id="n182" class="stm run hide_run"><a href="#n182">182</a></p>
254
+<p id="n183" class="pln"><a href="#n183">183</a></p>
255
+<p id="n184" class="stm run hide_run"><a href="#n184">184</a></p>
256
+<p id="n185" class="pln"><a href="#n185">185</a></p>
257
+<p id="n186" class="pln"><a href="#n186">186</a></p>
258
+<p id="n187" class="stm run hide_run"><a href="#n187">187</a></p>
259
+<p id="n188" class="pln"><a href="#n188">188</a></p>
260
+<p id="n189" class="pln"><a href="#n189">189</a></p>
261
+<p id="n190" class="pln"><a href="#n190">190</a></p>
262
+<p id="n191" class="pln"><a href="#n191">191</a></p>
263
+<p id="n192" class="pln"><a href="#n192">192</a></p>
264
+<p id="n193" class="pln"><a href="#n193">193</a></p>
265
+<p id="n194" class="pln"><a href="#n194">194</a></p>
266
+<p id="n195" class="pln"><a href="#n195">195</a></p>
267
+<p id="n196" class="pln"><a href="#n196">196</a></p>
268
+<p id="n197" class="stm run hide_run"><a href="#n197">197</a></p>
269
+<p id="n198" class="pln"><a href="#n198">198</a></p>
270
+<p id="n199" class="stm run hide_run"><a href="#n199">199</a></p>
271
+<p id="n200" class="pln"><a href="#n200">200</a></p>
272
+<p id="n201" class="stm run hide_run"><a href="#n201">201</a></p>
273
+<p id="n202" class="pln"><a href="#n202">202</a></p>
274
+<p id="n203" class="stm run hide_run"><a href="#n203">203</a></p>
275
+<p id="n204" class="pln"><a href="#n204">204</a></p>
276
+<p id="n205" class="stm run hide_run"><a href="#n205">205</a></p>
277
+<p id="n206" class="pln"><a href="#n206">206</a></p>
278
+<p id="n207" class="pln"><a href="#n207">207</a></p>
279
+<p id="n208" class="stm run hide_run"><a href="#n208">208</a></p>
280
+<p id="n209" class="pln"><a href="#n209">209</a></p>
281
+<p id="n210" class="pln"><a href="#n210">210</a></p>
282
+<p id="n211" class="pln"><a href="#n211">211</a></p>
283
+<p id="n212" class="pln"><a href="#n212">212</a></p>
284
+<p id="n213" class="pln"><a href="#n213">213</a></p>
285
+<p id="n214" class="pln"><a href="#n214">214</a></p>
286
+<p id="n215" class="pln"><a href="#n215">215</a></p>
287
+<p id="n216" class="pln"><a href="#n216">216</a></p>
288
+<p id="n217" class="stm run hide_run"><a href="#n217">217</a></p>
289
+<p id="n218" class="stm run hide_run"><a href="#n218">218</a></p>
290
+<p id="n219" class="stm run hide_run"><a href="#n219">219</a></p>
291
+<p id="n220" class="pln"><a href="#n220">220</a></p>
292
+<p id="n221" class="stm run hide_run"><a href="#n221">221</a></p>
293
+<p id="n222" class="pln"><a href="#n222">222</a></p>
294
+<p id="n223" class="pln"><a href="#n223">223</a></p>
295
+<p id="n224" class="stm run hide_run"><a href="#n224">224</a></p>
296
+<p id="n225" class="pln"><a href="#n225">225</a></p>
297
+<p id="n226" class="pln"><a href="#n226">226</a></p>
298
+<p id="n227" class="pln"><a href="#n227">227</a></p>
299
+<p id="n228" class="pln"><a href="#n228">228</a></p>
300
+<p id="n229" class="pln"><a href="#n229">229</a></p>
301
+<p id="n230" class="pln"><a href="#n230">230</a></p>
302
+<p id="n231" class="pln"><a href="#n231">231</a></p>
303
+<p id="n232" class="pln"><a href="#n232">232</a></p>
304
+<p id="n233" class="pln"><a href="#n233">233</a></p>
305
+<p id="n234" class="pln"><a href="#n234">234</a></p>
306
+<p id="n235" class="stm run hide_run"><a href="#n235">235</a></p>
307
+<p id="n236" class="pln"><a href="#n236">236</a></p>
308
+<p id="n237" class="stm run hide_run"><a href="#n237">237</a></p>
309
+<p id="n238" class="stm run hide_run"><a href="#n238">238</a></p>
310
+<p id="n239" class="stm run hide_run"><a href="#n239">239</a></p>
311
+<p id="n240" class="stm run hide_run"><a href="#n240">240</a></p>
312
+<p id="n241" class="pln"><a href="#n241">241</a></p>
313
+<p id="n242" class="stm run hide_run"><a href="#n242">242</a></p>
314
+<p id="n243" class="pln"><a href="#n243">243</a></p>
315
+<p id="n244" class="pln"><a href="#n244">244</a></p>
316
+<p id="n245" class="stm run hide_run"><a href="#n245">245</a></p>
317
+<p id="n246" class="pln"><a href="#n246">246</a></p>
318
+<p id="n247" class="pln"><a href="#n247">247</a></p>
319
+<p id="n248" class="pln"><a href="#n248">248</a></p>
320
+<p id="n249" class="pln"><a href="#n249">249</a></p>
321
+<p id="n250" class="pln"><a href="#n250">250</a></p>
322
+<p id="n251" class="pln"><a href="#n251">251</a></p>
323
+<p id="n252" class="pln"><a href="#n252">252</a></p>
324
+<p id="n253" class="pln"><a href="#n253">253</a></p>
325
+<p id="n254" class="stm run hide_run"><a href="#n254">254</a></p>
326
+<p id="n255" class="pln"><a href="#n255">255</a></p>
327
+<p id="n256" class="stm run hide_run"><a href="#n256">256</a></p>
328
+<p id="n257" class="pln"><a href="#n257">257</a></p>
329
+<p id="n258" class="stm run hide_run"><a href="#n258">258</a></p>
330
+<p id="n259" class="pln"><a href="#n259">259</a></p>
331
+<p id="n260" class="stm run hide_run"><a href="#n260">260</a></p>
332
+<p id="n261" class="pln"><a href="#n261">261</a></p>
333
+<p id="n262" class="stm run hide_run"><a href="#n262">262</a></p>
334
+<p id="n263" class="pln"><a href="#n263">263</a></p>
335
+<p id="n264" class="pln"><a href="#n264">264</a></p>
336
+<p id="n265" class="stm run hide_run"><a href="#n265">265</a></p>
337
+<p id="n266" class="pln"><a href="#n266">266</a></p>
338
+<p id="n267" class="pln"><a href="#n267">267</a></p>
339
+<p id="n268" class="pln"><a href="#n268">268</a></p>
340
+<p id="n269" class="pln"><a href="#n269">269</a></p>
341
+<p id="n270" class="pln"><a href="#n270">270</a></p>
342
+<p id="n271" class="pln"><a href="#n271">271</a></p>
343
+<p id="n272" class="pln"><a href="#n272">272</a></p>
344
+<p id="n273" class="pln"><a href="#n273">273</a></p>
345
+<p id="n274" class="stm run hide_run"><a href="#n274">274</a></p>
346
+<p id="n275" class="pln"><a href="#n275">275</a></p>
347
+<p id="n276" class="stm run hide_run"><a href="#n276">276</a></p>
348
+<p id="n277" class="pln"><a href="#n277">277</a></p>
349
+<p id="n278" class="stm run hide_run"><a href="#n278">278</a></p>
350
+<p id="n279" class="pln"><a href="#n279">279</a></p>
351
+<p id="n280" class="stm run hide_run"><a href="#n280">280</a></p>
352
+<p id="n281" class="pln"><a href="#n281">281</a></p>
353
+<p id="n282" class="pln"><a href="#n282">282</a></p>
354
+<p id="n283" class="stm run hide_run"><a href="#n283">283</a></p>
355
+<p id="n284" class="pln"><a href="#n284">284</a></p>
356
+<p id="n285" class="pln"><a href="#n285">285</a></p>
357
+<p id="n286" class="pln"><a href="#n286">286</a></p>
358
+<p id="n287" class="pln"><a href="#n287">287</a></p>
359
+<p id="n288" class="pln"><a href="#n288">288</a></p>
360
+<p id="n289" class="pln"><a href="#n289">289</a></p>
361
+<p id="n290" class="pln"><a href="#n290">290</a></p>
362
+<p id="n291" class="pln"><a href="#n291">291</a></p>
363
+<p id="n292" class="stm run hide_run"><a href="#n292">292</a></p>
364
+<p id="n293" class="pln"><a href="#n293">293</a></p>
365
+<p id="n294" class="stm run hide_run"><a href="#n294">294</a></p>
366
+<p id="n295" class="pln"><a href="#n295">295</a></p>
367
+<p id="n296" class="stm run hide_run"><a href="#n296">296</a></p>
368
+<p id="n297" class="pln"><a href="#n297">297</a></p>
369
+<p id="n298" class="pln"><a href="#n298">298</a></p>
370
+<p id="n299" class="pln"><a href="#n299">299</a></p>
371
+
372
+            </td>
373
+            <td class="text">
374
+<p id="t1" class="pln"><span class="str">"""Function library."""</span><span class="strut">&nbsp;</span></p>
375
+<p id="t2" class="pln"><span class="strut">&nbsp;</span></p>
376
+<p id="t3" class="stm run hide_run"><span class="key">import</span> <span class="nam">copy</span> <span class="key">as</span> <span class="nam">Copy</span><span class="strut">&nbsp;</span></p>
377
+<p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">functools</span><span class="strut">&nbsp;</span></p>
378
+<p id="t5" class="pln"><span class="strut">&nbsp;</span></p>
379
+<p id="t6" class="pln"><span class="com"># TYPES {{{</span><span class="strut">&nbsp;</span></p>
380
+<p id="t7" class="stm run hide_run"><span class="key">from</span> <span class="nam">typing</span> <span class="key">import</span> <span class="nam">Callable</span><span class="op">,</span> <span class="nam">Iterable</span><span class="op">,</span> <span class="nam">TypeVar</span><span class="op">,</span> <span class="nam">Union</span><span class="strut">&nbsp;</span></p>
381
+<p id="t8" class="pln"><span class="strut">&nbsp;</span></p>
382
+<p id="t9" class="stm run hide_run"><span class="nam">Predicate</span> <span class="op">=</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">bool</span><span class="op">]</span><span class="strut">&nbsp;</span></p>
383
+<p id="t10" class="pln"><span class="strut">&nbsp;</span></p>
384
+<p id="t11" class="stm run hide_run"><span class="nam">X</span> <span class="op">=</span> <span class="nam">TypeVar</span><span class="op">(</span><span class="str">"X"</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
385
+<p id="t12" class="stm run hide_run"><span class="nam">Y</span> <span class="op">=</span> <span class="nam">TypeVar</span><span class="op">(</span><span class="str">"Y"</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
386
+<p id="t13" class="stm run hide_run"><span class="nam">Z</span> <span class="op">=</span> <span class="nam">TypeVar</span><span class="op">(</span><span class="str">"Z"</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
387
+<p id="t14" class="pln"><span class="strut">&nbsp;</span></p>
388
+<p id="t15" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
389
+<p id="t16" class="pln"><span class="com"># COPIERS {{{</span><span class="strut">&nbsp;</span></p>
390
+<p id="t17" class="stm run hide_run"><span class="key">def</span> <span class="nam">copy</span><span class="op">(</span><span class="nam">x</span><span class="op">:</span> <span class="nam">X</span><span class="op">,</span> <span class="nam">deep</span><span class="op">:</span> <span class="nam">bool</span> <span class="op">=</span> <span class="key">False</span><span class="op">)</span> <span class="op">-></span> <span class="nam">X</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
391
+<p id="t18" class="pln">    <span class="str">"""Return a copy of x.</span><span class="strut">&nbsp;</span></p>
392
+<p id="t19" class="pln"><span class="strut">&nbsp;</span></p>
393
+<p id="t20" class="pln"><span class="str">    >>> a = [1, 2, 3]</span><span class="strut">&nbsp;</span></p>
394
+<p id="t21" class="pln"><span class="str">    >>> a == copy(a, True)</span><span class="strut">&nbsp;</span></p>
395
+<p id="t22" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
396
+<p id="t23" class="pln"><span class="str">    >>> a == copy(a, False)</span><span class="strut">&nbsp;</span></p>
397
+<p id="t24" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
398
+<p id="t25" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
399
+<p id="t26" class="stm run hide_run">    <span class="key">return</span> <span class="nam">Copy</span><span class="op">.</span><span class="nam">deepcopy</span><span class="op">(</span><span class="nam">x</span><span class="op">)</span> <span class="key">if</span> <span class="nam">deep</span> <span class="key">else</span> <span class="nam">Copy</span><span class="op">.</span><span class="nam">copy</span><span class="op">(</span><span class="nam">x</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
400
+<p id="t27" class="pln"><span class="strut">&nbsp;</span></p>
401
+<p id="t28" class="pln"><span class="strut">&nbsp;</span></p>
402
+<p id="t29" class="stm run hide_run"><span class="key">def</span> <span class="nam">copies</span><span class="op">(</span><span class="nam">x</span><span class="op">:</span> <span class="nam">X</span><span class="op">,</span> <span class="nam">n</span><span class="op">:</span> <span class="nam">int</span> <span class="op">=</span> <span class="num">2</span><span class="op">,</span> <span class="nam">deep</span><span class="op">:</span> <span class="nam">bool</span> <span class="op">=</span> <span class="key">False</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Iterable</span><span class="op">[</span><span class="nam">X</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
403
+<p id="t30" class="pln">    <span class="str">"""Return n copy of x.</span><span class="strut">&nbsp;</span></p>
404
+<p id="t31" class="pln"><span class="strut">&nbsp;</span></p>
405
+<p id="t32" class="pln"><span class="str">    >>> a = [1, 2, 3]</span><span class="strut">&nbsp;</span></p>
406
+<p id="t33" class="pln"><span class="str">    >>> b, c = copies(a)</span><span class="strut">&nbsp;</span></p>
407
+<p id="t34" class="pln"><span class="str">    >>> a == b == c</span><span class="strut">&nbsp;</span></p>
408
+<p id="t35" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
409
+<p id="t36" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
410
+<p id="t37" class="stm run hide_run">    <span class="key">assert</span> <span class="nam">n</span> <span class="op">></span> <span class="num">0</span><span class="op">,</span> <span class="str">"n must be greater than 0"</span><span class="strut">&nbsp;</span></p>
411
+<p id="t38" class="pln"><span class="strut">&nbsp;</span></p>
412
+<p id="t39" class="stm run hide_run">    <span class="key">for</span> <span class="nam">_</span> <span class="key">in</span> <span class="nam">range</span><span class="op">(</span><span class="nam">n</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
413
+<p id="t40" class="stm run hide_run">        <span class="key">yield</span> <span class="nam">copy</span><span class="op">(</span><span class="nam">x</span><span class="op">,</span> <span class="nam">deep</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
414
+<p id="t41" class="pln"><span class="strut">&nbsp;</span></p>
415
+<p id="t42" class="pln"><span class="strut">&nbsp;</span></p>
416
+<p id="t43" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
417
+<p id="t44" class="pln"><span class="com"># WRAPPERS {{{</span><span class="strut">&nbsp;</span></p>
418
+<p id="t45" class="stm run hide_run"><span class="nam">wraps</span> <span class="op">=</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">wraps</span><span class="strut">&nbsp;</span></p>
419
+<p id="t46" class="pln"><span class="strut">&nbsp;</span></p>
420
+<p id="t47" class="stm run hide_run"><span class="nam">partial</span> <span class="op">=</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">partial</span><span class="strut">&nbsp;</span></p>
421
+<p id="t48" class="pln"><span class="strut">&nbsp;</span></p>
422
+<p id="t49" class="stm run hide_run"><span class="nam">partialme</span> <span class="op">=</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">partialmethod</span><span class="strut">&nbsp;</span></p>
423
+<p id="t50" class="pln"><span class="strut">&nbsp;</span></p>
424
+<p id="t51" class="pln"><span class="strut">&nbsp;</span></p>
425
+<p id="t52" class="stm run hide_run"><span class="key">def</span> <span class="nam">flip</span><span class="op">(</span><span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
426
+<p id="t53" class="pln">    <span class="str">""""Flip f arguments.</span><span class="strut">&nbsp;</span></p>
427
+<p id="t54" class="pln"><span class="strut">&nbsp;</span></p>
428
+<p id="t55" class="pln"><span class="str">    >>> flip(print)(1, 2, 3, sep=',')</span><span class="strut">&nbsp;</span></p>
429
+<p id="t56" class="pln"><span class="str">    3,2,1</span><span class="strut">&nbsp;</span></p>
430
+<p id="t57" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
431
+<p id="t58" class="pln"><span class="strut">&nbsp;</span></p>
432
+<p id="t59" class="stm run hide_run">    <span class="op">@</span><span class="nam">functools</span><span class="op">.</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
433
+<p id="t60" class="pln">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
434
+<p id="t61" class="stm run hide_run">        <span class="key">return</span> <span class="nam">f</span><span class="op">(</span><span class="op">*</span><span class="nam">reversed</span><span class="op">(</span><span class="nam">args</span><span class="op">)</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
435
+<p id="t62" class="pln"><span class="strut">&nbsp;</span></p>
436
+<p id="t63" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
437
+<p id="t64" class="pln"><span class="strut">&nbsp;</span></p>
438
+<p id="t65" class="pln"><span class="strut">&nbsp;</span></p>
439
+<p id="t66" class="stm run hide_run"><span class="key">def</span> <span class="nam">partialfp</span><span class="op">(</span><span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
440
+<p id="t67" class="pln">    <span class="str">"""Flip and partial f.</span><span class="strut">&nbsp;</span></p>
441
+<p id="t68" class="pln"><span class="strut">&nbsp;</span></p>
442
+<p id="t69" class="pln"><span class="str">    >>> partialfp(print, 0, 1, sep=',')(2, 3)</span><span class="strut">&nbsp;</span></p>
443
+<p id="t70" class="pln"><span class="str">    3,2,1,0</span><span class="strut">&nbsp;</span></p>
444
+<p id="t71" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
445
+<p id="t72" class="stm run hide_run">    <span class="key">return</span> <span class="nam">partial</span><span class="op">(</span><span class="nam">flip</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
446
+<p id="t73" class="pln"><span class="strut">&nbsp;</span></p>
447
+<p id="t74" class="pln"><span class="strut">&nbsp;</span></p>
448
+<p id="t75" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
449
+<p id="t76" class="pln"><span class="com"># LOW-ORDER {{{</span><span class="strut">&nbsp;</span></p>
450
+<p id="t77" class="stm run hide_run"><span class="key">def</span> <span class="nam">ident</span><span class="op">(</span><span class="nam">x</span><span class="op">:</span> <span class="nam">X</span><span class="op">)</span> <span class="op">-></span> <span class="nam">X</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
451
+<p id="t78" class="pln">    <span class="str">"""Return x unchanged.</span><span class="strut">&nbsp;</span></p>
452
+<p id="t79" class="pln"><span class="strut">&nbsp;</span></p>
453
+<p id="t80" class="pln"><span class="str">    >>> ident(0) is 0</span><span class="strut">&nbsp;</span></p>
454
+<p id="t81" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
455
+<p id="t82" class="pln"><span class="str">    >>> ident(1) is 1</span><span class="strut">&nbsp;</span></p>
456
+<p id="t83" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
457
+<p id="t84" class="pln"><span class="str">    >>> ident(None) is None</span><span class="strut">&nbsp;</span></p>
458
+<p id="t85" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
459
+<p id="t86" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
460
+<p id="t87" class="stm run hide_run">    <span class="key">return</span> <span class="nam">x</span><span class="strut">&nbsp;</span></p>
461
+<p id="t88" class="pln"><span class="strut">&nbsp;</span></p>
462
+<p id="t89" class="pln"><span class="strut">&nbsp;</span></p>
463
+<p id="t90" class="stm run hide_run"><span class="key">def</span> <span class="nam">constantly</span><span class="op">(</span><span class="nam">x</span><span class="op">:</span> <span class="nam">X</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">X</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
464
+<p id="t91" class="pln">    <span class="str">"""Constantly returns x through a function.</span><span class="strut">&nbsp;</span></p>
465
+<p id="t92" class="pln"><span class="strut">&nbsp;</span></p>
466
+<p id="t93" class="pln"><span class="str">    >>> constantly(0)(1, 2, x=3)</span><span class="strut">&nbsp;</span></p>
467
+<p id="t94" class="pln"><span class="str">    0</span><span class="strut">&nbsp;</span></p>
468
+<p id="t95" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
469
+<p id="t96" class="pln"><span class="strut">&nbsp;</span></p>
470
+<p id="t97" class="stm run hide_run">    <span class="key">def</span> <span class="nam">constant</span><span class="op">(</span><span class="op">*</span><span class="nam">_</span><span class="op">,</span> <span class="op">**</span><span class="nam">__</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
471
+<p id="t98" class="stm run hide_run">        <span class="key">return</span> <span class="nam">x</span><span class="strut">&nbsp;</span></p>
472
+<p id="t99" class="pln"><span class="strut">&nbsp;</span></p>
473
+<p id="t100" class="stm run hide_run">    <span class="key">return</span> <span class="nam">constant</span><span class="strut">&nbsp;</span></p>
474
+<p id="t101" class="pln"><span class="strut">&nbsp;</span></p>
475
+<p id="t102" class="pln"><span class="strut">&nbsp;</span></p>
476
+<p id="t103" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
477
+<p id="t104" class="pln"><span class="com"># HIGH-ORDER {{{</span><span class="strut">&nbsp;</span></p>
478
+<p id="t105" class="stm run hide_run"><span class="key">def</span> <span class="nam">compose</span><span class="op">(</span><span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">[</span><span class="nam">Z</span><span class="op">]</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">,</span> <span class="nam">g</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Z</span><span class="op">]</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
479
+<p id="t106" class="pln">    <span class="str">"""Compose two functions left to right.</span><span class="strut">&nbsp;</span></p>
480
+<p id="t107" class="pln"><span class="strut">&nbsp;</span></p>
481
+<p id="t108" class="pln"><span class="str">    >>> compose(range, list)(3)</span><span class="strut">&nbsp;</span></p>
482
+<p id="t109" class="pln"><span class="str">    [0, 1, 2]</span><span class="strut">&nbsp;</span></p>
483
+<p id="t110" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
484
+<p id="t111" class="pln"><span class="strut">&nbsp;</span></p>
485
+<p id="t112" class="stm run hide_run">    <span class="key">def</span> <span class="nam">composed</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
486
+<p id="t113" class="stm run hide_run">        <span class="key">return</span> <span class="nam">g</span><span class="op">(</span><span class="nam">f</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
487
+<p id="t114" class="pln"><span class="strut">&nbsp;</span></p>
488
+<p id="t115" class="stm run hide_run">    <span class="key">return</span> <span class="nam">composed</span><span class="strut">&nbsp;</span></p>
489
+<p id="t116" class="pln"><span class="strut">&nbsp;</span></p>
490
+<p id="t117" class="pln"><span class="strut">&nbsp;</span></p>
491
+<p id="t118" class="stm run hide_run"><span class="key">def</span> <span class="nam">comp</span><span class="op">(</span><span class="op">*</span><span class="nam">fs</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
492
+<p id="t119" class="pln">    <span class="str">"""Compose functions from left to right.</span><span class="strut">&nbsp;</span></p>
493
+<p id="t120" class="pln"><span class="strut">&nbsp;</span></p>
494
+<p id="t121" class="pln"><span class="str">    >>> comp()(2)</span><span class="strut">&nbsp;</span></p>
495
+<p id="t122" class="pln"><span class="str">    2</span><span class="strut">&nbsp;</span></p>
496
+<p id="t123" class="pln"><span class="str">    >>> comp(float)(2)</span><span class="strut">&nbsp;</span></p>
497
+<p id="t124" class="pln"><span class="str">    2.0</span><span class="strut">&nbsp;</span></p>
498
+<p id="t125" class="pln"><span class="str">    >>> comp(range, list)(2)</span><span class="strut">&nbsp;</span></p>
499
+<p id="t126" class="pln"><span class="str">    [0, 1]</span><span class="strut">&nbsp;</span></p>
500
+<p id="t127" class="pln"><span class="str">    >>> comp(range, list, len)(2)</span><span class="strut">&nbsp;</span></p>
501
+<p id="t128" class="pln"><span class="str">    2</span><span class="strut">&nbsp;</span></p>
502
+<p id="t129" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
503
+<p id="t130" class="stm run hide_run">    <span class="key">if</span> <span class="key">not</span> <span class="nam">fs</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
504
+<p id="t131" class="stm run hide_run">        <span class="key">return</span> <span class="nam">ident</span><span class="strut">&nbsp;</span></p>
505
+<p id="t132" class="pln"><span class="strut">&nbsp;</span></p>
506
+<p id="t133" class="stm run hide_run">    <span class="key">return</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">reduce</span><span class="op">(</span><span class="nam">compose</span><span class="op">,</span> <span class="nam">fs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
507
+<p id="t134" class="pln"><span class="strut">&nbsp;</span></p>
508
+<p id="t135" class="pln"><span class="strut">&nbsp;</span></p>
509
+<p id="t136" class="stm run hide_run"><span class="key">def</span> <span class="nam">juxt</span><span class="op">(</span><span class="op">*</span><span class="nam">fs</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">tuple</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
510
+<p id="t137" class="pln">    <span class="str">"""Juxtapose functions results.</span><span class="strut">&nbsp;</span></p>
511
+<p id="t138" class="pln"><span class="strut">&nbsp;</span></p>
512
+<p id="t139" class="pln"><span class="str">    >>> juxt()(2)</span><span class="strut">&nbsp;</span></p>
513
+<p id="t140" class="pln"><span class="str">    (2,)</span><span class="strut">&nbsp;</span></p>
514
+<p id="t141" class="pln"><span class="str">    >>> juxt(float)(2)</span><span class="strut">&nbsp;</span></p>
515
+<p id="t142" class="pln"><span class="str">    (2.0,)</span><span class="strut">&nbsp;</span></p>
516
+<p id="t143" class="pln"><span class="str">    >>> juxt(float, str)(2)</span><span class="strut">&nbsp;</span></p>
517
+<p id="t144" class="pln"><span class="str">    (2.0, '2')</span><span class="strut">&nbsp;</span></p>
518
+<p id="t145" class="pln"><span class="str">    >>> juxt(float, str, bin)(2)</span><span class="strut">&nbsp;</span></p>
519
+<p id="t146" class="pln"><span class="str">    (2.0, '2', '0b10')</span><span class="strut">&nbsp;</span></p>
520
+<p id="t147" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
521
+<p id="t148" class="stm run hide_run">    <span class="key">if</span> <span class="key">not</span> <span class="nam">fs</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
522
+<p id="t149" class="stm run hide_run">        <span class="nam">fs</span> <span class="op">=</span> <span class="op">(</span><span class="nam">ident</span><span class="op">,</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
523
+<p id="t150" class="pln"><span class="strut">&nbsp;</span></p>
524
+<p id="t151" class="stm run hide_run">    <span class="key">def</span> <span class="nam">juxted</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
525
+<p id="t152" class="stm run hide_run">        <span class="key">return</span> <span class="nam">tuple</span><span class="op">(</span><span class="nam">f</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span> <span class="key">for</span> <span class="nam">f</span> <span class="key">in</span> <span class="nam">fs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
526
+<p id="t153" class="pln"><span class="strut">&nbsp;</span></p>
527
+<p id="t154" class="stm run hide_run">    <span class="key">return</span> <span class="nam">juxted</span><span class="strut">&nbsp;</span></p>
528
+<p id="t155" class="pln"><span class="strut">&nbsp;</span></p>
529
+<p id="t156" class="pln"><span class="strut">&nbsp;</span></p>
530
+<p id="t157" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
531
+<p id="t158" class="pln"><span class="com"># DECORATORS {{{</span><span class="strut">&nbsp;</span></p>
532
+<p id="t159" class="stm run hide_run"><span class="nam">memoize</span> <span class="op">=</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">lru_cache</span><span class="strut">&nbsp;</span></p>
533
+<p id="t160" class="pln"><span class="strut">&nbsp;</span></p>
534
+<p id="t161" class="stm run hide_run"><span class="nam">comparator</span> <span class="op">=</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">cmp_to_key</span><span class="strut">&nbsp;</span></p>
535
+<p id="t162" class="pln"><span class="strut">&nbsp;</span></p>
536
+<p id="t163" class="stm run hide_run"><span class="nam">totalordering</span> <span class="op">=</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">total_ordering</span><span class="strut">&nbsp;</span></p>
537
+<p id="t164" class="pln"><span class="strut">&nbsp;</span></p>
538
+<p id="t165" class="stm run hide_run"><span class="nam">singledispatch</span> <span class="op">=</span> <span class="nam">functools</span><span class="op">.</span><span class="nam">singledispatch</span><span class="strut">&nbsp;</span></p>
539
+<p id="t166" class="pln"><span class="strut">&nbsp;</span></p>
540
+<p id="t167" class="pln"><span class="strut">&nbsp;</span></p>
541
+<p id="t168" class="stm run hide_run"><span class="key">def</span> <span class="nam">pre</span><span class="op">(</span><span class="strut">&nbsp;</span></p>
542
+<p id="t169" class="pln">    <span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">,</span> <span class="nam">do</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">[</span><span class="nam">tuple</span><span class="op">,</span> <span class="nam">dict</span><span class="op">]</span><span class="op">,</span> <span class="key">None</span><span class="op">]</span> <span class="op">=</span> <span class="nam">print</span><span class="strut">&nbsp;</span></p>
543
+<p id="t170" class="pln"><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
544
+<p id="t171" class="pln">    <span class="str">"""Call do before f (decorator).</span><span class="strut">&nbsp;</span></p>
545
+<p id="t172" class="pln"><span class="strut">&nbsp;</span></p>
546
+<p id="t173" class="pln"><span class="str">    >>> pre(float)(2)</span><span class="strut">&nbsp;</span></p>
547
+<p id="t174" class="pln"><span class="str">    (2,) {}</span><span class="strut">&nbsp;</span></p>
548
+<p id="t175" class="pln"><span class="str">    2.0</span><span class="strut">&nbsp;</span></p>
549
+<p id="t176" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
550
+<p id="t177" class="pln"><span class="strut">&nbsp;</span></p>
551
+<p id="t178" class="stm run hide_run">    <span class="op">@</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
552
+<p id="t179" class="pln">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
553
+<p id="t180" class="stm run hide_run">        <span class="nam">do</span><span class="op">(</span><span class="nam">args</span><span class="op">,</span> <span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
554
+<p id="t181" class="pln"><span class="strut">&nbsp;</span></p>
555
+<p id="t182" class="stm run hide_run">        <span class="key">return</span> <span class="nam">f</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
556
+<p id="t183" class="pln"><span class="strut">&nbsp;</span></p>
557
+<p id="t184" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
558
+<p id="t185" class="pln"><span class="strut">&nbsp;</span></p>
559
+<p id="t186" class="pln"><span class="strut">&nbsp;</span></p>
560
+<p id="t187" class="stm run hide_run"><span class="key">def</span> <span class="nam">post</span><span class="op">(</span><span class="strut">&nbsp;</span></p>
561
+<p id="t188" class="pln">    <span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">,</span> <span class="nam">do</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">[</span><span class="nam">tuple</span><span class="op">,</span> <span class="nam">dict</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">,</span> <span class="key">None</span><span class="op">]</span> <span class="op">=</span> <span class="nam">print</span><span class="strut">&nbsp;</span></p>
562
+<p id="t189" class="pln"><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
563
+<p id="t190" class="pln">    <span class="str">"""Call do after f (decorator).</span><span class="strut">&nbsp;</span></p>
564
+<p id="t191" class="pln"><span class="strut">&nbsp;</span></p>
565
+<p id="t192" class="pln"><span class="str">    >>> post(float)(2)</span><span class="strut">&nbsp;</span></p>
566
+<p id="t193" class="pln"><span class="str">    (2,) {} 2.0</span><span class="strut">&nbsp;</span></p>
567
+<p id="t194" class="pln"><span class="str">    2.0</span><span class="strut">&nbsp;</span></p>
568
+<p id="t195" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
569
+<p id="t196" class="pln"><span class="strut">&nbsp;</span></p>
570
+<p id="t197" class="stm run hide_run">    <span class="op">@</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
571
+<p id="t198" class="pln">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
572
+<p id="t199" class="stm run hide_run">        <span class="nam">res</span> <span class="op">=</span> <span class="nam">f</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
573
+<p id="t200" class="pln"><span class="strut">&nbsp;</span></p>
574
+<p id="t201" class="stm run hide_run">        <span class="nam">do</span><span class="op">(</span><span class="nam">args</span><span class="op">,</span> <span class="nam">kwargs</span><span class="op">,</span> <span class="nam">res</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
575
+<p id="t202" class="pln"><span class="strut">&nbsp;</span></p>
576
+<p id="t203" class="stm run hide_run">        <span class="key">return</span> <span class="nam">res</span><span class="strut">&nbsp;</span></p>
577
+<p id="t204" class="pln"><span class="strut">&nbsp;</span></p>
578
+<p id="t205" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
579
+<p id="t206" class="pln"><span class="strut">&nbsp;</span></p>
580
+<p id="t207" class="pln"><span class="strut">&nbsp;</span></p>
581
+<p id="t208" class="stm run hide_run"><span class="key">def</span> <span class="nam">fnil</span><span class="op">(</span><span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">,</span> <span class="nam">x</span><span class="op">:</span> <span class="nam">X</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
582
+<p id="t209" class="pln">    <span class="str">"""Replace the first argument of f by x if None.</span><span class="strut">&nbsp;</span></p>
583
+<p id="t210" class="pln"><span class="strut">&nbsp;</span></p>
584
+<p id="t211" class="pln"><span class="str">    >>> fnil(pow, 5)(2, 3)</span><span class="strut">&nbsp;</span></p>
585
+<p id="t212" class="pln"><span class="str">    8</span><span class="strut">&nbsp;</span></p>
586
+<p id="t213" class="pln"><span class="str">    >>> fnil(pow, 5)(None, 3)</span><span class="strut">&nbsp;</span></p>
587
+<p id="t214" class="pln"><span class="str">    125</span><span class="strut">&nbsp;</span></p>
588
+<p id="t215" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
589
+<p id="t216" class="pln"><span class="strut">&nbsp;</span></p>
590
+<p id="t217" class="stm run hide_run">    <span class="op">@</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
591
+<p id="t218" class="stm run hide_run">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="nam">z</span><span class="op">:</span> <span class="nam">X</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
592
+<p id="t219" class="stm run hide_run">        <span class="key">return</span> <span class="nam">f</span><span class="op">(</span><span class="nam">x</span> <span class="key">if</span> <span class="nam">z</span> <span class="key">is</span> <span class="key">None</span> <span class="key">else</span> <span class="nam">z</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
593
+<p id="t220" class="pln"><span class="strut">&nbsp;</span></p>
594
+<p id="t221" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
595
+<p id="t222" class="pln"><span class="strut">&nbsp;</span></p>
596
+<p id="t223" class="pln"><span class="strut">&nbsp;</span></p>
597
+<p id="t224" class="stm run hide_run"><span class="key">def</span> <span class="nam">safe</span><span class="op">(</span><span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Y</span><span class="op">]</span><span class="op">,</span> <span class="nam">x</span><span class="op">:</span> <span class="nam">Z</span> <span class="op">=</span> <span class="key">None</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="nam">Union</span><span class="op">[</span><span class="nam">Y</span><span class="op">,</span> <span class="nam">Z</span><span class="op">]</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
598
+<p id="t225" class="pln">    <span class="str">"""Return x if f throws an exception (decorator).</span><span class="strut">&nbsp;</span></p>
599
+<p id="t226" class="pln"><span class="strut">&nbsp;</span></p>
600
+<p id="t227" class="pln"><span class="str">    >>> safe(abs)(2) == 2</span><span class="strut">&nbsp;</span></p>
601
+<p id="t228" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
602
+<p id="t229" class="pln"><span class="str">    >>> safe(abs)('a') is None</span><span class="strut">&nbsp;</span></p>
603
+<p id="t230" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
604
+<p id="t231" class="pln"><span class="str">    >>> safe(abs, 2)('a') == 2</span><span class="strut">&nbsp;</span></p>
605
+<p id="t232" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
606
+<p id="t233" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
607
+<p id="t234" class="pln"><span class="strut">&nbsp;</span></p>
608
+<p id="t235" class="stm run hide_run">    <span class="op">@</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
609
+<p id="t236" class="pln">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
610
+<p id="t237" class="stm run hide_run">        <span class="key">try</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
611
+<p id="t238" class="stm run hide_run">            <span class="key">return</span> <span class="nam">f</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
612
+<p id="t239" class="stm run hide_run">        <span class="key">except</span> <span class="nam">Exception</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
613
+<p id="t240" class="stm run hide_run">            <span class="key">return</span> <span class="nam">x</span><span class="strut">&nbsp;</span></p>
614
+<p id="t241" class="pln"><span class="strut">&nbsp;</span></p>
615
+<p id="t242" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
616
+<p id="t243" class="pln"><span class="strut">&nbsp;</span></p>
617
+<p id="t244" class="pln"><span class="strut">&nbsp;</span></p>
618
+<p id="t245" class="stm run hide_run"><span class="key">def</span> <span class="nam">pure</span><span class="op">(</span><span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="key">None</span><span class="op">]</span><span class="op">,</span> <span class="nam">deep</span><span class="op">:</span> <span class="nam">bool</span> <span class="op">=</span> <span class="key">False</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
619
+<p id="t246" class="pln">    <span class="str">"""Purify the side effect of f (decorator).</span><span class="strut">&nbsp;</span></p>
620
+<p id="t247" class="pln"><span class="str">    >>> l, append = [], pure(list.append)</span><span class="strut">&nbsp;</span></p>
621
+<p id="t248" class="pln"><span class="str">    >>> append(append(append(l, 0), 1), 2)</span><span class="strut">&nbsp;</span></p>
622
+<p id="t249" class="pln"><span class="str">    [0, 1, 2]</span><span class="strut">&nbsp;</span></p>
623
+<p id="t250" class="pln"><span class="str">    >>> l</span><span class="strut">&nbsp;</span></p>
624
+<p id="t251" class="pln"><span class="str">    []</span><span class="strut">&nbsp;</span></p>
625
+<p id="t252" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
626
+<p id="t253" class="pln"><span class="strut">&nbsp;</span></p>
627
+<p id="t254" class="stm run hide_run">    <span class="op">@</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
628
+<p id="t255" class="pln">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="nam">x</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
629
+<p id="t256" class="stm run hide_run">        <span class="nam">x</span> <span class="op">=</span> <span class="nam">copy</span><span class="op">(</span><span class="nam">x</span><span class="op">,</span> <span class="nam">deep</span><span class="op">=</span><span class="nam">deep</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
630
+<p id="t257" class="pln"><span class="strut">&nbsp;</span></p>
631
+<p id="t258" class="stm run hide_run">        <span class="nam">f</span><span class="op">(</span><span class="nam">x</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
632
+<p id="t259" class="pln"><span class="strut">&nbsp;</span></p>
633
+<p id="t260" class="stm run hide_run">        <span class="key">return</span> <span class="nam">x</span><span class="strut">&nbsp;</span></p>
634
+<p id="t261" class="pln"><span class="strut">&nbsp;</span></p>
635
+<p id="t262" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
636
+<p id="t263" class="pln"><span class="strut">&nbsp;</span></p>
637
+<p id="t264" class="pln"><span class="strut">&nbsp;</span></p>
638
+<p id="t265" class="stm run hide_run"><span class="key">def</span> <span class="nam">fluent</span><span class="op">(</span><span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">...</span><span class="op">,</span> <span class="key">None</span><span class="op">]</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Callable</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
639
+<p id="t266" class="pln">    <span class="str">"""Grant a fluent interface to f (decorator).</span><span class="strut">&nbsp;</span></p>
640
+<p id="t267" class="pln"><span class="str">    >>> l, append = [], fluent(list.append)</span><span class="strut">&nbsp;</span></p>
641
+<p id="t268" class="pln"><span class="str">    >>> append(append(append(l, 0), 1), 2)</span><span class="strut">&nbsp;</span></p>
642
+<p id="t269" class="pln"><span class="str">    [0, 1, 2]</span><span class="strut">&nbsp;</span></p>
643
+<p id="t270" class="pln"><span class="str">    >>> l</span><span class="strut">&nbsp;</span></p>
644
+<p id="t271" class="pln"><span class="str">    [0, 1, 2]</span><span class="strut">&nbsp;</span></p>
645
+<p id="t272" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
646
+<p id="t273" class="pln"><span class="strut">&nbsp;</span></p>
647
+<p id="t274" class="stm run hide_run">    <span class="op">@</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">f</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
648
+<p id="t275" class="pln">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="nam">x</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
649
+<p id="t276" class="stm run hide_run">        <span class="nam">f</span><span class="op">(</span><span class="nam">x</span><span class="op">,</span> <span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
650
+<p id="t277" class="pln"><span class="strut">&nbsp;</span></p>
651
+<p id="t278" class="stm run hide_run">        <span class="key">return</span> <span class="nam">x</span><span class="strut">&nbsp;</span></p>
652
+<p id="t279" class="pln"><span class="strut">&nbsp;</span></p>
653
+<p id="t280" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
654
+<p id="t281" class="pln"><span class="strut">&nbsp;</span></p>
655
+<p id="t282" class="pln"><span class="strut">&nbsp;</span></p>
656
+<p id="t283" class="stm run hide_run"><span class="key">def</span> <span class="nam">complement</span><span class="op">(</span><span class="nam">p</span><span class="op">:</span> <span class="nam">Predicate</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Predicate</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
657
+<p id="t284" class="pln">    <span class="str">"""Reverse the logic of p (decorator).</span><span class="strut">&nbsp;</span></p>
658
+<p id="t285" class="pln"><span class="strut">&nbsp;</span></p>
659
+<p id="t286" class="pln"><span class="str">    >>> complement(bool)(True)</span><span class="strut">&nbsp;</span></p>
660
+<p id="t287" class="pln"><span class="str">    False</span><span class="strut">&nbsp;</span></p>
661
+<p id="t288" class="pln"><span class="str">    >>> complement(bool)(False)</span><span class="strut">&nbsp;</span></p>
662
+<p id="t289" class="pln"><span class="str">    True</span><span class="strut">&nbsp;</span></p>
663
+<p id="t290" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
664
+<p id="t291" class="pln"><span class="strut">&nbsp;</span></p>
665
+<p id="t292" class="stm run hide_run">    <span class="op">@</span><span class="nam">wraps</span><span class="op">(</span><span class="nam">p</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
666
+<p id="t293" class="pln">    <span class="key">def</span> <span class="nam">wrapped</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
667
+<p id="t294" class="stm run hide_run">        <span class="key">return</span> <span class="key">not</span> <span class="nam">p</span><span class="op">(</span><span class="op">*</span><span class="nam">args</span><span class="op">,</span> <span class="op">**</span><span class="nam">kwargs</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
668
+<p id="t295" class="pln"><span class="strut">&nbsp;</span></p>
669
+<p id="t296" class="stm run hide_run">    <span class="key">return</span> <span class="nam">wrapped</span><span class="strut">&nbsp;</span></p>
670
+<p id="t297" class="pln"><span class="strut">&nbsp;</span></p>
671
+<p id="t298" class="pln"><span class="strut">&nbsp;</span></p>
672
+<p id="t299" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
673
+
674
+            </td>
675
+        </tr>
676
+    </table>
677
+</div>
678
+
679
+<div id="footer">
680
+    <div class="content">
681
+        <p>
682
+            <a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io">coverage.py v4.5.2</a>,
683
+            created at 2018-12-07 21:39
684
+        </p>
685
+    </div>
686
+</div>
687
+
688
+</body>
689
+</html>

+ 351
- 0
covers/htmlcov/funpy_io_py.html View File

@@ -0,0 +1,351 @@
1
+
2
+
3
+
4
+<!DOCTYPE html>
5
+<html>
6
+<head>
7
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8
+    
9
+    
10
+    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
11
+    <title>Coverage for funpy/io.py: 89%</title>
12
+    <link rel="stylesheet" href="style.css" type="text/css">
13
+    
14
+    <script type="text/javascript" src="jquery.min.js"></script>
15
+    <script type="text/javascript" src="jquery.hotkeys.js"></script>
16
+    <script type="text/javascript" src="jquery.isonscreen.js"></script>
17
+    <script type="text/javascript" src="coverage_html.js"></script>
18
+    <script type="text/javascript">
19
+        jQuery(document).ready(coverage.pyfile_ready);
20
+    </script>
21
+</head>
22
+<body class="pyfile">
23
+
24
+<div id="header">
25
+    <div class="content">
26
+        <h1>Coverage for <b>funpy/io.py</b> :
27
+            <span class="pc_cov">89%</span>
28
+        </h1>
29
+
30
+        <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" />
31
+
32
+        <h2 class="stats">
33
+            36 statements &nbsp;
34
+            <span class="run hide_run shortkey_r button_toggle_run">31 run</span>
35
+            <span class="mis shortkey_m button_toggle_mis">5 missing</span>
36
+            <span class="exc shortkey_x button_toggle_exc">0 excluded</span>
37
+
38
+            
39
+                <span class="par run hide_run shortkey_p button_toggle_par">0 partial</span>
40
+            
41
+        </h2>
42
+    </div>
43
+</div>
44
+
45
+<div class="help_panel">
46
+    <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" />
47
+    <p class="legend">Hot-keys on this page</p>
48
+    <div>
49
+    <p class="keyhelp">
50
+        <span class="key">r</span>
51
+        <span class="key">m</span>
52
+        <span class="key">x</span>
53
+        <span class="key">p</span> &nbsp; toggle line displays
54
+    </p>
55
+    <p class="keyhelp">
56
+        <span class="key">j</span>
57
+        <span class="key">k</span> &nbsp; next/prev highlighted chunk
58
+    </p>
59
+    <p class="keyhelp">
60
+        <span class="key">0</span> &nbsp; (zero) top of page
61
+    </p>
62
+    <p class="keyhelp">
63
+        <span class="key">1</span> &nbsp; (one) first highlighted chunk
64
+    </p>
65
+    </div>
66
+</div>
67
+
68
+<div id="source">
69
+    <table>
70
+        <tr>
71
+            <td class="linenos">
72
+<p id="n1" class="pln"><a href="#n1">1</a></p>
73
+<p id="n2" class="pln"><a href="#n2">2</a></p>
74
+<p id="n3" class="stm run hide_run"><a href="#n3">3</a></p>
75
+<p id="n4" class="stm run hide_run"><a href="#n4">4</a></p>
76
+<p id="n5" class="stm run hide_run"><a href="#n5">5</a></p>
77
+<p id="n6" class="stm run hide_run"><a href="#n6">6</a></p>
78
+<p id="n7" class="pln"><a href="#n7">7</a></p>
79
+<p id="n8" class="pln"><a href="#n8">8</a></p>
80
+<p id="n9" class="stm run hide_run"><a href="#n9">9</a></p>
81
+<p id="n10" class="pln"><a href="#n10">10</a></p>
82
+<p id="n11" class="stm run hide_run"><a href="#n11">11</a></p>
83
+<p id="n12" class="stm run hide_run"><a href="#n12">12</a></p>
84
+<p id="n13" class="pln"><a href="#n13">13</a></p>
85
+<p id="n14" class="pln"><a href="#n14">14</a></p>
86
+<p id="n15" class="stm run hide_run"><a href="#n15">15</a></p>
87
+<p id="n16" class="pln"><a href="#n16">16</a></p>
88
+<p id="n17" class="stm run hide_run"><a href="#n17">17</a></p>
89
+<p id="n18" class="pln"><a href="#n18">18</a></p>
90
+<p id="n19" class="pln"><a href="#n19">19</a></p>
91
+<p id="n20" class="stm run hide_run"><a href="#n20">20</a></p>
92
+<p id="n21" class="pln"><a href="#n21">21</a></p>
93
+<p id="n22" class="pln"><a href="#n22">22</a></p>
94
+<p id="n23" class="stm run hide_run"><a href="#n23">23</a></p>
95
+<p id="n24" class="pln"><a href="#n24">24</a></p>
96
+<p id="n25" class="stm mis"><a href="#n25">25</a></p>
97
+<p id="n26" class="stm mis"><a href="#n26">26</a></p>
98
+<p id="n27" class="pln"><a href="#n27">27</a></p>
99
+<p id="n28" class="pln"><a href="#n28">28</a></p>
100
+<p id="n29" class="pln"><a href="#n29">29</a></p>
101
+<p id="n30" class="pln"><a href="#n30">30</a></p>
102
+<p id="n31" class="stm run hide_run"><a href="#n31">31</a></p>
103
+<p id="n32" class="pln"><a href="#n32">32</a></p>
104
+<p id="n33" class="pln"><a href="#n33">33</a></p>
105
+<p id="n34" class="stm run hide_run"><a href="#n34">34</a></p>
106
+<p id="n35" class="pln"><a href="#n35">35</a></p>
107
+<p id="n36" class="stm mis"><a href="#n36">36</a></p>
108
+<p id="n37" class="stm mis"><a href="#n37">37</a></p>
109
+<p id="n38" class="pln"><a href="#n38">38</a></p>
110
+<p id="n39" class="pln"><a href="#n39">39</a></p>
111
+<p id="n40" class="pln"><a href="#n40">40</a></p>
112
+<p id="n41" class="pln"><a href="#n41">41</a></p>
113
+<p id="n42" class="stm run hide_run"><a href="#n42">42</a></p>
114
+<p id="n43" class="pln"><a href="#n43">43</a></p>
115
+<p id="n44" class="pln"><a href="#n44">44</a></p>
116
+<p id="n45" class="pln"><a href="#n45">45</a></p>
117
+<p id="n46" class="pln"><a href="#n46">46</a></p>
118
+<p id="n47" class="pln"><a href="#n47">47</a></p>
119
+<p id="n48" class="stm mis"><a href="#n48">48</a></p>
120
+<p id="n49" class="pln"><a href="#n49">49</a></p>
121
+<p id="n50" class="pln"><a href="#n50">50</a></p>
122
+<p id="n51" class="pln"><a href="#n51">51</a></p>
123
+<p id="n52" class="pln"><a href="#n52">52</a></p>
124
+<p id="n53" class="stm run hide_run"><a href="#n53">53</a></p>
125
+<p id="n54" class="pln"><a href="#n54">54</a></p>
126
+<p id="n55" class="stm run hide_run"><a href="#n55">55</a></p>
127
+<p id="n56" class="pln"><a href="#n56">56</a></p>
128
+<p id="n57" class="stm run hide_run"><a href="#n57">57</a></p>
129
+<p id="n58" class="pln"><a href="#n58">58</a></p>
130
+<p id="n59" class="stm run hide_run"><a href="#n59">59</a></p>
131
+<p id="n60" class="pln"><a href="#n60">60</a></p>
132
+<p id="n61" class="stm run hide_run"><a href="#n61">61</a></p>
133
+<p id="n62" class="pln"><a href="#n62">62</a></p>
134
+<p id="n63" class="pln"><a href="#n63">63</a></p>
135
+<p id="n64" class="stm run hide_run"><a href="#n64">64</a></p>
136
+<p id="n65" class="pln"><a href="#n65">65</a></p>
137
+<p id="n66" class="pln"><a href="#n66">66</a></p>
138
+<p id="n67" class="pln"><a href="#n67">67</a></p>
139
+<p id="n68" class="pln"><a href="#n68">68</a></p>
140
+<p id="n69" class="pln"><a href="#n69">69</a></p>
141
+<p id="n70" class="pln"><a href="#n70">70</a></p>
142
+<p id="n71" class="pln"><a href="#n71">71</a></p>
143
+<p id="n72" class="stm run hide_run"><a href="#n72">72</a></p>
144
+<p id="n73" class="pln"><a href="#n73">73</a></p>
145
+<p id="n74" class="pln"><a href="#n74">74</a></p>
146
+<p id="n75" class="stm run hide_run"><a href="#n75">75</a></p>
147
+<p id="n76" class="pln"><a href="#n76">76</a></p>
148
+<p id="n77" class="pln"><a href="#n77">77</a></p>
149
+<p id="n78" class="pln"><a href="#n78">78</a></p>
150
+<p id="n79" class="pln"><a href="#n79">79</a></p>
151
+<p id="n80" class="pln"><a href="#n80">80</a></p>
152
+<p id="n81" class="pln"><a href="#n81">81</a></p>
153
+<p id="n82" class="pln"><a href="#n82">82</a></p>
154
+<p id="n83" class="stm run hide_run"><a href="#n83">83</a></p>
155
+<p id="n84" class="pln"><a href="#n84">84</a></p>
156
+<p id="n85" class="pln"><a href="#n85">85</a></p>
157
+<p id="n86" class="stm run hide_run"><a href="#n86">86</a></p>
158
+<p id="n87" class="pln"><a href="#n87">87</a></p>
159
+<p id="n88" class="pln"><a href="#n88">88</a></p>
160
+<p id="n89" class="pln"><a href="#n89">89</a></p>
161
+<p id="n90" class="pln"><a href="#n90">90</a></p>
162
+<p id="n91" class="pln"><a href="#n91">91</a></p>
163
+<p id="n92" class="pln"><a href="#n92">92</a></p>
164
+<p id="n93" class="pln"><a href="#n93">93</a></p>
165
+<p id="n94" class="stm run hide_run"><a href="#n94">94</a></p>
166
+<p id="n95" class="pln"><a href="#n95">95</a></p>
167
+<p id="n96" class="pln"><a href="#n96">96</a></p>
168
+<p id="n97" class="stm run hide_run"><a href="#n97">97</a></p>
169
+<p id="n98" class="pln"><a href="#n98">98</a></p>
170
+<p id="n99" class="pln"><a href="#n99">99</a></p>
171
+<p id="n100" class="pln"><a href="#n100">100</a></p>
172
+<p id="n101" class="pln"><a href="#n101">101</a></p>
173
+<p id="n102" class="pln"><a href="#n102">102</a></p>
174
+<p id="n103" class="pln"><a href="#n103">103</a></p>
175
+<p id="n104" class="pln"><a href="#n104">104</a></p>
176
+<p id="n105" class="stm run hide_run"><a href="#n105">105</a></p>
177
+<p id="n106" class="pln"><a href="#n106">106</a></p>
178
+<p id="n107" class="pln"><a href="#n107">107</a></p>
179
+<p id="n108" class="stm run hide_run"><a href="#n108">108</a></p>
180
+<p id="n109" class="pln"><a href="#n109">109</a></p>
181
+<p id="n110" class="pln"><a href="#n110">110</a></p>
182
+<p id="n111" class="pln"><a href="#n111">111</a></p>
183
+<p id="n112" class="pln"><a href="#n112">112</a></p>
184
+<p id="n113" class="pln"><a href="#n113">113</a></p>
185
+<p id="n114" class="pln"><a href="#n114">114</a></p>
186
+<p id="n115" class="pln"><a href="#n115">115</a></p>
187
+<p id="n116" class="stm run hide_run"><a href="#n116">116</a></p>
188
+<p id="n117" class="pln"><a href="#n117">117</a></p>
189
+<p id="n118" class="pln"><a href="#n118">118</a></p>
190
+<p id="n119" class="stm run hide_run"><a href="#n119">119</a></p>
191
+<p id="n120" class="pln"><a href="#n120">120</a></p>
192
+<p id="n121" class="pln"><a href="#n121">121</a></p>
193
+<p id="n122" class="pln"><a href="#n122">122</a></p>
194
+<p id="n123" class="pln"><a href="#n123">123</a></p>
195
+<p id="n124" class="pln"><a href="#n124">124</a></p>
196
+<p id="n125" class="pln"><a href="#n125">125</a></p>
197
+<p id="n126" class="pln"><a href="#n126">126</a></p>
198
+<p id="n127" class="stm run hide_run"><a href="#n127">127</a></p>
199
+<p id="n128" class="pln"><a href="#n128">128</a></p>
200
+<p id="n129" class="pln"><a href="#n129">129</a></p>
201
+<p id="n130" class="pln"><a href="#n130">130</a></p>
202
+
203
+            </td>
204
+            <td class="text">
205
+<p id="t1" class="pln"><span class="str">"""Input/Output library."""</span><span class="strut">&nbsp;</span></p>
206
+<p id="t2" class="pln"><span class="strut">&nbsp;</span></p>
207
+<p id="t3" class="stm run hide_run"><span class="key">import</span> <span class="nam">fileinput</span><span class="strut">&nbsp;</span></p>
208
+<p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">glob</span> <span class="key">as</span> <span class="nam">Glob</span><span class="strut">&nbsp;</span></p>
209
+<p id="t5" class="stm run hide_run"><span class="key">import</span> <span class="nam">pprint</span> <span class="key">as</span> <span class="nam">Print</span><span class="strut">&nbsp;</span></p>
210
+<p id="t6" class="stm run hide_run"><span class="key">import</span> <span class="nam">textwrap</span><span class="strut">&nbsp;</span></p>
211
+<p id="t7" class="pln"><span class="strut">&nbsp;</span></p>
212
+<p id="t8" class="pln"><span class="com"># TYPES {{{</span><span class="strut">&nbsp;</span></p>
213
+<p id="t9" class="stm run hide_run"><span class="key">from</span> <span class="nam">typing</span> <span class="key">import</span> <span class="nam">AnyStr</span><span class="op">,</span> <span class="nam">Callable</span><span class="op">,</span> <span class="nam">Iterable</span><span class="op">,</span> <span class="nam">Iterator</span><span class="strut">&nbsp;</span></p>
214
+<p id="t10" class="pln"><span class="strut">&nbsp;</span></p>
215
+<p id="t11" class="stm run hide_run"><span class="nam">Path</span> <span class="op">=</span> <span class="nam">str</span><span class="strut">&nbsp;</span></p>
216
+<p id="t12" class="stm run hide_run"><span class="nam">Mode</span> <span class="op">=</span> <span class="nam">str</span><span class="strut">&nbsp;</span></p>
217
+<p id="t13" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
218
+<p id="t14" class="pln"><span class="com"># PATHS {{{</span><span class="strut">&nbsp;</span></p>
219
+<p id="t15" class="stm run hide_run"><span class="nam">glob</span> <span class="op">=</span> <span class="nam">Glob</span><span class="op">.</span><span class="nam">glob</span><span class="strut">&nbsp;</span></p>
220
+<p id="t16" class="pln"><span class="strut">&nbsp;</span></p>
221
+<p id="t17" class="stm run hide_run"><span class="nam">iglob</span> <span class="op">=</span> <span class="nam">Glob</span><span class="op">.</span><span class="nam">iglob</span><span class="strut">&nbsp;</span></p>
222
+<p id="t18" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
223
+<p id="t19" class="pln"><span class="com"># INPUTS {{{</span><span class="strut">&nbsp;</span></p>
224
+<p id="t20" class="stm run hide_run"><span class="nam">combine</span> <span class="op">=</span> <span class="nam">fileinput</span><span class="op">.</span><span class="nam">input</span><span class="strut">&nbsp;</span></p>
225
+<p id="t21" class="pln"><span class="strut">&nbsp;</span></p>
226
+<p id="t22" class="pln"><span class="strut">&nbsp;</span></p>
227
+<p id="t23" class="stm run hide_run"><span class="key">def</span> <span class="nam">slurp</span><span class="op">(</span><span class="nam">path</span><span class="op">:</span> <span class="nam">Path</span><span class="op">,</span> <span class="nam">mode</span><span class="op">:</span> <span class="nam">Mode</span> <span class="op">=</span> <span class="str">"r"</span><span class="op">)</span> <span class="op">-></span> <span class="nam">AnyStr</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
228
+<p id="t24" class="pln">    <span class="str">"""Slurp data from path."""</span><span class="strut">&nbsp;</span></p>
229
+<p id="t25" class="stm mis">    <span class="key">with</span> <span class="nam">open</span><span class="op">(</span><span class="nam">path</span><span class="op">,</span> <span class="nam">mode</span><span class="op">)</span> <span class="key">as</span> <span class="nam">r</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
230
+<p id="t26" class="stm mis">        <span class="key">return</span> <span class="nam">r</span><span class="op">.</span><span class="nam">read</span><span class="op">(</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
231
+<p id="t27" class="pln"><span class="strut">&nbsp;</span></p>
232
+<p id="t28" class="pln"><span class="strut">&nbsp;</span></p>
233
+<p id="t29" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
234
+<p id="t30" class="pln"><span class="com"># OUTPUTS {{{</span><span class="strut">&nbsp;</span></p>
235
+<p id="t31" class="stm run hide_run"><span class="nam">pprint</span> <span class="op">=</span> <span class="nam">Print</span><span class="op">.</span><span class="nam">pprint</span><span class="strut">&nbsp;</span></p>
236
+<p id="t32" class="pln"><span class="strut">&nbsp;</span></p>
237
+<p id="t33" class="pln"><span class="strut">&nbsp;</span></p>
238
+<p id="t34" class="stm run hide_run"><span class="key">def</span> <span class="nam">spit</span><span class="op">(</span><span class="nam">path</span><span class="op">:</span> <span class="nam">Path</span><span class="op">,</span> <span class="nam">s</span><span class="op">:</span> <span class="nam">AnyStr</span><span class="op">,</span> <span class="nam">mode</span><span class="op">:</span> <span class="nam">Mode</span> <span class="op">=</span> <span class="str">"w"</span><span class="op">)</span> <span class="op">-></span> <span class="key">None</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
239
+<p id="t35" class="pln">    <span class="str">"""Spit data to path."""</span><span class="strut">&nbsp;</span></p>
240
+<p id="t36" class="stm mis">    <span class="key">with</span> <span class="nam">open</span><span class="op">(</span><span class="nam">path</span><span class="op">,</span> <span class="nam">mode</span><span class="op">)</span> <span class="key">as</span> <span class="nam">w</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
241
+<p id="t37" class="stm mis">        <span class="nam">w</span><span class="op">.</span><span class="nam">write</span><span class="op">(</span><span class="nam">s</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
242
+<p id="t38" class="pln"><span class="strut">&nbsp;</span></p>
243
+<p id="t39" class="pln"><span class="strut">&nbsp;</span></p>
244
+<p id="t40" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
245
+<p id="t41" class="pln"><span class="com"># STREAMS {{{</span><span class="strut">&nbsp;</span></p>
246
+<p id="t42" class="stm run hide_run"><span class="key">def</span> <span class="nam">interact</span><span class="op">(</span><span class="strut">&nbsp;</span></p>
247
+<p id="t43" class="pln">    <span class="nam">f</span><span class="op">:</span> <span class="nam">Callable</span><span class="op">[</span><span class="op">[</span><span class="nam">AnyStr</span><span class="op">]</span><span class="op">,</span> <span class="nam">AnyStr</span><span class="op">]</span><span class="op">,</span><span class="strut">&nbsp;</span></p>
248
+<p id="t44" class="pln">    <span class="nam">files</span><span class="op">:</span> <span class="nam">Iterable</span><span class="op">[</span><span class="nam">Path</span><span class="op">]</span> <span class="op">=</span> <span class="key">None</span><span class="op">,</span><span class="strut">&nbsp;</span></p>
249
+<p id="t45" class="pln">    <span class="nam">mode</span><span class="op">:</span> <span class="nam">Mode</span> <span class="op">=</span> <span class="str">"r"</span><span class="op">,</span><span class="strut">&nbsp;</span></p>
250
+<p id="t46" class="pln"><span class="op">)</span> <span class="op">-></span> <span class="nam">Iterator</span><span class="op">[</span><span class="nam">AnyStr</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
251
+<p id="t47" class="pln">    <span class="str">"""Apply f on all line in files."""</span><span class="strut">&nbsp;</span></p>
252
+<p id="t48" class="stm mis">    <span class="key">return</span> <span class="nam">map</span><span class="op">(</span><span class="nam">f</span><span class="op">,</span> <span class="nam">combine</span><span class="op">(</span><span class="nam">files</span><span class="op">,</span> <span class="nam">mode</span><span class="op">=</span><span class="nam">mode</span><span class="op">)</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
253
+<p id="t49" class="pln"><span class="strut">&nbsp;</span></p>
254
+<p id="t50" class="pln"><span class="strut">&nbsp;</span></p>
255
+<p id="t51" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
256
+<p id="t52" class="pln"><span class="com"># STRINGS {{{</span><span class="strut">&nbsp;</span></p>
257
+<p id="t53" class="stm run hide_run"><span class="nam">wrap</span> <span class="op">=</span> <span class="nam">textwrap</span><span class="op">.</span><span class="nam">wrap</span><span class="strut">&nbsp;</span></p>
258
+<p id="t54" class="pln"><span class="strut">&nbsp;</span></p>
259
+<p id="t55" class="stm run hide_run"><span class="nam">fill</span> <span class="op">=</span> <span class="nam">textwrap</span><span class="op">.</span><span class="nam">fill</span><span class="strut">&nbsp;</span></p>
260
+<p id="t56" class="pln"><span class="strut">&nbsp;</span></p>
261
+<p id="t57" class="stm run hide_run"><span class="nam">indent</span> <span class="op">=</span> <span class="nam">textwrap</span><span class="op">.</span><span class="nam">indent</span><span class="strut">&nbsp;</span></p>
262
+<p id="t58" class="pln"><span class="strut">&nbsp;</span></p>
263
+<p id="t59" class="stm run hide_run"><span class="nam">dedent</span> <span class="op">=</span> <span class="nam">textwrap</span><span class="op">.</span><span class="nam">dedent</span><span class="strut">&nbsp;</span></p>
264
+<p id="t60" class="pln"><span class="strut">&nbsp;</span></p>
265
+<p id="t61" class="stm run hide_run"><span class="nam">shorten</span> <span class="op">=</span> <span class="nam">textwrap</span><span class="op">.</span><span class="nam">shorten</span><span class="strut">&nbsp;</span></p>
266
+<p id="t62" class="pln"><span class="strut">&nbsp;</span></p>
267
+<p id="t63" class="pln"><span class="strut">&nbsp;</span></p>
268
+<p id="t64" class="stm run hide_run"><span class="key">def</span> <span class="nam">unnl</span><span class="op">(</span><span class="nam">l</span><span class="op">:</span> <span class="nam">Iterable</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Iterator</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
269
+<p id="t65" class="pln">    <span class="str">"""Remove new lines from l.</span><span class="strut">&nbsp;</span></p>
270
+<p id="t66" class="pln"><span class="strut">&nbsp;</span></p>
271
+<p id="t67" class="pln"><span class="str">    >>> list(unnl([]))</span><span class="strut">&nbsp;</span></p>
272
+<p id="t68" class="pln"><span class="str">    []</span><span class="strut">&nbsp;</span></p>
273
+<p id="t69" class="pln"><span class="str">    >>> list(unnl(['hello\\n', '\\n', '', 'world']))</span><span class="strut">&nbsp;</span></p>
274
+<p id="t70" class="pln"><span class="str">    ['hello', '', '', 'world']</span><span class="strut">&nbsp;</span></p>
275
+<p id="t71" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
276
+<p id="t72" class="stm run hide_run">    <span class="key">return</span> <span class="op">(</span><span class="nam">x</span><span class="op">.</span><span class="nam">rstrip</span><span class="op">(</span><span class="str">"\n"</span><span class="op">)</span> <span class="key">for</span> <span class="nam">x</span> <span class="key">in</span> <span class="nam">l</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
277
+<p id="t73" class="pln"><span class="strut">&nbsp;</span></p>
278
+<p id="t74" class="pln"><span class="strut">&nbsp;</span></p>
279
+<p id="t75" class="stm run hide_run"><span class="key">def</span> <span class="nam">unbl</span><span class="op">(</span><span class="nam">l</span><span class="op">:</span> <span class="nam">Iterable</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Iterator</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
280
+<p id="t76" class="pln">    <span class="str">"""Remove blank lines from l.</span><span class="strut">&nbsp;</span></p>
281
+<p id="t77" class="pln"><span class="strut">&nbsp;</span></p>
282
+<p id="t78" class="pln"><span class="str">    >>> list(unbl([]))</span><span class="strut">&nbsp;</span></p>
283
+<p id="t79" class="pln"><span class="str">    []</span><span class="strut">&nbsp;</span></p>
284
+<p id="t80" class="pln"><span class="str">    >>> list(unbl(['hello\\n', '\\n', '', 'world']))</span><span class="strut">&nbsp;</span></p>
285
+<p id="t81" class="pln"><span class="str">    ['hello\\n', '\\n', 'world']</span><span class="strut">&nbsp;</span></p>
286
+<p id="t82" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
287
+<p id="t83" class="stm run hide_run">    <span class="key">return</span> <span class="op">(</span><span class="nam">x</span> <span class="key">for</span> <span class="nam">x</span> <span class="key">in</span> <span class="nam">l</span> <span class="key">if</span> <span class="nam">x</span> <span class="op">!=</span> <span class="str">""</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
288
+<p id="t84" class="pln"><span class="strut">&nbsp;</span></p>
289
+<p id="t85" class="pln"><span class="strut">&nbsp;</span></p>
290
+<p id="t86" class="stm run hide_run"><span class="key">def</span> <span class="nam">words</span><span class="op">(</span><span class="nam">s</span><span class="op">:</span> <span class="nam">str</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Iterator</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
291
+<p id="t87" class="pln">    <span class="str">"""Return a list of words from s.</span><span class="strut">&nbsp;</span></p>
292
+<p id="t88" class="pln"><span class="strut">&nbsp;</span></p>
293
+<p id="t89" class="pln"><span class="str">    >>> list(words(''))</span><span class="strut">&nbsp;</span></p>
294
+<p id="t90" class="pln"><span class="str">    []</span><span class="strut">&nbsp;</span></p>
295
+<p id="t91" class="pln"><span class="str">    >>> list(words('hello fp  world    !'))</span><span class="strut">&nbsp;</span></p>
296
+<p id="t92" class="pln"><span class="str">    ['hello', 'fp', 'world', '!']</span><span class="strut">&nbsp;</span></p>
297
+<p id="t93" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
298
+<p id="t94" class="stm run hide_run">    <span class="key">return</span> <span class="op">(</span><span class="nam">x</span> <span class="key">for</span> <span class="nam">x</span> <span class="key">in</span> <span class="nam">s</span><span class="op">.</span><span class="nam">split</span><span class="op">(</span><span class="key">None</span><span class="op">)</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
299
+<p id="t95" class="pln"><span class="strut">&nbsp;</span></p>
300
+<p id="t96" class="pln"><span class="strut">&nbsp;</span></p>
301
+<p id="t97" class="stm run hide_run"><span class="key">def</span> <span class="nam">unwords</span><span class="op">(</span><span class="nam">l</span><span class="op">:</span> <span class="nam">Iterable</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">)</span> <span class="op">-></span> <span class="nam">str</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
302
+<p id="t98" class="pln">    <span class="str">"""Return joined words from l.</span><span class="strut">&nbsp;</span></p>
303
+<p id="t99" class="pln"><span class="strut">&nbsp;</span></p>
304
+<p id="t100" class="pln"><span class="str">    >>> unwords([])</span><span class="strut">&nbsp;</span></p>
305
+<p id="t101" class="pln"><span class="str">    ''</span><span class="strut">&nbsp;</span></p>
306
+<p id="t102" class="pln"><span class="str">    >>> unwords(['hello', '', 'world'])</span><span class="strut">&nbsp;</span></p>
307
+<p id="t103" class="pln"><span class="str">    'hello  world'</span><span class="strut">&nbsp;</span></p>
308
+<p id="t104" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
309
+<p id="t105" class="stm run hide_run">    <span class="key">return</span> <span class="str">" "</span><span class="op">.</span><span class="nam">join</span><span class="op">(</span><span class="nam">l</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
310
+<p id="t106" class="pln"><span class="strut">&nbsp;</span></p>
311
+<p id="t107" class="pln"><span class="strut">&nbsp;</span></p>
312
+<p id="t108" class="stm run hide_run"><span class="key">def</span> <span class="nam">lines</span><span class="op">(</span><span class="nam">s</span><span class="op">:</span> <span class="nam">str</span><span class="op">)</span> <span class="op">-></span> <span class="nam">Iterator</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
313
+<p id="t109" class="pln">    <span class="str">"""Return a list of lines from s.</span><span class="strut">&nbsp;</span></p>
314
+<p id="t110" class="pln"><span class="strut">&nbsp;</span></p>
315
+<p id="t111" class="pln"><span class="str">    >>> list(lines(''))</span><span class="strut">&nbsp;</span></p>
316
+<p id="t112" class="pln"><span class="str">    []</span><span class="strut">&nbsp;</span></p>
317
+<p id="t113" class="pln"><span class="str">    >>> list(lines('hello\\r\\n\\nworld'))</span><span class="strut">&nbsp;</span></p>
318
+<p id="t114" class="pln"><span class="str">    ['hello', '', 'world']</span><span class="strut">&nbsp;</span></p>
319
+<p id="t115" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
320
+<p id="t116" class="stm run hide_run">    <span class="key">return</span> <span class="op">(</span><span class="nam">x</span> <span class="key">for</span> <span class="nam">x</span> <span class="key">in</span> <span class="nam">s</span><span class="op">.</span><span class="nam">splitlines</span><span class="op">(</span><span class="op">)</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
321
+<p id="t117" class="pln"><span class="strut">&nbsp;</span></p>
322
+<p id="t118" class="pln"><span class="strut">&nbsp;</span></p>
323
+<p id="t119" class="stm run hide_run"><span class="key">def</span> <span class="nam">unlines</span><span class="op">(</span><span class="nam">l</span><span class="op">:</span> <span class="nam">Iterable</span><span class="op">[</span><span class="nam">str</span><span class="op">]</span><span class="op">)</span> <span class="op">-></span> <span class="nam">str</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
324
+<p id="t120" class="pln">    <span class="str">"""Return joined lines from l.</span><span class="strut">&nbsp;</span></p>
325
+<p id="t121" class="pln"><span class="strut">&nbsp;</span></p>
326
+<p id="t122" class="pln"><span class="str">    >>> unlines([])</span><span class="strut">&nbsp;</span></p>
327
+<p id="t123" class="pln"><span class="str">    ''</span><span class="strut">&nbsp;</span></p>
328
+<p id="t124" class="pln"><span class="str">    >>> unlines(['hello', '', 'world'])</span><span class="strut">&nbsp;</span></p>
329
+<p id="t125" class="pln"><span class="str">    'hello\\n\\nworld'</span><span class="strut">&nbsp;</span></p>
330
+<p id="t126" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
331
+<p id="t127" class="stm run hide_run">    <span class="key">return</span> <span class="str">"\n"</span><span class="op">.</span><span class="nam">join</span><span class="op">(</span><span class="nam">l</span><span class="op">)</span><span class="strut">&nbsp;</span></p>
332
+<p id="t128" class="pln"><span class="strut">&nbsp;</span></p>
333
+<p id="t129" class="pln"><span class="strut">&nbsp;</span></p>
334
+<p id="t130" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
335
+
336
+            </td>
337
+        </tr>
338
+    </table>
339
+</div>
340
+
341
+<div id="footer">
342
+    <div class="content">
343
+        <p>
344
+            <a class="nav" href="index.html">&#xab; index</a> &nbsp; &nbsp; <a class="nav" href="https://coverage.readthedocs.io">coverage.py v4.5.2</a>,
345
+            created at 2018-12-07 21:39
346
+        </p>
347
+    </div>
348
+</div>
349
+
350
+</body>
351
+</html>

+ 1451
- 0
covers/htmlcov/funpy_it_py.html
File diff suppressed because it is too large
View File


+ 661
- 0
covers/htmlcov/funpy_op_py.html View File

@@ -0,0 +1,661 @@
1
+
2
+
3
+
4
+<!DOCTYPE html>
5
+<html>
6
+<head>
7
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8
+    
9
+    
10
+    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
11
+    <title>Coverage for funpy/op.py: 100%</title>
12
+    <link rel="stylesheet" href="style.css" type="text/css">
13
+    
14
+    <script type="text/javascript" src="jquery.min.js"></script>
15
+    <script type="text/javascript" src="jquery.hotkeys.js"></script>
16
+    <script type="text/javascript" src="jquery.isonscreen.js"></script>
17
+    <script type="text/javascript" src="coverage_html.js"></script>
18
+    <script type="text/javascript">
19
+        jQuery(document).ready(coverage.pyfile_ready);
20
+    </script>
21
+</head>
22
+<body class="pyfile">
23
+
24
+<div id="header">
25
+    <div class="content">
26
+        <h1>Coverage for <b>funpy/op.py</b> :
27
+            <span class="pc_cov">100%</span>
28
+        </h1>
29
+
30
+        <img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" />
31
+
32
+        <h2 class="stats">
33
+            100 statements &nbsp;
34
+            <span class="run hide_run shortkey_r button_toggle_run">100 run</span>
35
+            <span class="mis shortkey_m button_toggle_mis">0 missing</span>
36
+            <span class="exc shortkey_x button_toggle_exc">0 excluded</span>
37
+
38
+            
39
+                <span class="par run hide_run shortkey_p button_toggle_par">0 partial</span>
40
+            
41
+        </h2>
42
+    </div>
43
+</div>
44
+
45
+<div class="help_panel">
46
+    <img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" />
47
+    <p class="legend">Hot-keys on this page</p>
48
+    <div>
49
+    <p class="keyhelp">
50
+        <span class="key">r</span>
51
+        <span class="key">m</span>
52
+        <span class="key">x</span>
53
+        <span class="key">p</span> &nbsp; toggle line displays
54
+    </p>
55
+    <p class="keyhelp">
56
+        <span class="key">j</span>
57
+        <span class="key">k</span> &nbsp; next/prev highlighted chunk
58
+    </p>
59
+    <p class="keyhelp">
60
+        <span class="key">0</span> &nbsp; (zero) top of page
61
+    </p>
62
+    <p class="keyhelp">
63
+        <span class="key">1</span> &nbsp; (one) first highlighted chunk
64
+    </p>
65
+    </div>
66
+</div>
67
+
68
+<div id="source">
69
+    <table>
70
+        <tr>
71
+            <td class="linenos">
72
+<p id="n1" class="pln"><a href="#n1">1</a></p>
73
+<p id="n2" class="pln"><a href="#n2">2</a></p>
74
+<p id="n3" class="pln"><a href="#n3">3</a></p>
75
+<p id="n4" class="stm run hide_run"><a href="#n4">4</a></p>
76
+<p id="n5" class="stm run hide_run"><a href="#n5">5</a></p>
77
+<p id="n6" class="stm run hide_run"><a href="#n6">6</a></p>
78
+<p id="n7" class="stm run hide_run"><a href="#n7">7</a></p>
79
+<p id="n8" class="stm run hide_run"><a href="#n8">8</a></p>
80
+<p id="n9" class="pln"><a href="#n9">9</a></p>
81
+<p id="n10" class="pln"><a href="#n10">10</a></p>
82
+<p id="n11" class="stm run hide_run"><a href="#n11">11</a></p>
83
+<p id="n12" class="pln"><a href="#n12">12</a></p>
84
+<p id="n13" class="pln"><a href="#n13">13</a></p>
85
+<p id="n14" class="pln"><a href="#n14">14</a></p>
86
+<p id="n15" class="stm run hide_run"><a href="#n15">15</a></p>
87
+<p id="n16" class="pln"><a href="#n16">16</a></p>
88
+<p id="n17" class="stm run hide_run"><a href="#n17">17</a></p>
89
+<p id="n18" class="stm run hide_run"><a href="#n18">18</a></p>
90
+<p id="n19" class="pln"><a href="#n19">19</a></p>
91
+<p id="n20" class="stm run hide_run"><a href="#n20">20</a></p>
92
+<p id="n21" class="stm run hide_run"><a href="#n21">21</a></p>
93
+<p id="n22" class="pln"><a href="#n22">22</a></p>
94
+<p id="n23" class="stm run hide_run"><a href="#n23">23</a></p>
95
+<p id="n24" class="stm run hide_run"><a href="#n24">24</a></p>
96
+<p id="n25" class="pln"><a href="#n25">25</a></p>
97
+<p id="n26" class="stm run hide_run"><a href="#n26">26</a></p>
98
+<p id="n27" class="stm run hide_run"><a href="#n27">27</a></p>
99
+<p id="n28" class="pln"><a href="#n28">28</a></p>
100
+<p id="n29" class="stm run hide_run"><a href="#n29">29</a></p>
101
+<p id="n30" class="stm run hide_run"><a href="#n30">30</a></p>
102
+<p id="n31" class="pln"><a href="#n31">31</a></p>
103
+<p id="n32" class="pln"><a href="#n32">32</a></p>
104
+<p id="n33" class="stm run hide_run"><a href="#n33">33</a></p>
105
+<p id="n34" class="pln"><a href="#n34">34</a></p>
106
+<p id="n35" class="pln"><a href="#n35">35</a></p>
107
+<p id="n36" class="pln"><a href="#n36">36</a></p>
108
+<p id="n37" class="pln"><a href="#n37">37</a></p>
109
+<p id="n38" class="pln"><a href="#n38">38</a></p>
110
+<p id="n39" class="pln"><a href="#n39">39</a></p>
111
+<p id="n40" class="pln"><a href="#n40">40</a></p>
112
+<p id="n41" class="pln"><a href="#n41">41</a></p>
113
+<p id="n42" class="pln"><a href="#n42">42</a></p>
114
+<p id="n43" class="stm run hide_run"><a href="#n43">43</a></p>
115
+<p id="n44" class="pln"><a href="#n44">44</a></p>
116
+<p id="n45" class="pln"><a href="#n45">45</a></p>
117
+<p id="n46" class="stm run hide_run"><a href="#n46">46</a></p>
118
+<p id="n47" class="pln"><a href="#n47">47</a></p>
119
+<p id="n48" class="pln"><a href="#n48">48</a></p>
120
+<p id="n49" class="pln"><a href="#n49">49</a></p>
121
+<p id="n50" class="pln"><a href="#n50">50</a></p>
122
+<p id="n51" class="pln"><a href="#n51">51</a></p>
123
+<p id="n52" class="pln"><a href="#n52">52</a></p>
124
+<p id="n53" class="pln"><a href="#n53">53</a></p>
125
+<p id="n54" class="pln"><a href="#n54">54</a></p>
126
+<p id="n55" class="pln"><a href="#n55">55</a></p>
127
+<p id="n56" class="stm run hide_run"><a href="#n56">56</a></p>
128
+<p id="n57" class="pln"><a href="#n57">57</a></p>
129
+<p id="n58" class="pln"><a href="#n58">58</a></p>
130
+<p id="n59" class="stm run hide_run"><a href="#n59">59</a></p>
131
+<p id="n60" class="pln"><a href="#n60">60</a></p>
132
+<p id="n61" class="pln"><a href="#n61">61</a></p>
133
+<p id="n62" class="pln"><a href="#n62">62</a></p>
134
+<p id="n63" class="pln"><a href="#n63">63</a></p>
135
+<p id="n64" class="pln"><a href="#n64">64</a></p>
136
+<p id="n65" class="pln"><a href="#n65">65</a></p>
137
+<p id="n66" class="pln"><a href="#n66">66</a></p>
138
+<p id="n67" class="pln"><a href="#n67">67</a></p>
139
+<p id="n68" class="pln"><a href="#n68">68</a></p>
140
+<p id="n69" class="stm run hide_run"><a href="#n69">69</a></p>
141
+<p id="n70" class="pln"><a href="#n70">70</a></p>
142
+<p id="n71" class="pln"><a href="#n71">71</a></p>
143
+<p id="n72" class="stm run hide_run"><a href="#n72">72</a></p>
144
+<p id="n73" class="pln"><a href="#n73">73</a></p>
145
+<p id="n74" class="pln"><a href="#n74">74</a></p>
146
+<p id="n75" class="pln"><a href="#n75">75</a></p>
147
+<p id="n76" class="pln"><a href="#n76">76</a></p>
148
+<p id="n77" class="pln"><a href="#n77">77</a></p>
149
+<p id="n78" class="pln"><a href="#n78">78</a></p>
150
+<p id="n79" class="pln"><a href="#n79">79</a></p>
151
+<p id="n80" class="pln"><a href="#n80">80</a></p>
152
+<p id="n81" class="pln"><a href="#n81">81</a></p>
153
+<p id="n82" class="stm run hide_run"><a href="#n82">82</a></p>
154
+<p id="n83" class="pln"><a href="#n83">83</a></p>
155
+<p id="n84" class="pln"><a href="#n84">84</a></p>
156
+<p id="n85" class="stm run hide_run"><a href="#n85">85</a></p>
157
+<p id="n86" class="pln"><a href="#n86">86</a></p>
158
+<p id="n87" class="pln"><a href="#n87">87</a></p>
159
+<p id="n88" class="pln"><a href="#n88">88</a></p>
160
+<p id="n89" class="pln"><a href="#n89">89</a></p>
161
+<p id="n90" class="pln"><a href="#n90">90</a></p>
162
+<p id="n91" class="pln"><a href="#n91">91</a></p>
163
+<p id="n92" class="pln"><a href="#n92">92</a></p>
164
+<p id="n93" class="pln"><a href="#n93">93</a></p>
165
+<p id="n94" class="pln"><a href="#n94">94</a></p>
166
+<p id="n95" class="stm run hide_run"><a href="#n95">95</a></p>
167
+<p id="n96" class="pln"><a href="#n96">96</a></p>
168
+<p id="n97" class="pln"><a href="#n97">97</a></p>
169
+<p id="n98" class="stm run hide_run"><a href="#n98">98</a></p>
170
+<p id="n99" class="pln"><a href="#n99">99</a></p>
171
+<p id="n100" class="pln"><a href="#n100">100</a></p>
172
+<p id="n101" class="pln"><a href="#n101">101</a></p>
173
+<p id="n102" class="pln"><a href="#n102">102</a></p>
174
+<p id="n103" class="pln"><a href="#n103">103</a></p>
175
+<p id="n104" class="pln"><a href="#n104">104</a></p>
176
+<p id="n105" class="pln"><a href="#n105">105</a></p>
177
+<p id="n106" class="stm run hide_run"><a href="#n106">106</a></p>
178
+<p id="n107" class="pln"><a href="#n107">107</a></p>
179
+<p id="n108" class="pln"><a href="#n108">108</a></p>
180
+<p id="n109" class="stm run hide_run"><a href="#n109">109</a></p>
181
+<p id="n110" class="pln"><a href="#n110">110</a></p>
182
+<p id="n111" class="pln"><a href="#n111">111</a></p>
183
+<p id="n112" class="pln"><a href="#n112">112</a></p>
184
+<p id="n113" class="pln"><a href="#n113">113</a></p>
185
+<p id="n114" class="pln"><a href="#n114">114</a></p>
186
+<p id="n115" class="pln"><a href="#n115">115</a></p>
187
+<p id="n116" class="pln"><a href="#n116">116</a></p>
188
+<p id="n117" class="stm run hide_run"><a href="#n117">117</a></p>
189
+<p id="n118" class="pln"><a href="#n118">118</a></p>
190
+<p id="n119" class="pln"><a href="#n119">119</a></p>
191
+<p id="n120" class="pln"><a href="#n120">120</a></p>
192
+<p id="n121" class="pln"><a href="#n121">121</a></p>
193
+<p id="n122" class="stm run hide_run"><a href="#n122">122</a></p>
194
+<p id="n123" class="pln"><a href="#n123">123</a></p>
195
+<p id="n124" class="stm run hide_run"><a href="#n124">124</a></p>
196
+<p id="n125" class="stm run hide_run"><a href="#n125">125</a></p>
197
+<p id="n126" class="pln"><a href="#n126">126</a></p>
198
+<p id="n127" class="stm run hide_run"><a href="#n127">127</a></p>
199
+<p id="n128" class="stm run hide_run"><a href="#n128">128</a></p>
200
+<p id="n129" class="stm run hide_run"><a href="#n129">129</a></p>
201
+<p id="n130" class="pln"><a href="#n130">130</a></p>
202
+<p id="n131" class="pln"><a href="#n131">131</a></p>
203
+<p id="n132" class="stm run hide_run"><a href="#n132">132</a></p>
204
+<p id="n133" class="pln"><a href="#n133">133</a></p>
205
+<p id="n134" class="pln"><a href="#n134">134</a></p>
206
+<p id="n135" class="pln"><a href="#n135">135</a></p>
207
+<p id="n136" class="pln"><a href="#n136">136</a></p>
208
+<p id="n137" class="pln"><a href="#n137">137</a></p>
209
+<p id="n138" class="pln"><a href="#n138">138</a></p>
210
+<p id="n139" class="pln"><a href="#n139">139</a></p>
211
+<p id="n140" class="pln"><a href="#n140">140</a></p>
212
+<p id="n141" class="stm run hide_run"><a href="#n141">141</a></p>
213
+<p id="n142" class="pln"><a href="#n142">142</a></p>
214
+<p id="n143" class="pln"><a href="#n143">143</a></p>
215
+<p id="n144" class="stm run hide_run"><a href="#n144">144</a></p>
216
+<p id="n145" class="pln"><a href="#n145">145</a></p>
217
+<p id="n146" class="pln"><a href="#n146">146</a></p>
218
+<p id="n147" class="pln"><a href="#n147">147</a></p>
219
+<p id="n148" class="pln"><a href="#n148">148</a></p>
220
+<p id="n149" class="pln"><a href="#n149">149</a></p>
221
+<p id="n150" class="pln"><a href="#n150">150</a></p>
222
+<p id="n151" class="pln"><a href="#n151">151</a></p>
223
+<p id="n152" class="pln"><a href="#n152">152</a></p>
224
+<p id="n153" class="stm run hide_run"><a href="#n153">153</a></p>
225
+<p id="n154" class="pln"><a href="#n154">154</a></p>
226
+<p id="n155" class="pln"><a href="#n155">155</a></p>
227
+<p id="n156" class="pln"><a href="#n156">156</a></p>
228
+<p id="n157" class="pln"><a href="#n157">157</a></p>
229
+<p id="n158" class="stm run hide_run"><a href="#n158">158</a></p>
230
+<p id="n159" class="stm run hide_run"><a href="#n159">159</a></p>
231
+<p id="n160" class="stm run hide_run"><a href="#n160">160</a></p>
232
+<p id="n161" class="stm run hide_run"><a href="#n161">161</a></p>
233
+<p id="n162" class="pln"><a href="#n162">162</a></p>
234
+<p id="n163" class="stm run hide_run"><a href="#n163">163</a></p>
235
+<p id="n164" class="stm run hide_run"><a href="#n164">164</a></p>
236
+<p id="n165" class="pln"><a href="#n165">165</a></p>
237
+<p id="n166" class="pln"><a href="#n166">166</a></p>
238
+<p id="n167" class="stm run hide_run"><a href="#n167">167</a></p>
239
+<p id="n168" class="pln"><a href="#n168">168</a></p>
240
+<p id="n169" class="pln"><a href="#n169">169</a></p>
241
+<p id="n170" class="pln"><a href="#n170">170</a></p>
242
+<p id="n171" class="pln"><a href="#n171">171</a></p>
243
+<p id="n172" class="pln"><a href="#n172">172</a></p>
244
+<p id="n173" class="pln"><a href="#n173">173</a></p>
245
+<p id="n174" class="pln"><a href="#n174">174</a></p>
246
+<p id="n175" class="pln"><a href="#n175">175</a></p>
247
+<p id="n176" class="pln"><a href="#n176">176</a></p>
248
+<p id="n177" class="pln"><a href="#n177">177</a></p>
249
+<p id="n178" class="pln"><a href="#n178">178</a></p>
250
+<p id="n179" class="pln"><a href="#n179">179</a></p>
251
+<p id="n180" class="pln"><a href="#n180">180</a></p>
252
+<p id="n181" class="stm run hide_run"><a href="#n181">181</a></p>
253
+<p id="n182" class="pln"><a href="#n182">182</a></p>
254
+<p id="n183" class="pln"><a href="#n183">183</a></p>
255
+<p id="n184" class="pln"><a href="#n184">184</a></p>
256
+<p id="n185" class="pln"><a href="#n185">185</a></p>
257
+<p id="n186" class="stm run hide_run"><a href="#n186">186</a></p>
258
+<p id="n187" class="stm run hide_run"><a href="#n187">187</a></p>
259
+<p id="n188" class="pln"><a href="#n188">188</a></p>
260
+<p id="n189" class="stm run hide_run"><a href="#n189">189</a></p>
261
+<p id="n190" class="stm run hide_run"><a href="#n190">190</a></p>
262
+<p id="n191" class="pln"><a href="#n191">191</a></p>
263
+<p id="n192" class="pln"><a href="#n192">192</a></p>
264
+<p id="n193" class="stm run hide_run"><a href="#n193">193</a></p>
265
+<p id="n194" class="pln"><a href="#n194">194</a></p>
266
+<p id="n195" class="stm run hide_run"><a href="#n195">195</a></p>
267
+<p id="n196" class="stm run hide_run"><a href="#n196">196</a></p>
268
+<p id="n197" class="pln"><a href="#n197">197</a></p>
269
+<p id="n198" class="stm run hide_run"><a href="#n198">198</a></p>
270
+<p id="n199" class="pln"><a href="#n199">199</a></p>
271
+<p id="n200" class="pln"><a href="#n200">200</a></p>
272
+<p id="n201" class="stm run hide_run"><a href="#n201">201</a></p>
273
+<p id="n202" class="pln"><a href="#n202">202</a></p>
274
+<p id="n203" class="pln"><a href="#n203">203</a></p>
275
+<p id="n204" class="pln"><a href="#n204">204</a></p>
276
+<p id="n205" class="pln"><a href="#n205">205</a></p>
277
+<p id="n206" class="pln"><a href="#n206">206</a></p>
278
+<p id="n207" class="pln"><a href="#n207">207</a></p>
279
+<p id="n208" class="pln"><a href="#n208">208</a></p>
280
+<p id="n209" class="stm run hide_run"><a href="#n209">209</a></p>
281
+<p id="n210" class="pln"><a href="#n210">210</a></p>
282
+<p id="n211" class="pln"><a href="#n211">211</a></p>
283
+<p id="n212" class="stm run hide_run"><a href="#n212">212</a></p>
284
+<p id="n213" class="pln"><a href="#n213">213</a></p>
285
+<p id="n214" class="pln"><a href="#n214">214</a></p>
286
+<p id="n215" class="pln"><a href="#n215">215</a></p>
287
+<p id="n216" class="pln"><a href="#n216">216</a></p>
288
+<p id="n217" class="pln"><a href="#n217">217</a></p>
289
+<p id="n218" class="pln"><a href="#n218">218</a></p>
290
+<p id="n219" class="pln"><a href="#n219">219</a></p>
291
+<p id="n220" class="stm run hide_run"><a href="#n220">220</a></p>
292
+<p id="n221" class="pln"><a href="#n221">221</a></p>
293
+<p id="n222" class="pln"><a href="#n222">222</a></p>
294
+<p id="n223" class="stm run hide_run"><a href="#n223">223</a></p>
295
+<p id="n224" class="pln"><a href="#n224">224</a></p>
296
+<p id="n225" class="pln"><a href="#n225">225</a></p>
297
+<p id="n226" class="pln"><a href="#n226">226</a></p>
298
+<p id="n227" class="pln"><a href="#n227">227</a></p>
299
+<p id="n228" class="pln"><a href="#n228">228</a></p>
300
+<p id="n229" class="pln"><a href="#n229">229</a></p>
301
+<p id="n230" class="pln"><a href="#n230">230</a></p>
302
+<p id="n231" class="stm run hide_run"><a href="#n231">231</a></p>
303
+<p id="n232" class="pln"><a href="#n232">232</a></p>
304
+<p id="n233" class="pln"><a href="#n233">233</a></p>
305
+<p id="n234" class="pln"><a href="#n234">234</a></p>
306
+<p id="n235" class="pln"><a href="#n235">235</a></p>
307
+<p id="n236" class="stm run hide_run"><a href="#n236">236</a></p>
308
+<p id="n237" class="stm run hide_run"><a href="#n237">237</a></p>
309
+<p id="n238" class="stm run hide_run"><a href="#n238">238</a></p>
310
+<p id="n239" class="pln"><a href="#n239">239</a></p>
311
+<p id="n240" class="stm run hide_run"><a href="#n240">240</a></p>
312
+<p id="n241" class="stm run hide_run"><a href="#n241">241</a></p>
313
+<p id="n242" class="pln"><a href="#n242">242</a></p>
314
+<p id="n243" class="pln"><a href="#n243">243</a></p>
315
+<p id="n244" class="stm run hide_run"><a href="#n244">244</a></p>
316
+<p id="n245" class="stm run hide_run"><a href="#n245">245</a></p>
317
+<p id="n246" class="stm run hide_run"><a href="#n246">246</a></p>
318
+<p id="n247" class="stm run hide_run"><a href="#n247">247</a></p>
319
+<p id="n248" class="stm run hide_run"><a href="#n248">248</a></p>
320
+<p id="n249" class="pln"><a href="#n249">249</a></p>
321
+<p id="n250" class="stm run hide_run"><a href="#n250">250</a></p>
322
+<p id="n251" class="stm run hide_run"><a href="#n251">251</a></p>
323
+<p id="n252" class="pln"><a href="#n252">252</a></p>
324
+<p id="n253" class="stm run hide_run"><a href="#n253">253</a></p>
325
+<p id="n254" class="stm run hide_run"><a href="#n254">254</a></p>
326
+<p id="n255" class="stm run hide_run"><a href="#n255">255</a></p>
327
+<p id="n256" class="stm run hide_run"><a href="#n256">256</a></p>
328
+<p id="n257" class="pln"><a href="#n257">257</a></p>
329
+<p id="n258" class="stm run hide_run"><a href="#n258">258</a></p>
330
+<p id="n259" class="stm run hide_run"><a href="#n259">259</a></p>
331
+<p id="n260" class="stm run hide_run"><a href="#n260">260</a></p>
332
+<p id="n261" class="stm run hide_run"><a href="#n261">261</a></p>
333
+<p id="n262" class="pln"><a href="#n262">262</a></p>
334
+<p id="n263" class="stm run hide_run"><a href="#n263">263</a></p>
335
+<p id="n264" class="stm run hide_run"><a href="#n264">264</a></p>
336
+<p id="n265" class="stm run hide_run"><a href="#n265">265</a></p>
337
+<p id="n266" class="stm run hide_run"><a href="#n266">266</a></p>
338
+<p id="n267" class="pln"><a href="#n267">267</a></p>
339
+<p id="n268" class="stm run hide_run"><a href="#n268">268</a></p>
340
+<p id="n269" class="stm run hide_run"><a href="#n269">269</a></p>
341
+<p id="n270" class="pln"><a href="#n270">270</a></p>
342
+<p id="n271" class="stm run hide_run"><a href="#n271">271</a></p>
343
+<p id="n272" class="stm run hide_run"><a href="#n272">272</a></p>
344
+<p id="n273" class="stm run hide_run"><a href="#n273">273</a></p>
345
+<p id="n274" class="stm run hide_run"><a href="#n274">274</a></p>
346
+<p id="n275" class="pln"><a href="#n275">275</a></p>
347
+<p id="n276" class="stm run hide_run"><a href="#n276">276</a></p>
348
+<p id="n277" class="pln"><a href="#n277">277</a></p>
349
+<p id="n278" class="pln"><a href="#n278">278</a></p>
350
+<p id="n279" class="stm run hide_run"><a href="#n279">279</a></p>
351
+<p id="n280" class="stm run hide_run"><a href="#n280">280</a></p>
352
+<p id="n281" class="stm run hide_run"><a href="#n281">281</a></p>
353
+<p id="n282" class="stm run hide_run"><a href="#n282">282</a></p>
354
+<p id="n283" class="stm run hide_run"><a href="#n283">283</a></p>
355
+<p id="n284" class="stm run hide_run"><a href="#n284">284</a></p>
356
+<p id="n285" class="pln"><a href="#n285">285</a></p>
357
+
358
+            </td>
359
+            <td class="text">
360
+<p id="t1" class="pln"><span class="str">"""Operator library."""</span><span class="strut">&nbsp;</span></p>
361
+<p id="t2" class="pln"><span class="strut">&nbsp;</span></p>
362
+<p id="t3" class="pln"><span class="strut">&nbsp;</span></p>
363
+<p id="t4" class="stm run hide_run"><span class="key">import</span> <span class="nam">builtins</span><span class="strut">&nbsp;</span></p>
364
+<p id="t5" class="stm run hide_run"><span class="key">import</span> <span class="nam">fractions</span><span class="strut">&nbsp;</span></p>
365
+<p id="t6" class="stm run hide_run"><span class="key">import</span> <span class="nam">math</span><span class="strut">&nbsp;</span></p>
366
+<p id="t7" class="stm run hide_run"><span class="key">import</span> <span class="nam">operator</span><span class="strut">&nbsp;</span></p>
367
+<p id="t8" class="stm run hide_run"><span class="key">import</span> <span class="nam">statistics</span><span class="strut">&nbsp;</span></p>
368
+<p id="t9" class="pln"><span class="strut">&nbsp;</span></p>
369
+<p id="t10" class="pln"><span class="com"># TYPES {{{</span><span class="strut">&nbsp;</span></p>
370
+<p id="t11" class="stm run hide_run"><span class="key">from</span> <span class="nam">typing</span> <span class="key">import</span> <span class="nam">Any</span><span class="op">,</span> <span class="nam">Container</span><span class="op">,</span> <span class="nam">Sized</span><span class="strut">&nbsp;</span></p>
371
+<p id="t12" class="pln"><span class="strut">&nbsp;</span></p>
372
+<p id="t13" class="pln"><span class="com"># }}}</span><span class="strut">&nbsp;</span></p>
373
+<p id="t14" class="pln"><span class="com"># NUMBERS {{{</span><span class="strut">&nbsp;</span></p>
374
+<p id="t15" class="stm run hide_run"><span class="nam">abs</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">abs</span><span class="strut">&nbsp;</span></p>
375
+<p id="t16" class="pln"><span class="strut">&nbsp;</span></p>
376
+<p id="t17" class="stm run hide_run"><span class="nam">neg</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">neg</span><span class="strut">&nbsp;</span></p>
377
+<p id="t18" class="stm run hide_run"><span class="nam">pos</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">pos</span><span class="strut">&nbsp;</span></p>
378
+<p id="t19" class="pln"><span class="strut">&nbsp;</span></p>
379
+<p id="t20" class="stm run hide_run"><span class="nam">add</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">add</span><span class="strut">&nbsp;</span></p>
380
+<p id="t21" class="stm run hide_run"><span class="nam">sub</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">sub</span><span class="strut">&nbsp;</span></p>
381
+<p id="t22" class="pln"><span class="strut">&nbsp;</span></p>
382
+<p id="t23" class="stm run hide_run"><span class="nam">mul</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">mul</span><span class="strut">&nbsp;</span></p>
383
+<p id="t24" class="stm run hide_run"><span class="nam">matmul</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">matmul</span><span class="strut">&nbsp;</span></p>
384
+<p id="t25" class="pln"><span class="strut">&nbsp;</span></p>
385
+<p id="t26" class="stm run hide_run"><span class="nam">mod</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">mod</span><span class="strut">&nbsp;</span></p>
386
+<p id="t27" class="stm run hide_run"><span class="nam">div</span> <span class="op">=</span> <span class="nam">fractions</span><span class="op">.</span><span class="nam">Fraction</span><span class="strut">&nbsp;</span></p>
387
+<p id="t28" class="pln"><span class="strut">&nbsp;</span></p>
388
+<p id="t29" class="stm run hide_run"><span class="nam">truediv</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">truediv</span><span class="strut">&nbsp;</span></p>
389
+<p id="t30" class="stm run hide_run"><span class="nam">floordiv</span> <span class="op">=</span> <span class="nam">operator</span><span class="op">.</span><span class="nam">floordiv</span><span class="strut">&nbsp;</span></p>
390
+<p id="t31" class="pln"><span class="strut">&nbsp;</span></p>
391
+<p id="t32" class="pln"><span class="strut">&nbsp;</span></p>
392
+<p id="t33" class="stm run hide_run"><span class="key">def</span> <span class="nam">dec</span><span class="op">(</span><span class="nam">x</span><span class="op">:</span> <span class="nam">int</span><span class="op">)</span> <span class="op">-></span> <span class="nam">int</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
393
+<p id="t34" class="pln">    <span class="str">"""Return x - 1.</span><span class="strut">&nbsp;</span></p>
394
+<p id="t35" class="pln"><span class="strut">&nbsp;</span></p>
395
+<p id="t36" class="pln"><span class="str">    >>> dec(-1)</span><span class="strut">&nbsp;</span></p>
396
+<p id="t37" class="pln"><span class="str">    -2</span><span class="strut">&nbsp;</span></p>
397
+<p id="t38" class="pln"><span class="str">    >>> dec(0)</span><span class="strut">&nbsp;</span></p>
398
+<p id="t39" class="pln"><span class="str">    -1</span><span class="strut">&nbsp;</span></p>
399
+<p id="t40" class="pln"><span class="str">    >>> dec(1)</span><span class="strut">&nbsp;</span></p>
400
+<p id="t41" class="pln"><span class="str">    0</span><span class="strut">&nbsp;</span></p>
401
+<p id="t42" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
402
+<p id="t43" class="stm run hide_run">    <span class="key">return</span> <span class="nam">x</span> <span class="op">-</span> <span class="num">1</span><span class="strut">&nbsp;</span></p>
403
+<p id="t44" class="pln"><span class="strut">&nbsp;</span></p>
404
+<p id="t45" class="pln"><span class="strut">&nbsp;</span></p>
405
+<p id="t46" class="stm run hide_run"><span class="key">def</span> <span class="nam">inc</span><span class="op">(</span><span class="nam">x</span><span class="op">:</span> <span class="nam">int</span><span class="op">)</span> <span class="op">-></span> <span class="nam">int</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
406
+<p id="t47" class="pln">    <span class="str">"""Return x + 1.</span><span class="strut">&nbsp;</span></p>
407
+<p id="t48" class="pln"><span class="strut">&nbsp;</span></p>
408
+<p id="t49" class="pln"><span class="str">    >>> inc(-1)</span><span class="strut">&nbsp;</span></p>
409
+<p id="t50" class="pln"><span class="str">    0</span><span class="strut">&nbsp;</span></p>
410
+<p id="t51" class="pln"><span class="str">    >>> inc(0)</span><span class="strut">&nbsp;</span></p>
411
+<p id="t52" class="pln"><span class="str">    1</span><span class="strut">&nbsp;</span></p>
412
+<p id="t53" class="pln"><span class="str">    >>> inc(1)</span><span class="strut">&nbsp;</span></p>
413
+<p id="t54" class="pln"><span class="str">    2</span><span class="strut">&nbsp;</span></p>
414
+<p id="t55" class="pln"><span class="str">    """</span><span class="strut">&nbsp;</span></p>
415
+<p id="t56" class="stm run hide_run">    <span class="key">return</span> <span class="nam">x</span> <span class="op">+</span> <span class="num">1</span><span class="strut">&nbsp;</span></p>
416
+<p id="t57" class="pln"><span class="strut">&nbsp;</span></p>
417
+<p id="t58" class="pln"><span class="strut">&nbsp;</span></p>
418
+<p id="t59" class="stm run hide_run"><span class="key">def</span> <span class="nam">isneg</span><span class="op">(</span><span class="nam">x</span><span class="op">:</span> <span class="nam">int</span><span class="op">)</span> <span class="op">-></span> <span class="nam">bool</span><span class="op">:</span><span class="strut">&nbsp;</span></p>
419
+<p id="t60" class="pln">    <span class="str">"""Return True if x is negative.</span><span class="strut">&nbsp;</span></p>