code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.7692,
0.0385,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.8077,
0.0385,
0,
0.66,
0.25,
475,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.8462,
0.0385,
0,
0.66... | [
"print(\"Thread B\")",
"a = 666",
"b = -2",
"for i in range(10):\n a += i\n b -= i",
"print(a*b)"
] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [] | [] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.2088,
0.011,
0,
0.66,
0,
890,
0,
2,
0,
0,
890,
0,
0
]
] | [
"import string, sys"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.2237,
0.0132,
0,
0.66,
0,
827,
0,
1,
0,
0,
827,
0,
0
],
[
14,
0,
0.3026,
0.0132,
0,
0.66,
0.0625,
810,
3,
1,
0,
0,
816,
10,
1
],
[
8,
0,
0.3158,
0.0132,
0,
... | [
"import dict",
"l = range(5)",
"print(\"del l[3]\")",
"print(l)",
"d = {}",
"for n in range(5):\n d[n] = n",
" d[n] = n",
"print(\"del d[3]\")",
"print(\"d=\", d)",
"print(\"keys(locals)=\", dict.keys(locals()))",
"def delglob():\n global l\n print(\"delglob's l=\",l)\n del l",
... |
# Anything that starts with a # is a comment!
# Use lots of comments in your code to explain what you're doing.
# Use the PIC-specific Python libraries
import t114 as pic
line_sensor_right = pic.digital_io(1, 8, True)
right_wheel_stopped = 938
print "Running..."
i = 0;
while i < 10:
i = i + 1
# Print ou... | [
[
1,
0,
0.3125,
0.0625,
0,
0.66,
0,
423,
0,
1,
0,
0,
423,
0,
0
],
[
14,
0,
0.4375,
0.0625,
0,
0.66,
0.2,
927,
3,
3,
0,
0,
928,
10,
1
],
[
14,
0,
0.5,
0.0625,
0,
0.6... | [
"import t114 as pic",
"line_sensor_right = pic.digital_io(1, 8, True)",
"right_wheel_stopped = 938",
"print(\"Running...\")",
"i = 0;",
"while i < 10:\n i = i + 1\n # Print out line following diags\n if line_sensor_right.get():\n pass",
" i = i + 1",
" if line_sensor_right.g... |
# This file is Copyright 2011 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
2,
0,
0.725,
0.025,
0,
0.66,
10,
528,
0,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.75,
0.025,
0,
0.66,
11,
300,
0,
0,
0,
0,
0,
0,
0
]
] | [
"def foo(): pass",
"def bar(): pass"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
4,
0,
0.9286,
0.1905,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
1
],
[
8,
1,
1,
0.0476,
1,
0.18,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"if None:\n assert False\nelse:\n print(\"None is False. Passed.\")",
" print(\"None is False. Passed.\")"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.7917,
0.0417,
0,
0.66,
0,
190,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.9167,
0.0417,
0,
0.66,
1,
190,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.9583,
0.0417,
0,
0.66,
... | [
"x = 2 ** 8",
"x = 4",
"x = x ** x"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.2609,
0.0145,
0,
0.66,
0,
827,
0,
2,
0,
0,
827,
0,
0
],
[
4,
0,
0.4203,
0.2174,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
0,
12
],
[
14,
1,
0.3333,
0.0145,
1,
0,
... | [
"import dict, list",
"if 1:\n d = {}\n d[0] = \"zero\"\n d[\"one\"] = 1\n print(d)\n print(dict.keys(d))\n print(dict.values(d))",
" d = {}",
" d[0] = \"zero\"",
" d[\"one\"] = 1",
" print(d)",
" print(dict.keys(d))",
" print(dict.values(d))",
" dict.clear(d)",... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.4524,
0.0238,
0,
0.66,
0,
553,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.4762,
0.0238,
0,
0.66,
0.2,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.6429,
0.0238,
0,
0.66,... | [
"s = \"farley\" * 3",
"print(s)",
"t = (2,5,6) * 3",
"print(t)",
"r = range(3) * 3",
"print([[3,]*3, \"three\"*3, ('e',)*3]*3)"
] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.1939,
0.0102,
0,
0.66,
0,
492,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.2041,
0.0102,
0,
0.66,
0.0435,
25,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2143,
0.0102,
0,
0.... | [
"callback_table = {}",
"HOOK_1S = 1002",
"HOOK_ADC = 1003",
"def doNothing(f):\n print(\"in doNothing\")\n return f",
" print(\"in doNothing\")",
" return f",
"def setHook(event):\n print(\"in setHook\")\n def _sh(f):\n print(\"in _sh\")\n callback_table[event] = f\n ... |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
3,
0,
0.75,
0.0769,
0,
0.66,
0,
619,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.8462,
0.0385,
0,
0.66,
0.3333,
411,
3,
0,
0,
0,
619,
10,
1
],
[
8,
0,
0.9231,
0.0385,
0,
0.... | [
"class C():\n pass",
"c = C()",
"print(\"Expect TypeError:\")",
"for i in c:\n print(i)",
" print(i)"
] |
# This file is Copyright 2013 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.1044,
0.0055,
0,
0.66,
0,
810,
3,
1,
0,
0,
816,
10,
1
],
[
14,
0,
0.1099,
0.0055,
0,
0.66,
0.5,
553,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1154,
0.0055,
0,
0... | [
"l = range(5)",
"s = \"Some string\"",
"t = (2,5,6)"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.5862,
0.0345,
0,
0.66,
0,
938,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.6207,
0.0345,
0,
0.66,
0.2,
0,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6897,
0.0345,
0,
0.66,
... | [
"d1 = {}",
"d1[1] = \"one\"",
"d2 = {}",
"d2[2] = \"two\"",
"import dict",
"rv = dict.update(d1, d2)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.72,
0.04,
0,
0.66,
0,
355,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.76,
0.04,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.92,
0.04,
0,
0.66,
2,
4... | [
"d = {}",
"d[0] = 42",
"r = range(3)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.1961,
0.0294,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.5931,
0.7255,
0,
0.66,
0.2,
491,
0,
2,
0,
0,
0,
0,
0
],
[
2,
1,
0.4461,
0.3922,
1,
0.17,
... | [
"\"\"\"__NATIVE__\n#include <stdio.h>\n\"\"\"",
"class File():\n\n def __init__(self, fn):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmObj_t pfn;\n pPmObj_t pn;\n pPmObj_t pattrs;",
" def __init__(self, fn):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmOb... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [] | [] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.9474,
0.0526,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.0526,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"import sys",
"print(sys.heap())"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
2,
0,
0.5847,
0.5085,
0,
0.66,
0,
243,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.5847,
0.4746,
1,
0.27,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.8898,
0.0339,
0,
0.66,
0... | [
"def __gc_test(val):\n \"\"\"__NATIVE__\n pPmObj_t pval;\n int32_t nval;\n PmReturn_t retval = PM_RET_OK;\n\n if (NATIVE_GET_NUM_ARGS() != 1)\n {",
" \"\"\"__NATIVE__\n pPmObj_t pval;\n int32_t nval;\n PmReturn_t retval = PM_RET_OK;\n\n if (NATIVE_GET_NUM_ARGS() != 1)\n {\n ... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
2,
0,
0.4022,
0.0435,
0,
0.66,
0,
528,
0,
0,
1,
0,
0,
0,
0
],
[
13,
1,
0.413,
0.0217,
1,
0.74,
0,
0,
1,
0,
0,
0,
0,
3,
0
],
[
2,
0,
0.4674,
0.0435,
0,
0.66,
0... | [
"def foo():\n return \"foo\"",
" return \"foo\"",
"def foo1(a=42):\n return a+1",
" return a+1",
"def foo2(a,b=42):\n return a+b",
" return a+b",
"print(foo())",
"print(foo1())",
"print(foo1(1))",
"print(foo2(1))",
"print(foo2(1,2))",
"print(\"Expect TypeError:\")",
"map(ma... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
3,
0,
0.6571,
0.2,
0,
0.66,
0,
429,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.6714,
0.1714,
1,
0.74,
0,
555,
0,
1,
0,
0,
0,
0,
0
],
[
8,
2,
0.6714,
0.1143,
2,
0.37,
0,... | [
"class A():\n def __init__(self,):\n \"\"\"__NATIVE__\n NATIVE_SET_TOS(PM_NONE);\n return PM_RET_OK;\n \"\"\"\n pass",
" def __init__(self,):\n \"\"\"__NATIVE__\n NATIVE_SET_TOS(PM_NONE);\n return PM_RET_OK;\n \"\"\"\n pass",
" \... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.4872,
0.0256,
0,
0.66,
0,
810,
3,
1,
0,
0,
816,
10,
1
],
[
14,
0,
0.8462,
0.0256,
0,
0.66,
1.6667,
355,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.8718,
0.0256,
0,
... | [
"l = range(9)",
"d = {}",
"i = 9",
"while i >= 0:\n d[i] = i\n i -= 1",
" d[i] = i"
] |
# This file is Copyright 2011 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.9,
0.05,
0,
0.66,
0,
297,
0,
1,
0,
0,
297,
0,
0
]
] | [
"from t378e import the_list"
] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.8182,
0.0455,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
],
[
8,
0,
0.8636,
0.0455,
0,
0.66,
0.5,
535,
3,
2,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.0455,
0,
0.66,
1... | [
"x = 1.1",
"print(\"1.1 = \", x)",
"print(\"1.1 + 1.1 == \", x+x, \" Endian test passes.\")"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.6296,
0.037,
0,
0.66,
0,
827,
0,
1,
0,
0,
827,
0,
0
],
[
14,
0,
0.7407,
0.037,
0,
0.66,
0.3333,
355,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.8148,
0.037,
0,
0.6... | [
"import dict",
"d = {0:None}",
"r1 = dict.has_key(d, 0)",
"r2 = dict.has_key(d, None)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
4,
0,
0.9286,
0.1905,
0,
0.66,
0,
0,
3,
0,
0,
0,
0,
0,
3
],
[
8,
1,
0.9048,
0.0476,
1,
0.63,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
1,
1,
0.0476,
1,
0.63,
1,
... | [
"if ismain():\n print(\"In main.\")\nelse:\n print(\"Not in main.\")",
" print(\"In main.\")",
" print(\"Not in main.\")"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.7826,
0.0435,
0,
0.66,
0,
430,
0,
1,
0,
0,
430,
0,
0
],
[
14,
0,
0.8696,
0.0435,
0,
0.66,
0.5,
810,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.913,
0.0435,
0,
0.66... | [
"import list",
"l=[]",
"rv = list.append(l, 42)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.5,
0.0278,
0,
0.66,
0,
810,
5,
0,
0,
0,
0,
0,
1
],
[
14,
0,
0.5833,
0.0278,
0,
0.66,
0.6667,
810,
5,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.6111,
0.0278,
0,
0.66,... | [
"l = [x for x in range(5)]",
"l = [x*2 for x in range(5)]",
"print(\"[x*2 for x in range(5)] = \", l)",
"mat = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]"
] |
#
# PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers.
# Copyright 2010 Dean Hall. All rights reserved.
# PyMite is offered through one of two licenses: commercial or open-source.
# See the LICENSE file at the root of this package for licensing details.
#
#
# System Test 281
# Fix float co... | [
[
14,
0,
0.7647,
0.0588,
0,
0.66,
0,
475,
1,
0,
0,
0,
0,
2,
0
],
[
14,
0,
0.8235,
0.0588,
0,
0.66,
0.5,
756,
1,
0,
0,
0,
0,
2,
0
],
[
8,
0,
0.8824,
0.0588,
0,
0.66,... | [
"a = 3.4e-15",
"b = 3.5e-15",
"print(\"a == b ?\", a == b)"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.5,
0.0294,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.6176,
0.0882,
0,
0.66,
0.1667,
557,
0,
1,
0,
0,
0,
0,
0
],
[
6,
1,
0.6324,
0.0588,
1,
0.08,... | [
"from sys import gc",
"def iter(s):\n for i in s:\n yield i",
" for i in s:\n yield i",
" yield i",
"ch = iter(\"abcd\")",
"def i():\n print(ch.next())\n gc()",
" print(ch.next())",
" gc()",
"i()",
"i()",
"i()"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.72,
0.04,
0,
0.66,
0,
870,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.76,
0.04,
0,
0.66,
0.25,
282,
9,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.8,
0.04,
0,
0.66,
0.5,
... | [
"dx = 42",
"f1 = lambda x: x - dx",
"print(map(f1, range(5)))",
"f2 = lambda x: x + dx",
"print(map(f2, range(5)))"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.6923,
0.0385,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.7885,
0.0769,
0,
0.66,
0.5,
899,
0,
2,
1,
0,
0,
0,
0
],
[
13,
1,
0.8077,
0.0385,
1,
0.54... | [
"import sys",
"def f(a,b):\n return a+b",
" return a+b",
"print(f, sys)"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.9545,
0.0455,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(\"Expect AssertionError:\")"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.15,
0.0083,
0,
0.66,
0,
535,
3,
2,
0,
0,
0,
0,
1
],
[
8,
0,
0.1917,
0.0083,
0,
0.66,
0.2667,
535,
3,
2,
0,
0,
0,
0,
1
],
[
8,
0,
0.2333,
0.0083,
0,
0.66,
... | [
"print(\"0.0 + 3.0 == \", 0.0 + 3.0)",
"print(\"0.0 - 3.0 == \", 0.0 - 3.0)",
"print(\"0.0 * 3.0 == \", 0.0 * 3.0)",
"print(\"0.0 / 3.0 == \", 0.0 / 3.0)",
"print(\"0.0 % 3.0 == \", 0.0 % 3.0)",
"print(\"3.0 ** 3.0 == \", 3.0 ** 3.0)",
"print(\"0.0 and 3.0 == \", 0.0 and 3.0)",
"print(\"0.0 or 3.0 == ... |
# This file is Copyright 2011 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
1,
0.0556,
0,
0.66,
0,
23,
0,
0,
0,
0,
0,
5,
0
]
] | [
"the_list = [40]"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.4615,
0.0256,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5128,
0.0256,
0,
0.66,
0.2,
97,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.6538,
0.1538,
0,
0.66,... | [
"import sys",
"sharedVar = 42",
"def f1():\n global sharedVar\n print(\"f1: sharedVar is \", sharedVar)\n while sharedVar == 42:\n pass\n print(\"f1: sharedVar is \", sharedVar)",
" print(\"f1: sharedVar is \", sharedVar)",
" while sharedVar == 42:\n pass",
" print(\"f1:... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.75,
0.125,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.875,
0.0417,
0,
0.66,
0.3333,
756,
0,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.9167,
0.0417,
0,
0.66,
... | [
"\"\"\"NOT__NATIVE__\n/* Inserted this so there is a module-level __doc__ string in the code object */\n\"\"\"",
"b = \"__doc__\" in globals()",
"print(\"__doc__ in globals == \", b)",
"if b:\n print(\"len(__doc__) == \", len(globals()[\"__doc__\"]))",
" print(\"len(__doc__) == \", len(globals()[\"__d... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.4634,
0.0244,
0,
0.66,
0,
329,
0,
0,
0,
0,
0,
8,
0
],
[
4,
0,
0.5,
0.0488,
0,
0.66,
0.0909,
0,
2,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.561,
0.0244,
0,
0.66,
... | [
"t1 = ()",
"if t1:\n assert 0",
"t2 = (2,)",
"if not t2:\n assert 0",
"l1 = []",
"if l1:\n assert 0",
"l2 = [2,]",
"if not l2:\n assert 0",
"d1 = {}",
"if d1:\n assert 0",
"d2 = {2:2}",
"if not d2:\n assert 0"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.8182,
0.0455,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.9091,
0.0455,
0,
0.66,
1,
686,
3,
0,
0,
0,
283,
10,
1
]
] | [
"import sys",
"h = sys.heap()"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.6296,
0.037,
0,
0.66,
0,
890,
0,
1,
0,
0,
890,
0,
0
],
[
1,
0,
0.6667,
0.037,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.7037,
0.037,
0,
0.66... | [
"import string",
"from sys import gc",
"from t347b import *",
"print(bar1())",
"print(bar2())",
"gc()",
"print('did gc')",
"print(bar1())",
"print(bar2())"
] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.5625,
0.0312,
0,
0.66,
0,
745,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.5938,
0.0312,
0,
0.66,
0.2,
448,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.625,
0.0312,
0,
0.66,... | [
"s1 = \"\\0\"",
"s2 = \"a\" + s1",
"s3 = s2 + \"a\"",
"s2 = s1 + \"a\"",
"s3 = s2 + \"\\0\"",
"s2 = \"let's \\0 try\" + s1 + \"something else\\0\""
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [] | [] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.6897,
0.0345,
0,
0.66,
0,
475,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.7241,
0.0345,
0,
0.66,
0.1111,
756,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.7586,
0.0345,
0,
0... | [
"a = \"123\\x08456\"",
"b = 987",
"c = [a,b]",
"d = {a:b}",
"e = (c,d)",
"print(a)",
"print(b)",
"print(c)",
"print(d)",
"print(e)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.7692,
0.0385,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.8077,
0.0385,
0,
0.66,
0.25,
190,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.8462,
0.0385,
0,
0.66... | [
"print(\"Thread A\")",
"x = -42",
"y = 12",
"for i in range(10):\n x += i\n y -= i",
"print(x*y)"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.3469,
0.0204,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.3878,
0.0204,
0,
0.66,
0.1429,
890,
0,
1,
0,
0,
890,
0,
0
],
[
14,
0,
0.551,
0.0204,
0,
0.... | [
"print(\"Exercising string.join()\")",
"import string",
"e1 = ()",
"e2 = []",
"t = (\"check\", \"this\", \"out\")",
"l = [\"check\", \"this\", \"out\"]",
"j = ('', '\\x00', '\\x04', '\\n', ' ', '!', '\\xff', \"foo\")",
"for c in j:\n je1 = string.join(e1, c)\n je2 = string.join(e2, c)\n asser... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.4878,
0.0244,
0,
0.66,
0,
535,
3,
2,
0,
0,
0,
0,
2
],
[
2,
0,
0.622,
0.0488,
0,
0.66,
0.2857,
528,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6585,
0.0244,
0,
0.66... | [
"print(\"dir() = \",dir())",
"def foo():\n pass",
"d = dir()",
"foo.bar = \"bar\"",
"import sys",
"d = dir()",
"d = dir(sys)",
"print(\"dir(sys) = \",d)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [] | [] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.6129,
0.0323,
0,
0.66,
0,
888,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.6452,
0.0323,
0,
0.66,
0.2,
40,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.7419,
0.0323,
0,
0.66,... | [
"l1 = [2,5,6]",
"l2 = [2,5,6]",
"l3 = [2,5,5]",
"t1 = (2,5,6)",
"t2 = (2,5,6)",
"t3 = (2,5,5)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.3273,
0.0182,
0,
0.66,
0,
535,
3,
2,
0,
0,
0,
0,
1
],
[
8,
0,
0.3455,
0.0182,
0,
0.66,
0.1111,
535,
3,
2,
0,
0,
0,
0,
1
],
[
8,
0,
0.3636,
0.0182,
0,
0.66... | [
"print(\"True == \", True)",
"print(\"False == \", False)",
"print(\"not True == \", not True)",
"print(\"not False == \", not False)",
"d = {}",
"d[True] = \"t\"",
"d[False] = \"f\"",
"d = {}",
"d[0] = \"f\"",
"d[1] = \"t\""
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.5135,
0.027,
0,
0.66,
0,
553,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
0.5405,
0.027,
0,
0.66,
0.125,
773,
1,
0,
0,
0,
0,
1,
0
],
[
6,
0,
0.5946,
0.0811,
0,
0.66,... | [
"s = (2,5,6)",
"n = 0",
"for i in s:\n assert s[n] == i\n n += 1",
"s = [2,5,6]",
"n = 0",
"for i in s:\n assert s[n] == i\n n += 1",
"s = \"256\"",
"n = 0",
"for i in s:\n assert s[n] == i\n n += 1"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.76,
0.04,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.92,
0.04,
0,
0.66,
2,
509,
0,
1,
0,
0,
509,
0,
0
]
] | [
"from sys import maxint",
"from sys import *"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.7097,
0.0323,
0,
0.66,
0,
773,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.7742,
0.0323,
0,
0.66,
0.3333,
658,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.871,
0.0323,
0,
0.... | [
"n = 1",
"n0 = +n",
"n1 = ~n",
"n2 = -n"
] |
# This file is Copyright 2011 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.7826,
0.0435,
0,
0.66,
0,
297,
0,
1,
0,
0,
297,
0,
0
],
[
1,
0,
0.8261,
0.0435,
0,
0.66,
0.5,
686,
0,
1,
0,
0,
686,
0,
0
],
[
8,
0,
0.913,
0.0435,
0,
0.66... | [
"from t378e import the_list",
"import t378f",
"print(\"the_list[0] =\", the_list[0])"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.825,
0.025,
0,
0.66,
0,
200,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.9,
0.025,
0,
0.66,
0.5,
730,
3,
1,
0,
0,
147,
10,
1
],
[
8,
0,
0.925,
0.025,
0,
0.66,
... | [
"img = '\\nc\\x00\\x00\\x03\\x00\\x04\\x04\\x03\\x03\\x00sys\\x03\\x04\\x00putb\\x03\\x01\\x00n\\x03\\x00\\x00\\x04\\x05\\x01\\xff\\xff\\xff\\xff\\x00\\x014\\x00\\x00\\x00\\x01*\\x00\\x00\\x00\\x012\\x00\\x00\\x00d\\x00\\x00d\\x01\\x00k\\x00\\x00Z\\x00\\x00e\\x00\\x00i\\x01\\x00d\\x02\\x00\\x83\\x01\\x00Fd\\x03\\x0... |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.6429,
0.0357,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.75,
0.0357,
0,
0.66,
0.1667,
243,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.7857,
0.0357,
0,
0.66... | [
"import sys",
"sys.wait(-1)",
"sys.wait(0)",
"sys.wait(1)",
"print(\"Waiting 3 secs...\")",
"sys.wait(3000)",
"print(\"done.\")"
] |
# Anything that starts with a # is a comment!
# Use lots of comments in your code to explain what you're doing.
# Use the PIC-specific Python libraries
import t108b as pic
###############################################################
# Set up line sensors, distance sensor, motors
#################################... | [
[
1,
0,
0.1562,
0.0312,
0,
0.66,
0,
781,
0,
1,
0,
0,
781,
0,
0
],
[
14,
0,
0.375,
0.0312,
0,
0.66,
0.1429,
927,
3,
3,
0,
0,
928,
10,
1
],
[
14,
0,
0.4062,
0.0312,
0,
... | [
"import t108b as pic",
"line_sensor_right = pic.digital_io(1, 8, True)",
"right_wheel_stopped = 938",
"def drive_forward():\n right_wheel.setCounts(right_wheel_forward)",
" right_wheel.setCounts(right_wheel_forward)",
"def stop_driving():\n right_wheel.setCounts(right_wheel_stopped)",
" ... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.3529,
0.0196,
0,
0.66,
0,
826,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.3725,
0.0196,
0,
0.66,
0.05,
745,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3922,
0.0196,
0,
0.6... | [
"i = 4",
"s1 = \"test %d\" % i",
"s2 = \"test %d\" % (i,)",
"i = 205",
"s1 = \"test t%03d\" % i",
"s2 = \"test t%03d\" % (i,)",
"print(s1)",
"f = -3.14",
"s1 = \"test %f this\" % f",
"s2 = \"test %f this\" % (f,)",
"f = -3.14",
"s1 = \"test %1.2f\" % f",
"s2 = \"test %1.2f\" % (f,)",
"s = ... |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.3913,
0.0217,
0,
0.66,
0,
475,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.413,
0.0217,
0,
0.66,
0.1429,
773,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.4565,
0.0217,
0,
0.6... | [
"a = 2",
"n = 3",
"print(\" 2 % 3 in pymite:\", (a % n), \" and in cpython:\", 2)",
"print(\" (-2) % 3 in pymite:\", ((-a) % n), \" and in cpython:\", 1)",
"print(\" 2 % (-3) in pymite:\", (a % (-n)), \" and in cpython:\", -1)",
"print(\"(-2) % (-3) in pymite:\", ((-a) % (-n)), \" and in cpython:... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.4872,
0.0256,
0,
0.66,
0,
888,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.5385,
0.0256,
0,
0.66,
0.2222,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.5897,
0.0256,
0,
0.... | [
"l1 = [1, 2, 3]",
"print(l1)",
"l2 = [1, 2, 3, 4.0]",
"print(l2)",
"l3 = [1.0, 2.0, 3.0]",
"print(l3)",
"l4 = [1.1, 2.2, 3.3]",
"print(l4)",
"l5 = [1.1, 2.2, 3.3, 4.4]",
"print(l5)"
] |
# This file is Copyright 2011 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.9474,
0.0526,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.0526,
0,
0.66,
1,
92,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import sys",
"sys.gc()"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.413,
0.0217,
0,
0.66,
0,
15,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
0.5652,
0.0217,
0,
0.66,
2,
810,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.7174,
0.0217,
0,
0.66,
... | [
"t = (2,5,6)",
"l = [2,5,6]",
"s = \"256\"",
"d = {2:2, 5:\"5\", 6:None}"
] |
import sys
Import("env", "vars")
SOURCES = Glob("*.c")
PMSTDLIB_SOURCES = ["../lib/list.py",
"../lib/dict.py",
"../lib/__bi.py",
"../lib/sys.py",
"../lib/string.py",]
if env["IPM"] == True:
PMSTDLIB_SOURCES.append("../lib/ipm.py")
... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.1538,
0.0385,
0,
0.66,
0.1111,
248,
3,
2,
0,
0,
0,
0,
1
],
[
14,
0,
0.2308,
0.0385,
0,
0... | [
"import sys",
"Import(\"env\", \"vars\")",
"SOURCES = Glob(\"*.c\")",
"PMSTDLIB_SOURCES = [\"../lib/list.py\",\n \"../lib/dict.py\",\n \"../lib/__bi.py\",\n \"../lib/sys.py\",\n \"../lib/string.py\",]",
"if env[\"IPM\"] == True:\n ... |
# This file is Copyright 2007 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief avr
## @package avr
# @brief AVR Access Module
#
# Provides generic access to the AVR microcontroller
#
# Note ... | [
[
8,
0,
0.3103,
0.4557,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.5567,
0.0123,
0,
0.66,
0.2,
982,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.5567,
0.0074,
1,
0.37,
... | [
"\"\"\"__NATIVE__\n#include <avr/io.h>\n#include <util/delay.h>\n\n/*\n * Common method for all port register operations\n */\nPmReturn_t",
"def portA(a):\n \"\"\"__NATIVE__\n return _portX(&PORTA, &DDRA, &PINA);\n \"\"\"\n pass",
" \"\"\"__NATIVE__\n return _portX(&PORTA, &DDRA, &PINA);\n ... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief dict
## @package dict
# @brief Provides PyMite's dict module.
__name__ = "dict"
class _Autobox:
def clea... | [
[
14,
0,
0.0719,
0.006,
0,
0.66,
0,
136,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.1228,
0.0719,
0,
0.66,
0.1667,
235,
0,
4,
0,
0,
0,
0,
4
],
[
2,
1,
0.0988,
0.012,
1,
0.86,... | [
"__name__ = \"dict\"",
"class _Autobox:\n def clear(self):\n return clear(self.obj)\n\n def keys(self):\n return keys(self.obj)\n\n def has_key(self, k):",
" def clear(self):\n return clear(self.obj)",
" return clear(self.obj)",
" def keys(self):\n return ke... |
# This file is Copyright 2007 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief ipm_target
## @package ipm_target
# @brief Provides PyMite's interactive interface for the target.
##
# Recei... | [
[
2,
0,
0.4444,
0.5556,
0,
0.66,
0,
795,
0,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.4444,
0.5354,
1,
0.82,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.7727,
0.0606,
0,
0.66,
0... | [
"def _getImg():\n \"\"\"__NATIVE__\n PmReturn_t retval;\n uint8_t imgType;\n uint16_t imgSize;\n uint8_t *pchunk;\n pPmCodeImgObj_t pimg;\n uint16_t i;",
" \"\"\"__NATIVE__\n PmReturn_t retval;\n uint8_t imgType;\n uint16_t imgSize;\n uint8_t *pchunk;\n pPmCodeImgObj_t pimg;... |
# This file is Copyright 2002 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @package sys
# @brief Provides PyMite's system module, sys
#
# USAGE
# -----
#
# import sys
#
#### TODO
# modules = None #set pt... | [
[
14,
0,
0.083,
0.0038,
0,
0.66,
0,
279,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.1491,
0.1132,
0,
0.66,
0.125,
436,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.1491,
0.1057,
1,
0.59,... | [
"maxint = 0x7FFFFFFF # 2147483647",
"def exit(val):\n \"\"\"__NATIVE__\n pPmObj_t pval = C_NULL;\n PmReturn_t retval;\n\n /* If no arg given, assume return 0 */\n if (NATIVE_GET_NUM_ARGS() == 0)\n {",
" \"\"\"__NATIVE__\n pPmObj_t pval = C_NULL;\n PmReturn_t retval;\n\n /* If n... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief func
## @package func
# @brief Provides PyMite's func module.
##
# Returns the names tuple of the function/mo... | [
[
2,
0,
0.4153,
0.3051,
0,
0.66,
0,
987,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.4153,
0.2712,
1,
0.18,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.8051,
0.3051,
0,
0.66,
1... | [
"def co_names(f):\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n pPmObj_t pfunc;\n\n /* If wrong number of args, raise TypeError */\n if (NATIVE_GET_NUM_ARGS() != 1)\n {",
" \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n pPmObj_t pfunc;\n\n /* If wrong number of args, rai... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief sizeof
## @package sizeof
# @brief Provides PyMite's sizeof module.
#
# <b>USAGE</b>
#
# \code sizeof.sizeof(ob... | [
[
8,
0,
0.1515,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.4508,
0.5455,
0,
0.66,
0.5,
797,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.4508,
0.5303,
1,
0.19,
... | [
"\"\"\"__NATIVE__\n#include \"pm.h\"\n\"\"\"",
"def sizeof(obj):\n \"\"\"__NATIVE__\n pPmObj_t pobj;\n pPmObj_t psize;\n int32_t n;\n PmReturn_t retval = PM_RET_OK;\n int32_t static size[] = {\n sizeof(PmObj_t), /* None type */",
" \"\"\"__NATIVE__\n pPmObj_t pobj;\n pPmObj_t p... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
## @package string
# @brief Provides PyMite's string module.
#
"""__NATIVE__
#include <stdlib.h>
#include <string.h>
"""
... | [
[
8,
0,
0.0539,
0.0149,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0706,
0.0037,
0,
0.66,
0.1111,
136,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.0967,
0.0335,
0,
0.66,... | [
"\"\"\"__NATIVE__\n#include <stdlib.h>\n#include <string.h>\n\"\"\"",
"__name__ = \"string\"",
"class _Autobox:\n def join(self, l):\n return join(self.obj, l)\n\n def count(self, s):\n return count(self.obj, s)\n\n def find(self, s):",
" def join(self, l):\n return join(self.... |
# This file is Copyright 2002 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief __bi
## @package __bi
# @brief Provides PyMite's builtins module, __bi.
#
# <b>USAGE</b>
#
# The builtins are... | [
[
2,
0,
0.0195,
0.0031,
0,
0.66,
0,
799,
0,
1,
1,
0,
0,
0,
0
],
[
13,
1,
0.0205,
0.001,
1,
0.96,
0,
0,
6,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.0416,
0.037,
0,
0.66,
0.... | [
"def abs(n):\n# return n > 0 and n or -n\n return (n, -n)[n < 0]",
" return (n, -n)[n < 0]",
"def chr(n):\n \"\"\"__NATIVE__\n pPmObj_t ps;\n pPmObj_t pn;\n int32_t n;\n PmReturn_t retval;\n\n /* If wrong number of args, raise TypeError */",
" \"\"\"__NATIVE__\n pPmObj_t ps;\n... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief list
## @package list
# @brief Provides PyMite's list module.
#
# Notes:
# - index(l, o) does not offer start a... | [
[
14,
0,
0.0656,
0.0041,
0,
0.66,
0,
136,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.1209,
0.0984,
0,
0.66,
0.125,
235,
0,
7,
0,
0,
0,
0,
8
],
[
2,
1,
0.0799,
0.0082,
1,
0.38... | [
"__name__ = \"list\"",
"class _Autobox:\n def append(self, o):\n return append(self.obj, o)\n\n def count(self, v):\n return count(self.obj, v)\n\n def extend(self, s):",
" def append(self, o):\n return append(self.obj, o)",
" return append(self.obj, o)",
" def cou... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
[
14,
0,
0.0281,
0.0017,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0347,
0.0017,
0,
0.66,
0.0303,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.0364,
0.0017,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import sys",
"sys.path.insert(0, 'lib')",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from google.appengine.ext import db",
"from google... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
[
14,
0,
0.0557,
0.0033,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0689,
0.0033,
0,
0.66,
0.0333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0721,
0.0033,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import db",
"from google.appengine.ext.webapp import template",
"from apiclient.discovery import build_from_document",
"from apiclient.http import MediaUpload",
"from oauth2... |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | [
[
14,
0,
0.1667,
0.0556,
0,
0.66,
0,
189,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3889,
0.0556,
0,
0.66,
0.3333,
295,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6111,
0.0556,
0,
0... | [
"manual_verstr = \"1.5\"",
"auto_build_num = \"211\"",
"verstr = manual_verstr + \".\" + auto_build_num",
"try:\n from pyutil.version_class import Version as pyutil_Version\n __version__ = pyutil_Version(verstr)\nexcept (ImportError, ValueError):\n # Maybe there is no pyutil installed.\n from dist... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | [
[
8,
0,
0.3,
0.575,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.625,
0.025,
0,
0.66,
0.3333,
311,
0,
1,
0,
0,
311,
0,
0
],
[
1,
0,
0.65,
0.025,
0,
0.66,
0.6... | [
"\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including withou... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | [
[
8,
0,
0.2927,
0.561,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6098,
0.0244,
0,
0.66,
0.25,
311,
0,
1,
0,
0,
311,
0,
0
],
[
1,
0,
0.6341,
0.0244,
0,
0.66,
... | [
"\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including withou... |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | [
[
8,
0,
0.0437,
0.0741,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0847,
0.0026,
0,
0.66,
0.0588,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0899,
0.0026,
0,
0.66,... | [
"\"\"\"Multi-credential file store with lock support.\n\nThis module implements a JSON credential store where multiple\ncredentials can be stored in one file. That file supports locking\nboth in a single process and across processes.\n\nThe credential themselves are keyed off of:\n* client_id",
"__author__ = 'jb... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.0145,
0.0035,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0176,
0.0009,
0,
0.66,
0.0244,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0193,
0.0009,
0,
0.66,... | [
"\"\"\"An OAuth 2.0 client.\n\nTools for interacting with OAuth 2.0 protected resources.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import base64",
"import clientsecrets",
"import copy",
"import datetime",
"import httplib2",
"import logging",
"import os",
"import sys",
"im... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1604,
0.0472,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1981,
0.0094,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.217,
0.0094,
0,
0.66,
... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 2.0\ncredentials.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import os",
"import stat",
"import threading",
"from anyjson import simplejson",
"from client import Storage as BaseStorage",
"from clien... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1371,
0.0403,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1694,
0.0081,
0,
0.66,
0.1111,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1855,
0.0081,
0,
0.66,... | [
"\"\"\"OAuth 2.0 utilities for Django.\n\nUtilities for using OAuth 2.0 in conjunction with\nthe Django datastore.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import oauth2client",
"import base64",
"import pickle",
"from django.db import models",
"from oauth2client.client import St... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
[
1,
0,
0.0738,
0.0041,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0779,
0.0041,
0,
0.66,
0.0625,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.082,
0.0041,
0,
0... | [
"import base64",
"import hashlib",
"import logging",
"import time",
"from OpenSSL import crypto",
"from anyjson import simplejson",
"CLOCK_SKEW_SECS = 300 # 5 minutes in seconds",
"AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds",
"MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds",
"cla... |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1619,
0.0476,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2,
0.0095,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2286,
0.0095,
0,
0.66,
... | [
"\"\"\"Utilities for reading OAuth 2.0 client secret files.\n\nA client_secrets.json file contains all the information needed to interact with\nan OAuth 2.0 protected service.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"from anyjson import simplejson",
"TYPE_WEB = 'web'",
"TYPE_INSTALL... |
__version__ = "1.0c2"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__ = \"1.0c2\""
] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.5312,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6562,
0.0312,
0,
0.66,
0.5,
777,
1,
0,
0,
0,
0,
3,
0
],
[
7,
0,
0.875,
0.2812,
0,
0.66,
... | [
"\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"try: # pragma: no cover\n # Should work for Python2.6 and higher.\n import json as simplejson\nexcept ImportError: #... |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | [
[
1,
0,
0.006,
0.006,
0,
0.66,
0,
32,
0,
1,
0,
0,
32,
0,
0
],
[
1,
0,
0.0119,
0.006,
0,
0.66,
0.1,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0179,
0.006,
0,
0.66,
... | [
"import Cookie",
"import datetime",
"import time",
"import email.utils",
"import calendar",
"import base64",
"import hashlib",
"import hmac",
"import re",
"import logging",
"class LilCookies:\n\n @staticmethod\n def _utf8(s):\n if isinstance(s, unicode):\n return s.encode(\"utf-8\")\n ... |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | [
[
8,
0,
0.0814,
0.1105,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1453,
0.0058,
0,
0.66,
0.0833,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1512,
0.0058,
0,
0.66... | [
"\"\"\"MIME-Type Parser\n\nThis module provides basic functions for handling mime-types. It can handle\nmatching mime-types against a list of media-ranges. See section 14.1 of the\nHTTP specification [RFC 2616] for a complete explanation.\n\n http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1",
"__v... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.0342,
0.0083,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0414,
0.0021,
0,
0.66,
0.0476,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0476,
0.0021,
0,
0.66,... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import copy",
"import httplib2",
"import logging",
"import oauth2 as oauth",
"import urllib",
"import urlparse",
"from anyjson import simplejson",
"tr... |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
[
8,
0,
0.0519,
0.0182,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0649,
0.0026,
0,
0.66,
0.0625,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0701,
0.0026,
0,
0.66,... | [
"\"\"\"Model objects for requests and responses.\n\nEach API may support one or more serializations, such\nas JSON, Atom, etc. The model classes are responsible\nfor converting between the wire format and the Python\nobject representation.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.2619,
0.0635,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3175,
0.0159,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3492,
0.0159,
0,
0.66,
... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 1.0 credentials.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import pickle",
"import threading",
"from apiclient.oauth import Storage as BaseStorage",
"class Storage(BaseStorage):\n \"\"\"Store and retr... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
1,
0,
0.2679,
0.0179,
0,
0.66,
0,
629,
0,
1,
0,
0,
629,
0,
0
],
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0.2,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.6... | [
"import apiclient",
"import base64",
"import pickle",
"from django.db import models",
"class OAuthCredentialsField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def db_type(self):\n return 'VARCHAR'\n\n def to_python(self, value):",
" __metaclass__ = models.SubfieldBase",
" def db_t... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1259,
0.037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1556,
0.0074,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1704,
0.0074,
0,
0.66,
... | [
"\"\"\"Utilities for Google App Engine\n\nUtilities for making it easier to use the\nGoogle API Client for Python on Google App Engine.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import pickle",
"from google.appengine.ext import db",
"from apiclient.oauth import OAuthCredentials",
"... |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
[
8,
0,
0.1545,
0.0407,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.187,
0.0081,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2114,
0.0081,
0,
0.66,
... | [
"\"\"\"Errors for the library.\n\nAll exceptions defined by the library\nshould be defined in this file.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"from oauth2client.anyjson import simplejson",
"class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass",
" \"\"\"Base... |
__version__ = "1.0c2"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__ = \"1.0c2\""
] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1205,
0.1452,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2046,
0.0033,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2112,
0.0033,
0,
0.66,
... | [
"\"\"\"Schema processing for discovery based APIs\n\nSchemas holds an APIs discovery schemas. It can return those schema as\ndeserialized JSON objects, or pretty print them as prototype objects that\nconform to the schema.\n\nFor example, given the schema:",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.5312,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6562,
0.0312,
0,
0.66,
0.5,
777,
1,
0,
0,
0,
0,
3,
0
],
[
7,
0,
0.875,
0.2812,
0,
0.66,
... | [
"\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"try: # pragma: no cover\n import simplejson\nexcept ImportError: # pragma: no cover\n try:\n # Try to import from... |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | [
[
1,
0,
0.0204,
0.0068,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0272,
0.0068,
0,
0.66,
0.0833,
614,
0,
1,
0,
0,
614,
0,
0
],
[
14,
0,
0.0408,
0.0068,
0,
... | [
"import re",
"import urllib",
"RESERVED = \":/?#[]@!$&'()*+,;=\"",
"OPERATOR = \"+./;?|!@\"",
"EXPLODE = \"*+\"",
"MODIFIER = \":^\"",
"TEMPLATE = re.compile(r\"{(?P<operator>[\\+\\./;\\?|!@])?(?P<varlist>[^}]+)}\", re.UNICODE)",
"VAR = re.compile(r\"^(?P<varname>[^=\\+\\*:\\^]+)((?P<explode>[\\+\\*])... |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | [
[
8,
0,
0.1818,
0.0267,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2032,
0.0053,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.2219,
0.0107,
0,
0.66,
... | [
"\"\"\"Module to enforce different constraints on flags.\n\nA validator represents an invariant, enforced over a one or more flags.\nSee 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual.\n\"\"\"",
"__author__ = 'olexiy@google.com (Olexiy Oryeshko)'",
"class Error(Exception):\n \"\"\"Thrown If val... |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | [
[
8,
0,
0.0365,
0.0708,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.0845,
0.0205,
0,
0.66,
0.04,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0982,
0.0023,
0,
0.66,
... | [
"\"\"\"SocksiPy - Python SOCKS module.\nVersion 1.00\n\nCopyright 2006 Dan-Haim. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright ... |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | [
[
8,
0,
0.0318,
0.0545,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0636,
0.0091,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0727,
0.0091,
0,
0.66... | [
"\"\"\"\niri2uri\n\nConverts an IRI to a URI.\n\n\"\"\"",
"__author__ = \"Joe Gregorio (joe@bitworking.org)\"",
"__copyright__ = \"Copyright 2006, Joe Gregorio\"",
"__contributors__ = []",
"__version__ = \"1.0.0\"",
"__license__ = \"MIT\"",
"__history__ = \"\"\"\n\"\"\"",
"import urlparse",
"escape_... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
[
14,
0,
0.0557,
0.0033,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0689,
0.0033,
0,
0.66,
0.0333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0721,
0.0033,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import db",
"from google.appengine.ext.webapp import template",
"from apiclient.discovery import build_from_document",
"from apiclient.http import MediaUpload",
"from oauth2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.