code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/python
#
# Copyright 2008 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 a... | [
[
1,
0,
0.4722,
0.0278,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.5278,
0.0278,
0,
0.66,
0.5,
522,
0,
1,
0,
0,
522,
0,
0
],
[
8,
0,
0.8056,
0.4167,
0,
0.6... | [
"from distutils.core import setup",
"import ipaddr",
"setup(name='ipaddr',\n maintainer='Google',\n maintainer_email='ipaddr-py-dev@googlegroups.com',\n version=ipaddr.__version__,\n url='http://code.google.com/p/ipaddr-py/',\n license='Apache License, Version 2.0',\n classifiers=[... |
#!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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/LICE... | [
[
8,
0,
0.0111,
0.0032,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0135,
0.0005,
0,
0.66,
0.0417,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0146,
0.0005,
0,
0.66,... | [
"\"\"\"A fast, lightweight IPv4/IPv6 manipulation library in Python.\n\nThis library is used to create/poke/manipulate IPv4 and IPv6 addresses\nand networks.\n\n\"\"\"",
"__version__ = 'trunk'",
"import struct",
"class AddressValueError(ValueError):\n \"\"\"A Value Error related to the address.\"\"\"",
"... |
#!/usr/bin/python
#
# Copyright 2008 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 a... | [
[
1,
0,
0.4722,
0.0278,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.5278,
0.0278,
0,
0.66,
0.5,
522,
0,
1,
0,
0,
522,
0,
0
],
[
8,
0,
0.8056,
0.4167,
0,
0.6... | [
"from distutils.core import setup",
"import ipaddr",
"setup(name='ipaddr',\n maintainer='Google',\n maintainer_email='ipaddr-py-dev@googlegroups.com',\n version=ipaddr.__version__,\n url='http://code.google.com/p/ipaddr-py/',\n license='Apache License, Version 2.0',\n classifiers=[... |
#!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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/LICE... | [
[
8,
0,
0.0108,
0.0032,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0132,
0.0005,
0,
0.66,
0.0357,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0142,
0.0005,
0,
0.66,... | [
"\"\"\"A fast, lightweight IPv4/IPv6 manipulation library in Python.\n\nThis library is used to create/poke/manipulate IPv4 and IPv6 addresses\nand networks.\n\n\"\"\"",
"__version__ = '2.1.10'",
"import struct",
"IPV4LENGTH = 32",
"IPV6LENGTH = 128",
"class AddressValueError(ValueError):\n \"\"\"A Val... |
#!/usr/bin/python
#
# Copyright 2008 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 a... | [
[
1,
0,
0.4722,
0.0278,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.5278,
0.0278,
0,
0.66,
0.5,
522,
0,
1,
0,
0,
522,
0,
0
],
[
8,
0,
0.8056,
0.4167,
0,
0.6... | [
"from distutils.core import setup",
"import ipaddr",
"setup(name='ipaddr',\n maintainer='Google',\n maintainer_email='ipaddr-py-dev@googlegroups.com',\n version=ipaddr.__version__,\n url='http://code.google.com/p/ipaddr-py/',\n license='Apache License, Version 2.0',\n classifiers=[... |
#!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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/LICE... | [
[
8,
0,
0.0105,
0.0031,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0128,
0.0005,
0,
0.66,
0.0357,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0138,
0.0005,
0,
0.66,... | [
"\"\"\"A fast, lightweight IPv4/IPv6 manipulation library in Python.\n\nThis library is used to create/poke/manipulate IPv4 and IPv6 addresses\nand networks.\n\n\"\"\"",
"__version__ = '2.1.7'",
"import struct",
"IPV4LENGTH = 32",
"IPV6LENGTH = 128",
"class AddressValueError(ValueError):\n \"\"\"A Valu... |
#!/usr/bin/python
#
# Copyright 2008 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 a... | [
[
1,
0,
0.4857,
0.0286,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.5429,
0.0286,
0,
0.66,
0.5,
522,
0,
1,
0,
0,
522,
0,
0
],
[
8,
0,
0.8143,
0.4,
0,
0.66,
... | [
"from distutils.core import setup",
"import ipaddr",
"setup(name='ipaddr',\n maintainer='Google',\n maintainer_email='ipaddr-py-dev@googlegroups.com',\n version=ipaddr.__version__,\n url='http://code.google.com/p/ipaddr-py/',\n classifiers=[\n 'Development Status :: 5 - Product... |
#!/usr/bin/python
#
# Copyright 2007 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 a... | [
[
8,
0,
0.0169,
0.0044,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0204,
0.0009,
0,
0.66,
0.0667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.024,
0.0027,
0,
0.66,
... | [
"\"\"\"An IPv4/IPv6 manipulation library in Python.\n\nThis library is used to create/poke/manipulate IPv4 and IPv6 addresses and\nprefixes.\n\"\"\"",
"__version__ = '1.0.0'",
"class Error(Exception):\n \"\"\"Base class for exceptions.\"\"\"\n pass",
" \"\"\"Base class for exceptions.\"\"\"",
"class IPTy... |
#!/usr/bin/python
#
# Copyright 2008 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 a... | [
[
1,
0,
0.4722,
0.0278,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.5278,
0.0278,
0,
0.66,
0.5,
522,
0,
1,
0,
0,
522,
0,
0
],
[
8,
0,
0.8056,
0.4167,
0,
0.6... | [
"from distutils.core import setup",
"import ipaddr",
"setup(name='ipaddr',\n maintainer='Google',\n maintainer_email='ipaddr-py-dev@googlegroups.com',\n version=ipaddr.__version__,\n url='http://code.google.com/p/ipaddr-py/',\n license='Apache License, Version 2.0',\n classifiers=[... |
#!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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/LICE... | [
[
8,
0,
0.0105,
0.0031,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0128,
0.0005,
0,
0.66,
0.0357,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0138,
0.0005,
0,
0.66,... | [
"\"\"\"A fast, lightweight IPv4/IPv6 manipulation library in Python.\n\nThis library is used to create/poke/manipulate IPv4 and IPv6 addresses\nand networks.\n\n\"\"\"",
"__version__ = '2.1.9'",
"import struct",
"IPV4LENGTH = 32",
"IPV6LENGTH = 128",
"class AddressValueError(ValueError):\n \"\"\"A Valu... |
#!/usr/bin/python
#
# Copyright 2008 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 a... | [
[
1,
0,
0.4722,
0.0278,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.5278,
0.0278,
0,
0.66,
0.5,
522,
0,
1,
0,
0,
522,
0,
0
],
[
8,
0,
0.8056,
0.4167,
0,
0.6... | [
"from distutils.core import setup",
"import ipaddr",
"setup(name='ipaddr',\n maintainer='Google',\n maintainer_email='ipaddr-py-dev@googlegroups.com',\n version=ipaddr.__version__,\n url='http://code.google.com/p/ipaddr-py/',\n license='Apache License, Version 2.0',\n classifiers=[... |
#!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# 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/LICE... | [
[
8,
0,
0.0105,
0.0031,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0128,
0.0005,
0,
0.66,
0.0357,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0139,
0.0005,
0,
0.66,... | [
"\"\"\"A fast, lightweight IPv4/IPv6 manipulation library in Python.\n\nThis library is used to create/poke/manipulate IPv4 and IPv6 addresses\nand networks.\n\n\"\"\"",
"__version__ = '2.1.6'",
"import struct",
"IPV4LENGTH = 32",
"IPV6LENGTH = 128",
"class AddressValueError(ValueError):\n \"\"\"A Valu... |
#
# This file defines how to build PyMite using Scons (www.scons.org)
# Usage:
# scons tags
# scons docs
# scons PLATFORM=<platform>
#
import os, string
supported_platforms = Glob("src/platform/*")
allowed_platforms = [os.path.split(x)[1] for x in map(str, supported_platforms)]
vars = Variables()
# BUILD ... | [
[
1,
0,
0.1493,
0.0149,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
14,
0,
0.194,
0.0149,
0,
0.66,
0.25,
922,
3,
1,
0,
0,
753,
10,
1
],
[
14,
0,
0.209,
0.0149,
0,
0... | [
"import os, string",
"supported_platforms = Glob(\"src/platform/*\")",
"allowed_platforms = [os.path.split(x)[1] for x in map(str, supported_platforms)]",
"vars = Variables()",
"if \"tags\" in COMMAND_LINE_TARGETS or \"TAGS\" in COMMAND_LINE_TARGETS:\n vmfiles = Glob(\"src/vm/*\")\n ctags = Command('t... |
#!/usr/bin/env python
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip tools.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
"""
PyMite Heap Dump
================
Parses a heap dump into human-readable format.
The heap dump file is created ... | [
[
8,
0,
0.032,
0.0436,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0681,
0.0014,
0,
0.66,
0.0833,
688,
0,
6,
0,
0,
688,
0,
0
],
[
7,
0,
0.0729,
0.0054,
0,
0.66,... | [
"\"\"\"\nPyMite Heap Dump\n================\n\nParses a heap dump into human-readable format.\n\nThe heap dump file is created by inserting a calls to heap_dump()\ninside heap_gcRun(). Using two calls, a before and after, is ideal.",
"import os, struct, sys, types, UserDict, collections",
"try:\n import cSt... |
#!/usr/bin/env python
# This file is Copyright 2001 Dean Hall.
# This file is part of the Python-on-a-Chip tools.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
"""
PyMite Image Creator
====================
Converts Python source files to a PyMite code image library.
Performs ... | [
[
8,
0,
0.0191,
0.0228,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0481,
0.0165,
0,
0.66,
0.0244,
207,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0589,
0.001,
0,
0.66,
... | [
"\"\"\"\nPyMite Image Creator\n====================\n\nConverts Python source files to a PyMite code image library.\nPerforms code filtering to ensure it will run in PyMite.\nFormats the image as a raw binary file or a C file\ncontaining a byte array.",
"__usage__ = \"\"\"USAGE:\n pmImgCreator.py -f pmfeatures... |
#!/usr/bin/env python
# Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip tools.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copydoc pmReplaceCopyright
## @package pmReplaceCopyright
# @brief This program naively replaces the copyright head... | [
[
1,
0,
0.2571,
0.0143,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
14,
0,
0.3786,
0.1714,
0,
0.66,
0.2,
212,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.5643,
0.1714,
0,
0.6... | [
"import os, sys",
"PoaC_COPYRIGHT = \"\"\"# This file is Copyright 2003, 2006, 2007, 2009 Dean Hall.\n#\n# This file is part of the Python-on-a-Chip program.\n# Python-on-a-Chip is free software: you can redistribute it and/or modify\n# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.\n#\n... |
#!/usr/bin/env python
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip tools.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
"""
PyMite Object Descriptor Decoder
================================
Decodes an object descriptor value into its bi... | [
[
8,
0,
0.104,
0.0594,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2376,
0.0099,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.2772,
0.0297,
0,
0.66,... | [
"\"\"\"\nPyMite Object Descriptor Decoder\n================================\n\nDecodes an object descriptor value into its bit fields.\n\"\"\"",
"import sys",
"__usage__ = \"\"\"USAGE:\n ./pmOdDecoder.py odvalue\n\"\"\"",
"TYPES = (\n 'OBJ_TYPE_NON',\n 'OBJ_TYPE_INT',\n 'OBJ_TYPE_FLT',\n 'OBJ_T... |
#!/usr/bin/env python
# This file is Copyright 2001 Dean Hall.
# This file is part of the Python-on-a-Chip tools.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
"""
Python Byte Code utility functions.
count(fn) - count the number of times each byte code
appears in ... | [
[
8,
0,
0.1061,
0.0606,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2626,
0.0101,
0,
0.66,
0.1667,
279,
0,
2,
0,
0,
279,
0,
0
],
[
14,
0,
0.303,
0.0101,
0,
0.66... | [
"\"\"\"\nPython Byte Code utility functions.\n\ncount(fn) - count the number of times each byte code\n appears in a code object.\n\"\"\"",
"import dis, types",
"MAX_BCODE = 150",
"def count(fn):\n \"\"\"\n Compile the python source file named fn.\n Count all the bytecodes in the file.\n ... |
#!/usr/bin/env python
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip tools.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
"""Creates a release package for PyMite
Makes fresh export (no .svn folders), builds the docs, makes pymite-RR.tar.g... | [
[
8,
0,
0.1786,
0.0893,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3571,
0.0179,
0,
0.66,
0.0833,
688,
0,
5,
0,
0,
688,
0,
0
],
[
14,
0,
0.4107,
0.0179,
0,
0.6... | [
"\"\"\"Creates a release package for PyMite\n\nMakes fresh export (no .svn folders), builds the docs, makes pymite-RR.tar.gz\nand creates release tag in the svn repository\n\"\"\"",
"import os, string, subprocess, sys, tempfile",
"REPOS = \"https://python-on-a-chip.googlecode.com/svn/\"",
"RELEASE_NUM = sys.a... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# 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,
#... | [
[
1,
0,
0.9286,
0.0714,
0,
0.66,
0,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
1,
0.0714,
0,
0.66,
1,
327,
3,
1,
0,
0,
0,
0,
2
]
] | [
"import ipm",
"ipm.ipm(globals())"
] |
# 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,
# ... | [
[
8,
0,
0.0141,
0.0109,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.0558,
0.0699,
0,
0.66,
0.1,
238,
0,
3,
0,
0,
186,
0,
0
],
[
2,
1,
0.0353,
0.0263,
1,
0.91,
... | [
"\"\"\"__NATIVE__\n#include \"mbed.h\"\n#include \"TextLCD.h\"\n\nstatic DigitalOut led1(LED1);\nstatic DigitalOut led2(LED2);\nstatic DigitalOut led3(LED3);\nstatic DigitalOut led4(LED4);",
"class AnalogIn(object):\n\n def __init__(self, n):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmObj_t... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
#
# PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers.
# Copyright 2002 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.
#
#
# Runs the interactive interpret... | [
[
8,
0,
0.7059,
0.0588,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.8235,
0.0588,
0,
0.66,
0.3333,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
0.8824,
0.0588,
0,
0.... | [
"print(\"Hello\")",
"import ipm",
"ipm.ipm(globals())",
"print(\"Good-bye\")"
] |
# to get the Python executable path
import sys
# pulls in the variables set in the 'master' SConstruct file
Import("vars")
# these should match up with the source code
vars.Add("HEAP_SIZE", "Size of the VM's heap.", 0x2000)
vars.Add("IPM", "Add the interactive library to the standard lib", True)
CFLAGS = "/DHEAP_SIZ... | [
[
1,
0,
0.0488,
0.0244,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.122,
0.0244,
0,
0.66,
0.0769,
248,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1951,
0.0244,
0,
0.6... | [
"import sys",
"Import(\"vars\")",
"vars.Add(\"HEAP_SIZE\", \"Size of the VM's heap.\", 0x2000)",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"CFLAGS = \"/DHEAP_SIZE=$HEAP_SIZE /D_CONSOLE\"",
"if \"DEBUG\" in vars.args.keys():\n CFLAGS = \"-D_DEBUG=1 \" + CFLAGS",
"... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": False,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# 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.0384,
0.0186,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.1105,
0.1163,
0,
0.66,
0.0909,
9,
0,
2,
0,
0,
0,
0,
0
],
[
8,
1,
0.1105,
0.1116,
1,
0.06,
... | [
"\"\"\"__NATIVE__\n#include \"mc1322x.h\"\n#include \"board.h\"\n\n#ifndef HAVE_BYTEARRAY\n#error HAVE_BYTEARRAY must be defined for the Econotag packet implementation\n#endif\n\"\"\"",
"def gpio_func_sel(gpio, mode):\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n pPmObj_t pgpio, pmode;\n int32... |
#
# PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers.
# Copyright 2002 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.
#
import ipm
ipm.ipm()
| [
[
1,
0,
0.8889,
0.1111,
0,
0.66,
0,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
1,
0.1111,
0,
0.66,
1,
327,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import ipm",
"ipm.ipm()"
] |
#!/usr/bin/python
# This file was written by Andrew Pullin
# This file obtained from: http://bmi.berkeley.edu/~pullin/red-bsl.py
# No copyright or licensing is claimed
# Permission to use this file was granted via correspondence
import serial
from struct import pack,unpack
import os
import sys
import time
from optpa... | [
[
1,
0,
0.0316,
0.0035,
0,
0.66,
0,
601,
0,
1,
0,
0,
601,
0,
0
],
[
1,
0,
0.0351,
0.0035,
0,
0.66,
0.0161,
399,
0,
2,
0,
0,
399,
0,
0
],
[
1,
0,
0.0386,
0.0035,
0,
... | [
"import serial",
"from struct import pack,unpack",
"import os",
"import sys",
"import time",
"from optparse import OptionParser",
"parser = OptionParser()",
"parser.add_option(\"-f\", \"--file\", dest=\"filename\",\n help=\"binary file to program\", metavar=\"FILE\")",
"parser.add_o... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# This file is Copyright 2010 Oscar Lindberg.
#
# 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 usefu... | [
[
1,
0,
0.1548,
0.0119,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1667,
0.0119,
0,
0.66,
0.0769,
430,
0,
1,
0,
0,
430,
0,
0
],
[
1,
0,
0.1786,
0.0119,
0,
... | [
"import sys",
"import list",
"from ma import *",
"print(\"MoPync - bringing the Guido goodness to the world of MoSync\")",
"LOGO_HANDLE = 1",
"logo_width, logo_height = maGetImageSize(LOGO_HANDLE)",
"screen_width, screen_height = maGetScrSize()",
"background_color = 0x330055",
"rectangles = []",
"... |
# This file contains wrappers that has been automatically
# generated from the maapi.h. Some of these has been moved
# to ma.py, sometimes they have changed into more a more
# Pythonic format.
# When some function or constant is missing from ma.h,
# it might be here.
"""__NATIVE__
#include <ma.h>
"""
TRANS_NONE = 0... | [
[
8,
0,
0.003,
0.0009,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0041,
0.0003,
0,
0.66,
0.0034,
276,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0047,
0.0003,
0,
0.66,... | [
"\"\"\"__NATIVE__\n#include <ma.h>\n\"\"\"",
"TRANS_NONE = 0",
"TRANS_ROT90 = 5",
"TRANS_ROT180 = 3",
"TRANS_ROT270 = 6",
"TRANS_MIRROR = 2",
"TRANS_MIRROR_ROT90 = 7",
"TRANS_MIRROR_ROT180 = 1",
"TRANS_MIRROR_ROT270 = 4",
"HANDLE_SCREEN = 0",
"HANDLE_LOCAL = 0",
"RES_OUT_OF_MEMORY = 1",
"RES... |
# This file contains wrappers for the basic
# functions in maapi.
# If a function or constant is missing, look in ma_gen.py, it
# might be there.
"""__NATIVE__
#include <ma.h>
#define POP_TMPROOT_AND_RETURN_IF_ERROR(retval, objid) \
do \
{ \
if ((retval) != PM_RET_OK) \
{ \
heap_g... | [
[
8,
0,
0.0091,
0.0097,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0149,
0.0006,
0,
0.66,
0.0106,
276,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0156,
0.0006,
0,
0.66... | [
"\"\"\"__NATIVE__\n#include <ma.h>\n\n#define POP_TMPROOT_AND_RETURN_IF_ERROR(retval, objid) \\\n do \\\n { \\\n if ((retval) != PM_RET_OK) \\\n { \\",
"TRANS_NONE = 0",
"TRANS_ROT90 = 5",
"TRANS_ROT180 = 3",
"TRANS_ROT270 = 6",
"TRANS_MIRROR = 2",
"TRANS_MIRROR_ROT90 = 7",
"TRANS_... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": False,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# This file is Copyright 2007 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.5517,
0.0345,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.6207,
0.0345,
0,
0.66,
0.1667,
718,
0,
1,
0,
0,
718,
0,
0
],
[
8,
0,
0.7241,
0.0345,
0,
0.... | [
"print(\"Hello world.\")",
"import avr",
"print(\"Counting from 0 to 249 on portA's pins\")",
"avr.ddrA(0xFF)",
"i = 0",
"while i < 250:\n avr.portA(i)\n avr.delay(250)\n i += 1",
" avr.portA(i)",
" avr.delay(250)",
"print(\"Done.\")"
] |
import os
Import("vars")
vars.Add("IPM", "Add the interactive library to the standard lib", True)
vars.Add("MCU", "Type of AVR device; the arg to -mmcu.", "atmega103")
vars.Add("F_CPU", "Operating frequency of the AVR device.", "4000000UL")
vars.Add("NM", "", "avr-nm")
vars.Add("OBJCOPY", "", "avr-objcopy")
vars.Add(... | [
[
1,
0,
0.0213,
0.0213,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.0638,
0.0213,
0,
0.66,
0.0526,
248,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1064,
0.0213,
0,
0.... | [
"import os",
"Import(\"vars\")",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"vars.Add(\"MCU\", \"Type of AVR device; the arg to -mmcu.\", \"atmega103\")",
"vars.Add(\"F_CPU\", \"Operating frequency of the AVR device.\", \"4000000UL\")",
"vars.Add(\"NM\", \"\", \"avr-nm... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
#
# PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers.
# Copyright 2002 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.
#
import ipm
ipm.ipm()
# :mode=c:
| [
[
1,
0,
0.7273,
0.0909,
0,
0.66,
0,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
0.8182,
0.0909,
0,
0.66,
1,
327,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import ipm",
"ipm.ipm()"
] |
import os
import glob
TCHAIN = "arm-none-eabi"
Import("vars")
vars.Add("PM_UART_BAUD", "Baud rate of the ipm serial connection.", "19200")
vars.Add("IPM", "Add the interactive library to the standard lib", True)
vars.Add("MCU", "Type of ARM device; the arg to -mcpu.", "cortex-m3")
vars.Add("NM", "", "arm-eabi-nm")
v... | [
[
1,
0,
0.0154,
0.0154,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0308,
0.0154,
0,
0.66,
0.0435,
958,
0,
1,
0,
0,
958,
0,
0
],
[
14,
0,
0.0615,
0.0154,
0,
... | [
"import os",
"import glob",
"TCHAIN = \"arm-none-eabi\"",
"Import(\"vars\")",
"vars.Add(\"PM_UART_BAUD\", \"Baud rate of the ipm serial connection.\", \"19200\")",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"vars.Add(\"MCU\", \"Type of ARM device; the arg to -mcpu.\"... |
#!/usr/bin/env python
import urllib, zipfile, StringIO
from os import path, mkdir
extra_headers = ['stm32f10x.h','core_cm3.h','cortexm3_macro.h','system_stm32f10x.h']
extra_sources = ['core_cm3.c','cortexm3_macro.s','system_stm32f10x.c']
startup_files = ['startup_stm32f10x_hd.s']
#stm32liburl = 'http://www.st.com/st... | [
[
1,
0,
0.0769,
0.0256,
0,
0.66,
0,
614,
0,
3,
0,
0,
614,
0,
0
],
[
1,
0,
0.1026,
0.0256,
0,
0.66,
0.0909,
688,
0,
2,
0,
0,
688,
0,
0
],
[
14,
0,
0.1538,
0.0256,
0,
... | [
"import urllib, zipfile, StringIO",
"from os import path, mkdir",
"extra_headers = ['stm32f10x.h','core_cm3.h','cortexm3_macro.h','system_stm32f10x.h']",
"extra_sources = ['core_cm3.c','cortexm3_macro.s','system_stm32f10x.c']",
"startup_files = ['startup_stm32f10x_hd.s']",
"stm32liburl = \"http://www.st.c... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": False,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# 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,
# but WITHOUT ANY WARRANTY; without even the... | [
[
8,
0,
0.1939,
0.0102,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.2143,
0.0102,
0,
0.66,
0.1667,
718,
0,
1,
0,
0,
718,
0,
0
],
[
14,
0,
0.2449,
0.0102,
0,
0... | [
"print(\"Hello world.\")",
"import avr",
"teensyVersion = 1",
"morse = {\n# 'A' : '.-',\n# 'B' : '-...',\n# 'C' : '-.-.',\n 'D' : '-..',\n 'E' : '.',\n# 'F' : '..-.',\n# 'G' : '--.',",
"def loop():\n for i in range(1,6):\n printMorse(\"SOS\")\n avr.delay(1500)\n prin... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# This file is Copyright 2007 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.1291,
0.0769,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.2088,
0.0604,
0,
0.66,
0.0345,
26,
0,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.2088,
0.0495,
1,
0.14,
... | [
"\"\"\"__NATIVE__\n#include <pic24_all.h>\n#include <pps.h>\n#include \"pyToC.h\"\n\n/** Macro to convert a number to a string.\n * Typical usage: <code>TOSTRING(__LINE__)</code>\n */",
"def testConfigDigitalPin1():\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n\n EXCEPTION_ASSERT(_PCFG3 == 1);\n... |
# This file is Copyright 2007 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.0728,
0.0192,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.228,
0.2529,
0,
0.66,
0.2,
928,
0,
5,
0,
0,
186,
0,
0
],
[
2,
1,
0.2184,
0.0192,
1,
0.06,
... | [
"\"\"\"__NATIVE__\n#include <pic24_all.h>\n#include \"pyFuncsInC.h\"\n#include \"dataXfer.h\"\n\"\"\"",
"class digital_io(object):\n ## Configures a pin for digital operation.\n # Parameters:\n # @param port The port, specified as a one-letter string,\n # which must be from \"A\" to \"G... |
# This file is Copyright 2007 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.8947,
0.0526,
0,
0.66,
0,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
0.9474,
0.0526,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.0526,
0,
0.66,
... | [
"from ipm import ipm",
"print(\"Welcome to PIC24/dsPIC33 Python! Starting interactive mode.\")",
"ipm()"
] |
#! /usr/bin/env python
"Replace CRLF with LF in argument files. Print names of changed files."
import sys, os
def main():
for filename in sys.argv[1:]:
if os.path.isdir(filename):
print filename, "Directory!"
continue
data = open(filename, "rb").read()
if '\0' in d... | [
[
8,
0,
0.087,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1739,
0.0435,
0,
0.66,
0.3333,
509,
0,
2,
0,
0,
509,
0,
0
],
[
2,
0,
0.5652,
0.6522,
0,
0.66,... | [
"\"Replace CRLF with LF in argument files. Print names of changed files.\"",
"import sys, os",
"def main():\n for filename in sys.argv[1:]:\n if os.path.isdir(filename):\n print(filename, \"Directory!\")\n continue\n data = open(filename, \"rb\").read()\n if '\\0' ... |
# 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 pic24_dspic33 as pic
# Monitor RAM usage
import sys
print "\n\nRAM usage: (free, total): ", sys.heap()
#####################################################... | [
[
1,
0,
0.0417,
0.0083,
0,
0.66,
0,
542,
0,
1,
0,
0,
542,
0,
0
],
[
1,
0,
0.0667,
0.0083,
0,
0.66,
0.0476,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.075,
0.0083,
0,
0... | [
"import pic24_dspic33 as pic",
"import sys",
"print(\"\\n\\nRAM usage: (free, total): \", sys.heap())",
"print(\"Testing line sensors.\",)",
"line_sensor_left = pic.digital_io(1, 7, True)",
"line_sensor_middle = pic.digital_io(1, 8, True)",
"line_sensor_right = pic.digital_io(1, 9, True)",
... |
# This file is Copyright 2007 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.4872,
0.0256,
0,
0.66,
0,
542,
0,
1,
0,
0,
542,
0,
0
],
[
14,
0,
0.6667,
0.0256,
0,
0.66,
0.1429,
387,
3,
5,
0,
0,
928,
10,
1
],
[
8,
0,
0.6923,
0.0256,
0,
... | [
"import pic24_dspic33 as pic",
"dio = pic.digital_io(1, 1, False, False, 0)",
"dio.set(not dio.get())",
"ain = pic.analog_input(0)",
"print(ain.getVoltage())",
"pwm1 = pic.pwm(1000, True, 2, 0)",
"pwm1.set(0.5)",
"import main"
] |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# 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,
#... | [
[
1,
0,
0.9474,
0.0526,
0,
0.66,
0,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
1,
0.0526,
0,
0.66,
1,
327,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import ipm",
"ipm.ipm()"
] |
Import("vars")
vars.Add("IPM", "Add the interactive library to the standard lib", True)
CFLAGS = "-Os -Wall -gstabs -Wstrict-prototypes -Werror"
if "DEBUG" in vars.args.keys():
CFLAGS = "-g -ggdb -D__DEBUG__=1 " + CFLAGS
SOURCES = ["main.c", "plat.c"]
PY_SOURCES = ["main.py"]
PM_LIB_ROOT = ["pmvm_%s" % vars.args[... | [
[
8,
0,
0.0476,
0.0476,
0,
0.66,
0,
248,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1429,
0.0476,
0,
0.66,
0.1,
241,
3,
3,
0,
0,
0,
0,
1
],
[
14,
0,
0.2381,
0.0476,
0,
0.66,
... | [
"Import(\"vars\")",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"CFLAGS = \"-Os -Wall -gstabs -Wstrict-prototypes -Werror\"",
"if \"DEBUG\" in vars.args.keys():\n CFLAGS = \"-g -ggdb -D__DEBUG__=1 \" + CFLAGS",
" CFLAGS = \"-g -ggdb -D__DEBUG__=1 \" + CFLAGS",
"SO... |
# 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,
0.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# 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,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
1,
0.0526,
0,
0.66,
1,
327,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import ipm",
"ipm.ipm()"
] |
Import("vars")
vars.Add("IPM", "Add the interactive library to the standard lib", True)
CFLAGS = "-Os -Wall -gstabs -Wstrict-prototypes -Werror"
if "DEBUG" in vars.args.keys():
CFLAGS = "-g -ggdb -D__DEBUG__=1 " + CFLAGS
SOURCES = ["main.c", "plat.c"]
PY_SOURCES = ["main.py"]
PM_LIB_ROOT = ["pmvm_%s" % vars.args[... | [
[
8,
0,
0.0476,
0.0476,
0,
0.66,
0,
248,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1429,
0.0476,
0,
0.66,
0.1,
241,
3,
3,
0,
0,
0,
0,
1
],
[
14,
0,
0.2381,
0.0476,
0,
0.66,
... | [
"Import(\"vars\")",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"CFLAGS = \"-Os -Wall -gstabs -Wstrict-prototypes -Werror\"",
"if \"DEBUG\" in vars.args.keys():\n CFLAGS = \"-g -ggdb -D__DEBUG__=1 \" + CFLAGS",
" CFLAGS = \"-g -ggdb -D__DEBUG__=1 \" + CFLAGS",
"SO... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": False,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# This file is Copyright 2006 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.1753,
0.0309,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.4021,
0.3814,
0,
0.66,
0.25,
885,
0,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.4021,
0.3608,
1,
0.81,
... | [
"\"\"\"__NATIVE__\n#include \"Board.h\"\n\"\"\"",
"def get_buttons():\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n uint32_t val = 0;\n pPmObj_t pint;\n\n /* If wrong number of args, raise TypeError */\n if (NATIVE_GET_NUM_ARGS() != 0)",
" \"\"\"__NATIVE__\n PmReturn_t retval = P... |
import os
Import("vars")
vars.Add("IPM", "Add the interactive library to the standard lib", True)
vars.Add("MCU", "Type of ARM device; the arg to -mmcu.", "arm7tdmi")
vars.Add("SUBMDL", "The sub-model of ARM device.", "AT91SAM7S64")
vars.Add("NM", "", "arm-elf-nm")
vars.Add("OBJCOPY", "", "arm-elf-objcopy")
vars.Add(... | [
[
1,
0,
0.0204,
0.0204,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.0612,
0.0204,
0,
0.66,
0.0435,
248,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.102,
0.0204,
0,
0.6... | [
"import os",
"Import(\"vars\")",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"vars.Add(\"MCU\", \"Type of ARM device; the arg to -mmcu.\", \"arm7tdmi\")",
"vars.Add(\"SUBMDL\", \"The sub-model of ARM device.\", \"AT91SAM7S64\")",
"vars.Add(\"NM\", \"\", \"arm-elf-nm\")"... |
# 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.7031,
0.625,
0,
0.66,
0,
965,
0,
0,
0,
0,
0,
6,
0
]
] | [
"PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": False,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True,"
] |
# 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.8667,
0.0667,
0,
0.66,
0,
327,
0,
1,
0,
0,
327,
0,
0
],
[
8,
0,
1,
0.0667,
0,
0.66,
1,
327,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import ipm",
"ipm.ipm()"
] |
# This file is Copyright 2006 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.0732,
0.0135,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.1216,
0.0743,
0,
0.66,
0.1667,
212,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.1216,
0.0698,
1,
0.95,
... | [
"\"\"\"__NATIVE__\n#include <stdio.h>\n#include <avr/io.h>\n#include <util/delay.h>\n#include \"libmmb103.h\"\n\"\"\"",
"def adc_get(c):\n \"\"\"__NATIVE__\n /* The arg is the ADC channel to read */\n pPmObj_t pc = C_NULL;\n pPmObj_t pr = C_NULL;\n uint8_t chan;\n PmReturn_t retval;",
" \"\... |
# This file is Copyright 2006 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.1486,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
4,
0,
0.279,
0.1449,
0,
0.66,
0.25,
0,
1,
0,
0,
0,
0,
0,
11
],
[
1,
1,
0.2174,
0.0072,
1,
0.08,
... | [
"\"\"\"__NATIVE__\n#include <stdio.h>\n#include <avr/io.h>\n#include <util/delay.h>\n#include \"libmmb103.h\"\n\"\"\"",
"if False:\n import sys\n\n s = \"It's alive!\"\n print(s)\n\n import mmb\n mmb.lcd_print(\"PyMite on MMB103\")",
" import sys",
" s = \"It's alive!\"",
" print(s)"... |
import os
Import("vars")
vars.Add("IPM", "Add the interactive library to the standard lib", True)
vars.Add("MCU", "Type of AVR device; the arg to -mmcu.", "atmega103")
vars.Add("F_CPU", "Operating frequency of the AVR device.", "4000000UL")
vars.Add("NM", "", "avr-nm")
vars.Add("OBJCOPY", "", "avr-objcopy")
vars.Add(... | [
[
1,
0,
0.0213,
0.0213,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.0638,
0.0213,
0,
0.66,
0.0526,
248,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1064,
0.0213,
0,
0.... | [
"import os",
"Import(\"vars\")",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"vars.Add(\"MCU\", \"Type of AVR device; the arg to -mmcu.\", \"atmega103\")",
"vars.Add(\"F_CPU\", \"Operating frequency of the AVR device.\", \"4000000UL\")",
"vars.Add(\"NM\", \"\", \"avr-nm... |
# 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.7083,
0.0417,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
2,
0,
0.8542,
0.0833,
0,
0.66,
0.3333,
728,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.875,
0.0417,
1,
0.08,... | [
"print(\"Generator with wrong num args, Expect TypeError\")",
"def gen(o):\n yield o",
" yield o",
"f = gen()",
"print(f.next())"
] |
# 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.5806,
0.0323,
0,
0.66,
0,
745,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6129,
0.0323,
0,
0.66,
0.2,
448,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7419,
0.0323,
0,
0.66... | [
"s1 = \"test\"",
"s2 = s1[:]",
"t1 = (1,2,3)",
"t2 = t1[:]",
"l1 = [1,2,3]",
"l2 = l1[:]"
] |
# 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,
827,
0,
1,
0,
0,
827,
0,
0
],
[
8,
0,
0.9091,
0.0455,
0,
0.66,
1,
535,
3,
2,
0,
0,
0,
0,
3
]
] | [
"import dict",
"print(\"dict.keys(globals()) = \", dict.keys(globals()))"
] |
# This file is Copyright 2007 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.8824,
0.2941,
0,
0.66,
0,
928,
0,
2,
0,
0,
186,
0,
0
],
[
2,
1,
0.8529,
0.1176,
1,
0.9,
0,
555,
0,
4,
0,
0,
0,
0,
0
],
[
2,
1,
0.9706,
0.1176,
1,
0.9,
... | [
"class digital_io(object):\n def __init__(self, port, pin, isInput):\n pass\n def get(self,):\n return True",
" def __init__(self, port, pin, isInput):\n pass",
" def get(self,):\n return True",
" return True"
] |
# 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,
# ... | [
[
2,
0,
0.3854,
0.0417,
0,
0.66,
0,
331,
0,
3,
1,
0,
0,
0,
0
],
[
13,
1,
0.3958,
0.0208,
1,
0.78,
0,
0,
0,
0,
0,
0,
0,
8,
0
],
[
8,
0,
0.4375,
0.0208,
0,
0.66,
... | [
"def foo1(a=42, b=6, c=7):\n return (a, b, c)",
" return (a, b, c)",
"print(\"foo1()=\", foo1())",
"def foo2(a, b=6, c=7):\n return (a, b, c)",
" return (a, b, c)",
"print(\"foo2(42)=\", foo2(42))",
"def foo3(a, b, c=7):\n return (a, b, c)",
" return (a, b, c)",
"print(\"foo3(42, 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,
# ... | [
[
1,
0,
0.5625,
0.0312,
0,
0.66,
0,
890,
0,
1,
0,
0,
890,
0,
0
],
[
14,
0,
0.7969,
0.25,
0,
0.66,
0.5,
553,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.9688,
0.0312,
0,
0.66,... | [
"import string",
"s = \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234... |
# 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.6029,
0.0588,
0,
0.66,
0,
331,
0,
2,
1,
0,
0,
0,
0
],
[
13,
1,
0.6176,
0.0294,
1,
0.08,
0,
0,
4,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.75,
0.0588,
0,
0.66,
0.... | [
"def foo1(a, *b):\n return a+b",
" return a+b",
"def foo2(a, **kwb):\n return a+b[42]",
" return a+b[42]",
"def foo3(a):\n i = 0\n while 1:\n yield i\n i += a",
" i = 0",
" while 1:\n yield i\n i += a",
" yield 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,
# ... | [
[
2,
0,
0.5385,
0.1282,
0,
0.66,
0,
475,
0,
2,
1,
0,
0,
0,
0
],
[
8,
1,
0.5385,
0.0769,
1,
0.04,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
13,
1,
0.5897,
0.0256,
1,
0.04,
... | [
"def a(a1, a2):\n \"\"\"\n Return the sum of a1 and a2.\n \"\"\"\n return a1 + a2",
" \"\"\"\n Return the sum of a1 and a2.\n \"\"\"",
" return a1 + a2",
"def b(b1, b2):\n \"\"\"\n Return the difference between b1 and b2.\n \"\"\"\n return b1 - b2",
" \"\"\"\n Retur... |
# 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.4386,
0.0175,
0,
0.66,
0,
553,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.4561,
0.0175,
0,
0.66,
0.0909,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.5263,
0.0175,
0,
0.... | [
"s = \"farley\" * 30",
"print(s)",
"mul = 0",
"mul = -42",
"t = (2,5,6) * 30",
"print(t)",
"mul = 0",
"mul = -42",
"r = range(3) * 30",
"mul = 0",
"mul = -42",
"print([[3,]*30, \"three\"*30, ('e',)*30]*30)"
] |
# 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.6207,
0.0345,
0,
0.66,
0,
745,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6552,
0.0345,
0,
0.66,
0.3333,
448,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.7586,
0.0345,
0,
0... | [
"s1 = \"test\"",
"s2 = \"this\"",
"s3 = \"\"",
"print(\"String concatenation \" + s1 + \" passes\")"
] |
# 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,
0.5,
553,
1,
0,
0,
0,
0,
3,
0
],
[
4,
0,
0.9773,
0.0909,
0,
0.66... | [
"import sys",
"s = \"test\"",
"if s[0] != 't':\n sys.exit(1)",
" sys.exit(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.6667,
0.037,
0,
0.66,
0,
827,
0,
1,
0,
0,
827,
0,
0
],
[
14,
0,
0.7778,
0.037,
0,
0.66,
0.2,
355,
0,
0,
0,
0,
0,
6,
0
],
[
8,
0,
0.8148,
0.037,
0,
0.66,
... | [
"import dict",
"d = {0:\"zero\", \"one\":1}",
"dict.clear(d)",
"d[\"zero\"] = 0",
"d[1] = \"one\"",
"print(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,
# ... | [
[
8,
0,
0.322,
0.0169,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
3,
0,
0.3559,
0.0508,
0,
0.66,
0.0769,
567,
0,
1,
0,
0,
186,
0,
1
],
[
2,
1,
0.3644,
0.0339,
1,
0.5... | [
"print(\"testing Foo...\")",
"class Foo(object):\n def foo(self,):\n print(\"In foo.\")",
" def foo(self,):\n print(\"In foo.\")",
" print(\"In foo.\")",
"foo = Foo()",
"foo.foo()",
"print(\"testing Bar...\")",
"class Bar(Foo):\n def __init__(self, val):\n self.v =... |
# 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.5556,
0.0278,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.6111,
0.0278,
0,
0.66,
0.1111,
535,
3,
2,
0,
0,
0,
0,
2
],
[
14,
0,
0.6944,
0.0278,
0,
0... | [
"import sys",
"print(\"Heap =\", sys.heap())",
"i = 140",
"r = range(i)",
"print(\"r = range(\", i, \")\")",
"print(\"Heap =\", sys.heap())",
"while i > 0:\n i -= 1\n r[i] += 10",
"print(\"r[i] += 10; for all i\")",
"print(\"Heap =\", sys.heap())",
"print(\"Done.\")"
] |
# 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.9048,
0.0476,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
]
] | [
"import 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,
# ... | [
[
14,
0,
0.5625,
0.0312,
0,
0.66,
0,
556,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.5938,
0.0312,
0,
0.66,
0.125,
921,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.625,
0.0312,
0,
0.6... | [
"kn1 = 1 - 2",
"k0 = kn1 + 1",
"k1 = k0 + 1",
"id1 = id(-1)",
"id2 = id(kn1)",
"id1 = id(0)",
"id2 = id(k0)",
"id1 = id(1)",
"id2 = id(k1)"
] |
# 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.375,
0.0208,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4167,
0.0208,
0,
0.66,
0.125,
573,
3,
0,
0,
0,
654,
10,
1
],
[
8,
0,
0.4583,
0.0208,
0,
... | [
"import sys",
"t0 = sys.time()",
"print(\"t0 = \", t0)",
"print(\"killing time...\")",
"i=0",
"while i < 10000:\n j=0\n while j < 100:\n j += 1\n if i%100 == 0:\n print(i / 100, \" \",)\n i += 1",
" j=0",
" while j < 100:\n j += 1",
" if i%100 == 0:\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,
# ... | [
[
1,
0,
0.5862,
0.0345,
0,
0.66,
0,
430,
0,
1,
0,
0,
430,
0,
0
],
[
14,
0,
0.6897,
0.0345,
0,
0.66,
0.5,
810,
0,
0,
0,
0,
0,
5,
0
],
[
6,
0,
0.7586,
0.1034,
0,
0.66... | [
"import list",
"l = []",
"for i in xrange(3):\n print(i)\n list.append(l, i)",
" print(i)",
" list.append(l, 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.371,
0.0161,
0,
0.66,
0,
553,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4516,
0.0161,
0,
0.66,
0.5,
15,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
0.5323,
0.0161,
0,
0.66,
... | [
"s = \"test\"",
"t = (4, 2)",
"l = [2, 5, 6]",
"d = {0:0, 1:'t', \"2\":2}",
"a,b,c = (1,2,3)",
"c,b,a = [2,5,6]",
"a,b,c = \"256\""
] |
# 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.6667,
0.5,
0,
0.66,
0,
102,
0,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.6667,
0.4333,
1,
0.43,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.9833,
0.0667,
0,
0.66,
1,
... | [
"def bar1():\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n\n /* If wrong number of args, raise TypeError */\n if (NATIVE_GET_NUM_ARGS() != 0)\n {\n PM_RAISE(retval, PM_RET_EX_TYPE);",
" \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n\n /* If wrong number of args, raise TypeError ... |
# 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.3684,
0.0132,
0,
0.66,
0.2308,
411,
3,
1,
0,
0,
171,
10,
1
],
[
14,
0,
0.4079,
0.0132,
0,
0.66,
0.3846,
411,
3,
1,
0,
0,
171,
10,
1
],
[
14,
0,
0.4474,
0.0132,
... | [
"c = ord(\"t\")",
"c = ord(\"\\xff\")",
"c = ord(\"\\x00\")",
"n = chr(0)",
"n = chr(255)",
"n = chr(116)",
"i = 32",
"while i >= 0:\n assert ord(chr(i)) == i\n i -= 1",
"n = 255",
"m = abs(n)",
"n = -42",
"m = abs(n)",
"s = [2, 5, 6]",
"s = (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,
# ... | [
[
1,
0,
0.85,
0.05,
0,
0.66,
0,
865,
0,
1,
0,
0,
865,
0,
0
],
[
8,
0,
0.95,
0.05,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.05,
0,
0.66,
1,
535... | [
"from t350b import *",
"print(\"Expect NameError\")",
"print(_foo)"
] |
# 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.5897,
0.0256,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.641,
0.0256,
0,
0.66,
0.0833,
535,
3,
2,
0,
0,
0,
0,
2
],
[
14,
0,
0.6923,
0.0256,
0,
0.... | [
"import sys",
"print(\"Heap =\", sys.heap())",
"start = ord('a')",
"r = map(chr, range(start, start+36))",
"t = map(type, r)",
"print(\"r = \", r)",
"print(\"t = \", t)",
"print(\"Heap =\", sys.heap())",
"start = ord('A')",
"r = map(chr, range(start, start+36))",
"print(\"r = \", r)",
"print(\... |
# 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.5111,
0.1556,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.8,
0.2444,
0,
0.66,
0.3333,
255,
0,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.8,
0.2,
1,
0.9,
0,
... | [
"\"\"\"__NATIVE__\n/*\n * This is a regression test for issue #28.\n * Having this doc-level native block should not affect\n * the index of the native func below.\n */\n\"\"\"",
"def push42():\n \"\"\"__NATIVE__\n pPmObj_t pint = C_NULL;\n PmReturn_t retval;\n\n retval = int_new((int32_t)42, &pint);\... |
# 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.2812,
0.0156,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
3,
0,
0.3438,
0.0469,
0,
0.66,
0.0769,
854,
0,
1,
0,
0,
186,
0,
0
],
[
2,
1,
0.3516,
0.0312,
1,
... | [
"import sys",
"class Bar(object):\n def baz(self, ):\n return \"baz\"",
" def baz(self, ):\n return \"baz\"",
" return \"baz\"",
"class Foo(Bar):\n def faz(self, ):\n return \"faz\"",
" def faz(self, ):\n return \"faz\"",
" return \"faz\"",
"foo = ... |
# 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.3286,
0.0143,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.3429,
0.0143,
0,
0.66,
0.0909,
756,
5,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3571,
0.0143,
0,
0... | [
"a = [1,2,3,4]",
"b = (2*x for x in a)",
"c = [2*x for x in a]",
"n = 0",
"for i in b:\n print(i,)\n assert i == c[n]\n n += 1",
" print(i,)",
"def fib():\n a, b = 0, 1\n while True:\n yield a\n a, b = b, a+b",
" a, b = 0, 1",
" while True:\n yield a\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.5588,
0.0882,
0,
0.66,
0,
574,
0,
1,
0,
0,
0,
0,
1
],
[
8,
1,
0.5588,
0.0294,
1,
0.19,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
1,
0.5882,
0.0294,
1,
0.19,
... | [
"def divzero(n):\n print(\"In divzero\")\n a = n/0",
" print(\"In divzero\")",
" a = n/0",
"def foo():\n divzero(42)",
" divzero(42)",
"def bar():\n foo()",
" foo()",
"def baz():\n bar()",
" bar()",
"if ismain():\n print(\"calling baz()\")\n print(\"Expecting a ... |
# 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,
1,
0.0588,
0,
0.66,
0,
187,
1,
0,
0,
0,
0,
3,
0
]
] | [
"_foo = \"foo\""
] |
# 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.8409,
0.0909,
0,
0.66,
0,
528,
0,
1,
1,
0,
0,
0,
0
],
[
13,
1,
0.8636,
0.0455,
1,
0.47,
0,
0,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.9545,
0.0455,
0,
0.66,
... | [
"def foo(n):\n return n * 1",
" return n * 1",
"print(\"Expecting a TypeError\")",
"foo(1, 2)"
] |
# 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.6061,
0.0303,
0,
0.66,
0,
355,
0,
0,
0,
0,
0,
6,
0
],
[
6,
0,
0.6818,
0.0606,
0,
0.66,
0.3333,
826,
2,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7576,
0.0303,
0,
0.... | [
"d = {0:None, 1:\"one\", 2:\"two\"}",
"for i in d:\n assert i in d",
"k1,k2,k3 = d",
"s = sum(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.1895,
0.0105,
0,
0.66,
0,
728,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.2,
0.0105,
0,
0.66,
0.0769,
341,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.2105,
0.0105,
0,
... | [
"b0 = bytearray(\"test\")",
"b1 = bytearray(4)",
"b2 = bytearray([2,5,6,2])",
"b3 = bytearray((1,2,8,1))",
"b4 = bytearray(b0)",
"b5 = bytearray(['2',5,'6',2])",
"b6 = bytearray(('1','2',8,1))",
"b1[0] = 't'",
"b1[1] = 'e'",
"b1[2] = 's'",
"b1[3] = 't'",
"b0[False] = 0x34",
"b0[True] = 0x32"... |
# 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.84,
0.04,
0,
0.66,
0,
430,
0,
1,
0,
0,
430,
0,
0
],
[
14,
0,
0.88,
0.04,
0,
0.66,
0.5,
945,
1,
0,
0,
0,
0,
1,
0
],
[
1,
0,
0.96,
0.04,
0,
0.66,
1,
... | [
"import list",
"list.zero = 0",
"import list"
] |
# 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.5312,
0.0312,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.5938,
0.0312,
0,
0.66,
0.125,
475,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.625,
0.0312,
0,
0.66... | [
"print(\"hex(42) == %x\" % 42)",
"a = 42",
"s = \"%x\" % a",
"print(s)",
"S = \"%X\" % a",
"print(S)",
"print(\"Expect TypeError\")",
"b = 3.14",
"p = \"%x\" % 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,
# ... | [
[
14,
0,
0.383,
0.0213,
0,
0.66,
0,
175,
3,
2,
0,
0,
526,
10,
2
],
[
8,
0,
0.4255,
0.0213,
0,
0.66,
0.2222,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.4894,
0.0213,
0,
... | [
"e = filter(lambda x: x%2 == 0, range(5))",
"print(\"filter() test 1 passes.\")",
"e = filter(lambda x: x%2 == 2, range(5))",
"print(\"filter() test 2 passes.\")",
"e = filter(lambda x: True, range(0))",
"print(\"filter() test 3 passes.\")",
"e = filter(lambda x: True, [])",
"print(\"filter() test 4 p... |
# 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.6143,
0.0571,
0,
0.66,
0,
541,
0,
1,
1,
0,
0,
0,
0
],
[
13,
1,
0.6286,
0.0286,
1,
0.56,
0,
0,
1,
0,
0,
0,
0,
9,
0
],
[
14,
0,
0.6857,
0.0286,
0,
0.66,
... | [
"def noneify(a):\n return None",
" return None",
"r = map(noneify, \"test\")",
"def addPair(a):\n return a[0] + a[1]",
" return a[0] + a[1]",
"r = map(addPair, ((3,4),(5,6),(7,8)))"
] |
#
# NOTICE: This does not work yet.
#
import os
vars = Variables()
vars.args["PLATFORM"] = "desktop"
vars.Add("IPM", "Add the interactive library to the standard lib", True)
CFLAGS = "-g -ggdb -D__DEBUG__=1 -DHEAP_SIZE=$HEAP_SIZE " \
"-Os -Wall -gstabs -Wstrict-prototypes -Werror"
#PY_SOURCES = ["main.py"]... | [
[
1,
0,
0.1429,
0.0238,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1905,
0.0238,
0,
0.66,
0.0769,
302,
3,
0,
0,
0,
821,
10,
1
],
[
14,
0,
0.2143,
0.0238,
0,
... | [
"import os",
"vars = Variables()",
"vars.args[\"PLATFORM\"] = \"desktop\"",
"vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)",
"CFLAGS = \"-g -ggdb -D__DEBUG__=1 -DHEAP_SIZE=$HEAP_SIZE \" \\\n \"-Os -Wall -gstabs -Wstrict-prototypes -Werror\"",
"PM_LIB_ROOT = [\"pmvm_%... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.