code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.825,
0.025,
0,
0.66,
0,
200,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.9,
0.025,
0,
0.66,
0.5,
730,
3,
1,
0,
0,
147,
10,
1
],
[
8,
0,
0.925,
0.025,
0,
0.66,
... | [
"img = '\\nc\\x00\\x00\\x03\\x00\\x04\\x04\\x03\\x03\\x00sys\\x03\\x04\\x00putb\\x03\\x01\\x00n\\x03\\x00\\x00\\x04\\x05\\x01\\xff\\xff\\xff\\xff\\x00\\x014\\x00\\x00\\x00\\x01*\\x00\\x00\\x00\\x012\\x00\\x00\\x00d\\x00\\x00d\\x01\\x00k\\x00\\x00Z\\x00\\x00e\\x00\\x00i\\x01\\x00d\\x02\\x00\\x83\\x01\\x00Fd\\x03\\x0... |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.6429,
0.0357,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.75,
0.0357,
0,
0.66,
0.1667,
243,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.7857,
0.0357,
0,
0.66... | [
"import sys",
"sys.wait(-1)",
"sys.wait(0)",
"sys.wait(1)",
"print(\"Waiting 3 secs...\")",
"sys.wait(3000)",
"print(\"done.\")"
] |
# Anything that starts with a # is a comment!
# Use lots of comments in your code to explain what you're doing.
# Use the PIC-specific Python libraries
import t108b as pic
###############################################################
# Set up line sensors, distance sensor, motors
#################################... | [
[
1,
0,
0.1562,
0.0312,
0,
0.66,
0,
781,
0,
1,
0,
0,
781,
0,
0
],
[
14,
0,
0.375,
0.0312,
0,
0.66,
0.1429,
927,
3,
3,
0,
0,
928,
10,
1
],
[
14,
0,
0.4062,
0.0312,
0,
... | [
"import t108b as pic",
"line_sensor_right = pic.digital_io(1, 8, True)",
"right_wheel_stopped = 938",
"def drive_forward():\n right_wheel.setCounts(right_wheel_forward)",
" right_wheel.setCounts(right_wheel_forward)",
"def stop_driving():\n right_wheel.setCounts(right_wheel_stopped)",
" ... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.3529,
0.0196,
0,
0.66,
0,
826,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.3725,
0.0196,
0,
0.66,
0.05,
745,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3922,
0.0196,
0,
0.6... | [
"i = 4",
"s1 = \"test %d\" % i",
"s2 = \"test %d\" % (i,)",
"i = 205",
"s1 = \"test t%03d\" % i",
"s2 = \"test t%03d\" % (i,)",
"print(s1)",
"f = -3.14",
"s1 = \"test %f this\" % f",
"s2 = \"test %f this\" % (f,)",
"f = -3.14",
"s1 = \"test %1.2f\" % f",
"s2 = \"test %1.2f\" % (f,)",
"s = ... |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.3913,
0.0217,
0,
0.66,
0,
475,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.413,
0.0217,
0,
0.66,
0.1429,
773,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
0.4565,
0.0217,
0,
0.6... | [
"a = 2",
"n = 3",
"print(\" 2 % 3 in pymite:\", (a % n), \" and in cpython:\", 2)",
"print(\" (-2) % 3 in pymite:\", ((-a) % n), \" and in cpython:\", 1)",
"print(\" 2 % (-3) in pymite:\", (a % (-n)), \" and in cpython:\", -1)",
"print(\"(-2) % (-3) in pymite:\", ((-a) % (-n)), \" and in cpython:... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.4872,
0.0256,
0,
0.66,
0,
888,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.5385,
0.0256,
0,
0.66,
0.2222,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.5897,
0.0256,
0,
0.... | [
"l1 = [1, 2, 3]",
"print(l1)",
"l2 = [1, 2, 3, 4.0]",
"print(l2)",
"l3 = [1.0, 2.0, 3.0]",
"print(l3)",
"l4 = [1.1, 2.2, 3.3]",
"print(l4)",
"l5 = [1.1, 2.2, 3.3, 4.4]",
"print(l5)"
] |
# This file is Copyright 2011 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.9474,
0.0526,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.0526,
0,
0.66,
1,
92,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import sys",
"sys.gc()"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.413,
0.0217,
0,
0.66,
0,
15,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
0.5652,
0.0217,
0,
0.66,
2,
810,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.7174,
0.0217,
0,
0.66,
... | [
"t = (2,5,6)",
"l = [2,5,6]",
"s = \"256\"",
"d = {2:2, 5:\"5\", 6:None}"
] |
import sys
Import("env", "vars")
SOURCES = Glob("*.c")
PMSTDLIB_SOURCES = ["../lib/list.py",
"../lib/dict.py",
"../lib/__bi.py",
"../lib/sys.py",
"../lib/string.py",]
if env["IPM"] == True:
PMSTDLIB_SOURCES.append("../lib/ipm.py")
... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.1538,
0.0385,
0,
0.66,
0.1111,
248,
3,
2,
0,
0,
0,
0,
1
],
[
14,
0,
0.2308,
0.0385,
0,
0... | [
"import sys",
"Import(\"env\", \"vars\")",
"SOURCES = Glob(\"*.c\")",
"PMSTDLIB_SOURCES = [\"../lib/list.py\",\n \"../lib/dict.py\",\n \"../lib/__bi.py\",\n \"../lib/sys.py\",\n \"../lib/string.py\",]",
"if env[\"IPM\"] == True:\n ... |
# This file is Copyright 2007 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief avr
## @package avr
# @brief AVR Access Module
#
# Provides generic access to the AVR microcontroller
#
# Note ... | [
[
8,
0,
0.3103,
0.4557,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.5567,
0.0123,
0,
0.66,
0.2,
982,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.5567,
0.0074,
1,
0.36,
... | [
"\"\"\"__NATIVE__\n#include <avr/io.h>\n#include <util/delay.h>\n\n/*\n * Common method for all port register operations\n */\nPmReturn_t",
"def portA(a):\n \"\"\"__NATIVE__\n return _portX(&PORTA, &DDRA, &PINA);\n \"\"\"\n pass",
" \"\"\"__NATIVE__\n return _portX(&PORTA, &DDRA, &PINA);\n ... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief dict
## @package dict
# @brief Provides PyMite's dict module.
__name__ = "dict"
class _Autobox:
def clea... | [
[
14,
0,
0.0719,
0.006,
0,
0.66,
0,
136,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.1228,
0.0719,
0,
0.66,
0.1667,
235,
0,
4,
0,
0,
0,
0,
4
],
[
2,
1,
0.0988,
0.012,
1,
0.82,... | [
"__name__ = \"dict\"",
"class _Autobox:\n def clear(self):\n return clear(self.obj)\n\n def keys(self):\n return keys(self.obj)\n\n def has_key(self, k):",
" def clear(self):\n return clear(self.obj)",
" return clear(self.obj)",
" def keys(self):\n return ke... |
# This file is Copyright 2007 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief ipm_target
## @package ipm_target
# @brief Provides PyMite's interactive interface for the target.
##
# Recei... | [
[
2,
0,
0.4444,
0.5556,
0,
0.66,
0,
795,
0,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.4444,
0.5354,
1,
0.21,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.7727,
0.0606,
0,
0.66,
0... | [
"def _getImg():\n \"\"\"__NATIVE__\n PmReturn_t retval;\n uint8_t imgType;\n uint16_t imgSize;\n uint8_t *pchunk;\n pPmCodeImgObj_t pimg;\n uint16_t i;",
" \"\"\"__NATIVE__\n PmReturn_t retval;\n uint8_t imgType;\n uint16_t imgSize;\n uint8_t *pchunk;\n pPmCodeImgObj_t pimg;... |
# This file is Copyright 2002 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @package sys
# @brief Provides PyMite's system module, sys
#
# USAGE
# -----
#
# import sys
#
#### TODO
# modules = None #set pt... | [
[
14,
0,
0.083,
0.0038,
0,
0.66,
0,
279,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.1491,
0.1132,
0,
0.66,
0.125,
436,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.1491,
0.1057,
1,
0.2,
... | [
"maxint = 0x7FFFFFFF # 2147483647",
"def exit(val):\n \"\"\"__NATIVE__\n pPmObj_t pval = C_NULL;\n PmReturn_t retval;\n\n /* If no arg given, assume return 0 */\n if (NATIVE_GET_NUM_ARGS() == 0)\n {",
" \"\"\"__NATIVE__\n pPmObj_t pval = C_NULL;\n PmReturn_t retval;\n\n /* If n... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief func
## @package func
# @brief Provides PyMite's func module.
##
# Returns the names tuple of the function/mo... | [
[
2,
0,
0.4153,
0.3051,
0,
0.66,
0,
987,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.4153,
0.2712,
1,
0.68,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.8051,
0.3051,
0,
0.66,
1... | [
"def co_names(f):\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n pPmObj_t pfunc;\n\n /* If wrong number of args, raise TypeError */\n if (NATIVE_GET_NUM_ARGS() != 1)\n {",
" \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n pPmObj_t pfunc;\n\n /* If wrong number of args, rai... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief sizeof
## @package sizeof
# @brief Provides PyMite's sizeof module.
#
# <b>USAGE</b>
#
# \code sizeof.sizeof(ob... | [
[
8,
0,
0.1515,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.4508,
0.5455,
0,
0.66,
0.5,
797,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.4508,
0.5303,
1,
0.58,
... | [
"\"\"\"__NATIVE__\n#include \"pm.h\"\n\"\"\"",
"def sizeof(obj):\n \"\"\"__NATIVE__\n pPmObj_t pobj;\n pPmObj_t psize;\n int32_t n;\n PmReturn_t retval = PM_RET_OK;\n int32_t static size[] = {\n sizeof(PmObj_t), /* None type */",
" \"\"\"__NATIVE__\n pPmObj_t pobj;\n pPmObj_t p... |
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
## @package string
# @brief Provides PyMite's string module.
#
"""__NATIVE__
#include <stdlib.h>
#include <string.h>
"""
... | [
[
8,
0,
0.0539,
0.0149,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0706,
0.0037,
0,
0.66,
0.1111,
136,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.0967,
0.0335,
0,
0.66,... | [
"\"\"\"__NATIVE__\n#include <stdlib.h>\n#include <string.h>\n\"\"\"",
"__name__ = \"string\"",
"class _Autobox:\n def join(self, l):\n return join(self.obj, l)\n\n def count(self, s):\n return count(self.obj, s)\n\n def find(self, s):",
" def join(self, l):\n return join(self.... |
# This file is Copyright 2002 Dean Hall.
# This file is part of the Python-on-a-Chip libraries.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
## @file
# @copybrief __bi
## @package __bi
# @brief Provides PyMite's builtins module, __bi.
#
# <b>USAGE</b>
#
# The builtins are... | [
[
2,
0,
0.0195,
0.0031,
0,
0.66,
0,
799,
0,
1,
1,
0,
0,
0,
0
],
[
13,
1,
0.0205,
0.001,
1,
0.78,
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.97... | [
"__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... |
# Django settings for hgWeb project.
SERVICE_PATH = 'D:/praktyki/piotrbrzuska/hgWeb/src/hgWeb/'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'p... | [
[
14,
0,
0.03,
0.01,
0,
0.66,
0,
177,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.07,
0.01,
0,
0.66,
0.0526,
309,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.08,
0.01,
0,
0.66,
0.1... | [
"SERVICE_PATH = 'D:/praktyki/piotrbrzuska/hgWeb/src/hgWeb/'",
"DEBUG = True",
"TEMPLATE_DEBUG = DEBUG",
"ADMINS = (\n # ('Your Name', 'your_email@domain.com'),\n)",
"MANAGERS = ADMINS",
"DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postg... |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
import os
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^hgWeb/', include('hgWeb.foo.urls')),
# Uncomment the admin/doc line below and add 'django.cont... | [
[
1,
0,
0.0417,
0.0417,
0,
0.66,
0,
341,
0,
1,
0,
0,
341,
0,
0
],
[
1,
0,
0.1667,
0.0417,
0,
0.66,
0.25,
302,
0,
1,
0,
0,
302,
0,
0
],
[
1,
0,
0.2083,
0.0417,
0,
0.... | [
"from django.conf.urls.defaults import *",
"from django.contrib import admin",
"import os",
"admin.autodiscover()",
"urlpatterns = patterns('',\n # Example:\n # (r'^hgWeb/', include('hgWeb.foo.urls')),\n\n # Uncomment the admin/doc line below and add 'django.contrib.admindocs' \n # to INSTALLED_... |
HG_REPOSITORIES_ROOT = "D:\praktyki\piotrbrzuska\HgRepositories" | [
[
14,
0,
1,
1,
0,
0.66,
0,
239,
1,
0,
0,
0,
0,
3,
0
]
] | [
"HG_REPOSITORIES_ROOT = \"D:\\praktyki\\piotrbrzuska\\HgRepositories\""
] |
from django.db import models
from django.contrib.auth.models import User
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.conf import settings as global_settings
from mercurial import hg, ui
from datetime import da... | [
[
1,
0,
0.0118,
0.0118,
0,
0.66,
0,
40,
0,
1,
0,
0,
40,
0,
0
],
[
1,
0,
0.0235,
0.0118,
0,
0.66,
0.0714,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.0353,
0.0118,
0,
0.... | [
"from django.db import models",
"from django.contrib.auth.models import User",
"from django.db.models import Q",
"from django.utils.translation import ugettext_lazy as _",
"from django.core.urlresolvers import reverse",
"from django.conf import settings as global_settings",
"from mercurial import hg, ui... |
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
... | [
[
8,
0,
0.1522,
0.2609,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3478,
0.0435,
0,
0.66,
0.3333,
944,
0,
1,
0,
0,
944,
0,
0
],
[
3,
0,
0.5435,
0.2609,
0,
0.66... | [
"\"\"\"\nThis file demonstrates two different styles of tests (one doctest and one\nunittest). These will both pass when you run \"manage.py test\".\n\nReplace these with more appropriate tests for your application.\n\"\"\"",
"from django.test import TestCase",
"class SimpleTest(TestCase):\n def test_basic_a... |
#-*- coding: utf-8 -*-
from django.template import Context, loader
from hgWeb.hg.models import Repository,RepositoryContext
from hgWeb.hg.models import LanguageList
from django.http import HttpResponse, HttpResponseRedirect
from django.core.context_processors import csrf
from mercurial import hg, ui
import hgW... | [
[
1,
0,
0.025,
0.0083,
0,
0.66,
0,
213,
0,
2,
0,
0,
213,
0,
0
],
[
1,
0,
0.0333,
0.0083,
0,
0.66,
0.0833,
454,
0,
2,
0,
0,
454,
0,
0
],
[
1,
0,
0.0417,
0.0083,
0,
0... | [
"from django.template import Context, loader",
"from hgWeb.hg.models import Repository,RepositoryContext",
"from hgWeb.hg.models import LanguageList",
"from django.http import HttpResponse, HttpResponseRedirect",
"from django.core.context_processors import csrf",
"from mercurial import hg, ui",
"import ... |
'''
Created on 2010-08-02
@author: Administrator
'''
ORDER_VAR = 'o'
ORDER_TYPE_VAR = 'ot'
class SortHeaders:
"""
Handles generation of an argument for the Django ORM's
``order_by`` method and generation of table headers which reflect
the currently selected sort, based on defined table hea... | [
[
8,
0,
0.0265,
0.0442,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0531,
0.0088,
0,
0.66,
0.3333,
584,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0619,
0.0088,
0,
0.66... | [
"'''\nCreated on 2010-08-02\n\n@author: Administrator\n'''",
"ORDER_VAR = 'o'",
"ORDER_TYPE_VAR = 'ot'",
"class SortHeaders:\n \"\"\"\n Handles generation of an argument for the Django ORM's\n ``order_by`` method and generation of table headers which reflect\n the currently selected sort, based on... |
from django.contrib import admin
from hgWeb.hg.models import Repository
from hgWeb.hg.models import LanguageList
admin.site.register(Repository)
admin.site.register(LanguageList) | [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
302,
0,
1,
0,
0,
302,
0,
0
],
[
1,
0,
0.3333,
0.1667,
0,
0.66,
0.25,
454,
0,
1,
0,
0,
454,
0,
0
],
[
1,
0,
0.5,
0.1667,
0,
0.66,... | [
"from django.contrib import admin",
"from hgWeb.hg.models import Repository",
"from hgWeb.hg.models import LanguageList",
"admin.site.register(Repository)",
"admin.site.register(LanguageList)"
] |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... | [
[
1,
0,
0.1818,
0.0909,
0,
0.66,
0,
879,
0,
1,
0,
0,
879,
0,
0
],
[
7,
0,
0.5,
0.5455,
0,
0.66,
0.5,
0,
0,
1,
0,
0,
0,
0,
2
],
[
1,
1,
0.3636,
0.0909,
1,
0.23,
... | [
"from django.core.management import execute_manager",
"try:\n import settings # Assumed to be in the same directory.\nexcept ImportError:\n import sys\n sys.stderr.write(\"Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\\nYou'll have to run dj... |
#!/usr/bin/env python
#
# Copyright 2005, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your op... | [
[
1,
0,
0.2035,
0.0088,
0,
0.66,
0,
654,
0,
3,
0,
0,
654,
0,
0
],
[
1,
0,
0.2124,
0.0088,
0,
0.66,
0.125,
530,
0,
4,
0,
0,
530,
0,
0
],
[
1,
0,
0.2212,
0.0088,
0,
0... | [
"import time, struct, sys",
"from gnuradio import gr, blks2, usrp2, eng_notation",
"from gnuradio.eng_option import eng_option",
"from optparse import OptionParser",
"from tx80211g_ofdm import tx80211g_receive_path",
"from tx80211g_ofdm import ofdm_demod",
"class my_top_block(gr.top_block):\n def __i... |
#!/usr/bin/env python
#
# Copyright 2005, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your op... | [
[
1,
0,
0.1655,
0.0072,
0,
0.66,
0,
654,
0,
3,
0,
0,
654,
0,
0
],
[
1,
0,
0.1727,
0.0072,
0,
0.66,
0.1429,
530,
0,
4,
0,
0,
530,
0,
0
],
[
1,
0,
0.1799,
0.0072,
0,
... | [
"import time, struct, sys",
"from gnuradio import gr, blks2, usrp2, eng_notation",
"from gnuradio.eng_option import eng_option",
"from optparse import OptionParser",
"from tx80211g_ofdm import tx80211g_transmit_path",
"class my_top_block(gr.top_block):\n def __init__(self, options, payload=''):\n ... |
#!/usr/bin/env python
#
# Copyright 2005, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your op... | [
[
1,
0,
0.1655,
0.0072,
0,
0.66,
0,
654,
0,
3,
0,
0,
654,
0,
0
],
[
1,
0,
0.1727,
0.0072,
0,
0.66,
0.1429,
530,
0,
4,
0,
0,
530,
0,
0
],
[
1,
0,
0.1799,
0.0072,
0,
... | [
"import time, struct, sys",
"from gnuradio import gr, blks2, usrp2, eng_notation",
"from gnuradio.eng_option import eng_option",
"from optparse import OptionParser",
"from tx80211g_ofdm import tx80211g_transmit_path",
"class my_top_block(gr.top_block):\n def __init__(self, options, payload=''):\n ... |
#!/usr/bin/env python
#
# Copyright 2005, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your op... | [
[
1,
0,
0.2035,
0.0088,
0,
0.66,
0,
654,
0,
3,
0,
0,
654,
0,
0
],
[
1,
0,
0.2124,
0.0088,
0,
0.66,
0.125,
530,
0,
4,
0,
0,
530,
0,
0
],
[
1,
0,
0.2212,
0.0088,
0,
0... | [
"import time, struct, sys",
"from gnuradio import gr, blks2, usrp2, eng_notation",
"from gnuradio.eng_option import eng_option",
"from optparse import OptionParser",
"from tx80211g_ofdm import tx80211g_receive_path",
"from tx80211g_ofdm import ofdm_demod",
"class my_top_block(gr.top_block):\n def __i... |
#!/usr/bin/env python
import sys
import os, os.path
from optparse import OptionParser
def quote_line (line):
line = line.replace ('&', '&')
line = line.replace ('<', '<')
line = line.replace ('>', '>')
line = line.replace ("'", ''')
line = line.replace ('"', '"')
return lin... | [
[
1,
0,
0.0667,
0.0222,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0889,
0.0222,
0,
0.66,
0.1667,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1111,
0.0222,
0,
... | [
"import sys",
"import os, os.path",
"from optparse import OptionParser",
"def quote_line (line):\n line = line.replace ('&', '&')\n line = line.replace ('<', '<')\n line = line.replace ('>', '>')\n line = line.replace (\"'\", ''')\n line = line.replace ('\"', '"')\n retur... |
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
import howto
class qa_howto (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_square_ff (self):
src_data = (-3, 4, -5.5, 2, 3)
expected_result = ... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
530,
0,
2,
0,
0,
530,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.3333,
924,
0,
1,
0,
0,
924,
0,
0
],
[
3,
0,
0.5556,
0.7037,
0,
0.... | [
"from gnuradio import gr, gr_unittest",
"import howto",
"class qa_howto (gr_unittest.TestCase):\n\n def setUp (self):\n self.tb = gr.top_block ()\n\n def tearDown (self):\n self.tb = None",
" def setUp (self):\n self.tb = gr.top_block ()",
" self.tb = gr.top_block ()",
... |
#!/usr/bin/env python
import sys
import os, os.path
from optparse import OptionParser
def quote_line (line):
line = line.replace ('&', '&')
line = line.replace ('<', '<')
line = line.replace ('>', '>')
line = line.replace ("'", ''')
line = line.replace ('"', '"')
return lin... | [
[
1,
0,
0.0667,
0.0222,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0889,
0.0222,
0,
0.66,
0.1667,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1111,
0.0222,
0,
... | [
"import sys",
"import os, os.path",
"from optparse import OptionParser",
"def quote_line (line):\n line = line.replace ('&', '&')\n line = line.replace ('<', '<')\n line = line.replace ('>', '>')\n line = line.replace (\"'\", ''')\n line = line.replace ('\"', '"')\n retur... |
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
import howto
class qa_howto (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_square_ff (self):
src_data = (-3, 4, -5.5, 2, 3)
expected_result = ... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
530,
0,
2,
0,
0,
530,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.3333,
924,
0,
1,
0,
0,
924,
0,
0
],
[
3,
0,
0.5556,
0.7037,
0,
0.... | [
"from gnuradio import gr, gr_unittest",
"import howto",
"class qa_howto (gr_unittest.TestCase):\n\n def setUp (self):\n self.tb = gr.top_block ()\n\n def tearDown (self):\n self.tb = None",
" def setUp (self):\n self.tb = gr.top_block ()",
" self.tb = gr.top_block ()",
... |
#!/usr/bin/python
import sys
import math
import networkx
# Basically this file is just a wrapper around the graph generator
# networkx.generators.random_graphs.powerlaw_cluster_graph.
# Output is to standard out (so use pipe redirection)
def main():
# usage: graph_gen.py n m p seed > outputfile
if ( len(sys.argv... | [
[
1,
0,
0.1,
0.0333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1333,
0.0333,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.1667,
0.0333,
0,
0.66,... | [
"import sys",
"import math",
"import networkx",
"def main():\n\t# usage: graph_gen.py n m p seed > outputfile\n\tif ( len(sys.argv) != 5 ):\n\t\tprint(\"usage: graph_gen.py n m p seed > outputfile\")\n\t\treturn\n\n\tn = int(float(sys.argv[1])) \n\tm = int(sys.argv[2])",
"\tif ( len(sys.argv) != 5 ):\n\t\tp... |
#!/usr/bin/python
import sys
import math
import networkx as nx
# Donald Knuth's Running mean and variance calculation
# See Knuth TAOCP vol 2, 3rd edition, page 232
class RunningStat:
def __init__(self):
self.clear()
def clear(self):
self.m_n = 0
self.m_newM = 0
self.m_newM = 0.0
self.m_newS = 0.0
self... | [
[
1,
0,
0.0155,
0.0052,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0207,
0.0052,
0,
0.66,
0.1429,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0259,
0.0052,
0,
... | [
"import sys",
"import math",
"import networkx as nx",
"class RunningStat:\n\tdef __init__(self):\n\t\tself.clear()\n\n\tdef clear(self):\n\t\tself.m_n = 0\n\t\tself.m_newM = 0\n\t\tself.m_newM = 0.0",
"\tdef __init__(self):\n\t\tself.clear()",
"\t\tself.clear()",
"\tdef clear(self):\n\t\tself.m_n = 0\n\... |
#!/usr/bin/python
import sys
import math
import networkx
# Basically this file is just a wrapper around the graph generator
# networkx.generators.random_graphs.powerlaw_cluster_graph.
# Output is to standard out (so use pipe redirection)
def main():
# usage: graph_gen.py n m p seed > outputfile
if ( len(sys.argv... | [
[
1,
0,
0.1,
0.0333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1333,
0.0333,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.1667,
0.0333,
0,
0.66,... | [
"import sys",
"import math",
"import networkx",
"def main():\n\t# usage: graph_gen.py n m p seed > outputfile\n\tif ( len(sys.argv) != 5 ):\n\t\tprint(\"usage: graph_gen.py n m p seed > outputfile\")\n\t\treturn\n\n\tn = int(float(sys.argv[1])) \n\tm = int(sys.argv[2])",
"\tif ( len(sys.argv) != 5 ):\n\t\tp... |
#!/usr/bin/python
import sys
import math
import networkx as nx
# Donald Knuth's Running mean and variance calculation
# See Knuth TAOCP vol 2, 3rd edition, page 232
class RunningStat:
def __init__(self):
self.clear()
def clear(self):
self.m_n = 0
self.m_newM = 0
self.m_newM = 0.0
self.m_newS = 0.0
self... | [
[
1,
0,
0.0155,
0.0052,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0207,
0.0052,
0,
0.66,
0.1429,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0259,
0.0052,
0,
... | [
"import sys",
"import math",
"import networkx as nx",
"class RunningStat:\n\tdef __init__(self):\n\t\tself.clear()\n\n\tdef clear(self):\n\t\tself.m_n = 0\n\t\tself.m_newM = 0\n\t\tself.m_newM = 0.0",
"\tdef __init__(self):\n\t\tself.clear()",
"\t\tself.clear()",
"\tdef clear(self):\n\t\tself.m_n = 0\n\... |
#!/usr/bin/python
'''
dlm2dot.py:
Take an input graph file and convert to a dot file. This script
interprets the cluster label and generates an appropriate dot
graph.
Input format is edge-list with some delimiter used between
vertice labels (and optionally a weight). For now any weight
values are ignored if... | [
[
8,
0,
0.0975,
0.1695,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1949,
0.0085,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2034,
0.0085,
0,
0.66... | [
"'''\ndlm2dot.py:\n\tTake an input graph file and convert to a dot file. This script\n\tinterprets the cluster label and generates an appropriate dot\n\tgraph. \n\n\tInput format is edge-list with some delimiter used between\n\tvertice labels (and optionally a weight). For now any weight",
"import sys",
"imp... |
#!/usr/bin/python
'''
metis2clusters.py
input: output file from pmetis or kmetis
output: clusters file to use with addClusterLabels.py
Currently assumes node numbering starting at 1.
Also, may need to add vertex label map like was done
for community as gaps in the range of node values causes
errors.
usage:
m... | [
[
8,
0,
0.1491,
0.2456,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2982,
0.0175,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.4298,
0.2105,
0,
0.66,
... | [
"'''\nmetis2clusters.py\n\tinput: output file from pmetis or kmetis\n\toutput: clusters file to use with addClusterLabels.py\n\n\tCurrently assumes node numbering starting at 1. \n\tAlso, may need to add vertex label map like was done\n\tfor community as gaps in the range of node values causes",
"import sys",
... |
#!/usr/bin/python
'''
convertGraph.py:
Take an input graph file and convert it to a suitable format for the
partitioning/cluster programs (Community in this case).
Created on Apr 15, 2011
@author: cmhill
'''
import getopt
import networkx as nx
import sys
EDGE = "EDGE"
ADJ_LIST = "ADJ_LIST"
METIS = "METIS"
COM... | [
[
8,
0,
0.0747,
0.1149,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1494,
0.0115,
0,
0.66,
0.0909,
588,
0,
1,
0,
0,
588,
0,
0
],
[
1,
0,
0.1609,
0.0115,
0,
0.66... | [
"'''\nconvertGraph.py: \n\tTake an input graph file and convert it to a suitable format for the\n\tpartitioning/cluster programs (Community in this case).\n\n\t\n\nCreated on Apr 15, 2011",
"import getopt",
"import networkx as nx",
"import sys",
"EDGE = \"EDGE\"",
"ADJ_LIST = \"ADJ_LIST\"",
"METIS = \"M... |
#!/usr/bin/python
'''
metis2clusters.py
input: output file from pmetis or kmetis
output: clusters file to use with addClusterLabels.py
Currently assumes node numbering starting at 1.
Also, may need to add vertex label map like was done
for community as gaps in the range of node values causes
errors.
usage:
m... | [
[
8,
0,
0.1491,
0.2456,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2982,
0.0175,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.4298,
0.2105,
0,
0.66,
... | [
"'''\nmetis2clusters.py\n\tinput: output file from pmetis or kmetis\n\toutput: clusters file to use with addClusterLabels.py\n\n\tCurrently assumes node numbering starting at 1. \n\tAlso, may need to add vertex label map like was done\n\tfor community as gaps in the range of node values causes",
"import sys",
... |
#!/usr/bin/python
'''
dlm2dot.py:
Take an input graph file and convert to a dot file. This script
interprets the cluster label and generates an appropriate dot
graph.
Input format is edge-list with some delimiter used between
vertice labels (and optionally a weight). For now any weight
values are ignored if... | [
[
8,
0,
0.0975,
0.1695,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1949,
0.0085,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2034,
0.0085,
0,
0.66... | [
"'''\ndlm2dot.py:\n\tTake an input graph file and convert to a dot file. This script\n\tinterprets the cluster label and generates an appropriate dot\n\tgraph. \n\n\tInput format is edge-list with some delimiter used between\n\tvertice labels (and optionally a weight). For now any weight",
"import sys",
"imp... |
#!/usr/bin/python
'''
convertGraph.py:
Take an input graph file and convert it to a suitable format for the
partitioning/cluster programs (Community in this case).
Created on Apr 15, 2011
@author: cmhill
'''
import getopt
import networkx as nx
import sys
EDGE = "EDGE"
ADJ_LIST = "ADJ_LIST"
METIS = "METIS"
COM... | [
[
8,
0,
0.0747,
0.1149,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1494,
0.0115,
0,
0.66,
0.0909,
588,
0,
1,
0,
0,
588,
0,
0
],
[
1,
0,
0.1609,
0.0115,
0,
0.66... | [
"'''\nconvertGraph.py: \n\tTake an input graph file and convert it to a suitable format for the\n\tpartitioning/cluster programs (Community in this case).\n\n\t\n\nCreated on Apr 15, 2011",
"import getopt",
"import networkx as nx",
"import sys",
"EDGE = \"EDGE\"",
"ADJ_LIST = \"ADJ_LIST\"",
"METIS = \"M... |
#!/usr/bin/python
'''
addClusterLabels.py:
input: edge list and a set of clusters
output: edge list with clusters prepended to vertex name
usage:
addClusterLabels.py edgelist clusters > output
all arguments are filenames
Created on May 1, 2011
@author: ncrowell
'''
import getopt
import sys
# creates a dic... | [
[
8,
0,
0.1197,
0.169,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2254,
0.0141,
0,
0.66,
0.1667,
588,
0,
1,
0,
0,
588,
0,
0
],
[
1,
0,
0.2394,
0.0141,
0,
0.66,... | [
"'''\naddClusterLabels.py:\n\tinput: edge list and a set of clusters \n\toutput: edge list with clusters prepended to vertex name\n\nusage:\n\taddClusterLabels.py edgelist clusters > output\n\t\tall arguments are filenames",
"import getopt",
"import sys",
"def readClusters(f):\n\tclustermap = dict()\n\tfor... |
#!/usr/bin/python
'''
community2clusters.py:
input: tree output from community and map file generated if the graph
need to be convereted for community
output: clusters files to use with addClusterLabels.py
As a side note, communities pushes all node numbers down such that the
lowest is 0 and they are consecuti... | [
[
8,
0,
0.0931,
0.1569,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1863,
0.0098,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.3873,
0.3725,
0,
0.66... | [
"'''\ncommunity2clusters.py:\n\tinput: tree output from community and map file generated if the graph\n\t\t\t\tneed to be convereted for community\n\toutput: clusters files to use with addClusterLabels.py\n\n\tAs a side note, communities pushes all node numbers down such that the\n\tlowest is 0 and they are consecu... |
#!/usr/bin/python
'''
dlm2dot.py
usage:
randomClusters.py input_file k > output_file
input: input file name and the number of clusters to use k.
output: the cluster file
Created on May 2, 2011
@author: ncrowell
'''
import sys
import random
# Produces the set containings all of the nodes in the input
def proce... | [
[
8,
0,
0.0897,
0.141,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1795,
0.0128,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1923,
0.0128,
0,
0.66,... | [
"'''\ndlm2dot.py\n\t\nusage:\n\trandomClusters.py input_file k > output_file\n\t\tinput: input file name and the number of clusters to use k.\n\t\toutput: the cluster file",
"import sys",
"import random",
"def processInput(f):\n\tret = set()\n\tfor line in f.readlines():\n\t\tif (line.strip().startswith('#'))... |
#!/usr/bin/python
'''
dlm2dot.py
usage:
randomClusters.py input_file k > output_file
input: input file name and the number of clusters to use k.
output: the cluster file
Created on May 2, 2011
@author: ncrowell
'''
import sys
import random
# Produces the set containings all of the nodes in the input
def proce... | [
[
8,
0,
0.0897,
0.141,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1795,
0.0128,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1923,
0.0128,
0,
0.66,... | [
"'''\ndlm2dot.py\n\t\nusage:\n\trandomClusters.py input_file k > output_file\n\t\tinput: input file name and the number of clusters to use k.\n\t\toutput: the cluster file",
"import sys",
"import random",
"def processInput(f):\n\tret = set()\n\tfor line in f.readlines():\n\t\tif (line.strip().startswith('#'))... |
#!/usr/bin/python
'''
addClusterLabels.py:
input: edge list and a set of clusters
output: edge list with clusters prepended to vertex name
usage:
addClusterLabels.py edgelist clusters > output
all arguments are filenames
Created on May 1, 2011
@author: ncrowell
'''
import getopt
import sys
# creates a dic... | [
[
8,
0,
0.1197,
0.169,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2254,
0.0141,
0,
0.66,
0.1667,
588,
0,
1,
0,
0,
588,
0,
0
],
[
1,
0,
0.2394,
0.0141,
0,
0.66,... | [
"'''\naddClusterLabels.py:\n\tinput: edge list and a set of clusters \n\toutput: edge list with clusters prepended to vertex name\n\nusage:\n\taddClusterLabels.py edgelist clusters > output\n\t\tall arguments are filenames",
"import getopt",
"import sys",
"def readClusters(f):\n\tclustermap = dict()\n\tfor... |
#!/usr/bin/python
'''
community2clusters.py:
input: tree output from community and map file generated if the graph
need to be convereted for community
output: clusters files to use with addClusterLabels.py
As a side note, communities pushes all node numbers down such that the
lowest is 0 and they are consecuti... | [
[
8,
0,
0.0931,
0.1569,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1863,
0.0098,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.3873,
0.3725,
0,
0.66... | [
"'''\ncommunity2clusters.py:\n\tinput: tree output from community and map file generated if the graph\n\t\t\t\tneed to be convereted for community\n\toutput: clusters files to use with addClusterLabels.py\n\n\tAs a side note, communities pushes all node numbers down such that the\n\tlowest is 0 and they are consecu... |
'''
Read in an edge list and prepend all node id's with their cluster info. Ex:
1 2
1 3
1 5
Result:
cluster1/1 cluster1/2
cluster1/1 cluster2/3
...
'''
import os, sys
def getClusterMapping(filename):
file = open(filename, 'r')
clusterMappings = {}
for line in file:
tuple = line.strip().split('\t'... | [
[
8,
0,
0.175,
0.325,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.375,
0.025,
0,
0.66,
0.3333,
688,
0,
2,
0,
0,
688,
0,
0
],
[
2,
0,
0.5375,
0.25,
0,
0.66,
... | [
"'''\nRead in an edge list and prepend all node id's with their cluster info. Ex:\n\n\t1\t2\n\t1\t3\n\t1\t5\n\t\nResult:",
"import os, sys",
"def getClusterMapping(filename):\n\t\n\tfile = open(filename, 'r')\n\t\n\tclusterMappings = {}\n\tfor line in file:\n\t\ttuple = line.strip().split('\\t')\n\t\tclusterMa... |
'''
Transform the metis output from:
4
5
4
...
to the following format:
1 cluster_4
2 cluster_5
3 cluster_4
...
'''
import sys
if __name__ == '__main__':
metisFile = open(sys.argv[1], 'r')
outputFile = open(sys.argv[1] + ".map", 'w')
counter = 1
for line in metisFile:
outputFile.write(str(counter) + '\tc... | [
[
8,
0,
0.3148,
0.5926,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6667,
0.037,
0,
0.66,
0.5,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.8704,
0.2963,
0,
0.66,
... | [
"'''\nTransform the metis output from:\n\n4\n5\n4\n...",
"import sys",
"if __name__ == '__main__':\n\tmetisFile = open(sys.argv[1], 'r')\n\toutputFile = open(sys.argv[1] + \".map\", 'w')\n\t\n\tcounter = 1\n\tfor line in metisFile:\n\t\toutputFile.write(str(counter) + '\\tcluster_' + line.strip() + \"\\n\")\n\t... |
#!/usr/bin/env python
from Baseclass import *
#Hex
#Code Bytes Mnemonic Operands
#01 2 AJMP addr11
#02 3 LJMP addr16
#20 3 JB bit, offset
#21 2 AJMP addr11
#30 3 JNB bit, offset
#40 2 JC offset
#41 2 AJMP addr11
#50 2 JNC offset
#60 2 JZ offset
#61 2 AJMP addr11
#70 2 JNZ offset
#73 1 JMP @A+DPTR
#80 2 SJMP offset
... | [
[
1,
0,
0.005,
0.0025,
0,
0.66,
0,
93,
0,
1,
0,
0,
93,
0,
0
],
[
2,
0,
0.1206,
0.0075,
0,
0.66,
0.0323,
250,
0,
1,
1,
0,
0,
0,
0
],
[
14,
1,
0.1206,
0.0025,
1,
0.85... | [
"from Baseclass import *",
"def OP_00(pcntr):\n\tpcntr=pcntr+1\n\treturn pcntr",
"\tpcntr=pcntr+1",
"\treturn pcntr",
"def OP_02(pcntr):\n\t\"\"\"LJMP 3 byte istruction with 2 byte of address\"\"\"\n\tpcntr=pcntr+1\n\taddr1=UC.ROM[pcntr]\n\tpcntr=pcntr+1\n\taddr2=UC.ROM[pcntr]\n\tadr=adr1+adr2\n\tpcntr=UC.h... |
#!/usr/bin/python
from Read_Code import *
from runner import *
from Write_files import *
from GUI import *
import sys
filename = sys.argv[1]
Read_Code(filename)
runner()
Write_files()
GUI(filename)
| [
[
1,
0,
0.1667,
0.0833,
0,
0.66,
0,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.25,
0.0833,
0,
0.66,
0.1111,
180,
0,
1,
0,
0,
180,
0,
0
],
[
1,
0,
0.3333,
0.0833,
0,
0.... | [
"from Read_Code import *",
"from runner import *",
"from Write_files import *",
"from GUI import *",
"import sys",
"filename = sys.argv[1]",
"Read_Code(filename)",
"runner()",
"Write_files()",
"GUI(filename)"
] |
#!/usr/bin/python
from Baseclass import *
from mov import *
from arithmetics import *
from jmp import *
from decode_logical import *
def runner():
pcntr_run = 0
while pcntr_run < UC.PC:
if UC.ROM[pcntr_run] == '00':
pcntr_run=OP_00(pcntr_run)
elif UC.ROM[pcntr_run] == '01':
pcntr_run=OP_01(pcntr_run)... | [
[
1,
0,
0.0037,
0.0018,
0,
0.66,
0,
93,
0,
1,
0,
0,
93,
0,
0
],
[
1,
0,
0.0055,
0.0018,
0,
0.66,
0.2,
202,
0,
1,
0,
0,
202,
0,
0
],
[
1,
0,
0.0073,
0.0018,
0,
0.66,... | [
"from Baseclass import *",
"from mov import *",
"from arithmetics import *",
"from jmp import *",
"from decode_logical import *",
"def runner():\n\tpcntr_run = 0\n\twhile pcntr_run < UC.PC:\n\t\t\t\n\t\tif UC.ROM[pcntr_run] == '00':\n\t\t\tpcntr_run=OP_00(pcntr_run)\n\t\telif UC.ROM[pcntr_run] == '01':\n\... |
#!/usr/bin/env python
from Baseclass import *
def setpsw(n):
#--- set PSW nth bits ---#
temp = UC.hex2dec(UC.bin2hex(UC.PSW[2:]))
if n == 0 and UC.PSW[9] == '0':
temp += 1
elif n == 1 and UC.PSW[8] == '0':
temp += 2
elif n == 2 and UC.PSW[7] == '0':
temp += 4
elif n == 3 and UC.PSW[6] == '0':
temp += 8
... | [
[
1,
0,
0.0357,
0.0179,
0,
0.66,
0,
93,
0,
1,
0,
0,
93,
0,
0
],
[
2,
0,
0.2411,
0.3571,
0,
0.66,
0.3333,
238,
0,
1,
0,
0,
0,
0,
5
],
[
14,
1,
0.1071,
0.0179,
1,
0.0... | [
"from Baseclass import *",
"def setpsw(n):\n\t#--- set PSW nth bits ---#\n\ttemp = UC.hex2dec(UC.bin2hex(UC.PSW[2:]))\n\tif n == 0 and UC.PSW[9] == '0':\n\t\ttemp += 1\n\telif n == 1 and UC.PSW[8] == '0':\n\t\ttemp += 2\n\telif n == 2 and UC.PSW[7] == '0':",
"\ttemp = UC.hex2dec(UC.bin2hex(UC.PSW[2:]))",
"\ti... |
from Tkinter import *
import string
import Tkinter
import Pmw
from Baseclass import *
from decoder import *
######## GUI FILE #############
def GUI(filename):
class MyApp:
def __init__(self, parent):
self.myParent = parent
self.myContainer1 = Frame(parent)
self.myContainer1.pack()
# top frame
... | [
[
1,
0,
0.0041,
0.0041,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
1,
0,
0.0083,
0.0041,
0,
0.66,
0.1667,
890,
0,
1,
0,
0,
890,
0,
0
],
[
1,
0,
0.0124,
0.0041,
0,
... | [
"from Tkinter import *",
"import string",
"import Tkinter",
"import Pmw",
"from Baseclass import *",
"from decoder import *",
"def GUI(filename):\n\tclass MyApp:\n\t\tdef __init__(self, parent):\n\t\t\n\t\t\tself.myParent = parent \n\t\t\tself.myContainer1 = Frame(parent) \n\t\t\tself.myContainer1.pack(... |
#!/usr/bin/python
class BaseClass8051:
"""The base class of 8051 which consists of all common data types and functions used for the simulator"""
ROM=[hex(0)]*4096
RAM=[hex(0)]*256
A=hex(0)
R0=hex(0)
R1=hex(0)
R2=hex(0)
R3=hex(0)
R4=hex(0)
R5=hex(0)
R6=hex(0)
R7=hex(0)
#B=RAM[240] i.e. F0
#SP = RAM[129] ... | [
[
3,
0,
0.5066,
0.9474,
0,
0.66,
0,
649,
0,
6,
0,
0,
0,
0,
30
],
[
8,
1,
0.0526,
0.0132,
1,
0.36,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.0658,
0.0132,
1,
0.36,
... | [
"class BaseClass8051:\n\t\"\"\"The base class of 8051 which consists of all common data types and functions used for the simulator\"\"\"\n\tROM=[hex(0)]*4096\n\tRAM=[hex(0)]*256\t\n\tA=hex(0)\n\tR0=hex(0)\n\tR1=hex(0)\n\tR2=hex(0)",
"\t\"\"\"The base class of 8051 which consists of all common data types and funct... |
#!/usr/bin/python
from decoder import *
from Baseclass import *
def Read_Code(filename):
f=open(filename)
asm_code=f.read().strip().upper()
print asm_code
asm_code_list=asm_code
#print asm_code_list
asm_code_list=asm_code_list.splitlines()
print asm_code_list
f.close()
opcodes=[]
# count=0
# for n in asm... | [
[
1,
0,
0.0513,
0.0256,
0,
0.66,
0,
404,
0,
1,
0,
0,
404,
0,
0
],
[
1,
0,
0.0769,
0.0256,
0,
0.66,
0.5,
93,
0,
1,
0,
0,
93,
0,
0
],
[
2,
0,
0.5641,
0.8974,
0,
0.66,... | [
"from decoder import *",
"from Baseclass import *",
"def Read_Code(filename):\n\tf=open(filename)\n\tasm_code=f.read().strip().upper()\n\tprint(asm_code)\n\tasm_code_list=asm_code\n\t#print asm_code_list\n\tasm_code_list=asm_code_list.splitlines()\n\tprint(asm_code_list)",
"\tf=open(filename)",
"\tasm_code=... |
#!/usr/bin/python
from Baseclass import *
####################### AND OPerations #############################
## ANL(AND Logical)
# ANL data addr,A : 52 Not done
# ANL data addr,#data : 53 Not done
# ANL A,#data : 54 Not done
# ANL A,data addr: 55 Not done
# ANL A,@R0: 56 Not done
# ANL A,@R1: 57 Not done
# ANL ... | [
[
1,
0,
0.0038,
0.0019,
0,
0.66,
0,
93,
0,
1,
0,
0,
93,
0,
0
],
[
2,
0,
0.0904,
0.0169,
0,
0.66,
0.0294,
870,
0,
1,
1,
0,
0,
0,
3
],
[
8,
1,
0.0847,
0.0019,
1,
0.65... | [
"from Baseclass import *",
"def OP_54(pcntr):\n\t\"\"\" ANL A,#data \"\"\" \n\tpcntr=pcntr+1\n\tUC.A=UC.hex2dec(UC.A) & UC.hex2dec(UC.ROM[pcntr])\n\tUC.A=UC.dec2hex(UC.A)\n\tpcntr=pcntr+1\n\t#length=2\n\t#cycles=1",
"\t\"\"\" ANL A,#data \"\"\"",
"\tpcntr=pcntr+1",
"\tUC.A=UC.hex2dec(UC.A) & UC.hex2dec(UC.R... |
#!/usr/bin/env python
from Baseclass import *
from psw import *
def addacc(lsb,msb):
if lsb[0] != '0':
setpsw(6)
msb = UC.dec2hex(int(UC.hex2dec(msb)+1))
if msb[0] != '0':
setpsw(7)
UC.A = msb[1]+lsb[1]
else:
UC.A = msb[1]+lsb[1]
else:
if msb[0] != '0':
setpsw(7)
UC.A = msb[1]+lsb[1]
else:... | [
[
1,
0,
0.0035,
0.0018,
0,
0.66,
0,
93,
0,
1,
0,
0,
93,
0,
0
],
[
1,
0,
0.0053,
0.0018,
0,
0.66,
0.0154,
480,
0,
1,
0,
0,
480,
0,
0
],
[
2,
0,
0.0211,
0.0264,
0,
0.... | [
"from Baseclass import *",
"from psw import *",
"def addacc(lsb,msb):\n\tif lsb[0] != '0':\n\t\tsetpsw(6)\n\t\tmsb = UC.dec2hex(int(UC.hex2dec(msb)+1))\n\t\tif msb[0] != '0':\n\t\t\tsetpsw(7)\n\t\t\tUC.A = msb[1]+lsb[1]\n\t\telse:",
"\tif lsb[0] != '0':\n\t\tsetpsw(6)\n\t\tmsb = UC.dec2hex(int(UC.hex2dec(msb)... |
from Baseclass import *
from decoder import *
####--- This file is used to file writing operation for GUI purpose ---#####
def Write_files():
f=open('register.txt','w')
f.write('Accumulator A \t = \t')
f.write(UC.A)
f.write('\nRegisters')
f.write('\nB \t = \t')
f.write(UC.RAM[UC.hex2dec('F0')])
f.write('\nR0 \... | [
[
1,
0,
0.0145,
0.0145,
0,
0.66,
0,
93,
0,
1,
0,
0,
93,
0,
0
],
[
1,
0,
0.029,
0.0145,
0,
0.66,
0.5,
404,
0,
1,
0,
0,
404,
0,
0
],
[
2,
0,
0.5362,
0.942,
0,
0.66,
... | [
"from Baseclass import *",
"from decoder import *",
"def Write_files():\n\tf=open('register.txt','w')\n\tf.write('Accumulator A \\t = \\t')\n\tf.write(UC.A)\n\tf.write('\\nRegisters')\t\n\tf.write('\\nB \\t = \\t')\n\tf.write(UC.RAM[UC.hex2dec('F0')])\n\tf.write('\\nR0 \\t = \\t')",
"\tf=open('register.txt','... |
#!/usr/bin/python
from Baseclass import *
def OP_74(pcntr):
""" MOV A, #data"""
pcntr=pcntr+1
UC.A=UC.ROM[pcntr]
pcntr=pcntr+1
return(pcntr)
def OP_75(pcntr):
""" MOV dataaddr,#data"""
pcntr=pcntr+1
temp=UC.hex2dec(UC.ROM[pcntr])
pcntr=pcntr+1
UC.RAM[temp]=UC.ROM[pcntr]
pcntr=pcntr+1
return pcntr
def OP_... | [
[
1,
0,
0.004,
0.002,
0,
0.66,
0,
93,
0,
1,
0,
0,
93,
0,
0
],
[
2,
0,
0.013,
0.012,
0,
0.66,
0.0147,
159,
0,
1,
1,
0,
0,
0,
0
],
[
8,
1,
0.01,
0.002,
1,
0.69,
0... | [
"from Baseclass import *",
"def OP_74(pcntr):\n\t\"\"\" MOV A, #data\"\"\"\n\tpcntr=pcntr+1\n\tUC.A=UC.ROM[pcntr]\n\tpcntr=pcntr+1\n\treturn(pcntr)",
"\t\"\"\" MOV A, #data\"\"\"",
"\tpcntr=pcntr+1",
"\tUC.A=UC.ROM[pcntr]",
"\tpcntr=pcntr+1",
"\treturn(pcntr)",
"def OP_75(pcntr):\n\t\"\"\" MOV dataadd... |
import os, sys
from setuptools import setup, Extension
if sys.platform == 'darwin':
include_dirs = ['/Library/Frameworks/OneRing.framework/Headers/']
library_dirs = []
libraries = []
extra_link_args = ['-framework', 'OneRing']
else:
include_dirs = [os.path.join('..', '..', 'include')]
library_d... | [
[
1,
0,
0.0294,
0.0294,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0588,
0.0294,
0,
0.66,
0.1667,
182,
0,
2,
0,
0,
182,
0,
0
],
[
4,
0,
0.2647,
0.3235,
0,
... | [
"import os, sys",
"from setuptools import setup, Extension",
"if sys.platform == 'darwin':\n include_dirs = ['/Library/Frameworks/OneRing.framework/Headers/']\n library_dirs = []\n libraries = []\n extra_link_args = ['-framework', 'OneRing']\nelse:\n include_dirs = [os.path.join('..', '..', 'incl... |
#!/usr/bin/env python
# encoding: UTF-8
import sys
import logging
try:
import json
except ImportError:
import simplejson as json
import onering
logging.basicConfig(level=logging.DEBUG)
def app(environ, start_response):
start_response('200 OK', [])
path = environ['PATH_INFO']
if path == '/init':
... | [
[
1,
0,
0.0976,
0.0244,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.122,
0.0244,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
7,
0,
0.1829,
0.0976,
0,
0... | [
"import sys",
"import logging",
"try:\n import json\nexcept ImportError:\n import simplejson as json",
" import json",
" import simplejson as json",
"import onering",
"logging.basicConfig(level=logging.DEBUG)",
"def app(environ, start_response):\n start_response('200 OK', [])\n path ... |
import logging
from cStringIO import StringIO
try:
import json
except ImportError:
import simplejson as json
import _onering
__all__ = ['register_wsgi_app', 'loop', 'publish']
logger = logging.getLogger('onering')
def register_wsgi_app(appname, app):
def callback(method, url, body=None):
respons... | [
[
1,
0,
0.0208,
0.0208,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0417,
0.0208,
0,
0.66,
0.125,
764,
0,
1,
0,
0,
764,
0,
0
],
[
7,
0,
0.0938,
0.0833,
0,
0... | [
"import logging",
"from cStringIO import StringIO",
"try:\n import json\nexcept ImportError:\n import simplejson as json",
" import json",
" import simplejson as json",
"import _onering",
"__all__ = ['register_wsgi_app', 'loop', 'publish']",
"logger = logging.getLogger('onering')",
"def ... |
from distutils.core import setup
from glob import glob
import sys, os
from demo import __version__ as version
def gen_data_files(topdir):
for dirpath, dirnames, filenames in os.walk(topdir):
filenames = [x for x in filenames if not x.startswith('.')]
yield dirpath, [os.path.join(dirpath, fn) for fn... | [
[
1,
0,
0.0172,
0.0172,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.0345,
0.0172,
0,
0.66,
0.0909,
958,
0,
1,
0,
0,
958,
0,
0
],
[
1,
0,
0.0517,
0.0172,
0,
... | [
"from distutils.core import setup",
"from glob import glob",
"import sys, os",
"from demo import __version__ as version",
"def gen_data_files(topdir):\n for dirpath, dirnames, filenames in os.walk(topdir):\n filenames = [x for x in filenames if not x.startswith('.')]\n yield dirpath, [os.pa... |
#!/usr/bin/env python
# encoding: UTF-8
__author__ = "Qiangning Hong <hongqn@gmail.com>"
__version__ = "$Revision$"
__date__ = "$Date$"
import sys, os
import logging
import commands
import re
import shutil
from subprocess import check_call
logger = logging.getLogger()
def get_qt_dir():
onering = '/Library/Frame... | [
[
14,
0,
0.0367,
0.0092,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0459,
0.0092,
0,
0.66,
0.0588,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.055,
0.0092,
0,
0.... | [
"__author__ = \"Qiangning Hong <hongqn@gmail.com>\"",
"__version__ = \"$Revision$\"",
"__date__ = \"$Date$\"",
"import sys, os",
"import logging",
"import commands",
"import re",
"import shutil",
"from subprocess import check_call",
"logger = logging.getLogger()",
"def get_qt_dir():\n onering... |
#!/usr/bin/env python
#coding: utf-8
#
# scdd.py daemon process
#
# author: observer
# email: jingchaohu@gmail.com
# blog: http://obmem.com
# last edit @ 2009.12.19
import os,sys,time
import re
from daemon import Daemon
import sqlite3
import fetchvc
from download import httpfetch
from Queue import Queue
from threading ... | [
[
1,
0,
0.0794,
0.0079,
0,
0.66,
0,
688,
0,
3,
0,
0,
688,
0,
0
],
[
1,
0,
0.0873,
0.0079,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0952,
0.0079,
0,
... | [
"import os,sys,time",
"import re",
"from daemon import Daemon",
"import sqlite3",
"import fetchvc",
"from download import httpfetch",
"from Queue import Queue",
"from threading import Thread",
"class MyDaemon(Daemon):\n\tdef __init__(self,path,pid):\n\t\tself.path = path\n\t\tself.q = Queue()\n\t\tD... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# download.py: download with report
#
# author: observer
# email: jingchaohu@gmail.com
# blog: http://obmem.com
# last edit @ 2009.12.16
import os,sys
import urllib2
from time import time,sleep
path = os.path.dirname(os.path.realpath(sys.argv[0]))
#proxies = {'http':'ht... | [
[
1,
0,
0.1124,
0.0112,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1236,
0.0112,
0,
0.66,
0.1667,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.1348,
0.0112,
0,
... | [
"import os,sys",
"import urllib2",
"from time import time,sleep",
"path = os.path.dirname(os.path.realpath(sys.argv[0]))",
"def report(blocknum, bs, size, t):\n if t == 0:\n t = 1\n if size == -1:\n print('%10s' % (str(blocknum*bs)) + ' downloaded | Speed =' + '%5.2f' % (bs/t/1024) + 'KB... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# code.py: based on web.py
#
# author: observer
# email: jingchaohu@gmail.com
# blog: http://obmem.com
# last edit @ 2009.12.16
import web
import sqlite3
web.config.debug = False
db = web.database(dbn='sqlite', db='verycd.sqlite3.db')
urls = (
'/', 'index',
)
rende... | [
[
1,
0,
0.1351,
0.0135,
0,
0.66,
0,
183,
0,
1,
0,
0,
183,
0,
0
],
[
1,
0,
0.1486,
0.0135,
0,
0.66,
0.125,
790,
0,
1,
0,
0,
790,
0,
0
],
[
14,
0,
0.1757,
0.0135,
0,
... | [
"import web",
"import sqlite3",
"web.config.debug = False",
"db = web.database(dbn='sqlite', db='verycd.sqlite3.db')",
"urls = (\n\t'/', 'index', \n)",
"render = web.template.render('templates/')",
"app = web.application(urls, globals())",
"class index:\n\tdef GET(self):\n\t\ti = web.input(id=None,pag... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')
from UserDict import IterableUserDict
__all__ = ['HTTPHeaders']
class HTTPHeaders(IterableUserDict):
def __setitem__(self, key, item):
self.data[key.title()] = item
def add(self, key, item):
k... | [
[
14,
0,
0.0328,
0.0164,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
1,
0,
0.0656,
0.0164,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
14,
0,
0.0984,
0.0164,
0,
... | [
"__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')",
"from UserDict import IterableUserDict",
"__all__ = ['HTTPHeaders']",
"class HTTPHeaders(IterableUserDict):\n\n def __setitem__(self, key, item):\n self.data[key.title()] = item\n\n def add(self, key, item):\n key = key.title(... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = '%s & %s' % ('d3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64'),
'YnJvbnplMW1hbkBnbWFpbC5jb20='.decode('base64'))
import hashlib, itertools
__all__ = ['Crypto']
class XOR:
'''XOR with pure Python in case no PyCrypto'''
def __init__(self, key):
... | [
[
14,
0,
0.0192,
0.0154,
0,
0.66,
0,
777,
4,
0,
0,
0,
0,
0,
2
],
[
1,
0,
0.0385,
0.0077,
0,
0.66,
0.1667,
154,
0,
2,
0,
0,
154,
0,
0
],
[
14,
0,
0.0538,
0.0077,
0,
... | [
"__author__ = '%s & %s' % ('d3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64'),\n 'YnJvbnplMW1hbkBnbWFpbC5jb20='.decode('base64'))",
"import hashlib, itertools",
"__all__ = ['Crypto']",
"class XOR:\n '''XOR with pure Python in case no PyCrypto'''\n def __init__(self, key):\n self.key = ke... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')
__version__ = '0.0.2'
import gaeproxy
class MainHandler(gaeproxy.MainHandler):
_cachename = 'wp_cache2'
def dump_data(self, dic):
return '&'.join('%s=%s' % (k,str(v).encode('hex')) for k,v in dic.iteritems())
... | [
[
14,
0,
0.0909,
0.0455,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.1364,
0.0455,
0,
0.66,
0.2,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2273,
0.0455,
0,
0.... | [
"__author__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')",
"__version__ = '0.0.2'",
"import gaeproxy",
"class MainHandler(gaeproxy.MainHandler):\n _cachename = 'wp_cache2'\n\n def dump_data(self, dic):\n return '&'.join('%s=%s' % (k,str(v).encode('hex')) for k,v in dic.iteritems())\n\n def load_d... |
__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')
__version__ = '0.4.2'
import gaeproxy
from gaeproxy import struct, zlib, logging, memcache
class MainHandler(gaeproxy.MainHandler):
_cfg = gaeproxy._init_config(gaeproxy.crypto.Crypto2)
_unquote_map = {'0':'\x10', '1':'=', '2':'&'}
def _quote(s... | [
[
14,
0,
0.0114,
0.0114,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.0227,
0.0114,
0,
0.66,
0.1667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0455,
0.0114,
0,
... | [
"__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')",
"__version__ = '0.4.2'",
"import gaeproxy",
"from gaeproxy import struct, zlib, logging, memcache",
"class MainHandler(gaeproxy.MainHandler):\n _cfg = gaeproxy._init_config(gaeproxy.crypto.Crypto2)\n\n _unquote_map = {'0':'\\x10', '1':'='... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')
__version__ = '0.0.1'
import re
from util import urlinfo, urlfetch
def _sumRule(keyword, hash, share):
k = map(len, keyword)
hk = map(len, hash)
hv = [sum([len(v) for v in t.itervalues()]) for t in hash]
... | [
[
14,
0,
0.0068,
0.0034,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.0101,
0.0034,
0,
0.66,
0.0667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0169,
0.0034,
0,
... | [
"__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')",
"__version__ = '0.0.1'",
"import re",
"from util import urlinfo, urlfetch",
"def _sumRule(keyword, hash, share):\n k = map(len, keyword)\n hk = map(len, hash)\n hv = [sum([len(v) for v in t.itervalues()]) for t in hash]\n s = map(le... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')
__version__ = '0.0.1'
import forold
class Handler(forold.Handler):
crypto = forold._crypto.Crypto('XOR--0'); key = ''
def dump_data(self, dic):
return '&'.join('%s=%s' % (k, str(v).encode('hex')) for k, v in di... | [
[
14,
0,
0.0645,
0.0323,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.0968,
0.0323,
0,
0.66,
0.1667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1613,
0.0323,
0,
... | [
"__author__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')",
"__version__ = '0.0.1'",
"import forold",
"class Handler(forold.Handler):\n crypto = forold._crypto.Crypto('XOR--0'); key = ''\n\n def dump_data(self, dic):\n return '&'.join('%s=%s' % (k, str(v).encode('hex')) for k, v in dic.iteritems())\n... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')
__patcher__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')
__version__ = '0.0.4'
from util import proxylib
class Handler:
def __call__(self, host):
newhost = proxylib.map_hosts(host)
return newhost!=host
... | [
[
14,
0,
0.0526,
0.0263,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.0789,
0.0263,
0,
0.66,
0.1429,
875,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.1053,
0.0263,
0,... | [
"__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')",
"__patcher__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')",
"__version__ = '0.0.4'",
"from util import proxylib",
"class Handler:\n def __call__(self, host):\n newhost = proxylib.map_hosts(host)\n return newhost!=host\n test = ... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')
__version__ = '0.0.2'
import gaeproxy
class Handler(gaeproxy.Handler):
def dump_data(self, dic):
return '&'.join('%s=%s' % (k,str(v).encode('hex')) for k,v in dic.iteritems())
def load_data(self, qs):
r... | [
[
14,
0,
0.0714,
0.0357,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
14,
0,
0.1071,
0.0357,
0,
0.66,
0.1667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1786,
0.0357,
0,
... | [
"__author__ = 'ZHRtYWppYUAxNjMuY29t'.decode('base64')",
"__version__ = '0.0.2'",
"import gaeproxy",
"class Handler(gaeproxy.Handler):\n def dump_data(self, dic):\n return '&'.join('%s=%s' % (k,str(v).encode('hex')) for k,v in dic.iteritems())\n\n def load_data(self, qs):\n return dict((k,v... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')
from UserDict import IterableUserDict
__all__ = ['HTTPHeaders']
class HTTPHeaders(IterableUserDict):
def __setitem__(self, key, item):
self.data[key.title()] = item
def add(self, key, item):
k... | [
[
14,
0,
0.0328,
0.0164,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
1,
0,
0.0656,
0.0164,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
14,
0,
0.0984,
0.0164,
0,
... | [
"__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')",
"from UserDict import IterableUserDict",
"__all__ = ['HTTPHeaders']",
"class HTTPHeaders(IterableUserDict):\n\n def __setitem__(self, key, item):\n self.data[key.title()] = item\n\n def add(self, key, item):\n key = key.title(... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = '%s & %s' % ('d3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64'),
'YnJvbnplMW1hbkBnbWFpbC5jb20='.decode('base64'))
import hashlib, itertools
__all__ = ['Crypto']
class XOR:
'''XOR with pure Python in case no PyCrypto'''
def __init__(self, key):
... | [
[
14,
0,
0.0192,
0.0154,
0,
0.66,
0,
777,
4,
0,
0,
0,
0,
0,
2
],
[
1,
0,
0.0385,
0.0077,
0,
0.66,
0.1667,
154,
0,
2,
0,
0,
154,
0,
0
],
[
14,
0,
0.0538,
0.0077,
0,
... | [
"__author__ = '%s & %s' % ('d3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64'),\n 'YnJvbnplMW1hbkBnbWFpbC5jb20='.decode('base64'))",
"import hashlib, itertools",
"__all__ = ['Crypto']",
"class XOR:\n '''XOR with pure Python in case no PyCrypto'''\n def __init__(self, key):\n self.key = ke... |
# Copyright (C) 2010-2011 | GNU GPLv3
__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')
import os
import urlparse, urllib
__all__ = ['url2path', 'path2url', 'parse_netloc', 'unparse_netloc',
'host2ip', 'URL']
default_ports = {'http':80, 'https':443, 'ftp':21}
def url2path(path):
"""url2pat... | [
[
14,
0,
0.0132,
0.0066,
0,
0.66,
0,
777,
3,
1,
0,
0,
528,
10,
1
],
[
1,
0,
0.0265,
0.0066,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0331,
0.0066,
0,
0... | [
"__author__ = 'd3d3LmVodXN0QGdtYWlsLmNvbQ=='.decode('base64')",
"import os",
"import urlparse, urllib",
"__all__ = ['url2path', 'path2url', 'parse_netloc', 'unparse_netloc',\n 'host2ip', 'URL']",
"default_ports = {'http':80, 'https':443, 'ftp':21}",
"def url2path(path):\n \"\"\"url2path('/a%2... |
#!/usr/bin/env python
import sys, os
dir = os.path.abspath(os.path.dirname(sys.argv[0]))
sys.path.append(os.path.join(dir, 'src.zip'))
del sys, os, dir
import ProxyServer
ProxyServer.main()
| [
[
1,
0,
0.375,
0.125,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
0,
0.5,
0.125,
0,
0.66,
0.25,
152,
3,
1,
0,
0,
142,
10,
2
],
[
8,
0,
0.625,
0.125,
0,
0.66,
... | [
"import sys, os",
"dir = os.path.abspath(os.path.dirname(sys.argv[0]))",
"sys.path.append(os.path.join(dir, 'src.zip'))",
"import ProxyServer",
"ProxyServer.main()"
] |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | [
[
1,
0,
0.3514,
0.0135,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3649,
0.0135,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.3784,
0.0135,
0,
... | [
"import os",
"import re",
"import tempfile",
"import shutil",
"ignore_pattern = re.compile('^(.svn|target|bin|classes)')",
"java_pattern = re.compile('^.*\\.java')",
"annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')",
"def process_dir(dir):\n files = os.listdir(dir)\n for... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
'''
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.72,
... | [
"'''\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 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... |
'''
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... |
#!/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 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.