|
21 | 21 | }, |
22 | 22 | { |
23 | 23 | "cell_type": "code", |
24 | | - "execution_count": null, |
| 24 | + "execution_count": 1, |
25 | 25 | "metadata": { |
26 | | - "id": "buOgxm25ONit" |
| 26 | + "id": "buOgxm25ONit", |
| 27 | + "outputId": "f4e5a5c0-eb5d-4c8a-a22d-43df1c87c27b", |
| 28 | + "colab": { |
| 29 | + "base_uri": "https://localhost:8080/" |
| 30 | + } |
27 | 31 | }, |
28 | | - "outputs": [], |
| 32 | + "outputs": [ |
| 33 | + { |
| 34 | + "output_type": "stream", |
| 35 | + "name": "stdout", |
| 36 | + "text": [ |
| 37 | + "Installing the latest version of Magic...\n", |
| 38 | + " % Total % Received % Xferd Average Speed Time Time Time Current\n", |
| 39 | + " Dload Upload Total Spent Left Speed\n", |
| 40 | + " 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0\n", |
| 41 | + "100 49.9M 100 49.9M 0 0 16.3M 0 0:00:03 0:00:03 --:--:-- 52.1M\n", |
| 42 | + "Done. The 'magic' binary is in '/root/.modular/bin'\n", |
| 43 | + "\n", |
| 44 | + "Two more steps:\n", |
| 45 | + "1. To use 'magic', run this command so it's in your PATH:\n", |
| 46 | + "source /root/.bashrc\n", |
| 47 | + "2. To build with MAX and Mojo, go to http://modul.ar/get-started\n" |
| 48 | + ] |
| 49 | + } |
| 50 | + ], |
29 | 51 | "source": [ |
30 | 52 | "!curl -ssL https://magic.modular.com/ | bash" |
31 | 53 | ] |
32 | 54 | }, |
33 | 55 | { |
34 | 56 | "cell_type": "code", |
35 | | - "execution_count": null, |
| 57 | + "execution_count": 2, |
36 | 58 | "metadata": { |
37 | 59 | "id": "FVZvyhRiONiw" |
38 | 60 | }, |
|
44 | 66 | }, |
45 | 67 | { |
46 | 68 | "cell_type": "code", |
47 | | - "execution_count": null, |
| 69 | + "execution_count": 3, |
48 | 70 | "metadata": { |
49 | | - "id": "TqFD0EK0ONiw" |
| 71 | + "id": "TqFD0EK0ONiw", |
| 72 | + "outputId": "2c764610-85dc-480c-8035-4d66f77bf393", |
| 73 | + "colab": { |
| 74 | + "base_uri": "https://localhost:8080/" |
| 75 | + } |
50 | 76 | }, |
51 | | - "outputs": [], |
| 77 | + "outputs": [ |
| 78 | + { |
| 79 | + "output_type": "stream", |
| 80 | + "name": "stdout", |
| 81 | + "text": [ |
| 82 | + "\u001b[32m✔ \u001b[0mCreated /content/codes/mojoproject.toml\n" |
| 83 | + ] |
| 84 | + } |
| 85 | + ], |
52 | 86 | "source": [ |
53 | 87 | "!magic init codes --format mojoproject" |
54 | 88 | ] |
55 | 89 | }, |
56 | 90 | { |
57 | 91 | "cell_type": "code", |
58 | | - "execution_count": null, |
| 92 | + "execution_count": 4, |
59 | 93 | "metadata": { |
60 | | - "id": "k3Ddb6GcONiw" |
| 94 | + "id": "k3Ddb6GcONiw", |
| 95 | + "outputId": "7742dea4-6b54-45ad-c392-0a5a5ae1303e", |
| 96 | + "colab": { |
| 97 | + "base_uri": "https://localhost:8080/" |
| 98 | + } |
61 | 99 | }, |
62 | | - "outputs": [], |
| 100 | + "outputs": [ |
| 101 | + { |
| 102 | + "output_type": "stream", |
| 103 | + "name": "stdout", |
| 104 | + "text": [ |
| 105 | + "/content/codes\n" |
| 106 | + ] |
| 107 | + } |
| 108 | + ], |
63 | 109 | "source": [ |
64 | 110 | "%cd codes/" |
65 | 111 | ] |
66 | 112 | }, |
67 | 113 | { |
68 | 114 | "cell_type": "code", |
69 | | - "execution_count": 59, |
| 115 | + "execution_count": 107, |
70 | 116 | "metadata": { |
71 | 117 | "id": "IaxB1auxONix", |
72 | 118 | "colab": { |
73 | 119 | "base_uri": "https://localhost:8080/" |
74 | 120 | }, |
75 | | - "outputId": "810bf461-0f64-4580-f4eb-09f7cf2f846a" |
| 121 | + "outputId": "9fcaae95-97f2-4ee2-8f77-a90b36e98fc3" |
76 | 122 | }, |
77 | 123 | "outputs": [ |
78 | 124 | { |
|
124 | 170 | " result = merge_intervals(intervals)\n", |
125 | 171 | " i = 0\n", |
126 | 172 | " for each in result:\n", |
127 | | - " assert_true(each[][0] == expected[i][0] and each[][1] == expected[i][1], \"Assertion failed\")\n", |
| 173 | + " assert_true(\n", |
| 174 | + " each[][0] == expected[i][0] and each[][1] == expected[i][1],\n", |
| 175 | + " \"Assertion failed\",\n", |
| 176 | + " )\n", |
128 | 177 | " i += 1\n", |
129 | 178 | "\n", |
130 | | - " intervals = List[(Int, Int)]((1,4),(4,5))\n", |
| 179 | + " intervals = List[(Int, Int)]((1, 4), (4, 5))\n", |
131 | 180 | " expected = List[(Int, Int)]((1, 5))\n", |
132 | 181 | " result = merge_intervals(intervals)\n", |
133 | 182 | " i = 0\n", |
134 | 183 | " for each in result:\n", |
135 | | - " assert_true(each[][0] == expected[i][0] and each[][1] == expected[i][1], \"Assertion failed\")\n", |
136 | | - " i += 1" |
| 184 | + " assert_true(\n", |
| 185 | + " each[][0] == expected[i][0] and each[][1] == expected[i][1],\n", |
| 186 | + " \"Assertion failed\",\n", |
| 187 | + " )\n", |
| 188 | + " i += 1\n" |
137 | 189 | ] |
138 | 190 | }, |
139 | 191 | { |
140 | 192 | "cell_type": "code", |
141 | | - "execution_count": 60, |
| 193 | + "execution_count": 108, |
142 | 194 | "metadata": { |
143 | 195 | "colab": { |
144 | 196 | "base_uri": "https://localhost:8080/" |
145 | 197 | }, |
146 | 198 | "id": "h2k9wkDaONiz", |
147 | | - "outputId": "eb626910-8fa3-4efa-c748-11dd140951ab" |
| 199 | + "outputId": "5b2461ab-4ee4-4633-8572-6ee7dd647738" |
148 | 200 | }, |
149 | 201 | "outputs": [ |
150 | 202 | { |
|
161 | 213 | }, |
162 | 214 | { |
163 | 215 | "cell_type": "code", |
164 | | - "execution_count": 61, |
| 216 | + "execution_count": 105, |
165 | 217 | "metadata": { |
166 | 218 | "colab": { |
167 | 219 | "base_uri": "https://localhost:8080/" |
168 | 220 | }, |
169 | 221 | "id": "bSglX7bNONi0", |
170 | | - "outputId": "8b032107-fc51-4c3e-c72e-73ed37c2585e" |
| 222 | + "outputId": "24e912a4-ecc5-463d-a848-21189408635e" |
171 | 223 | }, |
172 | 224 | "outputs": [ |
173 | 225 | { |
|
195 | 247 | "base_uri": "https://localhost:8080/" |
196 | 248 | }, |
197 | 249 | "id": "z2OxrAfbJYKc", |
198 | | - "outputId": "a908ca4c-119f-45ff-df1f-c70edd0b4750" |
| 250 | + "outputId": "d1d2aea5-9b68-46a8-fe4d-3afebb806331" |
199 | 251 | }, |
200 | | - "execution_count": 62, |
| 252 | + "execution_count": 106, |
201 | 253 | "outputs": [ |
202 | 254 | { |
203 | 255 | "output_type": "stream", |
|
0 commit comments