Done some work on tour shapes
[ou-summer-of-code-2017.git] / 06-tour-shapes / tour-creation-for-background.ipynb
1 {
2 "cells": [
3 {
4 "cell_type": "markdown",
5 "metadata": {},
6 "source": [
7 "Given a sequence of {F|L|R}, each of which is \"move forward one step\", \"turn left, then move forward one step\", \"turn right, then move forward one step\":\n",
8 "1. which tours are closed?\n",
9 "2. what is the area enclosed by the tour?"
10 ]
11 },
12 {
13 "cell_type": "code",
14 "execution_count": 1,
15 "metadata": {
16 "collapsed": true
17 },
18 "outputs": [],
19 "source": [
20 "import collections\n",
21 "import enum\n",
22 "import random\n",
23 "import os\n",
24 "\n",
25 "import matplotlib.pyplot as plt\n",
26 "%matplotlib inline"
27 ]
28 },
29 {
30 "cell_type": "code",
31 "execution_count": 2,
32 "metadata": {
33 "collapsed": true
34 },
35 "outputs": [],
36 "source": [
37 "class Direction(enum.Enum):\n",
38 " UP = 1\n",
39 " RIGHT = 2\n",
40 " DOWN = 3\n",
41 " LEFT = 4\n",
42 " \n",
43 "turn_lefts = {Direction.UP: Direction.LEFT, Direction.LEFT: Direction.DOWN,\n",
44 " Direction.DOWN: Direction.RIGHT, Direction.RIGHT: Direction.UP}\n",
45 "\n",
46 "turn_rights = {Direction.UP: Direction.RIGHT, Direction.RIGHT: Direction.DOWN,\n",
47 " Direction.DOWN: Direction.LEFT, Direction.LEFT: Direction.UP}\n",
48 "\n",
49 "def turn_left(d):\n",
50 " return turn_lefts[d]\n",
51 "\n",
52 "def turn_right(d):\n",
53 " return turn_rights[d]\n"
54 ]
55 },
56 {
57 "cell_type": "code",
58 "execution_count": 3,
59 "metadata": {
60 "collapsed": true
61 },
62 "outputs": [],
63 "source": [
64 "Step = collections.namedtuple('Step', ['x', 'y', 'dir'])\n",
65 "Mistake = collections.namedtuple('Mistake', ['i', 'step'])"
66 ]
67 },
68 {
69 "cell_type": "code",
70 "execution_count": 4,
71 "metadata": {
72 "collapsed": true
73 },
74 "outputs": [],
75 "source": [
76 "def advance(step, d):\n",
77 " if d == Direction.UP:\n",
78 " return Step(step.x, step.y+1, d)\n",
79 " elif d == Direction.DOWN:\n",
80 " return Step(step.x, step.y-1, d)\n",
81 " elif d == Direction.LEFT:\n",
82 " return Step(step.x-1, step.y, d)\n",
83 " elif d == Direction.RIGHT:\n",
84 " return Step(step.x+1, step.y, d)"
85 ]
86 },
87 {
88 "cell_type": "code",
89 "execution_count": 5,
90 "metadata": {
91 "collapsed": true
92 },
93 "outputs": [],
94 "source": [
95 "def trace_tour(tour, startx=0, starty=0, startdir=Direction.RIGHT):\n",
96 " current = Step(startx, starty, startdir)\n",
97 " trace = [current]\n",
98 " for s in tour:\n",
99 " if s == 'F':\n",
100 " current = advance(current, current.dir)\n",
101 " elif s == 'L':\n",
102 " current = advance(current, turn_left(current.dir))\n",
103 " elif s == 'R':\n",
104 " current = advance(current, turn_right(current.dir))\n",
105 " trace += [current]\n",
106 " return trace "
107 ]
108 },
109 {
110 "cell_type": "code",
111 "execution_count": 6,
112 "metadata": {
113 "collapsed": true
114 },
115 "outputs": [],
116 "source": [
117 "def positions(trace):\n",
118 " return [(s.x, s.y) for s in trace]"
119 ]
120 },
121 {
122 "cell_type": "code",
123 "execution_count": 7,
124 "metadata": {
125 "collapsed": true
126 },
127 "outputs": [],
128 "source": [
129 "def valid(trace):\n",
130 " return (trace[-1].x == 0 \n",
131 " and trace[-1].y == 0 \n",
132 " and len(set(positions(trace))) + 1 == len(trace))"
133 ]
134 },
135 {
136 "cell_type": "code",
137 "execution_count": 8,
138 "metadata": {
139 "collapsed": true
140 },
141 "outputs": [],
142 "source": [
143 "def chunks(items, n=2):\n",
144 " return [items[i:i+n] for i in range(len(items) - n + 1)]"
145 ]
146 },
147 {
148 "cell_type": "markdown",
149 "metadata": {},
150 "source": [
151 "Using the [Shoelace formula](https://en.wikipedia.org/wiki/Shoelace_formula)"
152 ]
153 },
154 {
155 "cell_type": "code",
156 "execution_count": 9,
157 "metadata": {
158 "collapsed": true
159 },
160 "outputs": [],
161 "source": [
162 "def shoelace(trace):\n",
163 " return abs(sum(s.x * t.y - t.x * s.y for s, t in chunks(trace, 2))) // 2"
164 ]
165 },
166 {
167 "cell_type": "code",
168 "execution_count": 10,
169 "metadata": {
170 "collapsed": true
171 },
172 "outputs": [],
173 "source": [
174 "def step(s, current):\n",
175 " if s == 'F':\n",
176 " return advance(current, current.dir)\n",
177 " elif s == 'L':\n",
178 " return advance(current, turn_left(current.dir))\n",
179 " elif s == 'R':\n",
180 " return advance(current, turn_right(current.dir))\n",
181 " else:\n",
182 " raise ValueError"
183 ]
184 },
185 {
186 "cell_type": "code",
187 "execution_count": 11,
188 "metadata": {
189 "collapsed": true
190 },
191 "outputs": [],
192 "source": [
193 "def valid_prefix(tour):\n",
194 " current = Step(0, 0, Direction.RIGHT)\n",
195 " prefix = []\n",
196 " posns = []\n",
197 " for s in tour:\n",
198 " current = step(s, current)\n",
199 " prefix += [s]\n",
200 " if (current.x, current.y) in posns:\n",
201 " return ''\n",
202 " elif current.x == 0 and current.y == 0: \n",
203 " return ''.join(prefix)\n",
204 " posns += [(current.x, current.y)]\n",
205 " if current.x == 0 and current.y == 0:\n",
206 " return ''.join(prefix)\n",
207 " else:\n",
208 " return ''"
209 ]
210 },
211 {
212 "cell_type": "code",
213 "execution_count": 12,
214 "metadata": {
215 "collapsed": true
216 },
217 "outputs": [],
218 "source": [
219 "def mistake_positions(trace, debug=False):\n",
220 " mistakes = []\n",
221 " current = trace[0]\n",
222 " posns = [(0, 0)]\n",
223 " for i, current in enumerate(trace[1:]):\n",
224 " if (current.x, current.y) in posns:\n",
225 " if debug: print(i, current)\n",
226 " mistakes += [Mistake(i+1, current)]\n",
227 " posns += [(current.x, current.y)]\n",
228 " if (current.x, current.y) == (0, 0):\n",
229 " return mistakes[:-1]\n",
230 " else:\n",
231 " return mistakes + [Mistake(len(trace)+1, current)]"
232 ]
233 },
234 {
235 "cell_type": "code",
236 "execution_count": 13,
237 "metadata": {
238 "collapsed": true
239 },
240 "outputs": [],
241 "source": [
242 "def returns_to_origin(mistake_positions):\n",
243 " return [i for i, m in mistake_positions\n",
244 " if (m.x, m.y) == (0, 0)]"
245 ]
246 },
247 {
248 "cell_type": "code",
249 "execution_count": 14,
250 "metadata": {
251 "collapsed": true
252 },
253 "outputs": [],
254 "source": [
255 "def random_walk(steps=1000):\n",
256 " return ''.join(random.choice('FFLR') for _ in range(steps))"
257 ]
258 },
259 {
260 "cell_type": "code",
261 "execution_count": 15,
262 "metadata": {
263 "collapsed": true
264 },
265 "outputs": [],
266 "source": [
267 "def bounds(trace):\n",
268 " return (max(s.x for s in trace),\n",
269 " max(s.y for s in trace),\n",
270 " min(s.x for s in trace),\n",
271 " min(s.y for s in trace))"
272 ]
273 },
274 {
275 "cell_type": "code",
276 "execution_count": 16,
277 "metadata": {
278 "collapsed": true
279 },
280 "outputs": [],
281 "source": [
282 "def plot_trace(trace, colour='k', xybounds=None, fig=None, subplot_details=None, filename=None):\n",
283 " plt.axis('on')\n",
284 " plt.axes().set_aspect('equal')\n",
285 " for s, t in chunks(trace, 2):\n",
286 " w, h = plot_wh[t.dir]\n",
287 " plt.arrow(s.x, s.y, w, h, head_width=0.1, head_length=0.1, fc=colour, ec=colour, length_includes_head=True)\n",
288 " xh, yh, xl, yl = bounds(trace)\n",
289 " if xybounds is not None: \n",
290 " bxh, byh, bxl, byl = xybounds\n",
291 " plt.xlim([min(xl, bxl)-1, max(xh, bxh)+1])\n",
292 " plt.ylim([min(yl, byl)-1, max(yh, byh)+1])\n",
293 " else:\n",
294 " plt.xlim([xl-1, xh+1])\n",
295 " plt.ylim([yl-1, yh+1])\n",
296 " if filename:\n",
297 " plt.savefig(filename)"
298 ]
299 },
300 {
301 "cell_type": "code",
302 "execution_count": 17,
303 "metadata": {
304 "collapsed": true
305 },
306 "outputs": [],
307 "source": [
308 "def trim_loop(tour):\n",
309 " trace = trace_tour(tour)\n",
310 " mistakes = mistake_positions(trace)\n",
311 " end_mistake_index = 0\n",
312 "# print('end_mistake_index {} pointing to trace position {}; {} mistakes and {} in trace; {}'.format(end_mistake_index, mistakes[end_mistake_index].i, len(mistakes), len(trace), mistakes))\n",
313 " # while this mistake extends to the next step in the trace...\n",
314 " while (mistakes[end_mistake_index].i + 1 < len(trace) and \n",
315 " end_mistake_index + 1 < len(mistakes) and\n",
316 " mistakes[end_mistake_index].i + 1 == \n",
317 " mistakes[end_mistake_index + 1].i):\n",
318 "# print('end_mistake_index {} pointing to trace position {}; {} mistakes and {} in trace'.format(end_mistake_index, mistakes[end_mistake_index].i, len(mistakes), len(trace), mistakes))\n",
319 " # push this mistake finish point later\n",
320 " end_mistake_index += 1\n",
321 " mistake = mistakes[end_mistake_index]\n",
322 " \n",
323 " # find the first location that mentions where this mistake ends (which the point where the loop starts)\n",
324 " mistake_loop_start = max(i for i, loc in enumerate(trace[:mistake.i])\n",
325 " if (loc.x, loc.y) == (mistake.step.x, mistake.step.y))\n",
326 "# print('Dealing with mistake from', mistake_loop_start, 'to', mistake.i, ', trace has len', len(trace))\n",
327 " \n",
328 " # direction before entering the loop\n",
329 " direction_before = trace[mistake_loop_start].dir\n",
330 " \n",
331 " # find the new instruction to turn from heading before the loop to heading after the loop\n",
332 " new_instruction = 'F'\n",
333 " if (mistake.i + 1) < len(trace):\n",
334 " if turn_left(direction_before) == trace[mistake.i + 1].dir:\n",
335 " new_instruction = 'L'\n",
336 " if turn_right(direction_before) == trace[mistake.i + 1].dir:\n",
337 " new_instruction = 'R'\n",
338 "# if (mistake.i + 1) < len(trace):\n",
339 "# print('turning from', direction_before, 'to', trace[mistake.i + 1].dir, 'with', new_instruction )\n",
340 "# else:\n",
341 "# print('turning from', direction_before, 'to BEYOND END', 'with', new_instruction )\n",
342 " return tour[:mistake_loop_start] + new_instruction + tour[mistake.i+1:]\n",
343 "# return mistake, mistake_loop_start, trace[mistake_loop_start-2:mistake_loop_start+8]"
344 ]
345 },
346 {
347 "cell_type": "code",
348 "execution_count": 18,
349 "metadata": {
350 "collapsed": true
351 },
352 "outputs": [],
353 "source": [
354 "def trim_all_loops(tour, mistake_reduction_attempt_limit=10):\n",
355 " trace = trace_tour(tour)\n",
356 " mistake_limit = 1\n",
357 " if trace[-1].x == 0 and trace[-1].y == 0:\n",
358 " mistake_limit = 0\n",
359 " mistakes = mistake_positions(trace)\n",
360 " \n",
361 " old_mistake_count = len(mistakes)\n",
362 " mistake_reduction_tries = 0\n",
363 " \n",
364 " while len(mistakes) > mistake_limit and mistake_reduction_tries < mistake_reduction_attempt_limit:\n",
365 " tour = trim_loop(tour)\n",
366 " trace = trace_tour(tour)\n",
367 " mistakes = mistake_positions(trace)\n",
368 " if len(mistakes) < old_mistake_count:\n",
369 " old_mistake_count = len(mistakes)\n",
370 " mistake_reduction_tries = 0\n",
371 " else:\n",
372 " mistake_reduction_tries += 1\n",
373 " if mistake_reduction_tries >= mistake_reduction_attempt_limit:\n",
374 " return ''\n",
375 " else:\n",
376 " return tour"
377 ]
378 },
379 {
380 "cell_type": "code",
381 "execution_count": 19,
382 "metadata": {
383 "collapsed": true
384 },
385 "outputs": [],
386 "source": [
387 "def reverse_tour(tour):\n",
388 " def swap(tour_step):\n",
389 " if tour_step == 'R':\n",
390 " return 'L'\n",
391 " elif tour_step == 'L':\n",
392 " return 'R'\n",
393 " else:\n",
394 " return tour_step\n",
395 " \n",
396 " return ''.join(swap(s) for s in reversed(tour))"
397 ]
398 },
399 {
400 "cell_type": "code",
401 "execution_count": 20,
402 "metadata": {
403 "collapsed": true
404 },
405 "outputs": [],
406 "source": [
407 "def wander_near(locus, current, limit=10):\n",
408 " valid_proposal = False\n",
409 " while not valid_proposal:\n",
410 " s = random.choice('FFFRL')\n",
411 " if s == 'F':\n",
412 " proposed = advance(current, current.dir)\n",
413 " elif s == 'L':\n",
414 " proposed = advance(current, turn_left(current.dir))\n",
415 " elif s == 'R':\n",
416 " proposed = advance(current, turn_right(current.dir))\n",
417 " if abs(proposed.x - locus.x) < limit and abs(proposed.y - locus.y) < limit:\n",
418 " valid_proposal = True\n",
419 "# print('At {} going to {} by step {} to {}'.format(current, locus, s, proposed))\n",
420 " return s, proposed"
421 ]
422 },
423 {
424 "cell_type": "code",
425 "execution_count": 21,
426 "metadata": {
427 "collapsed": true
428 },
429 "outputs": [],
430 "source": [
431 "def seek(goal, current):\n",
432 " dx = current.x - goal.x\n",
433 " dy = current.y - goal.y\n",
434 "\n",
435 " if dx < 0 and abs(dx) > abs(dy): # to the left\n",
436 " side = 'left'\n",
437 " if current.dir == Direction.RIGHT:\n",
438 " s = 'F'\n",
439 " elif current.dir == Direction.UP:\n",
440 " s = 'R'\n",
441 " else:\n",
442 " s = 'L'\n",
443 " elif dx > 0 and abs(dx) > abs(dy): # to the right\n",
444 " side = 'right'\n",
445 " if current.dir == Direction.LEFT:\n",
446 " s = 'F'\n",
447 " elif current.dir == Direction.UP:\n",
448 " s = 'L'\n",
449 " else:\n",
450 " s = 'R'\n",
451 " elif dy > 0 and abs(dx) <= abs(dy): # above\n",
452 " side = 'above'\n",
453 " if current.dir == Direction.DOWN:\n",
454 " s = 'F'\n",
455 " elif current.dir == Direction.RIGHT:\n",
456 " s = 'R'\n",
457 " else:\n",
458 " s = 'L'\n",
459 " else: # below\n",
460 " side = 'below'\n",
461 " if current.dir == Direction.UP:\n",
462 " s = 'F'\n",
463 " elif current.dir == Direction.LEFT:\n",
464 " s = 'R'\n",
465 " else:\n",
466 " s = 'L'\n",
467 " if s == 'F':\n",
468 " proposed = advance(current, current.dir)\n",
469 " elif s == 'L':\n",
470 " proposed = advance(current, turn_left(current.dir))\n",
471 " elif s == 'R':\n",
472 " proposed = advance(current, turn_right(current.dir))\n",
473 " \n",
474 "# print('At {} going to {}, currently {}, by step {} to {}'.format(current, goal, side, s, proposed))\n",
475 "\n",
476 " return s, proposed"
477 ]
478 },
479 {
480 "cell_type": "code",
481 "execution_count": 22,
482 "metadata": {
483 "collapsed": true
484 },
485 "outputs": [],
486 "source": [
487 "def guided_walk(loci, locus_limit=5, wander_limit=10, seek_step_limit=20):\n",
488 " trail = ''\n",
489 " current = Step(0, 0, Direction.RIGHT) \n",
490 " l = 0\n",
491 " finished = False\n",
492 " while not finished:\n",
493 " if abs(current.x - loci[l].x) < locus_limit and abs(current.y - loci[l].y) < locus_limit:\n",
494 " l += 1\n",
495 " if l == len(loci) - 1:\n",
496 " finished = True\n",
497 " s, proposed = wander_near(loci[l], current, limit=wander_limit)\n",
498 " trail += s\n",
499 " current = proposed\n",
500 "# print('!! Finished loci')\n",
501 " seek_steps = 0\n",
502 " while not (current.x == loci[l].x and current.y == loci[l].y) and seek_steps < seek_step_limit:\n",
503 "# error = max(abs(current.x - loci[l].x), abs(current.y - loci[l].y))\n",
504 "# s, proposed = wander_near(loci[l], current, limit=error+1)\n",
505 " s, proposed = seek(loci[l], current)\n",
506 " trail += s\n",
507 " current = proposed\n",
508 " seek_steps += 1\n",
509 " if seek_steps >= seek_step_limit:\n",
510 " return ''\n",
511 " else:\n",
512 " return trail"
513 ]
514 },
515 {
516 "cell_type": "code",
517 "execution_count": 24,
518 "metadata": {},
519 "outputs": [],
520 "source": [
521 "def square_tour(a=80):\n",
522 " \"a is width of square\"\n",
523 " return ('F' * a + 'L') * 4"
524 ]
525 },
526 {
527 "cell_type": "code",
528 "execution_count": 25,
529 "metadata": {},
530 "outputs": [],
531 "source": [
532 "def cross_tour(a=50, b=40):\n",
533 " \"a is width of cross arm, b is length of cross arm\"\n",
534 " return ('F' * a + 'L' + 'F' * b + 'R' + 'F' * b + 'L') * 4"
535 ]
536 },
537 {
538 "cell_type": "code",
539 "execution_count": 26,
540 "metadata": {},
541 "outputs": [],
542 "source": [
543 "def quincunx_tour(a=60, b=30, c=50):\n",
544 " \"a is length of indent, b is indent/outdent distance, c is outdent outer length\"\n",
545 " return ('F' * a + 'R' + 'F' * b + 'L' + 'F' * c + 'L' + 'F' * c + 'L' + 'F' * b + 'R') * 4\n"
546 ]
547 },
548 {
549 "cell_type": "code",
550 "execution_count": 27,
551 "metadata": {},
552 "outputs": [],
553 "source": [
554 "heart_points = [Step(60, 50, Direction.UP), Step(50, 90, Direction.UP),\n",
555 " Step(20, 70, Direction.UP), \n",
556 " Step(-40, 90, Direction.UP), Step(-60, 80, Direction.UP), \n",
557 " Step(0, 0, Direction.RIGHT)]\n",
558 "\n",
559 "heart_tour = ''\n",
560 "current = Step(0, 0, Direction.RIGHT)\n",
561 "\n",
562 "for hp in heart_points:\n",
563 " while not (current.x == hp.x and current.y == hp.y):\n",
564 " s, proposed = seek(hp, current)\n",
565 " heart_tour += s\n",
566 " current = proposed\n",
567 "\n",
568 "def heart_tour_func(): return heart_tour"
569 ]
570 },
571 {
572 "cell_type": "code",
573 "execution_count": 28,
574 "metadata": {
575 "collapsed": true
576 },
577 "outputs": [],
578 "source": [
579 "# success_count = 0\n",
580 "# while success_count <= 20:\n",
581 "# lc = trace_tour(square_tour(a=10))\n",
582 "# rw = guided_walk(lc, wander_limit=4, locus_limit=2)\n",
583 "# if rw:\n",
584 "# rw_trimmed = trim_all_loops(rw)\n",
585 "# if len(rw_trimmed) > 10:\n",
586 "# with open('small-squares.txt', 'a') as f:\n",
587 "# f.write(rw_trimmed + '\\n')\n",
588 "# success_count += 1"
589 ]
590 },
591 {
592 "cell_type": "code",
593 "execution_count": 29,
594 "metadata": {
595 "collapsed": true
596 },
597 "outputs": [],
598 "source": [
599 "# success_count = 0\n",
600 "# while success_count <= 20:\n",
601 "# lc = trace_tour(square_tour())\n",
602 "# rw = guided_walk(lc)\n",
603 "# if rw:\n",
604 "# rw_trimmed = trim_all_loops(rw)\n",
605 "# if len(rw_trimmed) > 10:\n",
606 "# with open('large-squares.txt', 'a') as f:\n",
607 "# f.write(rw_trimmed + '\\n')\n",
608 "# success_count += 1"
609 ]
610 },
611 {
612 "cell_type": "code",
613 "execution_count": 30,
614 "metadata": {
615 "collapsed": true
616 },
617 "outputs": [],
618 "source": [
619 "# success_count = 0\n",
620 "# while success_count <= 20:\n",
621 "# lc = trace_tour(cross_tour())\n",
622 "# rw = guided_walk(lc)\n",
623 "# if rw:\n",
624 "# rw_trimmed = trim_all_loops(rw)\n",
625 "# if len(rw_trimmed) > 10:\n",
626 "# with open('cross.txt', 'a') as f:\n",
627 "# f.write(rw_trimmed + '\\n')\n",
628 "# success_count += 1"
629 ]
630 },
631 {
632 "cell_type": "code",
633 "execution_count": 31,
634 "metadata": {
635 "collapsed": true
636 },
637 "outputs": [],
638 "source": [
639 "# success_count = 0\n",
640 "# while success_count <= 20:\n",
641 "# lc = trace_tour(quincunx_tour())\n",
642 "# rw = guided_walk(lc)\n",
643 "# if rw:\n",
644 "# rw_trimmed = trim_all_loops(rw)\n",
645 "# if len(rw_trimmed) > 10:\n",
646 "# with open('quincunx.txt', 'a') as f:\n",
647 "# f.write(rw_trimmed + '\\n')\n",
648 "# success_count += 1"
649 ]
650 },
651 {
652 "cell_type": "code",
653 "execution_count": 32,
654 "metadata": {
655 "collapsed": true
656 },
657 "outputs": [],
658 "source": [
659 "patterns = [square_tour, cross_tour, quincunx_tour, heart_tour_func]\n",
660 "tours_filename = 'tours.txt'\n",
661 "\n",
662 "try:\n",
663 " os.remove(tours_filename)\n",
664 "except OSError:\n",
665 " pass\n",
666 "\n",
667 "success_count = 0\n",
668 "while success_count < 100:\n",
669 " lc = trace_tour(random.choice(patterns)())\n",
670 " rw = guided_walk(lc)\n",
671 " if rw:\n",
672 " rw_trimmed = trim_all_loops(rw)\n",
673 " if len(rw_trimmed) > 10:\n",
674 " with open(tours_filename, 'a') as f:\n",
675 " f.write(rw_trimmed + '\\n')\n",
676 " success_count += 1"
677 ]
678 },
679 {
680 "cell_type": "code",
681 "execution_count": null,
682 "metadata": {
683 "collapsed": true
684 },
685 "outputs": [],
686 "source": []
687 }
688 ],
689 "metadata": {
690 "kernelspec": {
691 "display_name": "Python 3",
692 "language": "python",
693 "name": "python3"
694 },
695 "language_info": {
696 "codemirror_mode": {
697 "name": "ipython",
698 "version": 3
699 },
700 "file_extension": ".py",
701 "mimetype": "text/x-python",
702 "name": "python",
703 "nbconvert_exporter": "python",
704 "pygments_lexer": "ipython3",
705 "version": "3.5.2+"
706 }
707 },
708 "nbformat": 4,
709 "nbformat_minor": 2
710 }