code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# 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.7097,
0.6129,
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.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.7097,
0.6129,
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 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 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.7097,
0.6129,
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 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.31,
... | [
"\"\"\"__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.7097,
0.6129,
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.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.65,
... | [
"\"\"\"__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... |
# 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,
#... | [
[
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.68,
... | [
"\"\"\"__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,
#... | [
[
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()"
] |
# 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.7097,
0.6129,
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,
#... | [
[
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"
] |
#! /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' ... |
# 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.72,
... | [
"\"\"\"__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 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.62,
... | [
"\"\"\"__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 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 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.7097,
0.6129,
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 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.05,... | [
"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 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.26,
... | [
"\"\"\"__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
# @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.69,... | [
"__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 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.41,
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 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.84,
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.53... | [
"__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... |
# 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.16,
... | [
"\"\"\"__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
## @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 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,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.7727,
0.0606,
0,
0.66,
0.5,... | [
"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;... |
#!/usr/bin/python
import sys
fd=file(sys.argv[1],'r')
if fd==0:
print "can't open %s"%sys.argv[1]
sys.exit()
buf=fd.read()
n=len(buf)
if n > 510:
print "boot block too large: %s bytes (max 510)"%n
sys.exit()
print "boot block is %s bytes (max 510)"%n
fd.close()
fd=file(sys.argv[1],'w')
if fd==0:
print "can't... | [
[
1,
0,
0.1154,
0.0385,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.1538,
0.0385,
0,
0.66,
0.0909,
863,
3,
2,
0,
0,
107,
10,
1
],
[
4,
0,
0.2308,
0.1154,
0,
... | [
"import sys",
"fd=file(sys.argv[1],'r')",
"if fd==0:\n\tprint(\"can't open %s\"%sys.argv[1])\n\tsys.exit()",
"\tprint(\"can't open %s\"%sys.argv[1])",
"\tsys.exit()",
"buf=fd.read()",
"n=len(buf)",
"if n > 510:\n\tprint(\"boot block too large: %s bytes (max 510)\"%n)\n\tsys.exit()",
"\tprint(\"boot ... |
from google.appengine.ext import db
# Site settings,
class Site(db.Expando):
title = db.StringProperty()
# The permissions describe what operations exist
class Permission(db.Model):
title = db.StringProperty()
# Role-based access control is the underlying principle
class Role(db.Model):
title = db.... | [
[
1,
0,
0.0312,
0.0312,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
3,
0,
0.1406,
0.0625,
0,
0.66,
0.2,
695,
0,
0,
0,
0,
323,
0,
1
],
[
14,
1,
0.1562,
0.0312,
1,
0.... | [
"from google.appengine.ext import db",
"class Site(db.Expando):\n title = db.StringProperty()",
" title = db.StringProperty()",
"class Permission(db.Model):\n title = db.StringProperty()",
" title = db.StringProperty()",
"class Role(db.Model):\n title = db.StringProperty()\n permissions = db.ListPro... |
# gmemsess.py - memcache-backed session Class for Google Appengine
# Version 1.2
# Copyright 2008 Greg Fawcett <greg@vig.co.nz>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | [
[
1,
0,
0.2169,
0.012,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.2289,
0.012,
0,
0.66,
0.1667,
848,
0,
1,
0,
0,
848,
0,
0
],
[
1,
0,
0.241,
0.012,
0,
0.66... | [
"import random",
"import pickle",
"from google.appengine.api import memcache",
"_sidChars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'",
"_defaultTimeout=30*60 # 30 min",
"_defaultCookieName='gsid'",
"class Session(dict):\n\t\"\"\"A secure lightweight memcache-backed session Class for Google A... |
# coding=UTF-8
import cgi
import wsgiref.handlers
import os
import re
import unicodedata
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext import db
from django.template import Template
from google.appengine.ext.db... | [
[
1,
0,
0.0075,
0.0025,
0,
0.66,
0,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.01,
0.0025,
0,
0.66,
0.04,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.0125,
0.0025,
0,
0.66... | [
"import cgi",
"import wsgiref.handlers",
"import os",
"import re",
"import unicodedata",
"from google.appengine.ext.webapp import template",
"from google.appengine.api import users",
"from google.appengine.ext import webapp",
"from google.appengine.ext import db",
"from django.template import Temp... |
#! /usr/bin/env python
import sys, os
import tarfile, zipfile, gzip, bz2
from optparse import OptionParser
"""
Builds packaged releases of DebugKit so I don't have to do things manually.
Excludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.
"""
def main():
parser = OptionParser... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.125,
223,
0,
4,
0,
0,
223,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
0... | [
"import sys, os",
"import tarfile, zipfile, gzip, bz2",
"from optparse import OptionParser",
"\"\"\"\nBuilds packaged releases of DebugKit so I don't have to do things manually.\n\nExcludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.\n\"\"\"",
"def main():\n parser = O... |
#! /usr/bin/env python
import sys, os
import tarfile, zipfile, gzip, bz2
from optparse import OptionParser
"""
Builds packaged releases of DebugKit so I don't have to do things manually.
Excludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.
"""
def main():
parser = OptionParser... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.125,
223,
0,
4,
0,
0,
223,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
0... | [
"import sys, os",
"import tarfile, zipfile, gzip, bz2",
"from optparse import OptionParser",
"\"\"\"\nBuilds packaged releases of DebugKit so I don't have to do things manually.\n\nExcludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.\n\"\"\"",
"def main():\n parser = O... |
#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| [
[
1,
0,
0.1818,
0.0909,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
14,
0,
0.2727,
0.0909,
0,
0.66,
0.1111,
15,
3,
0,
0,
0,
654,
10,
1
],
[
14,
0,
0.3636,
0.0909,
0,
... | [
"import time",
"t = time.time()",
"u = time.gmtime(t)",
"s = time.strftime('%a, %e %b %Y %T GMT', u)",
"print('Content-Type: text/javascript')",
"print('Cache-Control: no-cache')",
"print('Date: ' + s)",
"print('Expires: ' + s)",
"print('')",
"print('var timeskew = new Date().getTime() - ' + str(t... |
'''
Created on May 1, 2012
@author: mshen
'''
import wx
from datetime import datetime
class CreateTopicDialog(wx.Dialog):
def __init__(self, parent):
super(CreateTopicDialog, self).__init__(parent=parent, title="Create Charity", size=(300, 300))
self.parent = parent
self.... | [
[
8,
0,
0.0455,
0.0758,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0909,
0.0152,
0,
0.66,
0.3333,
666,
0,
1,
0,
0,
666,
0,
0
],
[
1,
0,
0.1061,
0.0152,
0,
0.66... | [
"'''\nCreated on May 1, 2012\n\n@author: mshen\n'''",
"import wx",
"from datetime import datetime",
"class CreateTopicDialog(wx.Dialog):\n \n def __init__(self, parent):\n super(CreateTopicDialog, self).__init__(parent=parent, title=\"Create Charity\", size=(300, 300))\n self.parent = pare... |
'''
Created on May 1, 2012
@author: mshen
'''
import wx
from datetime import datetime
class CreateCharityDialog(wx.Dialog):
def __init__(self, parent):
super(CreateCharityDialog, self).__init__(parent=parent, title="Create Charity", size=(300, 300))
self.parent = parent
s... | [
[
8,
0,
0.0395,
0.0658,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0789,
0.0132,
0,
0.66,
0.3333,
666,
0,
1,
0,
0,
666,
0,
0
],
[
1,
0,
0.0921,
0.0132,
0,
0.66... | [
"'''\nCreated on May 1, 2012\n\n@author: mshen\n'''",
"import wx",
"from datetime import datetime",
"class CreateCharityDialog(wx.Dialog):\n \n def __init__(self, parent):\n super(CreateCharityDialog, self).__init__(parent=parent, title=\"Create Charity\", size=(300, 300))\n self.parent = ... |
'''
Created on Apr 25, 2012
@author: jesus
'''
class Comment(object):
def __init__(self, comment = "default", topic = "default", cid="default"):
self.comment = comment
self.topicName = topic
self.topicCommunityID = cid
def getComment(self):
return self.comment
def se... | [
[
8,
0,
0.0833,
0.1389,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.5972,
0.8333,
0,
0.66,
1,
846,
0,
9,
0,
0,
186,
0,
0
],
[
2,
1,
0.2917,
0.1111,
1,
0.7,
... | [
"'''\nCreated on Apr 25, 2012\n\n@author: jesus\n'''",
"class Comment(object):\n\n def __init__(self, comment = \"default\", topic = \"default\", cid=\"default\"):\n self.comment = comment\n self.topicName = topic\n self.topicCommunityID = cid\n\n def getComment(self):",
" def __in... |
import practice
import json_practice
import json
import datetime
import wx
import os
from http_rest_client import ReachOutHttpClient
from CreateCharityDialog import CreateCharityDialog
from DonateCharityDialog import DonateCharityDialog
from CreateTopicDialog import CreateTopicDialog
from Charity import Charity
from Id... | [
[
1,
0,
0.0046,
0.0046,
0,
0.66,
0,
754,
0,
1,
0,
0,
754,
0,
0
],
[
1,
0,
0.0093,
0.0046,
0,
0.66,
0.0625,
126,
0,
1,
0,
0,
126,
0,
0
],
[
1,
0,
0.0139,
0.0046,
0,
... | [
"import practice",
"import json_practice",
"import json",
"import datetime",
"import wx",
"import os",
"from http_rest_client import ReachOutHttpClient",
"from CreateCharityDialog import CreateCharityDialog",
"from DonateCharityDialog import DonateCharityDialog",
"from CreateTopicDialog import Cre... |
import json
import datetime
from Topic import Topic
from Identity import Identity
from Comment import Comment
from Subscription import Subscription
from datetime import datetime
#class Charity(): pass
#class Identity(): pass
#c = Charity()
#c.name = "PlanetGranite?"
#c.description = "what?"
#i = Identit... | [
[
1,
0,
0.0196,
0.0196,
0,
0.66,
0,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.0392,
0.0196,
0,
0.66,
0.0714,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0588,
0.0196,
0,
... | [
"import json",
"import datetime",
"from Topic import Topic",
"from Identity import Identity",
"from Comment import Comment",
"from Subscription import Subscription",
"from datetime import datetime",
"t = Topic(\"Climbing\", \"all about climbing\")",
"i = Identity(\"Cathedral\", \"Michael\")",
"t.s... |
'''
Created on Apr 25, 2012
@author: mshen
'''
import datetime
class Identity(object):
def __init__(self, community = "default", user = "default"):
self.fromCommunity = community
self.fromUser = user
def getCommunity(self):
return self.fromCommunity
def setComm... | [
[
8,
0,
0.0968,
0.1613,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2258,
0.0323,
0,
0.66,
0.5,
426,
0,
1,
0,
0,
426,
0,
0
],
[
3,
0,
0.6452,
0.7419,
0,
0.66,
... | [
"'''\nCreated on Apr 25, 2012\n\n@author: mshen\n'''",
"import datetime",
"class Identity(object):\n\n def __init__(self, community = \"default\", user = \"default\"):\n self.fromCommunity = community\n self.fromUser = user\n\n def getCommunity(self):\n return self.fromCommunity",
"... |
'''
Created on Apr 25, 2012
@author: jesus
'''
class Topic(object):
def __init__(self, title = "default", description = "default"):
self.topictitle = title
self.topicdescription = description
self.data = []
def getTitle(self):
return self.topictitle
def setTitle(self... | [
[
8,
0,
0.0833,
0.1389,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.5972,
0.8333,
0,
0.66,
1,
265,
0,
9,
0,
0,
186,
0,
1
],
[
2,
1,
0.2917,
0.1111,
1,
0.34,
... | [
"'''\nCreated on Apr 25, 2012\n\n@author: jesus\n'''",
"class Topic(object):\n\n def __init__(self, title = \"default\", description = \"default\"):\n self.topictitle = title\n self.topicdescription = description\n self.data = []\n\n def getTitle(self):",
" def __init__(self, title... |
'''
Created on Apr 25, 2012
@author: mshen
'''
class Charity(object):
def __init__(self, name = "default", desc = "default", cid = "default", amount = "0"):
self.name = name;
self.description = desc
self.charityCommunityId = cid
self.amount = amount
def ... | [
[
8,
0,
0.0698,
0.1163,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.5814,
0.8605,
0,
0.66,
1,
134,
0,
11,
0,
0,
186,
0,
0
],
[
2,
1,
0.2558,
0.1163,
1,
0.75,
... | [
"'''\nCreated on Apr 25, 2012\n\n@author: mshen\n'''",
"class Charity(object):\n \n def __init__(self, name = \"default\", desc = \"default\", cid = \"default\", amount = \"0\"):\n self.name = name;\n self.description = desc\n self.charityCommunityId = cid\n self.amount = amount"... |
'''
Created on Apr 25, 2012
@author: mshen
'''
import json
import datetime
# import the REST library
from restful_lib import Connection
class ReachOutHttpClient():
def __init__(self, base_url = "http://localhost:8080/ReachOut/rest/community"):
self.base_url = base_url
self.conn = ... | [
[
8,
0,
0.0227,
0.0379,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0455,
0.0076,
0,
0.66,
0.25,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.053,
0.0076,
0,
0.66,
... | [
"'''\nCreated on Apr 25, 2012\n\n@author: mshen\n'''",
"import json",
"import datetime",
"from restful_lib import Connection",
"class ReachOutHttpClient():\n\n def __init__(self, base_url = \"http://localhost:8080/ReachOut/rest/community\"):\n self.base_url = base_url\n self.conn = Connecti... |
import practice
import json_practice
import json
import datetime
import wx
import os
from http_rest_client import ReachOutHttpClient
from CreateCharityDialog import CreateCharityDialog
# import the REST library
client = ReachOutHttpClient()
print client.listCharities()
#charity = client.getCharityByName(... | [
[
1,
0,
0.0064,
0.0064,
0,
0.66,
0,
754,
0,
1,
0,
0,
754,
0,
0
],
[
1,
0,
0.0128,
0.0064,
0,
0.66,
0.1111,
126,
0,
1,
0,
0,
126,
0,
0
],
[
1,
0,
0.0192,
0.0064,
0,
... | [
"import practice",
"import json_practice",
"import json",
"import datetime",
"import wx",
"import os",
"from http_rest_client import ReachOutHttpClient",
"from CreateCharityDialog import CreateCharityDialog",
"client = ReachOutHttpClient()",
"print(client.listCharities())"
] |
'''
Created on Apr 26, 2012
@author: jesus
'''
class Subscription(object):
def __init__(self, email="default", name="default", amount="0", fromCommunity="default", cid="default"):
self.email = email
self.name = name
self.amount = amount
self.fromCommunity = fromCommunity
s... | [
[
8,
0,
0.0682,
0.1136,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.5795,
0.8636,
0,
0.66,
1,
173,
0,
11,
0,
0,
186,
0,
0
],
[
2,
1,
0.2614,
0.1364,
1,
0.08,
... | [
"'''\nCreated on Apr 26, 2012\n\n@author: jesus\n'''",
"class Subscription(object):\n\n def __init__(self, email=\"default\", name=\"default\", amount=\"0\", fromCommunity=\"default\", cid=\"default\"):\n self.email = email\n self.name = name\n self.amount = amount\n self.fromCommun... |
'''
Created on May 1, 2012
@author: mshen
'''
import wx
from datetime import datetime
class DonateCharityDialog(wx.Dialog):
def __init__(self, parent):
super(DonateCharityDialog, self).__init__(parent=parent, title="Donate Charity", size=(200, 225))
self.parent = parent
s... | [
[
8,
0,
0.0423,
0.0704,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0845,
0.0141,
0,
0.66,
0.3333,
666,
0,
1,
0,
0,
666,
0,
0
],
[
1,
0,
0.0986,
0.0141,
0,
0.66... | [
"'''\nCreated on May 1, 2012\n\n@author: mshen\n'''",
"import wx",
"from datetime import datetime",
"class DonateCharityDialog(wx.Dialog):\n \n def __init__(self, parent):\n super(DonateCharityDialog, self).__init__(parent=parent, title=\"Donate Charity\", size=(200, 225))\n self.parent = ... |
list2 = []
list2.append("Hello")
list2.append("There")
| [
[
14,
0,
0.375,
0.125,
0,
0.66,
0,
526,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.625,
0.125,
0,
0.66,
0.5,
243,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.75,
0.125,
0,
0.66,
1,
... | [
"list2 = []",
"list2.append(\"Hello\")",
"list2.append(\"There\")"
] |
# -*- coding: utf-8 -*-
import pytest
from selenium import webdriver
@pytest.fixture
def driver():
driver = webdriver.Firefox()
driver.base_url = "http://localhost"
return driver | [
[
1,
0,
0.2222,
0.1111,
0,
0.66,
0,
719,
0,
1,
0,
0,
719,
0,
0
],
[
1,
0,
0.3333,
0.1111,
0,
0.66,
0.5,
454,
0,
1,
0,
0,
454,
0,
0
],
[
2,
0,
0.8333,
0.4444,
0,
0.6... | [
"import pytest",
"from selenium import webdriver",
"def driver():\n driver = webdriver.Firefox()\n driver.base_url = \"http://localhost\"\n return driver",
" driver = webdriver.Firefox()",
" driver.base_url = \"http://localhost\"",
" return driver"
] |
# -*- coding: utf-8 -*-
class Basic_data:
def __init__(self):
self.base_url = "http://localhost"
self.login_url = "/php4dvd/"
class User:
def __init__(self):
self.password = "admin"
self.login = "admin"
| [
[
3,
0,
0.3462,
0.3077,
0,
0.66,
0,
801,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.3846,
0.2308,
1,
0.33,
0,
555,
0,
1,
0,
0,
0,
0,
0
],
[
14,
2,
0.3846,
0.0769,
2,
0.97,
... | [
"class Basic_data:\n def __init__(self):\n self.base_url = \"http://localhost\"\n self.login_url = \"/php4dvd/\"",
" def __init__(self):\n self.base_url = \"http://localhost\"\n self.login_url = \"/php4dvd/\"",
" self.base_url = \"http://localhost\"",
" self.login_url = \"/php4dvd/\"",
"... |
# -*- coding: utf-8 -*-
from selenium.webdriver.common.keys import Keys
from re import compile, search
import time
import data
class Page(data.Basic_data):
def __init__(self, driver):
data.Basic_data.__init__(self)
self.driver = driver
self.match_by_obj = compile(r'^[^=]+')
self.match_what_obj = comp... | [
[
1,
0,
0.0308,
0.0154,
0,
0.66,
0,
797,
0,
1,
0,
0,
797,
0,
0
],
[
1,
0,
0.0462,
0.0154,
0,
0.66,
0.2,
540,
0,
2,
0,
0,
540,
0,
0
],
[
1,
0,
0.0615,
0.0154,
0,
0.6... | [
"from selenium.webdriver.common.keys import Keys",
"from re import compile, search",
"import time",
"import data",
"class Page(data.Basic_data):\n def __init__(self, driver):\n data.Basic_data.__init__(self)\n self.driver = driver\n self.match_by_obj = compile(r'^[^=]+')\n self.match_what_obj =... |
# -*- coding: utf-8 -*-
from data import *
class Steps_of ():
def __init__(self, page):
if page == "login_page":
actions = login_page_steps()
return actions
class Common_steps ():
def __init__(self, driver_instance):
self.driver_instance = driver_instance
def log_out(self):
#logout m... | [
[
1,
0,
0.0571,
0.0286,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
],
[
3,
0,
0.1857,
0.1714,
0,
0.66,
0.3333,
943,
0,
1,
0,
0,
0,
0,
1
],
[
2,
1,
0.2143,
0.1143,
1,
0.... | [
"from data import *",
"class Steps_of ():\n\n def __init__(self, page):\n if page == \"login_page\":\n actions = login_page_steps()\n return actions",
" def __init__(self, page):\n if page == \"login_page\":\n actions = login_page_steps()\n return actions",
" if page == \"login_... |
from selenium import webdriver
import pytest
#class film_test_fixture:
@pytest.fixture(scope = "module")
def driver (request):
driver = webdriver.Firefox()
driver.implicitly_wait(10)
request.addfinalizer(driver.quit)
return driver | [
[
1,
0,
0.0769,
0.0769,
0,
0.66,
0,
454,
0,
1,
0,
0,
454,
0,
0
],
[
1,
0,
0.1538,
0.0769,
0,
0.66,
0.5,
719,
0,
1,
0,
0,
719,
0,
0
],
[
2,
0,
0.8462,
0.3846,
0,
0.6... | [
"from selenium import webdriver",
"import pytest",
"def driver (request):\n driver = webdriver.Firefox()\n driver.implicitly_wait(10)\n request.addfinalizer(driver.quit)\n return driver",
" driver = webdriver.Firefox()",
" driver.implicitly_wait(10)",
" request.addfinalizer(driver.quit)",
" retu... |
#!/usr/bin/python
import urllib
import urllib2
import time
url = "http://biz.binaryvibes.co.in/webservice/messagequeue"
bizsense_api_key = 'd38326c24292937f2bc645839dbaa7f11ea1bd30'
params = {
'custom_content': 1,
'first_name': 'a',
'middle_name': None,
'last_name': 'b',
'email': 'rtest1@rexample... | [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.5,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"import urllib",
"import urllib2",
"import time"
] |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | [
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.1224,
0.0102,
0,
0.66,
0.0714,
792,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1531,
0.0102,
0,
... | [
"import os, re, mimetypes, sys",
"SOURCE = sys.argv[1:]",
"COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)",
"COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)",
"COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)",
"EXCLUDE_TYPES = [\n \"application/xml\... |
#
# -*-encoding:gb2312-*-
import sys
if sys.version_info.major !=2 and sys.version_info.minor<6:
print 'require python 2.6 or newer'
exit()
try:
import twisted
except ImportError as err:
print 'require twisted 10.2.0 or newer'
exit()
if sys.platform == 'win32':
try:
from twisted.inte... | [
[
1,
0,
0.027,
0.0068,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.0473,
0.0203,
0,
0.66,
0.0769,
0,
0,
0,
0,
0,
0,
0,
2
],
[
8,
1,
0.0473,
0.0068,
1,
0.32,... | [
"import sys",
"if sys.version_info.major !=2 and sys.version_info.minor<6:\n print('require python 2.6 or newer')\n exit()",
" print('require python 2.6 or newer')",
" exit()",
"try:\n import twisted\nexcept ImportError as err:\n print('require twisted 10.2.0 or newer')\n exit()",
" ... |
from array import array
counts = [chr(sum([(i >> j) & 1 for j in xrange(8)])) for i in xrange(256)]
counts = ''.join(counts)
class BitOp (object):
def __contians__(self, idx):
return self[idx]
def __and__(self, bf):
return BitfieldOperatorProxy(self, bf, lambda x,y: x&y)
# def __or__(sel... | [
[
1,
0,
0.0053,
0.0053,
0,
0.66,
0,
80,
0,
1,
0,
0,
80,
0,
0
],
[
14,
0,
0.0158,
0.0053,
0,
0.66,
0.1667,
560,
5,
0,
0,
0,
0,
0,
4
],
[
14,
0,
0.0211,
0.0053,
0,
0.... | [
"from array import array",
"counts = [chr(sum([(i >> j) & 1 for j in xrange(8)])) for i in xrange(256)]",
"counts = ''.join(counts)",
"class BitOp (object):\n def __contians__(self, idx):\n return self[idx]\n\n def __and__(self, bf):\n return BitfieldOperatorProxy(self, bf, lambda x,y: x&y... |
#
# -*-encoding:gb2312-*-
import hashlib
import struct
import socket
import time
from twisted.internet import reactor, defer
from twisted.internet import protocol
from twisted.python import log
from ClientIdentifier import identify_client
from bitfield import Bitfield
from tools import SpeedMonitor, sleep
from uploa... | [
[
1,
0,
0.0117,
0.0029,
0,
0.66,
0,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.0146,
0.0029,
0,
0.66,
0.0714,
399,
0,
1,
0,
0,
399,
0,
0
],
[
1,
0,
0.0175,
0.0029,
0,
... | [
"import hashlib",
"import struct",
"import socket",
"import time",
"from twisted.internet import reactor, defer",
"from twisted.internet import protocol",
"from twisted.python import log",
"from ClientIdentifier import identify_client",
"from bitfield import Bitfield",
"from tools import SpeedMoni... |
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | [
[
3,
0,
0.1015,
0.015,
0,
0.66,
0,
969,
0,
0,
0,
0,
645,
0,
0
],
[
2,
0,
0.1541,
0.0752,
0,
0.66,
0.027,
819,
0,
2,
1,
0,
0,
0,
2
],
[
14,
1,
0.1353,
0.0075,
1,
0.6... | [
"class BTError(Exception):\n pass",
"def decode_int(x, f):\n f += 1\n newf = x.index('e', f)\n n = int(x[f:newf])\n if x[f] == '-':\n if x[f + 1] == '0':\n raise ValueError\n elif x[f] == '0' and newf != f+1:",
" newf = x.index('e', f)",
" n = int(x[f:newf])",
" ... |
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... | [
[
1,
0,
0.0892,
0.0064,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.1019,
0.0064,
0,
0.66,
0.2,
153,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3312,
0.4395,
0,
0.6... | [
"import re",
"v64p = '[\\da-zA-Z.-]{3}'",
"matches = (\n ('-AZ(?P<version>\\d+)-+.+$' , \"Azureus\" ),\n ('M(?P<version>\\d-\\d-\\d)--.+$' , \"BitTorrent\" ),\n ('T(?P<version>%s)0?-+.+$'%v64p , \"BitTornado\" ),\n ('-UT(?P<vers... |
#
# -*-encoding:gb2312-*-
from twisted.internet import reactor
from bencode import bencode, bdecode
from twisted.internet import defer
from twisted.web.client import getPage
from tools import sleep
from urllib import urlencode
import hashlib
import socket
import struct
peers = [('60.50.9.1', 14004), ('98.235.129.... | [
[
1,
0,
0.0377,
0.0094,
0,
0.66,
0,
937,
0,
1,
0,
0,
937,
0,
0
],
[
1,
0,
0.0566,
0.0094,
0,
0.66,
0.1,
558,
0,
2,
0,
0,
558,
0,
0
],
[
1,
0,
0.0755,
0.0094,
0,
0.6... | [
"from twisted.internet import reactor",
"from bencode import bencode, bdecode",
"from twisted.internet import defer",
"from twisted.web.client import getPage",
"from tools import sleep",
"from urllib import urlencode",
"import hashlib",
"import socket",
"import struct",
"peers = [('60.50.9.1', 140... |
#
# -*-encoding:gb2312-*-
from twisted.internet import reactor
from tools import SpeedMonitor
class BTUpload (object) :
# producer interface implementation
def __init__(self, protocol):
self.protocol = protocol
self.peer_interested = None
self.am_choke = None
self.uploadSpe... | [
[
1,
0,
0.0345,
0.0086,
0,
0.66,
0,
937,
0,
1,
0,
0,
937,
0,
0
],
[
1,
0,
0.0517,
0.0086,
0,
0.66,
0.5,
409,
0,
1,
0,
0,
409,
0,
0
],
[
3,
0,
0.5302,
0.931,
0,
0.66... | [
"from twisted.internet import reactor",
"from tools import SpeedMonitor",
"class BTUpload (object) :\n # producer interface implementation\n\n def __init__(self, protocol):\n self.protocol = protocol\n\n self.peer_interested = None\n self.am_choke = None",
" def __init__(self, pr... |
#
# -*-encoding:gb2312-*-
import sys
import os
from MetaInfo import BTMetaInfo
from FileManager import BTFiles
def hashTest(btfilepath) :
btf = BTMetaInfo(btfilepath)
bfs = BTFiles(btf, '.', [0])
print bfs
goodPiece = 0
for i in range(len(bfs)):
res = bfs[i]
... | [
[
1,
0,
0.0714,
0.0179,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0893,
0.0179,
0,
0.66,
0.2,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.125,
0.0179,
0,
0.66... | [
"import sys",
"import os",
"from MetaInfo import BTMetaInfo",
"from FileManager import BTFiles",
"def hashTest(btfilepath) :\n btf = BTMetaInfo(btfilepath)\n bfs = BTFiles(btf, '.', [0])\n\n print(bfs)\n \n goodPiece = 0\n for i in range(len(bfs)):",
" btf = BTMetaInfo(btfilepath)",
... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | [
[
8,
0,
0.0319,
0.0532,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0745,
0.0106,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0851,
0.0106,
0,
0.66... | [
"'''\nModule which brings history information about files from Mercurial.\n\n@author: Rodrigo Damazio\n'''",
"import re",
"import subprocess",
"REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')",
"def _GetOutputLines(args):\n '''\n Runs an external process and returns its output as a list of lines... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | [
[
8,
0,
0.0417,
0.0521,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0104,
0,
0.66,
0.125,
640,
0,
1,
0,
0,
640,
0,
0
],
[
1,
0,
0.0938,
0.0104,
0,
0.66,... | [
"'''\nEntry point for My Tracks i18n tool.\n\n@author: Rodrigo Damazio\n'''",
"import mytracks.files",
"import mytracks.translate",
"import mytracks.validate",
"import sys",
"def Usage():\n print('Usage: %s <command> [<language> ...]\\n' % sys.argv[0])\n print('Commands are:')\n print(' cleanup')\n p... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | [
[
8,
0,
0.1905,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.7143,
0.619,
0,
0.66,
1,
229,
0,
2,
0,
0,
186,
0,
1
],
[
8,
1,
0.5238,
0.1429,
1,
0.21,
... | [
"'''\nModule which prompts the user for translations and saves them.\n\nTODO: implement\n\n@author: Rodrigo Damazio\n'''",
"class Translator(object):\n '''\n classdocs\n '''\n\n def __init__(self, language):\n '''\n Constructor",
" '''\n classdocs\n '''",
" def __init__(self, language):\n '''... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | [
[
8,
0,
0.0304,
0.0522,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0783,
0.0087,
0,
0.66,
... | [
"'''\nModule which compares languague files to the master file and detects\nissues.\n\n@author: Rodrigo Damazio\n'''",
"import os",
"from mytracks.parser import StringsParser",
"import mytracks.history",
"class Validator(object):\n\n def __init__(self, languages):\n '''\n Builds a strings file valida... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
... | [
"'''\nModule for dealing with resource files (but not their contents).\n\n@author: Rodrigo Damazio\n'''",
"import os.path",
"from glob import glob",
"import re",
"MYTRACKS_RES_DIR = 'MyTracks/res'",
"ANDROID_MASTER_VALUES = 'values'",
"ANDROID_VALUES_MASK = 'values-*'",
"def GetMyTracksDir():\n '''\n... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | [
[
8,
0,
0.0261,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0609,
0.0087,
0,
0.66,
0.3333,
573,
0,
1,
0,
0,
573,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66... | [
"'''\nModule which parses a string XML file.\n\n@author: Rodrigo Damazio\n'''",
"from xml.parsers.expat import ParserCreate",
"import re",
"class StringsParser(object):\n '''\n Parser for string XML files.\n\n This object is not thread-safe and should be used for parsing a single file at\n a time, only.\n... |
import string
from bluetooth import BluetoothSocket, RFCOMM, PORT_ANY, advertise_service, SERIAL_PORT_CLASS, SERIAL_PORT_PROFILE
import win32com.client
class WinappController(object):
def __init__(self, app=None):
self.app = app
self.shell = win32com.client.Dispatch("WScript.Shell")
... | [
[
1,
0,
0.0147,
0.0147,
0,
0.66,
0,
890,
0,
1,
0,
0,
890,
0,
0
],
[
1,
0,
0.0294,
0.0147,
0,
0.66,
0.0667,
256,
0,
6,
0,
0,
256,
0,
0
],
[
1,
0,
0.0441,
0.0147,
0,
... | [
"import string",
"from bluetooth import BluetoothSocket, RFCOMM, PORT_ANY, advertise_service, SERIAL_PORT_CLASS, SERIAL_PORT_PROFILE",
"import win32com.client",
"class WinappController(object):\n def __init__(self, app=None):\n self.app = app\n self.shell = win32com.client.Dispatch(\"WScript.... |
from distutils.core import setup
import py2exe
import os
origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
if os.path.basename(pathname).lower() in ("mfc90.dll"):
return 0
return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL
s... | [
[
1,
0,
0.0769,
0.0769,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.1538,
0.0769,
0,
0.66,
0.1667,
768,
0,
1,
0,
0,
768,
0,
0
],
[
1,
0,
0.2308,
0.0769,
0,
... | [
"from distutils.core import setup",
"import py2exe",
"import os",
"origIsSystemDLL = py2exe.build_exe.isSystemDLL",
"def isSystemDLL(pathname):\n if os.path.basename(pathname).lower() in (\"mfc90.dll\"):\n return 0\n return origIsSystemDLL(pathname)",
" if os.path.basen... |
#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| [
[
1,
0,
0.1818,
0.0909,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
14,
0,
0.2727,
0.0909,
0,
0.66,
0.1111,
15,
3,
0,
0,
0,
654,
10,
1
],
[
14,
0,
0.3636,
0.0909,
0,
... | [
"import time",
"t = time.time()",
"u = time.gmtime(t)",
"s = time.strftime('%a, %e %b %Y %T GMT', u)",
"print('Content-Type: text/javascript')",
"print('Cache-Control: no-cache')",
"print('Date: ' + s)",
"print('Expires: ' + s)",
"print('')",
"print('var timeskew = new Date().getTime() - ' + str(t... |
'''Copyright 2011 Google Inc. All Rights Reserved.
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 ... | [
[
8,
0,
0.1842,
0.3421,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4211,
0.0263,
0,
0.66,
0.1111,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.4474,
0.0263,
0,
0.66... | [
"'''Copyright 2011 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0",
"from google.appengine.api import ... |
'''Copyright 2011 Google Inc. All Rights Reserved.
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 ... | [
[
8,
0,
0.0282,
0.0524,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0605,
0.004,
0,
0.66,
0.0909,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.0645,
0.004,
0,
0.66,
... | [
"'''Copyright 2011 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0",
"from google.appengine.api import ... |
'''Copyright 2011 Google Inc. All Rights Reserved.
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 ... | [
[
8,
0,
0.25,
0.4643,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5357,
0.0357,
0,
0.66,
0.25,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.5714,
0.0357,
0,
0.66,
... | [
"'''Copyright 2011 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0",
"import json",
"import logging",... |
'''Copyright 2011 Google Inc. All Rights Reserved.
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 ... | [
[
8,
0,
0.5385,
1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"'''Copyright 2011 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0"
] |
'''Copyright 2011 Google Inc. All Rights Reserved.
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 ... | [
[
8,
0,
0.0547,
0.1016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1094,
0.0078,
0,
0.66,
0.0625,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.125,
0.0078,
0,
0.66,... | [
"'''Copyright 2011 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0",
"from google.appengine.api import ... |
import logging
# Change default log level to debug in dev_appserver to match production
logging.getLogger().setLevel(logging.DEBUG)
# but leave the default for App Engine APIs
logging.getLogger('google.appengine').setLevel(logging.INFO)
| [
[
1,
0,
0.1429,
0.1429,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
8,
0,
0.5714,
0.1429,
0,
0.66,
0.5,
810,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
1,
0.1429,
0,
0.66,
... | [
"import logging",
"logging.getLogger().setLevel(logging.DEBUG)",
"logging.getLogger('google.appengine').setLevel(logging.INFO)"
] |
#!/usr/bin/env python2.7
import json
import logging
import os
import pprint as pp
import sys
import unittest
import urllib2
try:
from webtest import TestApp
except:
print """Please install webtest from http://webtest.pythonpaste.org/"""
sys.exit(1)
# Attempt to locate the App Engine SDK based on the system PAT... | [
[
1,
0,
0.0091,
0.003,
0,
0.66,
0,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.0121,
0.003,
0,
0.66,
0.0667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0152,
0.003,
0,
0.6... | [
"import json",
"import logging",
"import os",
"import pprint as pp",
"import sys",
"import unittest",
"import urllib2",
"try:\n from webtest import TestApp\nexcept:\n print(\"\"\"Please install webtest from http://webtest.pythonpaste.org/\"\"\")\n sys.exit(1)",
" from webtest import TestApp",
... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
Reads a text file using espeak, mbrola and a media player.
The espeak program is a software speech synthesizer.
The mbrola synthesiser can improve the naturalness of speech. However, it
has licensing restrictions, and is not part of Debian's main repository.
Ubuntu mak... | [
[
8,
0,
0.1295,
0.2455,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2545,
0.0045,
0,
0.66,
0.2,
588,
0,
6,
0,
0,
588,
0,
0
],
[
2,
0,
0.2924,
0.0625,
0,
0.66,
... | [
"'''\nReads a text file using espeak, mbrola and a media player.\n\nThe espeak program is a software speech synthesizer.\nThe mbrola synthesiser can improve the naturalness of speech. However, it\nhas licensing restrictions, and is not part of Debian's main repository.\nUbuntu makes mbrola and mbrola voices availab... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
To read a plain text file using speech-dispatcher
Tip: Before using this script, try out speech-dispatcher using
Accessories > Terminal (the command line console) with
spd-say "Text to say"
If the sound doesn't work, or it sounds distorted, try killing
the s... | [
[
8,
0,
0.125,
0.2037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2315,
0.0093,
0,
0.66,
0.25,
588,
0,
4,
0,
0,
588,
0,
0
],
[
2,
0,
0.3426,
0.1944,
0,
0.66,
... | [
"'''\nTo read a plain text file using speech-dispatcher\n Tip: Before using this script, try out speech-dispatcher using\n Accessories > Terminal (the command line console) with \n spd-say \"Text to say\"\n If the sound doesn't work, or it sounds distorted, try killing\n the speech daemon with System Monitor... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
Reads a text file using pico2wave and a media player.
The SVOX Pico engine is a software speech synthesizer for German,English (GB
and US),Spanish,French and Italian.
SVOX produces a clear and distinct speech output made possible by the use of
Hidden Markov Model (HM... | [
[
8,
0,
0.1061,
0.1955,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2067,
0.0056,
0,
0.66,
0.2,
588,
0,
6,
0,
0,
588,
0,
0
],
[
2,
0,
0.257,
0.0838,
0,
0.66,
... | [
"'''\nReads a text file using pico2wave and a media player.\n\nThe SVOX Pico engine is a software speech synthesizer for German,English (GB\n and US),Spanish,French and Italian.\n\nSVOX produces a clear and distinct speech output made possible by the use of\nHidden Markov Model (HMM) algorithms.",
"import getopt,... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
To encode the text in a QR Code image file (png).
QR Code uses square patterns to encode characters in an image.
Readers are available in many mobile phone platforms. For Linux,
use zbar. Zbar is an open source toolkit that can decode QR code
images (zbarimg) and scan ... | [
[
8,
0,
0.1966,
0.3371,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3708,
0.0112,
0,
0.66,
0.2,
588,
0,
4,
0,
0,
588,
0,
0
],
[
2,
0,
0.4326,
0.0899,
0,
0.66,
... | [
"'''\nTo encode the text in a QR Code image file (png).\n\nQR Code uses square patterns to encode characters in an image.\nReaders are available in many mobile phone platforms. For Linux, \nuse zbar. Zbar is an open source toolkit that can decode QR code\nimages (zbarimg) and scan QR codes with a webcam (zbarcam).\... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
Reads a text file using festival and a media player.
The festival engine is a software speech synthesizer.
Install festival using a package manager to install a festivox or festival voice.
The package manager should automatically select the festival package and the
re... | [
[
8,
0,
0.0949,
0.1679,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1825,
0.0073,
0,
0.66,
0.2,
588,
0,
6,
0,
0,
588,
0,
0
],
[
2,
0,
0.2409,
0.0949,
0,
0.66,
... | [
"'''\nReads a text file using festival and a media player.\n\nThe festival engine is a software speech synthesizer.\n\nInstall festival using a package manager to install a festivox or festival voice.\nThe package manager should automatically select the festival package and the\nrequired support files.",
"import ... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
To read a plain text file using speech-dispatcher
Tip: Before using this script, try out speech-dispatcher using
Accessories > Terminal (the command line console) with
spd-say "Text to say"
If the sound doesn't work, or it sounds distorted, try killing
the s... | [
[
8,
0,
0.125,
0.2037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2315,
0.0093,
0,
0.66,
0.25,
588,
0,
4,
0,
0,
588,
0,
0
],
[
2,
0,
0.3426,
0.1944,
0,
0.66,
... | [
"'''\nTo read a plain text file using speech-dispatcher\n Tip: Before using this script, try out speech-dispatcher using\n Accessories > Terminal (the command line console) with \n spd-say \"Text to say\"\n If the sound doesn't work, or it sounds distorted, try killing\n the speech daemon with System Monitor... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
To encode the text in a QR Code image file (png).
QR Code uses square patterns to encode characters in an image.
Readers are available in many mobile phone platforms. For Linux,
use zbar. Zbar is an open source toolkit that can decode QR code
images (zbarimg) and scan ... | [
[
8,
0,
0.1966,
0.3371,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3708,
0.0112,
0,
0.66,
0.2,
588,
0,
4,
0,
0,
588,
0,
0
],
[
2,
0,
0.4326,
0.0899,
0,
0.66,
... | [
"'''\nTo encode the text in a QR Code image file (png).\n\nQR Code uses square patterns to encode characters in an image.\nReaders are available in many mobile phone platforms. For Linux, \nuse zbar. Zbar is an open source toolkit that can decode QR code\nimages (zbarimg) and scan QR codes with a webcam (zbarcam).\... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
Use python to access operating system commands
Read Text Extension for OpenOffice.org (for Linux) :
See: http://sites.google.com/site/readtextextension/
Tools > Add-Ons > Read Selection... Dialog setup:
External program: /usr/bin/python
Command line: "(OS_PY)" ... | [
[
8,
0,
0.1204,
0.1852,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2222,
0.0185,
0,
0.66,
0.2,
588,
0,
4,
0,
0,
588,
0,
0
],
[
2,
0,
0.3056,
0.1111,
0,
0.66,
... | [
"'''\nUse python to access operating system commands\n\nRead Text Extension for OpenOffice.org (for Linux) :\n See: http://sites.google.com/site/readtextextension/\n Tools > Add-Ons > Read Selection... Dialog setup:\n External program: /usr/bin/python\n Command line: \"(OS_PY)\" --c \"espeak -f '(TMP)'\"",
"i... |
#!/usr/bin/env python
# -*- coding: UTF-8-*-
'''
Read Text Library
Common tools for Read Text Extension
Copyright (c) 2011 James Holgate
'''
import getopt,sys,codecs,os,platform,time,wave,math,subprocess,shlex
def usage():
'''
Displays the usage of the included python app "main", which can be used to convert
wa... | [
[
8,
0,
0.0094,
0.0118,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0165,
0.0024,
0,
0.66,
0.0833,
588,
0,
10,
0,
0,
588,
0,
0
],
[
2,
0,
0.04,
0.04,
0,
0.66,
... | [
"'''\nRead Text Library\nCommon tools for Read Text Extension\nCopyright (c) 2011 James Holgate\n'''",
"import getopt,sys,codecs,os,platform,time,wave,math,subprocess,shlex",
"def usage():\n '''\n Displays the usage of the included python app \"main\", which can be used to convert\n wav files to other format... |
#!/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... |
#!/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/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... |
#!/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 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.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: #... |
# 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) 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.