code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
import cv2.cv as cv import tesseract import sys api = tesseract.TessBaseAPI() api.Init(".","eng",tesseract.OEM_DEFAULT) api.SetPageSegMode(tesseract.PSM_AUTO) image=cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_GRAYSCALE) tesseract.SetCvImage(image,api) text=api.GetUTF8Text() conf=api.MeanTextConf() print "scanned text:...
[ [ 1, 0, 0.0769, 0.0769, 0, 0.66, 0, 369, 0, 1, 0, 0, 369, 0, 0 ], [ 1, 0, 0.1538, 0.0769, 0, 0.66, 0.1, 332, 0, 1, 0, 0, 332, 0, 0 ], [ 1, 0, 0.2308, 0.0769, 0, 0.6...
[ "import cv2.cv as cv", "import tesseract", "import sys", "api = tesseract.TessBaseAPI()", "api.Init(\".\",\"eng\",tesseract.OEM_DEFAULT)", "api.SetPageSegMode(tesseract.PSM_AUTO)", "image=cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_GRAYSCALE)", "tesseract.SetCvImage(image,api)", "text=api.GetUTF8Text...
#!/usr/bin/env python # -*- encoding:utf8 -*- # protoc-gen-erl # Google's Protocol Buffers project, ported to lua. # https://code.google.com/p/protoc-gen-lua/ # # Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) netsnail@gmail.com # All rights reserved. # # Use, modification and distribution are subject to the "New BSD License" #...
[ [ 1, 0, 0.0289, 0.0022, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0311, 0.0022, 0, 0.66, 0.0417, 79, 0, 1, 0, 0, 79, 0, 0 ], [ 1, 0, 0.0333, 0.0022, 0, 0....
[ "import sys", "import os.path as path", "from cStringIO import StringIO", "import plugin_pb2", "import google.protobuf.descriptor_pb2 as descriptor_pb2", "_packages = {}", "_files = {}", "_message = {}", "FDP = plugin_pb2.descriptor_pb2.FieldDescriptorProto", "if sys.platform == \"win32\":\n im...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Zdenko Podobný # Author: Zdenko Podobný # # 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/LIC...
[ [ 1, 0, 0.25, 0.25, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.5, 0.25, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.75, 0.25, 0, 0.66, 1, ...
[ "import os", "import sys", "import ctypes" ]
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
[ [ 1, 0, 0.1111, 0.037, 0, 0.66, 0, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1481, 0.037, 0, 0.66, 0.1, 838, 0, 1, 0, 0, 838, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.66, ...
[ "import subprocess", "import MySQLdb", "import os", "import re", "import sys", "import time", "import statvfs", "ip=\"114.80.213.44\"", "ping = subprocess.Popen([\"ping\", \"-c\", \"2\", \"-w\", \"500\", ip], shell=False)", "ping.wait()", "if ping.returncode != 0:\n #print ping.returncode, \"...
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
[ [ 1, 0, 0.1111, 0.037, 0, 0.66, 0, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1481, 0.037, 0, 0.66, 0.1, 838, 0, 1, 0, 0, 838, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.66, ...
[ "import subprocess", "import MySQLdb", "import os", "import re", "import sys", "import time", "import statvfs", "ip=\"114.80.213.44\"", "ping = subprocess.Popen([\"ping\", \"-c\", \"2\", \"-w\", \"500\", ip], shell=False)", "ping.wait()", "if ping.returncode != 0:\n #print ping.returncode, \"...
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
[ [ 1, 0, 0.1111, 0.037, 0, 0.66, 0, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1481, 0.037, 0, 0.66, 0.1, 838, 0, 1, 0, 0, 838, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.66, ...
[ "import subprocess", "import MySQLdb", "import os", "import re", "import sys", "import time", "import statvfs", "ip=\"114.80.213.44\"", "ping = subprocess.Popen([\"ping\", \"-c\", \"2\", \"-w\", \"500\", ip], shell=False)", "ping.wait()", "if ping.returncode != 0:\n #print ping.returncode, \"...
#!/usr/bin/python -u #-*- coding: UTF-8 -*- import subprocess import MySQLdb import os import re import sys import time import statvfs ip="114.80.213.44" ping = subprocess.Popen(["ping", "-c", "2", "-w", "500", ip], shell=False) ping.wait() if ping.returncode != 0: #print ping.returncode, "ERROR: failed to ping ho...
[ [ 1, 0, 0.1111, 0.037, 0, 0.66, 0, 394, 0, 1, 0, 0, 394, 0, 0 ], [ 1, 0, 0.1481, 0.037, 0, 0.66, 0.1, 838, 0, 1, 0, 0, 838, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.66, ...
[ "import subprocess", "import MySQLdb", "import os", "import re", "import sys", "import time", "import statvfs", "ip=\"114.80.213.44\"", "ping = subprocess.Popen([\"ping\", \"-c\", \"2\", \"-w\", \"500\", ip], shell=False)", "ping.wait()", "if ping.returncode != 0:\n #print ping.returncode, \"...
#!/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\...
#!/usr/bin/python # -*- coding: utf-8 -*- # Dieses Script kontrolliert eine Lösung. Es wird ausgegeben, wie viele Farben # verwendet wurden und wie groß das Dreieck ist. # Funktioniert nur mit korrekter Eingabedatei (keine Leerzeichen zum trennen der # Farben, neue Zeilen für eine neue Ebene des n-Traumrechtecks) i...
[ [ 1, 0, 0.0957, 0.0106, 0, 0.66, 0, 739, 0, 2, 0, 0, 739, 0, 0 ], [ 1, 0, 0.1064, 0.0106, 0, 0.66, 0.0435, 323, 0, 1, 0, 0, 323, 0, 0 ], [ 1, 0, 0.1277, 0.0106, 0, ...
[ "import copy, os", "from optparse import OptionParser", "import psyco", "psyco.full()", "parser = OptionParser()", "parser.add_option(\"-i\", \"--input\", dest=\"solutionfile\", \n default= os.getcwd() + '/Beispiele/solution-4-errors.txt',\n help=\"Textdatei mit der Loesung\"...
#!/usr/bin/python # -*- coding: utf-8 -*- # Dieses Script kontrolliert eine Lösung. Es wird ausgegeben, wie viele Farben # verwendet wurden und wie groß das Dreieck ist. # Funktioniert nur mit korrekter Eingabedatei (keine Leerzeichen zum trennen der # Farben, neue Zeilen für eine neue Ebene des n-Traumrechtecks) i...
[ [ 1, 0, 0.0957, 0.0106, 0, 0.66, 0, 739, 0, 2, 0, 0, 739, 0, 0 ], [ 1, 0, 0.1064, 0.0106, 0, 0.66, 0.0435, 323, 0, 1, 0, 0, 323, 0, 0 ], [ 1, 0, 0.1277, 0.0106, 0, ...
[ "import copy, os", "from optparse import OptionParser", "import psyco", "psyco.full()", "parser = OptionParser()", "parser.add_option(\"-i\", \"--input\", dest=\"solutionfile\", \n default= os.getcwd() + '/Beispiele/solution-4-errors.txt',\n help=\"Textdatei mit der Loesung\"...
''' 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.61, ...
[ "'''\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...
''' Created on 18 avr. 12 @author: peterd ''' class CalculationError: pass def get_1d_cutting_plan(stock_piece_length, custom_pieces, cut_thickness): num_custom_pieces = len(custom_pieces) cutting_schema = {} i = 0 while i < num_custom_pieces: num_elem = 1 prev_custom_packs = [] wh...
[ [ 8, 0, 0.0194, 0.0323, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.0484, 0.0129, 0, 0.66, 0.5, 246, 0, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.5097, 0.8839, 0, 0.66, ...
[ "'''\nCreated on 18 avr. 12\n\n@author: peterd\n'''", "class CalculationError:\n\tpass", "def get_1d_cutting_plan(stock_piece_length, custom_pieces, cut_thickness):\n\tnum_custom_pieces = len(custom_pieces)\t\n\tcutting_schema = {}\t\n\ti = 0\n\t\n\twhile i < num_custom_pieces:\n\t\tnum_elem = 1\t\n\t\tprev_cus...
#!/usr/bin/env python from django.core.management import execute_manager import imp try: imp.find_module('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 custo...
[ [ 1, 0, 0.1429, 0.0714, 0, 0.66, 0, 879, 0, 1, 0, 0, 879, 0, 0 ], [ 1, 0, 0.2143, 0.0714, 0, 0.66, 0.25, 201, 0, 1, 0, 0, 201, 0, 0 ], [ 7, 0, 0.4643, 0.4286, 0, 0....
[ "from django.core.management import execute_manager", "import imp", "try:\n imp.find_module('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 thi...
from django.conf.urls.defaults import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', url(r'^solver$', '1d-cutter.views.cutting_plan_solver'), url(r'^1d-cutter/solver', '1d-cutter.views.cutting_plan_so...
[ [ 1, 0, 0.0833, 0.0833, 0, 0.66, 0, 341, 0, 3, 0, 0, 341, 0, 0 ], [ 14, 0, 0.7917, 0.5, 0, 0.66, 1, 990, 3, 5, 0, 0, 75, 10, 5 ] ]
[ "from django.conf.urls.defaults import patterns, include, url", "urlpatterns = patterns('',\n\turl(r'^solver$', '1d-cutter.views.cutting_plan_solver'),\n url(r'^1d-cutter/solver', '1d-cutter.views.cutting_plan_solver'), \n url(r'^1d-cutter$', '1d-cutter.views.init'),\n url(r'^1d-cutter/', '1d-cutt...
# Django settings for app project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
[ [ 14, 0, 0.0204, 0.0068, 0, 0.66, 0, 309, 1, 0, 0, 0, 0, 4, 0 ], [ 14, 0, 0.0272, 0.0068, 0, 0.66, 0.0435, 7, 2, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0476, 0.0204, 0, 0.6...
[ "DEBUG = True", "TEMPLATE_DEBUG = DEBUG", "ADMINS = (\n # ('Your Name', 'your_email@example.com'),\n)", "MANAGERS = ADMINS", "DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.\n 'NAME': '', ...
from django.views.generic.simple import direct_to_template from solver import * def init(request): return direct_to_template(request, '1d-cutter/1d_cutting_plan_form.html', {}) def cutting_plan_solver(request): order_num = request.GET['order_num'] stock_type = request.GET['stock_type'] stock_length...
[ [ 1, 0, 0.0294, 0.0294, 0, 0.66, 0, 956, 0, 1, 0, 0, 956, 0, 0 ], [ 1, 0, 0.0882, 0.0294, 0, 0.66, 0.3333, 186, 0, 1, 0, 0, 186, 0, 0 ], [ 2, 0, 0.1618, 0.0588, 0, ...
[ "from django.views.generic.simple import direct_to_template", "from solver import *", "def init(request):\n\treturn direct_to_template(request, '1d-cutter/1d_cutting_plan_form.html', {})", "\treturn direct_to_template(request, '1d-cutter/1d_cutting_plan_form.html', {})", "def cutting_plan_solver(request):\n...
import time, urllib , sys, threading workers = [] pendingurls = [] def ex(line): if "http://" in line: #and (".pls" in line.lower() or ".m3u" in line.lower()): url = line.split("'")[1].replace("''", "") pendingurls.append(url) class Worker(threading.Thread): def run(self): ...
[ [ 1, 0, 0.0161, 0.0161, 0, 0.66, 0, 654, 0, 4, 0, 0, 654, 0, 0 ], [ 14, 0, 0.0484, 0.0161, 0, 0.66, 0.0667, 181, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.0645, 0.0161, 0, ...
[ "import time, urllib , sys, threading", "workers = []", "pendingurls = []", "def ex(line):\n if \"http://\" in line: #and (\".pls\" in line.lower() or \".m3u\" in line.lower()):\n url = line.split(\"'\")[1].replace(\"''\", \"\")\n pendingurls.append(url)", " if \"http://\" in line: #and ...
import struct, string, time, os pasw = 704 dst = [] def crypt(text): text = text.replace("http://", "") key = len(text) % 10 result = "" for i in xrange(len(text)): result += chr( ( ord(text[i]) ^ ( (pasw * (i+1)) + key ) ) % 256) return result def writeint8(num): data...
[ [ 1, 0, 0.0088, 0.0088, 0, 0.66, 0, 399, 0, 4, 0, 0, 399, 0, 0 ], [ 14, 0, 0.0265, 0.0088, 0, 0.66, 0.0417, 292, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0442, 0.0088, 0, ...
[ "import struct, string, time, os", "pasw = 704", "dst = []", "def crypt(text):\n text = text.replace(\"http://\", \"\")\n key = len(text) % 10\n result = \"\"\n for i in xrange(len(text)):\n result += chr( ( ord(text[i]) ^ ( (pasw * (i+1)) + key ) ) % 256)\n return result", " text =...
import struct, string, time, os pasw = 704 dst = [] def crypt(text): text = text.replace("http://", "") return text #key = len(text) % 10 #result = "" #for i in xrange(len(text)): # result += chr( ( ord(text[i]) ^ ( (pasw * (i+1)) + key ) ) % 256) #return result def wri...
[ [ 1, 0, 0.0077, 0.0077, 0, 0.66, 0, 399, 0, 4, 0, 0, 399, 0, 0 ], [ 14, 0, 0.0231, 0.0077, 0, 0.66, 0.0323, 292, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0385, 0.0077, 0, ...
[ "import struct, string, time, os", "pasw = 704", "dst = []", "def crypt(text):\n text = text.replace(\"http://\", \"\")\n return text", " text = text.replace(\"http://\", \"\")", " return text", "def writeint8(num):\n data = struct.pack(\"B\",num)\n dst.append(data)", " data = str...
extlist = [".bk1",".bk2",".$$$",".local",".a",".tmp",".drc",".o",".cfg",".ddp", ".stat",".pec2bac",".identcache",".dcu",".ppu",".depend",".layout",".win"] #put extensions to delete import sys, os, subprocess print "START THE CLEARING PROCESS" print "DELETING FILES WITH THE FOLLOWING EXT" print extlist i = ...
[ [ 14, 0, 0.0714, 0.0952, 0, 0.66, 0, 699, 0, 0, 0, 0, 0, 5, 0 ], [ 1, 0, 0.1905, 0.0476, 0, 0.66, 0.125, 509, 0, 3, 0, 0, 509, 0, 0 ], [ 8, 0, 0.2857, 0.0476, 0, 0....
[ "extlist = [\".bk1\",\".bk2\",\".$$$\",\".local\",\".a\",\".tmp\",\".drc\",\".o\",\".cfg\",\".ddp\",\n \".stat\",\".pec2bac\",\".identcache\",\".dcu\",\".ppu\",\".depend\",\".layout\",\".win\"] #put extensions to delete", "import sys, os, subprocess", "print(\"START THE CLEARING PROCESS\")", "print(...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: models.py Type: Class definition Last modified: 2010-05-24 22:27 Description: This file contains a class that would turn a dictionary containing user information as was returned by json request into a T163User...
[ [ 8, 0, 0.0241, 0.0331, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0422, 0.003, 0, 0.66, 0.0833, 970, 0, 1, 0, 0, 970, 0, 0 ], [ 3, 0, 0.1867, 0.2741, 0, 0.66,...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: models.py\nType: Class definition\nLast modified: 2010-05-24 22:27\n\nDescription:\nThis file contains a class that would turn a dictionary containing user", "from utils import parse_timestring", "class T163UserBase(object):\n \"...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: utils.py Type: Utility Last modified: 2010-07-18 14:06 Description: Utility functions for this project. """ import locale import os import urllib2 from datetime import datetime, timedelta ############## # E...
[ [ 8, 0, 0.0422, 0.0542, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0723, 0.006, 0, 0.66, 0.0714, 884, 0, 1, 0, 0, 884, 0, 0 ], [ 1, 0, 0.0783, 0.006, 0, 0.66, ...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: utils.py\nType: Utility\nLast modified: 2010-07-18 14:06\n\nDescription:\nUtility functions for this project.", "import locale", "import os", "import urllib2", "from datetime import datetime, timedelta", "class AuthenticationE...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: __init__.py Type: Module meta information holder Last modified: 2010-05-16 20:44 Description: """ __author__ = "xiaket" __version__ = "0.2b"
[ [ 8, 0, 0.5, 0.6154, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.9231, 0.0769, 0, 0.66, 0.5, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 1, 0.0769, 0, 0.66, 1, ...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: __init__.py\nType: Module meta information holder\nLast modified: 2010-05-16 20:44\n\nDescription:\n\"\"\"", "__author__ = \"xiaket\"", "__version__ = \"0.2b\"" ]
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: models.py Type: Class definition Last modified: 2010-05-24 22:27 Description: This file contains a class that would turn a dictionary containing user information as was returned by json request into a T163User...
[ [ 8, 0, 0.0241, 0.0331, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0422, 0.003, 0, 0.66, 0.0833, 970, 0, 1, 0, 0, 970, 0, 0 ], [ 3, 0, 0.1867, 0.2741, 0, 0.66,...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: models.py\nType: Class definition\nLast modified: 2010-05-24 22:27\n\nDescription:\nThis file contains a class that would turn a dictionary containing user", "from utils import parse_timestring", "class T163UserBase(object):\n \"...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: tests.py Type: Unit test module Last modified: 2010-05-21 16:51 Description: This file contains unit test cases for this project. """ import os import time import unittest from models import T163UserBase, Use...
[ [ 8, 0, 0.0119, 0.0153, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0203, 0.0017, 0, 0.66, 0.0556, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.022, 0.0017, 0, 0.66,...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: tests.py\nType: Unit test module\nLast modified: 2010-05-21 16:51\n\nDescription:\nThis file contains unit test cases for this project.", "import os", "import time", "import unittest", "from models import T163UserBase, User, Fol...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: utils.py Type: Utility Last modified: 2010-07-18 14:06 Description: Utility functions for this project. """ import locale import os import urllib2 from datetime import datetime, timedelta ############## # E...
[ [ 8, 0, 0.0422, 0.0542, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0723, 0.006, 0, 0.66, 0.0714, 884, 0, 1, 0, 0, 884, 0, 0 ], [ 1, 0, 0.0783, 0.006, 0, 0.66, ...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: utils.py\nType: Utility\nLast modified: 2010-07-18 14:06\n\nDescription:\nUtility functions for this project.", "import locale", "import os", "import urllib2", "from datetime import datetime, timedelta", "class AuthenticationE...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: tests.py Type: Unit test module Last modified: 2010-05-21 16:51 Description: This file contains unit test cases for this project. """ import os import time import unittest from models import T163UserBase, Use...
[ [ 8, 0, 0.0119, 0.0153, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0203, 0.0017, 0, 0.66, 0.0556, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.022, 0.0017, 0, 0.66,...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: tests.py\nType: Unit test module\nLast modified: 2010-05-21 16:51\n\nDescription:\nThis file contains unit test cases for this project.", "import os", "import time", "import unittest", "from models import T163UserBase, User, Fol...
#!/usr/bin/env python #coding=utf-8 """ Author: Xia Kai <xiaket@gmail.com> Filename: __init__.py Type: Module meta information holder Last modified: 2010-05-16 20:44 Description: """ __author__ = "xiaket" __version__ = "0.2b"
[ [ 8, 0, 0.5, 0.6154, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.9231, 0.0769, 0, 0.66, 0.5, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 1, 0.0769, 0, 0.66, 1, ...
[ "\"\"\"\nAuthor: Xia Kai <xiaket@gmail.com>\nFilename: __init__.py\nType: Module meta information holder\nLast modified: 2010-05-16 20:44\n\nDescription:\n\"\"\"", "__author__ = \"xiaket\"", "__version__ = \"0.2b\"" ]
import pygtk pygtk.require('2.0') import gtk class TreeViewColumnExample(object): # close the window and quit def delete_event(self, widget, event, data=None): gtk.main_quit() return False def __init__(self): # Create a new window self.window = gtk.Window(gtk.WINDOW_TOPLEV...
[ [ 1, 0, 0.013, 0.013, 0, 0.66, 0, 106, 0, 1, 0, 0, 106, 0, 0 ], [ 8, 0, 0.026, 0.013, 0, 0.66, 0.2, 66, 3, 1, 0, 0, 0, 0, 1 ], [ 1, 0, 0.039, 0.013, 0, 0.66, 0....
[ "import pygtk", "pygtk.require('2.0')", "import gtk", "class TreeViewColumnExample(object):\n\n # close the window and quit\n def delete_event(self, widget, event, data=None):\n gtk.main_quit()\n return False\n\n def __init__(self):", " def delete_event(self, widget, event, data=No...
# MySQL for Python import MySQLdb db = MySQLdb.connect ( host = 'localhost', user = 'root', passwd = '', db = 'db_1clic2learn' #bd = 'mysql' ) cursor = db.cursor() cursor.execute('SELECT * FROM db.PL_SQLINJECTION') result = cursor.fetchall() if result: for z in result: print z
[ [ 1, 0, 0.1579, 0.0526, 0, 0.66, 0, 838, 0, 1, 0, 0, 838, 0, 0 ], [ 14, 0, 0.4211, 0.3684, 0, 0.66, 0.2, 761, 3, 4, 0, 0, 242, 10, 1 ], [ 14, 0, 0.6842, 0.0526, 0, ...
[ "import MySQLdb", "db = MySQLdb.connect (\n host = 'localhost',\n user = 'root',\n passwd = '',\n db = 'db_1clic2learn'\n #bd = 'mysql'\n )", "cursor = db.cursor()", "cursor.execute('SELECT * FROM db.PL_SQLINJECTION')", "result = cursor.fetchall()", "if result:\n for z in result:\n ...
import sys import time, tkMessageBox import Controller try: import pygtk pygtk.require("2.0") except: pass try: import gtk import gtk.glade except: sys.exit(1) ######################################################################## class JanelaPrincipal: ...
[ [ 1, 0, 0.0038, 0.0038, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0075, 0.0038, 0, 0.66, 0.1667, 654, 0, 2, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0113, 0.0038, 0, ...
[ "import sys", "import time, tkMessageBox", "import Controller", "try:\n import pygtk\n pygtk.require(\"2.0\")\nexcept:\n pass", " import pygtk", " pygtk.require(\"2.0\")", "try:\n import gtk\n import gtk.glade\nexcept:\n sys.exit(1)", " im...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access ######################################################################## # CLASSE PLUGINSQL FILHO DE PLUGINS class PluginSQL (object): """ Responsavel por...
[ [ 1, 0, 0.0115, 0.0057, 0, 0.66, 0, 614, 0, 5, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0172, 0.0057, 0, 0.66, 0.3333, 857, 0, 4, 0, 0, 857, 0, 0 ], [ 1, 0, 0.023, 0.0057, 0, 0...
[ "import urllib,requests,urllib2,socket,mechanize", "from urlparse import urlsplit,urlparse,urlunparse,urljoin", "from Data import Data_Access", "class PluginSQL (object):\n \"\"\"\n Responsavel por montar e analisar ataques de Injecao de Comandos SQL\n \"\"\" \n #-------------------------------...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access ######################################################################## # CLASSE PLUGINSQL FILHO DE PLUGINS class PluginSQL (object): """ Responsavel por...
[ [ 1, 0, 0.0115, 0.0057, 0, 0.66, 0, 614, 0, 5, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0172, 0.0057, 0, 0.66, 0.3333, 857, 0, 4, 0, 0, 857, 0, 0 ], [ 1, 0, 0.023, 0.0057, 0, 0...
[ "import urllib,requests,urllib2,socket,mechanize", "from urlparse import urlsplit,urlparse,urlunparse,urljoin", "from Data import Data_Access", "class PluginSQL (object):\n \"\"\"\n Responsavel por montar e analisar ataques de Injecao de Comandos SQL\n \"\"\" \n #-------------------------------...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access from bs4 import BeautifulSoup ######################################################################## class PluginXSS (object): """ Responsavel por monta...
[ [ 1, 0, 0.0118, 0.0059, 0, 0.66, 0, 614, 0, 5, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0176, 0.0059, 0, 0.66, 0.25, 857, 0, 4, 0, 0, 857, 0, 0 ], [ 1, 0, 0.0235, 0.0059, 0, 0....
[ "import urllib,requests,urllib2,socket,mechanize", "from urlparse import urlsplit,urlparse,urlunparse,urljoin", "from Data import Data_Access", "from bs4 import BeautifulSoup", "class PluginXSS (object):\n \"\"\"\n Responsavel por montar e analisar ataques de Injecao de Codigos Script\n \"\"\" \...
import urllib from Business import PluginSQL from bs4 import BeautifulSoup from urlparse import urlparse # Estava pensando em colocar o Exploiter para fazer o ataque e a análise ######################################################################## class Exploiter(object): """""" #-------------------------...
[ [ 1, 0, 0.0083, 0.0083, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0165, 0.0083, 0, 0.66, 0.1429, 559, 0, 1, 0, 0, 559, 0, 0 ], [ 1, 0, 0.0248, 0.0083, 0, ...
[ "import urllib", "from Business import PluginSQL", "from bs4 import BeautifulSoup", "from urlparse import urlparse", "class Exploiter(object):\n \"\"\"\"\"\"\n\n #----------------------------------------------------------------------\n # Construtor recebe a URL alvo e o objeto Plugin dos ataques\n ...
from urlparse import urlparse from Business import Exploiter from Business import PluginSQL from Business import PluginXSS from bs4 import BeautifulSoup ######################################################################## class Controller (object): """""" #--------------------------------------------------...
[ [ 1, 0, 0.009, 0.009, 0, 0.66, 0, 857, 0, 1, 0, 0, 857, 0, 0 ], [ 1, 0, 0.018, 0.009, 0, 0.66, 0.2, 559, 0, 1, 0, 0, 559, 0, 0 ], [ 1, 0, 0.027, 0.009, 0, 0.66, ...
[ "from urlparse import urlparse", "from Business import Exploiter", "from Business import PluginSQL", "from Business import PluginXSS", "from bs4 import BeautifulSoup", "class Controller (object):\n \"\"\"\"\"\"\n #----------------------------------------------------------------------\n def __init...
#!/usr/bin/env python import urllib,requests,urllib2,socket,mechanize from urlparse import urlsplit,urlparse,urlunparse,urljoin from Data import Data_Access from bs4 import BeautifulSoup ######################################################################## class PluginXSS (object): """ Responsavel por monta...
[ [ 1, 0, 0.0118, 0.0059, 0, 0.66, 0, 614, 0, 5, 0, 0, 614, 0, 0 ], [ 1, 0, 0.0176, 0.0059, 0, 0.66, 0.25, 857, 0, 4, 0, 0, 857, 0, 0 ], [ 1, 0, 0.0235, 0.0059, 0, 0....
[ "import urllib,requests,urllib2,socket,mechanize", "from urlparse import urlsplit,urlparse,urlunparse,urljoin", "from Data import Data_Access", "from bs4 import BeautifulSoup", "class PluginXSS (object):\n \"\"\"\n Responsavel por montar e analisar ataques de Injecao de Codigos Script\n \"\"\" \...
import MySQLdb ######################################################################## class Data_Access (object): #---------------------------------------------------------------------- def __init__ (self, id_vulnerability, pl_attack): """ Construtor: Cria conexão com a Base de Dados ...
[ [ 1, 0, 0.0143, 0.0143, 0, 0.66, 0, 838, 0, 1, 0, 0, 838, 0, 0 ], [ 3, 0, 0.5214, 0.9429, 0, 0.66, 1, 671, 0, 4, 0, 0, 186, 0, 14 ], [ 2, 1, 0.2, 0.2429, 1, 0.78, ...
[ "import MySQLdb", "class Data_Access (object):\n #----------------------------------------------------------------------\n def __init__ (self, id_vulnerability, pl_attack):\n \"\"\"\n Construtor:\n Cria conexão com a Base de Dados\n \"\"\" \n try:\t# Ainda falta tra...
import MySQLdb ######################################################################## class Data_Access (object): """ Cria conexao com a Base de Dados """ dba = MySQLdb.connect (host = 'localhost', user = 'root', passwd = '', db = 'DB_1CLIC2LEARN') #---------------------------------------...
[ [ 1, 0, 0.0189, 0.0189, 0, 0.66, 0, 838, 0, 1, 0, 0, 838, 0, 0 ], [ 3, 0, 0.5377, 0.9057, 0, 0.66, 1, 671, 0, 4, 0, 0, 186, 0, 12 ], [ 8, 1, 0.1321, 0.0566, 1, 0.92...
[ "import MySQLdb", "class Data_Access (object):\n \"\"\"\n Cria conexao com a Base de Dados\n \"\"\" \n dba = MySQLdb.connect (host = 'localhost', user = 'root', passwd = '', db = 'DB_1CLIC2LEARN') \n\n\n #----------------------------------------------------------------------", " \"\"\"\n ...
import os import urllib from google.appengine.api import users from google.appengine.ext import ndb import jinja2 import webapp2 JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], autoescape=True) class MainPage(webapp...
[ [ 1, 0, 0.0385, 0.0385, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0769, 0.0385, 0, 0.66, 0.125, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.1538, 0.0385, 0, 0...
[ "import os", "import urllib", "from google.appengine.api import users", "from google.appengine.ext import ndb", "import jinja2", "import webapp2", "JINJA_ENVIRONMENT = jinja2.Environment(\n loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),\n extensions=['jinja2.ext.autoescape'],\n auto...
#! /usr/bin/env python # encoding: utf-8 # waf 1.6.10 VERSION='0.3.3' import sys APPNAME='p2t' top = '.' out = 'build' CPP_SOURCES = ['poly2tri/common/shapes.cc', 'poly2tri/sweep/cdt.cc', 'poly2tri/sweep/advancing_front.cc', 'poly2tri/sweep/sweep_context.cc', ...
[ [ 14, 0, 0.1111, 0.0222, 0, 0.66, 0, 557, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.1333, 0.0222, 0, 0.66, 0.0909, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.1556, 0.0222, 0, ...
[ "VERSION='0.3.3'", "import sys", "APPNAME='p2t'", "top = '.'", "out = 'build'", "CPP_SOURCES = ['poly2tri/common/shapes.cc',\n 'poly2tri/sweep/cdt.cc',\n 'poly2tri/sweep/advancing_front.cc',\n 'poly2tri/sweep/sweep_context.cc',\n 'poly2tri/sweep/swee...
#!/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\...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Zdenko Podobný # Author: Zdenko Podobný # # 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/LIC...
[ [ 1, 0, 0.25, 0.25, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.5, 0.25, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.75, 0.25, 0, 0.66, 1, ...
[ "import os", "import sys", "import ctypes" ]
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' import os import cgi import time import logging import simplejson from datetime import date from google.appengine.api import xmpp from google.appengine.ext import webapp from google.appengine.ext.webapp.uti...
[ [ 14, 0, 0.0175, 0.0044, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0263, 0.0044, 0, 0.66, 0.0357, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0307, 0.0044, 0, 0...
[ "__author__ = 'Michael Liao (askxuefeng@gmail.com)'", "import os", "import cgi", "import time", "import logging", "import simplejson", "from datetime import date", "from google.appengine.api import xmpp", "from google.appengine.ext import webapp", "from google.appengine.ext.webapp.util import run_...
# $Id: CheetahWrapper.py,v 1.26 2007/10/02 01:22:04 tavis_rudd Exp $ """Cheetah command-line interface. 2002-09-03 MSO: Total rewrite. 2002-09-04 MSO: Bugfix, compile command was using wrong output ext. 2002-11-08 MSO: Another rewrite. Meta-Data ========================================================================...
[ [ 8, 0, 0.0127, 0.0206, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0237, 0.0016, 0, 0.66, 0.05, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0253, 0.0016, 0, 0.66, ...
[ "\"\"\"Cheetah command-line interface.\n\n2002-09-03 MSO: Total rewrite.\n2002-09-04 MSO: Bugfix, compile command was using wrong output ext.\n2002-11-08 MSO: Another rewrite.\n\nMeta-Data\n================================================================================", "__author__ = \"Tavis Rudd <tavis@damnsim...
''' Provides an abstract Servlet baseclass for Cheetah's Template class ''' import sys import os.path isWebwareInstalled = False try: try: from ds.appserver.Servlet import Servlet as BaseServlet except: from WebKit.Servlet import Servlet as BaseServlet isWebwareInstalled = True if not...
[ [ 8, 0, 0.0179, 0.0268, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0446, 0.0089, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0536, 0.0089, 0, 0.66, ...
[ "'''\nProvides an abstract Servlet baseclass for Cheetah's Template class\n'''", "import sys", "import os.path", "isWebwareInstalled = False", "try:\n try:\n from ds.appserver.Servlet import Servlet as BaseServlet\n except:\n from WebKit.Servlet import Servlet as BaseServlet\n isWebwa...
# $Id: ErrorCatchers.py,v 1.7 2005/01/03 19:59:07 tavis_rudd Exp $ """ErrorCatcher class for Cheetah Templates Meta-Data ================================================================================ Author: Tavis Rudd <tavis@damnsimple.com> Version: $Revision: 1.7 $ Start Date: 2001/08/01 Last Revision Date: $Date:...
[ [ 8, 0, 0.0968, 0.1452, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1774, 0.0161, 0, 0.66, 0.1, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1935, 0.0161, 0, 0.66, ...
[ "\"\"\"ErrorCatcher class for Cheetah Templates\n\nMeta-Data\n================================================================================\nAuthor: Tavis Rudd <tavis@damnsimple.com>\nVersion: $Revision: 1.7 $\nStart Date: 2001/08/01\nLast Revision Date: $Date: 2005/01/03 19:59:07 $", "__author__ = \"Tavis Rud...
""" Nothing, but in a friendly way. Good for filling in for objects you want to hide. If $form.f1 is a RecursiveNull object, then $form.f1.anything["you"].might("use") will resolve to the empty string. This module was contributed by Ian Bicking. """ class RecursiveNull(object): def __getattr__(self, attr): ...
[ [ 8, 0, 0.1429, 0.25, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.6429, 0.6786, 0, 0.66, 1, 956, 0, 8, 0, 0, 186, 0, 0 ], [ 2, 1, 0.375, 0.0714, 1, 0.66, 0,...
[ "\"\"\"\nNothing, but in a friendly way. Good for filling in for objects you want to\nhide. If $form.f1 is a RecursiveNull object, then\n$form.f1.anything[\"you\"].might(\"use\") will resolve to the empty string.\n\nThis module was contributed by Ian Bicking.\n\"\"\"", "class RecursiveNull(object):\n def __g...
""" @@TR: This code is pretty much unsupported. MondoReport.py -- Batching module for Python and Cheetah. Version 2001-Nov-18. Doesn't do much practical yet, but the companion testMondoReport.py passes all its tests. -Mike Orr (Iron) TODO: BatchRecord.prev/next/prev_batches/next_batches/query, prev.query, next.quer...
[ [ 8, 0, 0.0162, 0.0302, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0323, 0.0022, 0, 0.66, 0.0455, 616, 0, 1, 0, 0, 616, 0, 0 ], [ 7, 0, 0.0399, 0.0129, 0, 0.66...
[ "\"\"\"\n@@TR: This code is pretty much unsupported.\n\nMondoReport.py -- Batching module for Python and Cheetah.\n\nVersion 2001-Nov-18. Doesn't do much practical yet, but the companion\ntestMondoReport.py passes all its tests.\n-Mike Orr (Iron)", "import operator", "try:\n from functools import reduce\nex...
"""This package contains classes, functions, objects and packages contributed by Cheetah users. They are not used by Cheetah itself. There is no guarantee that this directory will be included in Cheetah releases, that these objects will remain here forever, or that they will remain backward-compatible. ""...
[ [ 8, 0, 0.4375, 0.75, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ] ]
[ "\"\"\"This package contains classes, functions, objects and packages contributed\n by Cheetah users. They are not used by Cheetah itself. There is no\n guarantee that this directory will be included in Cheetah releases, that\n these objects will remain here forever, or that they will remain\n backward-co...
# $Id: CGITemplate.py,v 1.6 2006/01/29 02:09:59 tavis_rudd Exp $ """A subclass of Cheetah.Template for use in CGI scripts. Usage in a template: #extends Cheetah.Tools.CGITemplate #implements respond $cgiHeaders#slurp Usage in a template inheriting a Python class: 1. The template #extends MyPythonClass...
[ [ 8, 0, 0.2532, 0.4675, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4935, 0.013, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.5065, 0.013, 0, 0.66, ...
[ "\"\"\"A subclass of Cheetah.Template for use in CGI scripts.\n\nUsage in a template:\n #extends Cheetah.Tools.CGITemplate\n #implements respond\n $cgiHeaders#slurp\n\nUsage in a template inheriting a Python class:", "__author__ = \"Mike Orr <iron@mso.oz.net>\"", "__revision__ = \"$Revision: 1.6 $\"[11...
# $Id: SiteHierarchy.py,v 1.1 2001/10/11 03:25:54 tavis_rudd Exp $ """Create menus and crumbs from a site hierarchy. You define the site hierarchy as lists/tuples. Each location in the hierarchy is a (url, description) tuple. Each list has the base URL/text in the 0 position, and all the children coming after it. A...
[ [ 8, 0, 0.0512, 0.0843, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1145, 0.006, 0, 0.66, 0.25, 890, 0, 1, 0, 0, 890, 0, 0 ], [ 7, 0, 0.1295, 0.0241, 0, 0.66, ...
[ "\"\"\"Create menus and crumbs from a site hierarchy.\n\nYou define the site hierarchy as lists/tuples. Each location in the hierarchy\nis a (url, description) tuple. Each list has the base URL/text in the 0\nposition, and all the children coming after it. Any child can be a list,\nrepresenting further depth to ...
#
[]
[]
from turbocheetah import cheetahsupport TurboCheetah = cheetahsupport.TurboCheetah __all__ = ["TurboCheetah"]
[ [ 1, 0, 0.2, 0.2, 0, 0.66, 0, 172, 0, 1, 0, 0, 172, 0, 0 ], [ 14, 0, 0.6, 0.2, 0, 0.66, 0.5, 316, 7, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 1, 0.2, 0, 0.66, 1, 272, ...
[ "from turbocheetah import cheetahsupport", "TurboCheetah = cheetahsupport.TurboCheetah", "__all__ = [\"TurboCheetah\"]" ]
"Template support for Cheetah" import sys, os, imp from Cheetah import Compiler import pkg_resources def _recompile_template(package, basename, tfile, classname): tmpl = pkg_resources.resource_string(package, "%s.tmpl" % basename) c = Compiler.Compiler(source=tmpl, mainClassName='GenTemplate') code = str...
[ [ 8, 0, 0.0091, 0.0091, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0273, 0.0091, 0, 0.66, 0.2, 509, 0, 3, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0455, 0.0091, 0, 0.66, ...
[ "\"Template support for Cheetah\"", "import sys, os, imp", "from Cheetah import Compiler", "import pkg_resources", "def _recompile_template(package, basename, tfile, classname):\n tmpl = pkg_resources.resource_string(package, \"%s.tmpl\" % basename)\n c = Compiler.Compiler(source=tmpl, mainClassName='...
import Cheetah.Template def render(template_file, **kwargs): ''' Cheetah.Django.render() takes the template filename (the filename should be a file in your Django TEMPLATE_DIRS) Any additional keyword arguments are passed into the template are propogated into the templat...
[ [ 1, 0, 0.0625, 0.0625, 0, 0.66, 0, 171, 0, 1, 0, 0, 171, 0, 0 ], [ 2, 0, 0.5938, 0.875, 0, 0.66, 1, 24, 0, 2, 1, 0, 0, 0, 4 ], [ 8, 1, 0.4688, 0.5, 1, 0.44, 0,...
[ "import Cheetah.Template", "def render(template_file, **kwargs):\n '''\n Cheetah.Django.render() takes the template filename \n (the filename should be a file in your Django \n TEMPLATE_DIRS)\n\n Any additional keyword arguments are passed into the \n template are propogated ...
''' Provides several CacheStore backends for Cheetah's caching framework. The methods provided by these classes have the same semantics as those in the python-memcached API, except for their return values: set(key, val, time=0) set the value unconditionally add(key, val, time=0) set only if the server doesn't alr...
[ [ 8, 0, 0.0787, 0.1481, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1574, 0.0093, 0, 0.66, 0.1667, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.1759, 0.0093, 0, 0.66...
[ "'''\nProvides several CacheStore backends for Cheetah's caching framework. The\nmethods provided by these classes have the same semantics as those in the\npython-memcached API, except for their return values:\n\nset(key, val, time=0)\n set the value unconditionally\nadd(key, val, time=0)", "import time", "fr...
try: from ds.sys.Unspecified import Unspecified except ImportError: class _Unspecified: def __repr__(self): return 'Unspecified' def __str__(self): return 'Unspecified' Unspecified = _Unspecified()
[ [ 7, 0, 0.5556, 1, 0, 0.66, 0, 0, 0, 1, 0, 0, 0, 0, 1 ], [ 1, 1, 0.2222, 0.1111, 1, 0.02, 0, 219, 0, 1, 0, 0, 219, 0, 0 ], [ 3, 1, 0.6667, 0.5556, 1, 0.02, 0, ...
[ "try:\n from ds.sys.Unspecified import Unspecified\nexcept ImportError:\n class _Unspecified:\n def __repr__(self):\n return 'Unspecified' \n def __str__(self):\n return 'Unspecified'", " from ds.sys.Unspecified import Unspecified", " class _Unspecified:\n ...
# $Id: CacheRegion.py,v 1.3 2006/01/28 04:19:30 tavis_rudd Exp $ ''' Cache holder classes for Cheetah: Cache regions are defined using the #cache Cheetah directive. Each cache region can be viewed as a dictionary (keyed by cacheRegionID) handling at least one cache item (the default one). It's possible to add cacheIte...
[ [ 8, 0, 0.0809, 0.1397, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 7, 0, 0.1728, 0.0294, 0, 0.66, 0.1667, 0, 0, 1, 0, 0, 0, 0, 0 ], [ 1, 1, 0.1691, 0.0074, 1, 0.17, ...
[ "'''\nCache holder classes for Cheetah:\n\nCache regions are defined using the #cache Cheetah directive. Each\ncache region can be viewed as a dictionary (keyed by cacheRegionID)\nhandling at least one cache item (the default one). It's possible to add\ncacheItems in a region by using the `varyBy` #cache directive ...
#!/usr/bin/env python ''' Tests for the 'cheetah' command. Besides unittest usage, recognizes the following command-line options: --list CheetahWrapper.py List all scenarios that are tested. The argument is the path of this script. --nodelete Don't delete scratch directory at end. ...
[ [ 8, 0, 0.0131, 0.0209, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0244, 0.0017, 0, 0.66, 0.027, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0262, 0.0017, 0, 0.66,...
[ "'''\nTests for the 'cheetah' command.\n\nBesides unittest usage, recognizes the following command-line options:\n --list CheetahWrapper.py\n List all scenarios that are tested. The argument is the path\n of this script.\n --nodelete", "import os", "import os.path", "import pdb", "impo...
#!/usr/bin/env python ''' Core module of Cheetah's Unit-testing framework TODO ================================================================================ # combo tests # negative test cases for expected exceptions # black-box vs clear-box testing # do some tests that run the Template for long enough to check tha...
[ [ 8, 0, 0.1226, 0.1887, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2453, 0.0189, 0, 0.66, 0.0588, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.2642, 0.0189, 0, 0.66...
[ "'''\nCore module of Cheetah's Unit-testing framework\n\nTODO\n================================================================================\n# combo tests\n# negative test cases for expected exceptions\n# black-box vs clear-box testing", "import sys", "import unittest", "from Cheetah.Tests import SyntaxAn...
""" XML Test Runner for PyUnit """ # Written by Sebastian Rittau <srittau@jroger.in-berlin.de> and placed in # the Public Domain. With contributions by Paolo Borelli. __revision__ = "$Id: /private/python/stdlib/xmlrunner.py 16654 2007-11-12T12:46:35.368945Z srittau $" import os.path import re import sys import time...
[ [ 8, 0, 0.0052, 0.0079, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.021, 0.0026, 0, 0.66, 0.05, 809, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0262, 0.0026, 0, 0.66, ...
[ "\"\"\"\nXML Test Runner for PyUnit\n\"\"\"", "__revision__ = \"$Id: /private/python/stdlib/xmlrunner.py 16654 2007-11-12T12:46:35.368945Z srittau $\"", "import os.path", "import re", "import sys", "import time", "import traceback", "import unittest", "from StringIO import StringIO", "from xml.sa...
#!/usr/bin/env python # -*- encoding: utf8 -*- from Cheetah.Template import Template from Cheetah import CheetahWrapper from Cheetah import DummyTransaction import imp import os import sys import tempfile import unittest class CommandLineTest(unittest.TestCase): def createAndCompile(self, source): sourcef...
[ [ 1, 0, 0.0169, 0.0042, 0, 0.66, 0, 171, 0, 1, 0, 0, 171, 0, 0 ], [ 1, 0, 0.0211, 0.0042, 0, 0.66, 0.0476, 920, 0, 1, 0, 0, 920, 0, 0 ], [ 1, 0, 0.0253, 0.0042, 0, ...
[ "from Cheetah.Template import Template", "from Cheetah import CheetahWrapper", "from Cheetah import DummyTransaction", "import imp", "import os", "import sys", "import tempfile", "import unittest", "class CommandLineTest(unittest.TestCase):\n def createAndCompile(self, source):\n sourcefil...
#!/usr/bin/env python import sys import types import os import os.path import unittest from Cheetah.NameMapper import NotFound, valueForKey, \ valueForName, valueFromSearchList, valueFromFrame, valueFromFrameOrSearchList class DummyClass: classVar1 = 123 def __init__(self): self.instanceVar1 ...
[ [ 1, 0, 0.0076, 0.0019, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0095, 0.0019, 0, 0.66, 0.0385, 209, 0, 1, 0, 0, 209, 0, 0 ], [ 1, 0, 0.0114, 0.0019, 0, ...
[ "import sys", "import types", "import os", "import os.path", "import unittest", "from Cheetah.NameMapper import NotFound, valueForKey, \\\n valueForName, valueFromSearchList, valueFromFrame, valueFromFrameOrSearchList", "class DummyClass:\n classVar1 = 123\n\n def __init__(self):\n self...
#!/usr/bin/env python import hotshot import hotshot.stats import os import sys import unittest from test import pystone import time import Cheetah.NameMapper import Cheetah.Template # This can be turned on with the `--debug` flag when running the test # and will cause the tests to all just dump out how long they t...
[ [ 1, 0, 0.0123, 0.0041, 0, 0.66, 0, 974, 0, 1, 0, 0, 974, 0, 0 ], [ 1, 0, 0.0165, 0.0041, 0, 0.66, 0.04, 226, 0, 1, 0, 0, 226, 0, 0 ], [ 1, 0, 0.0206, 0.0041, 0, 0....
[ "import hotshot", "import hotshot.stats", "import os", "import sys", "import unittest", "from test import pystone", "import time", "import Cheetah.NameMapper", "import Cheetah.Template", "DEBUG = False", "kPS = 1000", "TOLERANCE = 0.5*kPS", "class DurationError(AssertionError):\n pass", ...
#!/usr/bin/env python import unittest from Cheetah import DirectiveAnalyzer class AnalyzerTests(unittest.TestCase): def test_set(self): template = ''' #set $foo = "bar" Hello ${foo}! ''' calls = DirectiveAnalyzer.analyze(template) self.assertEquals(1, calls.get('s...
[ [ 1, 0, 0.1034, 0.0345, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.1724, 0.0345, 0, 0.66, 0.3333, 920, 0, 1, 0, 0, 920, 0, 0 ], [ 3, 0, 0.5517, 0.5862, 0, 0....
[ "import unittest", "from Cheetah import DirectiveAnalyzer", "class AnalyzerTests(unittest.TestCase):\n def test_set(self):\n template = '''\n #set $foo = \"bar\"\n Hello ${foo}!\n '''\n calls = DirectiveAnalyzer.analyze(template)\n self.assertEquals(1, calls.get('set...
#!/usr/bin/env python import unittest from Cheetah import SettingsManager class SettingsManagerTests(unittest.TestCase): def test_mergeDictionaries(self): left = {'foo' : 'bar', 'abc' : {'a' : 1, 'b' : 2, 'c' : (3,)}} right = {'xyz' : (10, 9)} expect = {'xyz': (10, 9), 'foo': 'bar', 'abc...
[ [ 1, 0, 0.15, 0.05, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.25, 0.05, 0, 0.66, 0.3333, 920, 0, 1, 0, 0, 920, 0, 0 ], [ 3, 0, 0.575, 0.4, 0, 0.66, 0.66...
[ "import unittest", "from Cheetah import SettingsManager", "class SettingsManagerTests(unittest.TestCase):\n def test_mergeDictionaries(self):\n left = {'foo' : 'bar', 'abc' : {'a' : 1, 'b' : 2, 'c' : (3,)}}\n right = {'xyz' : (10, 9)}\n expect = {'xyz': (10, 9), 'foo': 'bar', 'abc': {'a'...
#
[]
[]
#!/usr/bin/env python import Cheetah.NameMapper import Cheetah.Template import sys import unittest majorVer, minorVer = sys.version_info[0], sys.version_info[1] versionTuple = (majorVer, minorVer) def isPython23(): ''' Python 2.3 is still supported by Cheetah, but doesn't support decorators ''' return maj...
[ [ 1, 0, 0.0122, 0.0041, 0, 0.66, 0, 308, 0, 1, 0, 0, 308, 0, 0 ], [ 1, 0, 0.0163, 0.0041, 0, 0.66, 0.0714, 171, 0, 1, 0, 0, 171, 0, 0 ], [ 1, 0, 0.0244, 0.0041, 0, ...
[ "import Cheetah.NameMapper", "import Cheetah.Template", "import sys", "import unittest", "majorVer, minorVer = sys.version_info[0], sys.version_info[1]", "versionTuple = (majorVer, minorVer)", "def isPython23():\n ''' Python 2.3 is still supported by Cheetah, but doesn't support decorators '''\n r...
#!/usr/bin/env python import unittest from Cheetah import Parser class ArgListTest(unittest.TestCase): def setUp(self): super(ArgListTest, self).setUp() self.al = Parser.ArgList() def test_merge1(self): ''' Testing the ArgList case results from Template.Preprocessors.tes...
[ [ 1, 0, 0.0612, 0.0204, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.102, 0.0204, 0, 0.66, 0.3333, 920, 0, 1, 0, 0, 920, 0, 0 ], [ 3, 0, 0.5306, 0.7959, 0, 0.6...
[ "import unittest", "from Cheetah import Parser", "class ArgListTest(unittest.TestCase):\n def setUp(self):\n super(ArgListTest, self).setUp()\n self.al = Parser.ArgList()\n\n def test_merge1(self):\n ''' \n Testing the ArgList case results from Template.Preprocessors.test_c...
from glob import glob import os from os import listdir import os.path import re from tempfile import mktemp def _escapeRegexChars(txt, escapeRE=re.compile(r'([\$\^\*\+\.\?\{\}\[\]\(\)\|\\])')): return escapeRE.sub(r'\\\1', txt) def findFiles(*args, **kw): """Recursively find all the file...
[ [ 1, 0, 0.0056, 0.0028, 0, 0.66, 0, 958, 0, 1, 0, 0, 958, 0, 0 ], [ 1, 0, 0.0084, 0.0028, 0, 0.66, 0.0769, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0112, 0.0028, 0, ...
[ "from glob import glob", "import os", "from os import listdir", "import os.path", "import re", "from tempfile import mktemp", "def _escapeRegexChars(txt,\n escapeRE=re.compile(r'([\\$\\^\\*\\+\\.\\?\\{\\}\\[\\]\\(\\)\\|\\\\])')):\n return escapeRE.sub(r'\\\\\\1', txt)", " ret...
#
[]
[]
import gettext _ = gettext.gettext class I18n(object): def __init__(self, parser): pass ## junk I'm playing with to test the macro framework # def parseArgs(self, parser, startPos): # parser.getWhiteSpace() # args = parser.getExpression(useNameMapper=False, # ...
[ [ 1, 0, 0.0149, 0.0149, 0, 0.66, 0, 723, 0, 1, 0, 0, 723, 0, 0 ], [ 14, 0, 0.0299, 0.0149, 0, 0.66, 0.5, 660, 7, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.5149, 0.9552, 0, 0.66...
[ "import gettext", "_ = gettext.gettext", "class I18n(object):\n def __init__(self, parser):\n pass\n\n## junk I'm playing with to test the macro framework \n# def parseArgs(self, parser, startPos):\n# parser.getWhiteSpace()\n# args = parser.getExpression(useNameMapper=False,", " ...
''' Compiler classes for Cheetah: ModuleCompiler aka 'Compiler' ClassCompiler MethodCompiler If you are trying to grok this code start with ModuleCompiler.__init__, ModuleCompiler.compile, and ModuleCompiler.__getattr__. ''' import sys import os import os.path from os.path import getmtime, exi...
[ [ 8, 0, 0.0025, 0.0045, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0055, 0.0005, 0, 0.66, 0.0312, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.006, 0.0005, 0, 0.66,...
[ "'''\n Compiler classes for Cheetah:\n ModuleCompiler aka 'Compiler'\n ClassCompiler\n MethodCompiler\n\n If you are trying to grok this code start with ModuleCompiler.__init__,\n ModuleCompiler.compile, and ModuleCompiler.__getattr__.", "import sys", "import os", "import os.path", "from o...
"""SourceReader class for Cheetah's Parser and CodeGenerator """ import re import sys EOLre = re.compile(r'[ \f\t]*(?:\r\n|\r|\n)') EOLZre = re.compile(r'(?:\r\n|\r|\n|\Z)') ENCODINGsearch = re.compile("coding[=:]\s*([-\w.]+)").search class Error(Exception): pass class SourceReade...
[ [ 8, 0, 0.0052, 0.0069, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0103, 0.0034, 0, 0.66, 0.1429, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0138, 0.0034, 0, 0.66...
[ "\"\"\"SourceReader class for Cheetah's Parser and CodeGenerator\n\"\"\"", "import re", "import sys", "EOLre = re.compile(r'[ \\f\\t]*(?:\\r\\n|\\r|\\n)')", "EOLZre = re.compile(r'(?:\\r\\n|\\r|\\n|\\Z)')", "ENCODINGsearch = re.compile(\"coding[=:]\\s*([-\\w.]+)\").search", "class Error(Exception):\n ...
""" Indentation maker. @@TR: this code is unsupported and largely undocumented ... This version is based directly on code by Robert Kuzelj <robert_kuzelj@yahoo.com> and uses his directive syntax. Some classes and attributes have been renamed. Indentation is output via $self._CHEETAH__indenter.indent() to prevent '_i...
[ [ 8, 0, 0.0488, 0.0894, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1057, 0.0081, 0, 0.66, 0.2, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.1138, 0.0081, 0, 0.66, ...
[ "\"\"\"\nIndentation maker.\n@@TR: this code is unsupported and largely undocumented ...\n\nThis version is based directly on code by Robert Kuzelj\n<robert_kuzelj@yahoo.com> and uses his directive syntax. Some classes and\nattributes have been renamed. Indentation is output via\n$self._CHEETAH__indenter.indent()...
## statprof.py ## Copyright (C) 2004,2005 Andy Wingo <wingo at pobox dot com> ## Copyright (C) 2001 Rob Browning <rlb at defaultvalue dot org> ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foun...
[ [ 8, 0, 0.2336, 0.3257, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 7, 0, 0.4276, 0.0362, 0, 0.66, 0.0556, 0, 0, 1, 0, 0, 0, 0, 1 ], [ 1, 1, 0.4145, 0.0033, 1, 0.04, ...
[ "\"\"\"\nstatprof is intended to be a fairly simple statistical profiler for\npython. It was ported directly from a statistical profiler for guile,\nalso named statprof, available from guile-lib [0].\n\n[0] http://wingolog.org/software/guile-lib/statprof/\n\nTo start profiling, call statprof.start():", "try:\n ...
"""This is a copy of the htmlDecode function in Webware. @@TR: It implemented more efficiently. """ from Cheetah.Utils.htmlEncode import htmlCodesReversed def htmlDecode(s, codes=htmlCodesReversed): """ Returns the ASCII decoded version of the given HTML string. This does NOT remove normal HTML tags like <p...
[ [ 8, 0, 0.2143, 0.3571, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.5, 0.0714, 0, 0.66, 0.5, 756, 0, 1, 0, 0, 756, 0, 0 ], [ 2, 0, 0.8214, 0.4286, 0, 0.66, ...
[ "\"\"\"This is a copy of the htmlDecode function in Webware.\n\n@@TR: It implemented more efficiently.\n\n\"\"\"", "from Cheetah.Utils.htmlEncode import htmlCodesReversed", "def htmlDecode(s, codes=htmlCodesReversed):\n \"\"\" Returns the ASCII decoded version of the given HTML string. This does\n NOT rem...
#!/usr/bin/env python """ Miscellaneous functions/objects used by Cheetah but also useful standalone. """ import os # Used in mkdirsWithPyInitFile. import sys # Used in die. ################################################## ## MISCELLANEOUS FUNCTIONS def die(reason): sys.stderr.write(reason...
[ [ 8, 0, 0.0448, 0.0448, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0746, 0.0149, 0, 0.66, 0.1429, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0896, 0.0149, 0, 0.66...
[ "\"\"\"\n Miscellaneous functions/objects used by Cheetah but also useful standalone.\n\"\"\"", "import os # Used in mkdirsWithPyInitFile.", "import sys # Used in die.", "def die(reason):\n sys.stderr.write(reason + '\\n')\n sys.exit(1)", " sys.stderr.write(reason + '\\n')", "...
# $Id: WebInputMixin.py,v 1.10 2006/01/06 21:56:54 tavis_rudd Exp $ """Provides helpers for Template.webInput(), a method for importing web transaction variables in bulk. See the docstring of webInput for full details. Meta-Data ================================================================================ Author: ...
[ [ 8, 0, 0.0735, 0.1176, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1373, 0.0098, 0, 0.66, 0.1667, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1471, 0.0098, 0, 0.66...
[ "\"\"\"Provides helpers for Template.webInput(), a method for importing web\ntransaction variables in bulk. See the docstring of webInput for full details.\n\nMeta-Data\n================================================================================\nAuthor: Mike Orr <iron@mso.oz.net>\nLicense: This software is r...
#
[]
[]
"""This is a copy of the htmlEncode function in Webware. @@TR: It implemented more efficiently. """ htmlCodes = [ ['&', '&amp;'], ['<', '&lt;'], ['>', '&gt;'], ['"', '&quot;'], ] htmlCodesReversed = htmlCodes[:] htmlCodesReversed.reverse() def htmlEncode(s, codes=htmlCodes): """ Returns the HTML...
[ [ 8, 0, 0.1667, 0.2857, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4524, 0.2857, 0, 0.66, 0.25, 350, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.619, 0.0476, 0, 0.66, ...
[ "\"\"\"This is a copy of the htmlEncode function in Webware.\n\n\n@@TR: It implemented more efficiently.\n\n\"\"\"", "htmlCodes = [\n ['&', '&amp;'],\n ['<', '&lt;'],\n ['>', '&gt;'],\n ['\"', '&quot;'],\n]", "htmlCodesReversed = htmlCodes[:]", "htmlCodesReversed.reverse()", "def htmlEncode(s, c...
import sys import os.path import copy as copyModule from ConfigParser import ConfigParser import re from tokenize import Intnumber, Floatnumber, Number from types import * import types import new import time from StringIO import StringIO # not cStringIO because of unicode support import imp # used by S...
[ [ 1, 0, 0.0034, 0.0034, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0069, 0.0034, 0, 0.66, 0.0455, 79, 0, 1, 0, 0, 79, 0, 0 ], [ 1, 0, 0.0103, 0.0034, 0, 0....
[ "import sys", "import os.path", "import copy as copyModule", "from ConfigParser import ConfigParser", "import re", "from tokenize import Intnumber, Floatnumber, Number", "from types import *", "import types", "import new", "import time", "from StringIO import StringIO # not cStringIO because of ...
Version = '2.4.1' VersionTuple = (2, 4, 1, 'final', 0) MinCompatibleVersion = '2.0rc6' MinCompatibleVersionTuple = (2, 0, 0, 'candidate', 6) #### def convertVersionStringToTuple(s): versionNum = [0, 0, 0] releaseType = 'final' releaseTypeSubNum = 0 if s.find('a')!=-1: num, releaseTypeSubNum = ...
[ [ 14, 0, 0.0172, 0.0172, 0, 0.66, 0, 444, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0345, 0.0172, 0, 0.66, 0.2, 292, 0, 0, 0, 0, 0, 8, 0 ], [ 14, 0, 0.069, 0.0172, 0, 0.66,...
[ "Version = '2.4.1'", "VersionTuple = (2, 4, 1, 'final', 0)", "MinCompatibleVersion = '2.0rc6'", "MinCompatibleVersionTuple = (2, 0, 0, 'candidate', 6)", "def convertVersionStringToTuple(s):\n versionNum = [0, 0, 0]\n releaseType = 'final'\n releaseTypeSubNum = 0\n if s.find('a')!=-1:\n nu...
''' Cheetah is an open source template engine and code generation tool. It can be used standalone or combined with other tools and frameworks. Web development is its principle use, but Cheetah is very flexible and is also being used to generate C++ game code, Java, sql, form emails and even Python code. Homepage ...
[ [ 8, 0, 0.475, 0.9, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 1, 0.05, 0, 0.66, 1, 444, 0, 1, 0, 0, 444, 0, 0 ] ]
[ "'''\nCheetah is an open source template engine and code generation tool.\n\nIt can be used standalone or combined with other tools and frameworks. Web\ndevelopment is its principle use, but Cheetah is very flexible and is also being\nused to generate C++ game code, Java, sql, form emails and even Python code.\n\nH...
import os.path import string l = ['_'] * 256 for c in string.digits + string.letters: l[ord(c)] = c _pathNameTransChars = string.join(l, '') del l, c def convertTmplPathToModuleName(tmplPath, _pathNameTransChars=_pathNameTransChars, splitdrive=os.pat...
[ [ 1, 0, 0.0667, 0.0667, 0, 0.66, 0, 79, 0, 1, 0, 0, 79, 0, 0 ], [ 1, 0, 0.1333, 0.0667, 0, 0.66, 0.2, 890, 0, 1, 0, 0, 890, 0, 0 ], [ 14, 0, 0.2667, 0.0667, 0, 0.66...
[ "import os.path", "import string", "l = ['_'] * 256", "for c in string.digits + string.letters:\n l[ord(c)] = c", " l[ord(c)] = c", "_pathNameTransChars = string.join(l, '')", "def convertTmplPathToModuleName(tmplPath,\n _pathNameTransChars=_pathNameTransChars,\n ...
#!/usr/bin/env python import os import pprint try: from functools import reduce except ImportError: # Assume we have reduce pass from Cheetah import Parser from Cheetah import Compiler from Cheetah import Template class Analyzer(Parser.Parser): def __init__(self, *args, **kwargs): self.calls...
[ [ 1, 0, 0.0306, 0.0102, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0408, 0.0102, 0, 0.66, 0.0714, 276, 0, 1, 0, 0, 276, 0, 0 ], [ 7, 0, 0.0816, 0.051, 0, 0...
[ "import os", "import pprint", "try:\n from functools import reduce\nexcept ImportError:\n # Assume we have reduce\n pass", " from functools import reduce", "from Cheetah import Parser", "from Cheetah import Compiler", "from Cheetah import Template", "class Analyzer(Parser.Parser):\n def...
# $Id: ImportHooks.py,v 1.27 2007/11/16 18:28:47 tavis_rudd Exp $ """Provides some import hooks to allow Cheetah's .tmpl files to be imported directly like Python .py modules. To use these: import Cheetah.ImportHooks Cheetah.ImportHooks.install() Meta-Data ========================================================...
[ [ 8, 0, 0.0761, 0.1159, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1377, 0.0072, 0, 0.66, 0.0455, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1449, 0.0072, 0, 0.66...
[ "\"\"\"Provides some import hooks to allow Cheetah's .tmpl files to be imported\ndirectly like Python .py modules.\n\nTo use these:\n import Cheetah.ImportHooks\n Cheetah.ImportHooks.install()\n\nMeta-Data", "__author__ = \"Tavis Rudd <tavis@damnsimple.com>\"", "__revision__ = \"$Revision: 1.27 $\"[11:-2]", ...
# $Id: _SkeletonPage.py,v 1.13 2002/10/01 17:52:02 tavis_rudd Exp $ """A baseclass for the SkeletonPage template Meta-Data ========== Author: Tavis Rudd <tavis@damnsimple.com>, Version: $Revision: 1.13 $ Start Date: 2001/04/05 Last Revision Date: $Date: 2002/10/01 17:52:02 $ """ __author__ = "Tavis Rudd <tavis@damnsim...
[ [ 8, 0, 0.0282, 0.0423, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0516, 0.0047, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0563, 0.0047, 0, 0.66, ...
[ "\"\"\"A baseclass for the SkeletonPage template\n\nMeta-Data\n==========\nAuthor: Tavis Rudd <tavis@damnsimple.com>,\nVersion: $Revision: 1.13 $\nStart Date: 2001/04/05\nLast Revision Date: $Date: 2002/10/01 17:52:02 $", "__author__ = \"Tavis Rudd <tavis@damnsimple.com>\"", "__revision__ = \"$Revision: 1.13 $\...
""" Parser classes for Cheetah's Compiler Classes: ParseError( Exception ) _LowLevelParser( Cheetah.SourceReader.SourceReader ), basically a lexer _HighLevelParser( _LowLevelParser ) Parser === _HighLevelParser (an alias) """ import os import sys import re from re import DOTALL, MULTILINE from types import St...
[ [ 8, 0, 0.0019, 0.0034, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0041, 0.0004, 0, 0.66, 0.0132, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0045, 0.0004, 0, 0.66...
[ "\"\"\"\nParser classes for Cheetah's Compiler\n\nClasses:\n ParseError( Exception )\n _LowLevelParser( Cheetah.SourceReader.SourceReader ), basically a lexer\n _HighLevelParser( _LowLevelParser )\n Parser === _HighLevelParser (an alias)", "import os", "import sys", "import re", "from re import DOTALL, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' import datetime from xml.parsers.expat import ParserCreate codes = { 0 : u'龙卷风', # tornado 1 : u'热带风暴', # tropical storm 2 : u'飓风', # hurricane 3 : u'风暴', # severe thunderstorm...
[ [ 14, 0, 0.0172, 0.0043, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0258, 0.0043, 0, 0.66, 0.0714, 426, 0, 1, 0, 0, 426, 0, 0 ], [ 1, 0, 0.03, 0.0043, 0, 0.6...
[ "__author__ = 'Michael Liao (askxuefeng@gmail.com)'", "import datetime", "from xml.parsers.expat import ParserCreate", "codes = {\n 0 : u'龙卷风', # tornado\n 1 : u'热带风暴', # tropical storm\n 2 : u'飓风', # hurricane\n 3 : u'风暴', # severe thunderstorms\n 4 : u'雷雨', # thunderstorms...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' from os import path from Cheetah.Template import Template def main(): file = path.join(path.split(__file__)[0], 'home.html') print 'Compile template %s...' % file cc = Template.compile(source=None,...
[ [ 14, 0, 0.1739, 0.0435, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.2609, 0.0435, 0, 0.66, 0.25, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.3043, 0.0435, 0, 0.6...
[ "__author__ = 'Michael Liao (askxuefeng@gmail.com)'", "from os import path", "from Cheetah.Template import Template", "def main():\n file = path.join(path.split(__file__)[0], 'home.html')\n print('Compile template %s...' % file)\n cc = Template.compile(source=None, file=file, returnAClass=False, modu...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Michael Liao (askxuefeng@gmail.com)' from google.appengine.ext import db class City(db.Model): name = db.StringProperty(required=True) aliases = db.StringListProperty(required=True) code = db.IntegerProperty(required=True) def f...
[ [ 14, 0, 0.0151, 0.0038, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0226, 0.0038, 0, 0.66, 0.0455, 167, 0, 1, 0, 0, 167, 0, 0 ], [ 3, 0, 0.0472, 0.0377, 0, 0...
[ "__author__ = 'Michael Liao (askxuefeng@gmail.com)'", "from google.appengine.ext import db", "class City(db.Model):\n name = db.StringProperty(required=True)\n aliases = db.StringListProperty(required=True)\n code = db.IntegerProperty(required=True)\n\n def first_alias(self):\n return self.al...
#!/usr/bin/env python # -*- coding: UTF-8 -*- ################################################## ## DEPENDENCIES import sys import os import os.path import __builtin__ from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVers...
[ [ 1, 0, 0.0253, 0.0028, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0281, 0.0028, 0, 0.66, 0.0345, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0309, 0.0028, 0, ...
[ "import sys", "import os", "import os.path", "import __builtin__", "from os.path import getmtime, exists", "import time", "import types", "from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion", "from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTupl...
''' Cookie-handlin' mix-in helper; inspired by WebOb. This module offers a cookie-handling mixin class meant to be used with Google App Engine; this class can in fact be mixed into any class that shares the following features with webapp.RequestHandler subclasses: - a self.request.cookies object with a get(key, defa...
[ [ 8, 0, 0.0538, 0.1, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1308, 0.0077, 0, 0.66, 0.1667, 32, 0, 1, 0, 0, 32, 0, 0 ], [ 1, 0, 0.1385, 0.0077, 0, 0.66, ...
[ "''' Cookie-handlin' mix-in helper; inspired by WebOb.\n\nThis module offers a cookie-handling mixin class meant to be used with Google\nApp Engine; this class can in fact be mixed into any class that shares the\nfollowing features with webapp.RequestHandler subclasses:\n - a self.request.cookies object with a get...