code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""`cssmin` - A Python port of the YUI CSS compressor."""
"""
Home page: https://github.com/zacharyvoase/cssmin
License: BSD: https://github.com/zacharyvoase/cssmin/blob/master/LICENSE
Original author: Zachary Voase
Modified for inclusion into web2py by: Ross Peoples <ros... | [
[
8,
0,
0.0173,
0.0043,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.0368,
0.026,
0,
0.66,
0.0526,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0606,
0.0043,
0,
0.66,
... | [
"\"\"\"`cssmin` - A Python port of the YUI CSS compressor.\"\"\"",
"\"\"\"\nHome page: https://github.com/zacharyvoase/cssmin\nLicense: BSD: https://github.com/zacharyvoase/cssmin/blob/master/LICENSE\nOriginal author: Zachary Voase\nModified for inclusion into web2py by: Ross Peoples <ross.peoples@gmail.com>\n\"\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
High-level CSS and JS minification class for web2py.
Called by response.include_files()
Created by: Ross Peoples <ross.peoples@gmail.com>
Modified by: Massimo Di Pierro <massimo.dipierro@gmail.com>
"""
import cssmin
import jsmin
import os
import hashlib
import re
de... | [
[
8,
0,
0.0455,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0769,
0.007,
0,
0.66,
0.1111,
291,
0,
1,
0,
0,
291,
0,
0
],
[
1,
0,
0.0839,
0.007,
0,
0.66,
... | [
"\"\"\"\nHigh-level CSS and JS minification class for web2py.\nCalled by response.include_files()\nCreated by: Ross Peoples <ross.peoples@gmail.com>\nModified by: Massimo Di Pierro <massimo.dipierro@gmail.com>\n\"\"\"",
"import cssmin",
"import jsmin",
"import os",
"import hashlib",
"import re",
"def re... |
# coding: utf-8
import re
def minify(response):
def _replace(match):
match = match.group()
# save whole <pre>, <textarea> tags, and opening <!-- (so it doesn't break <script>)
# otherwise, replace all whitespace with a single space character
return match if match.startswith(('<pre... | [
[
1,
0,
0.2,
0.0667,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.7,
0.6667,
0,
0.66,
1,
72,
0,
1,
1,
0,
0,
0,
4
],
[
2,
1,
0.6,
0.3333,
1,
0.37,
0,
... | [
"import re",
"def minify(response):\n def _replace(match):\n match = match.group()\n # save whole <pre>, <textarea> tags, and opening <!-- (so it doesn't break <script>)\n # otherwise, replace all whitespace with a single space character\n return match if match.startswith(('<pre', '... |
#!/usr/bin/env python
# -*- coding: ascii -*-
#
# Copyright 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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/... | [
[
8,
0,
0.0946,
0.0997,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1458,
0.0026,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1483,
0.0026,
0,
0.66... | [
"r\"\"\"\n=====================\n Javascript Minifier\n=====================\n\nJavascript Minifier based on `jsmin.c by Douglas Crockford`_\\.\n\nThis module is a re-implementation based on the semantics of jsmin.c. Usually",
"__author__ = \"Andr\\xe9 Malo\"",
"__author__ = getattr(__author__, 'decode', lambda... |
"""Simple AES cipher implementation in pure Python following PEP-272 API
Homepage: https://bitbucket.org/intgr/pyaes/
The goal of this module is to be as fast as reasonable in Python while still
being Pythonic and readable/understandable. It is licensed under the permissive
MIT license.
Hopefully the code is readabl... | [
[
8,
0,
0.0269,
0.0518,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1016,
0.002,
0,
0.66,
0.0526,
80,
0,
1,
0,
0,
80,
0,
0
],
[
14,
0,
0.1096,
0.002,
0,
0.66,
... | [
"\"\"\"Simple AES cipher implementation in pure Python following PEP-272 API\n\nHomepage: https://bitbucket.org/intgr/pyaes/\n\nThe goal of this module is to be as fast as reasonable in Python while still\nbeing Pythonic and readable/understandable. It is licensed under the permissive\nMIT license.",
"from array ... |
SMSCODES = {
'Aliant': '@chat.wirefree.ca',
'Alltel': '@message.alltel.com',
'Ameritech': '@paging.acswireless.com',
'AT&T': '@txt.att.net',
'AU by KDDI': '@ezweb.ne.jp',
'BeeLine GSM': '@sms.beemail.ru',
'Bell Mobility Canada': '@txt.bellmobility.ca',
'Bellsouth': '@bellsouth.cl',
'... | [
[
14,
0,
0.4391,
0.8696,
0,
0.66,
0,
606,
0,
0,
0,
0,
0,
6,
0
],
[
2,
0,
0.9478,
0.113,
0,
0.66,
1,
988,
0,
2,
1,
0,
0,
0,
1
],
[
8,
1,
0.9174,
0.0348,
1,
0.42,
... | [
"SMSCODES = {\n 'Aliant': '@chat.wirefree.ca',\n 'Alltel': '@message.alltel.com',\n 'Ameritech': '@paging.acswireless.com',\n 'AT&T': '@txt.att.net',\n 'AU by KDDI': '@ezweb.ne.jp',\n 'BeeLine GSM': '@sms.beemail.ru',\n 'Bell Mobility Canada': '@txt.bellmobility.ca',",
"def sms_email(number, ... |
"""
Developed by 616d41631bff906704951934ffe4015e
Released under web2py license because includes gluon/cache.py source code
"""
import redis
from redis.exceptions import ConnectionError
from gluon import current
from gluon.cache import CacheAbstract
import cPickle as pickle
import time
import re
import logging
import ... | [
[
8,
0,
0.0147,
0.0235,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0353,
0.0059,
0,
0.66,
0.0769,
977,
0,
1,
0,
0,
977,
0,
0
],
[
1,
0,
0.0412,
0.0059,
0,
0.66... | [
"\"\"\"\nDeveloped by 616d41631bff906704951934ffe4015e\nReleased under web2py license because includes gluon/cache.py source code\n\"\"\"",
"import redis",
"from redis.exceptions import ConnectionError",
"from gluon import current",
"from gluon.cache import CacheAbstract",
"import cPickle as pickle",
"i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# # Creates a taskbar icon for web2py
# # Author: Mark Larsen, mostly stolen from Mark Hammond's
# # C:\Python25\Lib\site-packages\win32\Demos\win32gui_taskbar.py
# # 11/7/08
# dual licensed under the web2py license (LGPL) and the Python license.
import os
import sys
imp... | [
[
1,
0,
0.037,
0.0041,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0412,
0.0041,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0453,
0.0041,
0,
0... | [
"import os",
"import sys",
"import base64",
"import win32con",
"import win32api",
"import win32gui",
"class TaskBarIcon:\n\n def __init__(self, iconPath=None):\n\n self.iconPath = iconPath\n self.status = []\n\n msg_TaskbarRestart = \\",
" def __init__(self, iconPath=None):\... |
"""
PyRSS2Gen - A Python library for generating RSS 2.0 feeds.
(This is the BSD license, based on the template at
http://www.opensource.org/licenses/bsd-license.php )
Copyright (c) 2003, Dalke Scientific Software, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modific... | [
[
8,
0,
0.0383,
0.0747,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0785,
0.0019,
0,
0.66,
0.0417,
136,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0805,
0.0019,
0,
0.66... | [
"\"\"\"\nPyRSS2Gen - A Python library for generating RSS 2.0 feeds.\n\n(This is the BSD license, based on the template at\n http://www.opensource.org/licenses/bsd-license.php )\n\nCopyright (c) 2003, Dalke Scientific Software, LLC",
"__name__ = \"PyRSS2Gen\"",
"__version__ = (1, 1, 0)",
"__author__ = \"Andr... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
# This program 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 Foundation; either version 3, or (at your option) any later
# version.
#
# This program is distributed ... | [
[
8,
0,
0.0255,
0.002,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0294,
0.002,
0,
0.66,
0.0667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0314,
0.002,
0,
0.66,
... | [
"\"Simple SOAP Server implementation\"",
"__author__ = \"Mariano Reingart (reingart@gmail.com)\"",
"__copyright__ = \"Copyright (C) 2010 Mariano Reingart\"",
"__license__ = \"LGPL 3.0\"",
"__version__ = \"1.03c\"",
"import logging",
"import re",
"import traceback",
"from simplexml import SimpleXMLEl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"PySimpleSOAP"
import client
import server
import simplexml
import transport | [
[
8,
0,
0.4286,
0.1429,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5714,
0.1429,
0,
0.66,
0.25,
608,
0,
1,
0,
0,
608,
0,
0
],
[
1,
0,
0.7143,
0.1429,
0,
0.66,
... | [
"\"PySimpleSOAP\"",
"import client",
"import server",
"import simplexml",
"import transport"
] |
#!/usr/bin/env python
# created my Massimo Di Pierro
# license MIT/BSD/GPL
import re
import cgi
import sys
import doctest
from optparse import OptionParser
__all__ = ['render','markmin2latex']
META = 'META'
regex_newlines = re.compile('(\n\r)|(\r\n)')
regex_dd=re.compile('\$\$(?P<latex>.*?)\$\$')
regex_code = re.comp... | [
[
1,
0,
0.0137,
0.0034,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0171,
0.0034,
0,
0.66,
0.04,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0205,
0.0034,
0,
0.... | [
"import re",
"import cgi",
"import sys",
"import doctest",
"from optparse import OptionParser",
"__all__ = ['render','markmin2latex']",
"META = 'META'",
"regex_newlines = re.compile('(\\n\\r)|(\\r\\n)')",
"regex_dd=re.compile('\\$\\$(?P<latex>.*?)\\$\\$')",
"regex_code = re.compile('('+META+')|(``... |
# this file exists for backward compatibility
__all__ = ['DAL', 'Field', 'drivers', 'gae']
from gluon.dal import DAL, Field, Table, Query, Set, Expression, Row, Rows, drivers, BaseAdapter, SQLField, SQLTable, SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL, SQLCustomType, gae
| [
[
14,
0,
0.6,
0.2,
0,
0.66,
0,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
1,
0.2,
0,
0.66,
1,
169,
0,
22,
0,
0,
169,
0,
0
]
] | [
"__all__ = ['DAL', 'Field', 'drivers', 'gae']",
"from gluon.dal import DAL, Field, Table, Query, Set, Expression, Row, Rows, drivers, BaseAdapter, SQLField, SQLTable, SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL, SQLCustomType, gae"
] |
from gluon import XML
def button(merchant_id="123456789012345",
products=[dict(name="shoes",
quantity=1,
price=23.5,
currency='USD',
description="running shoes black")]):
t = '<input name="item_%(key)... | [
[
1,
0,
0.0667,
0.0667,
0,
0.66,
0,
826,
0,
1,
0,
0,
826,
0,
0
],
[
2,
0,
0.6,
0.8667,
0,
0.66,
1,
95,
0,
2,
1,
0,
0,
0,
5
],
[
14,
1,
0.6,
0.0667,
1,
0.26,
0,
... | [
"from gluon import XML",
"def button(merchant_id=\"123456789012345\",\n products=[dict(name=\"shoes\",\n quantity=1,\n price=23.5,\n currency='USD',\n description=\"running shoes black\")]):\n t = '<in... |
# -*- coding: utf-8 -*-
import struct
import re
try:
import cStringIO as StringIO
except ImportError:
import StringIO
from err import Warning, Error, InterfaceError, DataError, \
DatabaseError, OperationalError, IntegrityError, InternalError, \
NotSupportedError, ProgrammingError
ins... | [
[
1,
0,
0.0049,
0.0024,
0,
0.66,
0,
399,
0,
1,
0,
0,
399,
0,
0
],
[
1,
0,
0.0073,
0.0024,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0159,
0.0098,
0,
... | [
"import struct",
"import re",
"try:\n import cStringIO as StringIO\nexcept ImportError:\n import StringIO",
" import cStringIO as StringIO",
" import StringIO",
"from err import Warning, Error, InterfaceError, DataError, \\\n DatabaseError, OperationalError, IntegrityError, Interna... |
import re
import datetime
import time
import sys
from constants import FIELD_TYPE, FLAG
from charset import charset_by_id
PYTHON3 = sys.version_info[0] > 2
try:
set
except NameError:
try:
from sets import BaseSet as set
except ImportError:
from sets import Set as set
ESCAPE_REGEX = re.co... | [
[
1,
0,
0.0028,
0.0028,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0056,
0.0028,
0,
0.66,
0.0244,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0084,
0.0028,
0,
... | [
"import re",
"import datetime",
"import time",
"import sys",
"from constants import FIELD_TYPE, FLAG",
"from charset import charset_by_id",
"PYTHON3 = sys.version_info[0] > 2",
"try:\n set\nexcept NameError:\n try:\n from sets import BaseSet as set\n except ImportError:\n from s... |
from time import localtime
from datetime import date, datetime, time, timedelta
Date = date
Time = time
TimeDelta = timedelta
Timestamp = datetime
def DateFromTicks(ticks):
return date(*localtime(ticks)[:3])
def TimeFromTicks(ticks):
return time(*localtime(ticks)[3:6])
def TimestampFromTicks(ticks):
ret... | [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.125,
0.0625,
0,
0.66,
0.125,
426,
0,
4,
0,
0,
426,
0,
0
],
[
14,
0,
0.25,
0.0625,
0,
0.6... | [
"from time import localtime",
"from datetime import date, datetime, time, timedelta",
"Date = date",
"Time = time",
"TimeDelta = timedelta",
"Timestamp = datetime",
"def DateFromTicks(ticks):\n return date(*localtime(ticks)[:3])",
" return date(*localtime(ticks)[:3])",
"def TimeFromTicks(ticks... |
import struct
def byte2int(b):
if isinstance(b, int):
return b
else:
return struct.unpack("!B", b)[0]
def int2byte(i):
return struct.pack("!B", i)
def join_bytes(bs):
if len(bs) == 0:
return ""
else:
rv = bs[0]
for b in bs[1:]:
rv += b
r... | [
[
1,
0,
0.0526,
0.0526,
0,
0.66,
0,
399,
0,
1,
0,
0,
399,
0,
0
],
[
2,
0,
0.2632,
0.2632,
0,
0.66,
0.3333,
33,
0,
1,
1,
0,
0,
0,
2
],
[
4,
1,
0.2895,
0.2105,
1,
0.6... | [
"import struct",
"def byte2int(b):\n if isinstance(b, int):\n return b\n else:\n return struct.unpack(\"!B\", b)[0]",
" if isinstance(b, int):\n return b\n else:\n return struct.unpack(\"!B\", b)[0]",
" return b",
" return struct.unpack(\"!B\", b)[0]",
... |
MBLENGTH = {
8:1,
33:3,
88:2,
91:2
}
class Charset:
def __init__(self, id, name, collation, is_default):
self.id, self.name, self.collation = id, name, collation
self.is_default = is_default == 'Yes'
class Charsets:
def __init__(self):
self._by_i... | [
[
14,
0,
0.0201,
0.0345,
0,
0.66,
0,
757,
0,
0,
0,
0,
0,
6,
0
],
[
3,
0,
0.0546,
0.023,
0,
0.66,
0.0075,
237,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.0575,
0.0172,
1,
0.15... | [
"MBLENGTH = {\n 8:1,\n 33:3,\n 88:2,\n 91:2\n }",
"class Charset:\n def __init__(self, id, name, collation, is_default):\n self.id, self.name, self.collation = id, name, collation\n self.is_default = is_default == 'Yes'",
" def __init__(self, id, name, coll... |
import pymysql
import unittest
class PyMySQLTestCase(unittest.TestCase):
# Edit this to suit your test environment.
databases = [
{"host":"localhost","user":"root",
"passwd":"","db":"test_pymysql", "use_unicode": True},
{"host":"localhost","user":"root","passwd":"","db":"test_pymysql2"... | [
[
1,
0,
0.05,
0.05,
0,
0.66,
0,
244,
0,
1,
0,
0,
244,
0,
0
],
[
1,
0,
0.1,
0.05,
0,
0.66,
0.5,
88,
0,
1,
0,
0,
88,
0,
0
],
[
3,
0,
0.575,
0.8,
0,
0.66,
1,
2... | [
"import pymysql",
"import unittest",
"class PyMySQLTestCase(unittest.TestCase):\n # Edit this to suit your test environment.\n databases = [\n {\"host\":\"localhost\",\"user\":\"root\",\n \"passwd\":\"\",\"db\":\"test_pymysql\", \"use_unicode\": True},\n {\"host\":\"localhost\",\"use... |
from pymysql.tests.test_issues import *
from pymysql.tests.test_example import *
from pymysql.tests.test_basic import *
from pymysql.tests.test_DictCursor import *
import sys
if sys.version_info[0] == 2:
# MySQLdb tests were designed for Python 3
from pymysql.tests.thirdparty import *
if __name__ == "__main__... | [
[
1,
0,
0.0769,
0.0769,
0,
0.66,
0,
897,
0,
1,
0,
0,
897,
0,
0
],
[
1,
0,
0.1538,
0.0769,
0,
0.66,
0.1667,
138,
0,
1,
0,
0,
138,
0,
0
],
[
1,
0,
0.2308,
0.0769,
0,
... | [
"from pymysql.tests.test_issues import *",
"from pymysql.tests.test_example import *",
"from pymysql.tests.test_basic import *",
"from pymysql.tests.test_DictCursor import *",
"import sys",
"if sys.version_info[0] == 2:\n # MySQLdb tests were designed for Python 3\n from pymysql.tests.thirdparty imp... |
'''
PyMySQL: A pure-Python drop-in replacement for MySQLdb.
Copyright (c) 2010 PyMySQL contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitati... | [
[
8,
0,
0.0954,
0.1832,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1985,
0.0076,
0,
0.66,
0.0345,
557,
0,
0,
0,
0,
0,
8,
0
],
[
1,
0,
0.2137,
0.0076,
0,
0.66,... | [
"'''\nPyMySQL: A pure-Python drop-in replacement for MySQLdb.\n\nCopyright (c) 2010 PyMySQL contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including wi... |
COM_SLEEP = 0x00
COM_QUIT = 0x01
COM_INIT_DB = 0x02
COM_QUERY = 0x03
COM_FIELD_LIST = 0x04
COM_CREATE_DB = 0x05
COM_DROP_DB = 0x06
COM_REFRESH = 0x07
COM_SHUTDOWN = 0x08
COM_STATISTICS = 0x09
COM_PROCESS_INFO = 0x0a
COM_CONNECT = 0x0b
COM_PROCESS_KILL = 0x0c
COM_DEBUG = 0x0d
COM_PING = 0x0e
COM_TIME = 0x0f
COM_DELAYED... | [
[
14,
0,
0.087,
0.0435,
0,
0.66,
0,
19,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1304,
0.0435,
0,
0.66,
0.0476,
408,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1739,
0.0435,
0,
0.6... | [
"COM_SLEEP = 0x00",
"COM_QUIT = 0x01",
"COM_INIT_DB = 0x02",
"COM_QUERY = 0x03",
"COM_FIELD_LIST = 0x04",
"COM_CREATE_DB = 0x05",
"COM_DROP_DB = 0x06",
"COM_REFRESH = 0x07",
"COM_SHUTDOWN = 0x08",
"COM_STATISTICS = 0x09",
"COM_PROCESS_INFO = 0x0a",
"COM_CONNECT = 0x0b",
"COM_PROCESS_KILL = 0... |
DECIMAL = 0
TINY = 1
SHORT = 2
LONG = 3
FLOAT = 4
DOUBLE = 5
NULL = 6
TIMESTAMP = 7
LONGLONG = 8
INT24 = 9
DATE = 10
TIME = 11
DATETIME = 12
YEAR = 13
NEWDATE = 14
VARCHAR = 15
BIT = 16
NEWDECIMAL = 246
ENUM = 247
SET = 248
TINY_BLOB = 249
MEDIUM_BLOB = 250
LONG_BLOB = 251
BLOB = 252
VAR_STRING = 253
STRING = 254
GEO... | [
[
14,
0,
0.0938,
0.0312,
0,
0.66,
0,
22,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.125,
0.0312,
0,
0.66,
0.0357,
474,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1562,
0.0312,
0,
0.6... | [
"DECIMAL = 0",
"TINY = 1",
"SHORT = 2",
"LONG = 3",
"FLOAT = 4",
"DOUBLE = 5",
"NULL = 6",
"TIMESTAMP = 7",
"LONGLONG = 8",
"INT24 = 9",
"DATE = 10",
"TIME = 11",
"DATETIME = 12",
"YEAR = 13",
"NEWDATE = 14",
"VARCHAR = 15",
"BIT = 16",
"NEWDECIMAL = 246",
"ENUM = 247",
"SET = ... |
NOT_NULL = 1
PRI_KEY = 2
UNIQUE_KEY = 4
MULTIPLE_KEY = 8
BLOB = 16
UNSIGNED = 32
ZEROFILL = 64
BINARY = 128
ENUM = 256
AUTO_INCREMENT = 512
TIMESTAMP = 1024
SET = 2048
PART_KEY = 16384
GROUP = 32767
UNIQUE = 65536
| [
[
14,
0,
0.0667,
0.0667,
0,
0.66,
0,
79,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.1333,
0.0667,
0,
0.66,
0.0714,
978,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2,
0.0667,
0,
0.66,... | [
"NOT_NULL = 1",
"PRI_KEY = 2",
"UNIQUE_KEY = 4",
"MULTIPLE_KEY = 8",
"BLOB = 16",
"UNSIGNED = 32",
"ZEROFILL = 64",
"BINARY = 128",
"ENUM = 256",
"AUTO_INCREMENT = 512",
"TIMESTAMP = 1024",
"SET = 2048",
"PART_KEY = 16384",
"GROUP = 32767",
"UNIQUE = 65536"
] |
ERROR_FIRST = 1000
HASHCHK = 1000
NISAMCHK = 1001
NO = 1002
YES = 1003
CANT_CREATE_FILE = 1004
CANT_CREATE_TABLE = 1005
CANT_CREATE_DB = 1006
DB_CREATE_EXISTS = 1007
DB_DROP_EXISTS = 1008
DB_DROP_DELETE = 1009
DB_DROP_RMDIR = 1010
CANT_DELETE_FILE = 1011
CANT_FIND_SYSTEM_REC = 1012
CANT_GET_STAT = 1013
CANT_GET_WD = 1... | [
[
14,
0,
0.0042,
0.0021,
0,
0.66,
0,
135,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0064,
0.0021,
0,
0.66,
0.0021,
316,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0085,
0.0021,
0,
0... | [
"ERROR_FIRST = 1000",
"HASHCHK = 1000",
"NISAMCHK = 1001",
"NO = 1002",
"YES = 1003",
"CANT_CREATE_FILE = 1004",
"CANT_CREATE_TABLE = 1005",
"CANT_CREATE_DB = 1006",
"DB_CREATE_EXISTS = 1007",
"DB_DROP_EXISTS = 1008",
"DB_DROP_DELETE = 1009",
"DB_DROP_RMDIR = 1010",
"CANT_DELETE_FILE = 1011"... |
SERVER_STATUS_IN_TRANS = 1
SERVER_STATUS_AUTOCOMMIT = 2
SERVER_MORE_RESULTS_EXISTS = 8
SERVER_QUERY_NO_GOOD_INDEX_USED = 16
SERVER_QUERY_NO_INDEX_USED = 32
SERVER_STATUS_CURSOR_EXISTS = 64
SERVER_STATUS_LAST_ROW_SENT = 128
SERVER_STATUS_DB_DROPPED = 256
SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512
SERVER_STATUS_METADATA_C... | [
[
14,
0,
0.1667,
0.0833,
0,
0.66,
0,
869,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.25,
0.0833,
0,
0.66,
0.1111,
540,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.3333,
0.0833,
0,
0.6... | [
"SERVER_STATUS_IN_TRANS = 1",
"SERVER_STATUS_AUTOCOMMIT = 2",
"SERVER_MORE_RESULTS_EXISTS = 8",
"SERVER_QUERY_NO_GOOD_INDEX_USED = 16",
"SERVER_QUERY_NO_INDEX_USED = 32",
"SERVER_STATUS_CURSOR_EXISTS = 64",
"SERVER_STATUS_LAST_ROW_SENT = 128",
"SERVER_STATUS_DB_DROPPED = 256",
"SERVER_STATUS_NO_BACK... |
LONG_PASSWORD = 1
FOUND_ROWS = 1 << 1
LONG_FLAG = 1 << 2
CONNECT_WITH_DB = 1 << 3
NO_SCHEMA = 1 << 4
COMPRESS = 1 << 5
ODBC = 1 << 6
LOCAL_FILES = 1 << 7
IGNORE_SPACE = 1 << 8
PROTOCOL_41 = 1 << 9
INTERACTIVE = 1 << 10
SSL = 1 << 11
IGNORE_SIGPIPE = 1 << 12
TRANSACTIONS = 1 << 13
SECURE_CONNECTION = 1 << 15
MULTI_STA... | [
[
14,
0,
0.1,
0.05,
0,
0.66,
0,
65,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.15,
0.05,
0,
0.66,
0.0588,
129,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2,
0.05,
0,
0.66,
0.1176... | [
"LONG_PASSWORD = 1",
"FOUND_ROWS = 1 << 1",
"LONG_FLAG = 1 << 2",
"CONNECT_WITH_DB = 1 << 3",
"NO_SCHEMA = 1 << 4",
"COMPRESS = 1 << 5",
"ODBC = 1 << 6",
"LOCAL_FILES = 1 << 7",
"IGNORE_SPACE = 1 << 8",
"PROTOCOL_41 = 1 << 9",
"INTERACTIVE = 1 << 10",
"SSL = 1 << 11",
"IGNORE_SIGPIPE = 1 << ... |
from gluon.contrib.memcache.memcache import Client
from gluon.cache import CacheAbstract
import time
"""
examle of usage:
cache.memcache = MemcacheClient(request,[127.0.0.1:11211],debug=true)
"""
import cPickle as pickle
import thread
from gluon import current
DEFAULT_TIME_EXPIRE = 300 # seconds (must be the same a... | [
[
1,
0,
0.009,
0.009,
0,
0.66,
0,
698,
0,
1,
0,
0,
698,
0,
0
],
[
1,
0,
0.018,
0.009,
0,
0.66,
0.1111,
38,
0,
1,
0,
0,
38,
0,
0
],
[
1,
0,
0.027,
0.009,
0,
0.66,
... | [
"from gluon.contrib.memcache.memcache import Client",
"from gluon.cache import CacheAbstract",
"import time",
"\"\"\"\nexamle of usage:\n\ncache.memcache = MemcacheClient(request,[127.0.0.1:11211],debug=true)\n\"\"\"",
"import cPickle as pickle",
"import thread",
"from gluon import current",
"DEFAULT_... |
# (c) 2007 Chris AtLee <chris@atlee.ca>
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
PAM module for python
Provides an authenticate function that will allow the caller to authenticate
a user against the Pluggable Authentication Modules (PAM) on the system.
Implemented usi... | [
[
8,
0,
0.0586,
0.0625,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0938,
0.0078,
0,
0.66,
0.0345,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1094,
0.0078,
0,
0.66,... | [
"\"\"\"\nPAM module for python\n\nProvides an authenticate function that will allow the caller to authenticate\na user against the Pluggable Authentication Modules (PAM) on the system.\n\nImplemented using ctypes, so no compilation is necessary.\n\"\"\"",
"__all__ = ['authenticate']",
"from ctypes import CDLL, ... |
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | [
[
8,
0,
0.1082,
0.0112,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1194,
0.0037,
0,
0.66,
0.0526,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1231,
0.0037,
0,
0.66... | [
"\"\"\"\nAn interactive, stateful AJAX shell that runs Python code on the server.\n\"\"\"",
"import logging",
"import new",
"import os",
"import cPickle",
"import sys",
"import traceback",
"import types",
"import wsgiref.handlers",
"import StringIO",
"import threading",
"locker = threading.RLo... |
"""
Developed by niphlod@gmail.com
"""
import redis
from redis.exceptions import ConnectionError
from gluon import current
from gluon.storage import Storage
import cPickle as pickle
import time
import re
import logging
import thread
logger = logging.getLogger("web2py.session.redis")
locker = thread.allocate_lock()
... | [
[
8,
0,
0.0096,
0.0144,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.024,
0.0048,
0,
0.66,
0.0625,
977,
0,
1,
0,
0,
977,
0,
0
],
[
1,
0,
0.0288,
0.0048,
0,
0.66,... | [
"\"\"\"\nDeveloped by niphlod@gmail.com\n\"\"\"",
"import redis",
"from redis.exceptions import ConnectionError",
"from gluon import current",
"from gluon.storage import Storage",
"import cPickle as pickle",
"import time",
"import re",
"import logging",
"import thread",
"logger = logging.getLogg... |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, Mathieu Fenniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above co... | [
[
14,
0,
0.0377,
0.0013,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0403,
0.0013,
0,
0.66,
0.0345,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0428,
0.0013,
0,
0.... | [
"__author__ = \"Mathieu Fenniak\"",
"__version__ = \"1.10\"",
"import datetime",
"import time",
"import interface",
"import types",
"import threading",
"from errors import *",
"from warnings import warn",
"apilevel = \"2.0\"",
"threadsafety = 3",
"paramstyle = 'format' # paramstyle can be chan... |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, Mathieu Fenniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above co... | [
[
14,
0,
0.0213,
0.0007,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0227,
0.0007,
0,
0.66,
0.0185,
687,
0,
1,
0,
0,
687,
0,
0
],
[
7,
0,
0.0245,
0.0028,
0,
0... | [
"__author__ = \"Mathieu Fenniak\"",
"import socket",
"try:\n import ssl as sslmodule\nexcept ImportError:\n sslmodule = None",
" import ssl as sslmodule",
" sslmodule = None",
"import select",
"import threading",
"import struct",
"import hashlib",
"from cStringIO import StringIO",
"f... |
class MulticastDelegate(object):
def __init__(self):
self.delegates = []
def __iadd__(self, delegate):
self.add(delegate)
return self
def add(self, delegate):
self.delegates.append(delegate)
def __isub__(self, delegate):
self.delegates.remove(dele... | [
[
3,
0,
0.525,
0.9,
0,
0.66,
0,
718,
0,
5,
0,
0,
186,
0,
4
],
[
2,
1,
0.175,
0.1,
1,
0.28,
0,
555,
0,
1,
0,
0,
0,
0,
0
],
[
14,
2,
0.2,
0.05,
2,
0.65,
0,
74... | [
"class MulticastDelegate(object):\n def __init__(self):\n self.delegates = []\n\n def __iadd__(self, delegate):\n self.add(delegate)\n return self",
" def __init__(self):\n self.delegates = []",
" self.delegates = []",
" def __iadd__(self, delegate):\n sel... |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, Mathieu Fenniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above co... | [
[
14,
0,
0.0424,
0.0014,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0452,
0.0014,
0,
0.66,
0.0167,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0466,
0.0014,
0,
0... | [
"__author__ = \"Mathieu Fenniak\"",
"import datetime",
"import decimal",
"import struct",
"import math",
"from errors import (NotSupportedError, ArrayDataParseError, InternalError,\n ArrayContentEmptyError, ArrayContentNotHomogenousError,\n ArrayContentNotSupportedError, ArrayDimensionsNotCo... |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, Mathieu Fenniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above co... | [
[
14,
0,
0.8108,
0.027,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.8649,
0.027,
0,
0.66,
0.25,
782,
0,
1,
0,
0,
782,
0,
0
],
[
14,
0,
0.8919,
0.027,
0,
0.66,... | [
"__author__ = \"Mathieu Fenniak\"",
"import dbapi as DBAPI",
"pg8000_dbapi = DBAPI",
"from interface import *",
"from types import Bytea"
] |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, Mathieu Fenniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above co... | [
[
14,
0,
0.2609,
0.0087,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.2826,
0.0174,
0,
0.66,
0.0476,
781,
0,
0,
0,
0,
542,
0,
0
],
[
3,
0,
0.3087,
0.0174,
0,
0... | [
"__author__ = \"Mathieu Fenniak\"",
"class Warning(StandardError):\n pass",
"class Error(StandardError):\n pass",
"class InterfaceError(Error):\n pass",
"class ConnectionClosedError(InterfaceError):\n def __init__(self):\n InterfaceError.__init__(self, \"connection is closed\")",
" d... |
from types import StringType, ListType, TupleType
from copy import deepcopy
from Elements import *
DEFAULT_TAB_WIDTH = 720
ParagraphAlignmentMap = { ParagraphPropertySet.LEFT : 'ql',
ParagraphPropertySet.RIGHT : 'qr',
ParagraphPropertySet.CENTER : 'qc... | [
[
1,
0,
0.0016,
0.0016,
0,
0.66,
0,
209,
0,
3,
0,
0,
209,
0,
0
],
[
1,
0,
0.0031,
0.0016,
0,
0.66,
0.0714,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.0047,
0.0016,
0,
... | [
"from types import StringType, ListType, TupleType",
"from copy import deepcopy",
"from Elements import *",
"DEFAULT_TAB_WIDTH = 720",
"ParagraphAlignmentMap = { ParagraphPropertySet.LEFT : 'ql',\n ParagraphPropertySet.RIGHT : 'qr',\n ParagraphPro... |
from types import IntType, FloatType, LongType, StringTypes
from copy import deepcopy
from binascii import hexlify
from Constants import *
from Styles import *
class UnhandledParamError( Exception ) :
def __init__( self, param ) :
Exception.__init__( self, "Don't... | [
[
1,
0,
0.0013,
0.0013,
0,
0.66,
0,
209,
0,
4,
0,
0,
209,
0,
0
],
[
1,
0,
0.0026,
0.0013,
0,
0.66,
0.0083,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.004,
0.0013,
0,
0... | [
"from types import IntType, FloatType, LongType, StringTypes",
"from copy import deepcopy",
"from binascii import hexlify",
"from Constants import *",
"from Styles import *",
"class UnhandledParamError( Exception ) :\n def __init__( self, param ) :\n Ex... |
"""
A Styles is a collection of PropertySets that can be applied to a particular RTF element.
At present there are only two, Text and Paragraph but ListStyles will be added soon too.
"""
from PropertySets import *
class TextStyle :
def __init__( self, text_props, name=None, shading_props=None ) :
self.... | [
[
8,
0,
0.0426,
0.0745,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0957,
0.0106,
0,
0.66,
0.3333,
611,
0,
1,
0,
0,
611,
0,
0
],
[
3,
0,
0.2287,
0.234,
0,
0.66,... | [
"\"\"\"\nA Styles is a collection of PropertySets that can be applied to a particular RTF element.\n\nAt present there are only two, Text and Paragraph but ListStyles will be added soon too.\n\n\n\"\"\"",
"from PropertySets import *",
"class TextStyle :\n def __init__( self, text_props, name=None, shading_pr... |
"""
PropertySets group common attributes together, each property set is used to control a specific part of the rendering.
PropertySets can be used in different elements of the document.
For example the FramePropertySet is used in paragraphs, tables, cells, etc.
The TextPropertySet can be used for text or in a Paragr... | [
[
8,
0,
0.0112,
0.0204,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0245,
0.002,
0,
0.66,
0.0417,
209,
0,
1,
0,
0,
209,
0,
0
],
[
1,
0,
0.0266,
0.002,
0,
0.66,
... | [
"\"\"\"\nPropertySets group common attributes together, each property set is used to control a specific part of the rendering.\n\nPropertySets can be used in different elements of the document.\n\nFor example the FramePropertySet is used in paragraphs, tables, cells, etc.\n\nThe TextPropertySet can be used for text... |
from PropertySets import *
from Elements import *
from Styles import *
from Renderer import *
def dumps(doc):
import cStringIO
s=cStringIO.StringIO()
r=Renderer()
r.Write(doc,s)
return s.getvalue()
| [
[
1,
0,
0.0833,
0.0833,
0,
0.66,
0,
611,
0,
1,
0,
0,
611,
0,
0
],
[
1,
0,
0.1667,
0.0833,
0,
0.66,
0.25,
413,
0,
1,
0,
0,
413,
0,
0
],
[
1,
0,
0.25,
0.0833,
0,
0.66... | [
"from PropertySets import *",
"from Elements import *",
"from Styles import *",
"from Renderer import *",
"def dumps(doc):\n import cStringIO\n s=cStringIO.StringIO()\n r=Renderer()\n r.Write(doc,s)\n return s.getvalue()",
" import cStringIO",
" s=cStri... |
class ViewKind :
"""An integer (0-5) that represents the view mode of the document."""
NONE = 0
PageLayout = 1
Outline = 2
MasterDocument = 3
Normal = 4
OnlineLayout = 5
DEFAULT = PageLayout
def _IsValid( cls, value ) :
return value in [ 0, 1... | [
[
3,
0,
0.0506,
0.0949,
0,
0.66,
0,
480,
0,
1,
0,
0,
0,
0,
1
],
[
8,
1,
0.0127,
0.0063,
1,
0.31,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.0253,
0.0063,
1,
0.31,
... | [
"class ViewKind :\n \"\"\"An integer (0-5) that represents the view mode of the document.\"\"\"\n\n NONE = 0\n PageLayout = 1\n Outline = 2\n MasterDocument = 3\n Normal = 4",
" \"\"\"An integer (0-5) that represents the view mode of the document.\"\"\"",
" N... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
# Fonts:
fpdf_charwidths = {}
fpdf_charwidths['courier']={}
for i in xrange(0,256):
fpdf_charwidths['courier'][chr(i)]=600
fpdf_charwidths['courierB']=fpdf_charwidths['courier']
fpdf_charwidths['courierI']=fpdf_charwidths['courier']
fpdf_c... | [
[
14,
0,
0.0385,
0.0064,
0,
0.66,
0,
225,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.0513,
0.0064,
0,
0.66,
0.0833,
0,
0,
0,
0,
0,
0,
6,
0
],
[
6,
0,
0.0769,
0.0321,
0,
0.66... | [
"fpdf_charwidths = {}",
"fpdf_charwidths['courier']={}",
"for i in xrange(0,256):\n fpdf_charwidths['courier'][chr(i)]=600\n fpdf_charwidths['courierB']=fpdf_charwidths['courier']\n fpdf_charwidths['courierI']=fpdf_charwidths['courier']\n fpdf_charwidths['courierBI']=fpdf_charwidths['courier']",
"... |
#******************************************************************************
# TTFontFile class
#
# This class is based on The ReportLab Open Source PDF library ... | [
[
1,
0,
0.0175,
0.0009,
0,
0.66,
0,
399,
0,
3,
0,
0,
399,
0,
0
],
[
1,
0,
0.0185,
0.0009,
0,
0.66,
0.0769,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0194,
0.0009,
0,
... | [
"from struct import pack, unpack, unpack_from",
"import re",
"import warnings",
"from php import die, substr, str_repeat, str_pad, strlen, count",
"_TTF_MAC_HEADER = False",
"GF_WORDS = (1 << 0)",
"GF_SCALE = (1 << 3)",
"GF_MORE = (1 << 5)",
"GF_XYSCALE = (1 << 6)",
"GF_TWOBYTWO = (1 << 7)",
"... |
# -*- coding: iso-8859-1 -*-
"PDF Template Helper for FPDF.py"
__author__ = "Mariano Reingart <reingart@gmail.com>"
__copyright__ = "Copyright (C) 2010 Mariano Reingart"
__license__ = "LGPL 3.0"
import sys,os,csv
from fpdf import FPDF
def rgb(col):
return (col // 65536), (col // 256 % 256), (col% 256)
class Te... | [
[
8,
0,
0.01,
0.0033,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0166,
0.0033,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0199,
0.0033,
0,
0.66,
... | [
"\"PDF Template Helper for FPDF.py\"",
"__author__ = \"Mariano Reingart <reingart@gmail.com>\"",
"__copyright__ = \"Copyright (C) 2010 Mariano Reingart\"",
"__license__ = \"LGPL 3.0\"",
"import sys,os,csv",
"from fpdf import FPDF",
"def rgb(col):\n return (col // 65536), (col // 256 % 256), (col% 256... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
# fpdf php helpers:
def substr(s, start, length=-1):
if length < 0:
length=len(s)-start
return s[start:start+length]
def sprintf(fmt, *args): return fmt % args
def print_r(array):
if not isinstance(array, dict):
a... | [
[
2,
0,
0.1531,
0.0816,
0,
0.66,
0,
219,
0,
3,
1,
0,
0,
0,
1
],
[
4,
1,
0.1531,
0.0408,
1,
0.31,
0,
0,
0,
0,
0,
0,
0,
0,
1
],
[
14,
2,
0.1633,
0.0204,
2,
0.23,
... | [
"def substr(s, start, length=-1):\n if length < 0:\n length=len(s)-start\n return s[start:start+length]",
" if length < 0:\n length=len(s)-start",
" length=len(s)-start",
" return s[start:start+length]",
"def sprintf(fmt, *args): return fmt %... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"FPDF for python"
__license__ = "LGPL 3.0"
__version__ = "1.7"
from fpdf import *
try:
from html import HTMLMixin
except ImportError:
import warnings
warnings.warn("web2py gluon package not installed, required for html2pdf")
from template import Template
| [
[
8,
0,
0.25,
0.0625,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.375,
0.0625,
0,
0.66,
0.2,
11,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.4375,
0.0625,
0,
0.66,
0... | [
"\"FPDF for python\"",
"__license__ = \"LGPL 3.0\"",
"__version__ = \"1.7\"",
"from fpdf import *",
"try:\n from html import HTMLMixin\nexcept ImportError:\n import warnings\n warnings.warn(\"web2py gluon package not installed, required for html2pdf\")",
" from html import HTMLMixin",
" i... |
"""
Developed by Massimo Di Pierro
Released under the web2py license (LGPL)
What does it do?
if html is a variable containing HTML text and urls in the text, when you call
html = expend_html(html)
it automatically converts the url to links but when possible it embeds the object being linked.
In particular it ca... | [
[
8,
0,
0.1014,
0.1982,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2074,
0.0046,
0,
0.66,
0.0435,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.212,
0.0046,
0,
0.66,... | [
"\"\"\"\nDeveloped by Massimo Di Pierro\nReleased under the web2py license (LGPL)\n\nWhat does it do?\n\nif html is a variable containing HTML text and urls in the text, when you call",
"import re",
"import cgi",
"import sys",
"from simplejson import loads",
"import urllib",
"import uuid",
"try:\n ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Developed by Robin Bhattacharyya (memecache for GAE)
Released under the web2py license (LGPL)
from gluon.contrib.gae_memcache import MemcacheClient
cache.ram=cache.disk=MemcacheClient(request)
"""
import time
from google.appengine.api.memcache import Client
class M... | [
[
8,
0,
0.1029,
0.1029,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1765,
0.0147,
0,
0.66,
0.3333,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.1912,
0.0147,
0,
0.66... | [
"\"\"\"\nDeveloped by Robin Bhattacharyya (memecache for GAE)\nReleased under the web2py license (LGPL)\n\nfrom gluon.contrib.gae_memcache import MemcacheClient\ncache.ram=cache.disk=MemcacheClient(request)\n\"\"\"",
"import time",
"from google.appengine.api.memcache import Client",
"class MemcacheClient(obje... |
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | [
[
8,
0,
0.025,
0.0417,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.05,
0.0083,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
7,
0,
0.1125,
0.0667,
0,
0.66,
... | [
"\"\"\"Drop-in replacement for collections.OrderedDict by Raymond Hettinger\n\nhttp://code.activestate.com/recipes/576693/\n\n\"\"\"",
"from UserDict import DictMixin",
"try:\n all\nexcept NameError:\n def all(seq):\n for elem in seq:\n if not elem:\n return False\n ... |
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
raise ImportError # because assumes simplejson in path
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['m... | [
[
8,
0,
0.019,
0.0253,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.038,
0.0127,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.0886,
0.0886,
0,
0.66,
... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"def _import_c_make_scanner():\n try:\n raise ImportError # because assumes simplejson in path\n from simplejson._speedups import make_scanner\n return make_scanner\n except ImportError:\n return None",
" try:\n raise... |
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
raise ImportError # because assumes simplejson in path
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
re... | [
[
8,
0,
0.003,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.006,
0.002,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"from decimal import Decimal",
"def _import_speedups():\n try:\n raise ImportError # because assumes simplejson in path\n from simplejson import _speedups\n return _speedups.encode_basestring_ascii, _speedups.make_encoder\n ... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | [
[
8,
0,
0.1136,
0.225,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2273,
0.0023,
0,
0.66,
0.0625,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2341,
0.0114,
0,
0.66,... | [
"r\"\"\"JSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\n:mod:`simplejson` exposes an API familiar to users of the standard library\n:mod:`marshal` and :mod:`pickle` modules. It is the externally maintaine... |
import urllib
import simplejson
class Stripe:
"""
Usage:
key='<api key>'
d = Stripe(key).charge(
amount=100,
currency='usd',
card_number='4242424242424242',
card_exp_month='5',
card_exp_year='2012',
card_cvc_chec... | [
[
1,
0,
0.0152,
0.0152,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0303,
0.0152,
0,
0.66,
0.3333,
386,
0,
1,
0,
0,
386,
0,
0
],
[
3,
0,
0.4697,
0.803,
0,
0... | [
"import urllib",
"import simplejson",
"class Stripe:\n \"\"\"\n Usage:\n key='<api key>'\n d = Stripe(key).charge(\n amount=100,\n currency='usd',\n card_number='4242424242424242',",
" \"\"\"\n Usage:\n key='<api key>'\n d = Stripe(key).charge(... |
from markdown2 import *
from gluon.html import XML
def WIKI(text, encoding="utf8", safe_mode='escape', html4tags=False, **attributes):
if not text:
test = ''
if attributes.has_key('extras'):
extras = attributes['extras']
del attributes['extras']
else:
extras=None
text = ... | [
[
1,
0,
0.0588,
0.0588,
0,
0.66,
0,
623,
0,
1,
0,
0,
623,
0,
0
],
[
1,
0,
0.1176,
0.0588,
0,
0.66,
0.5,
373,
0,
1,
0,
0,
373,
0,
0
],
[
2,
0,
0.5882,
0.7647,
0,
0.6... | [
"from markdown2 import *",
"from gluon.html import XML",
"def WIKI(text, encoding=\"utf8\", safe_mode='escape', html4tags=False, **attributes):\n if not text:\n test = ''\n if attributes.has_key('extras'):\n extras = attributes['extras']\n del attributes['extras']\n else:\n ... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for zh (Chinese)
nplurals=1 # Chinese language has ONE form!
# Always returns 0:
get_plural_id = lambda n: 0
# Construct and return plural form of *word* using
# *plural_id* (which ALWAYS>0). This function will be executed
# for words (or phrases) not foun... | [
[
14,
0,
0.3571,
0.0714,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.5714,
0.0714,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=1 # Chinese language has ONE form!",
"get_plural_id = lambda n: 0"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for it (Italian)
nplurals=2 # Italian language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Italian language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for es (Spanish)
nplurals=2 # Spanish language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Spanish language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for ja (Japanese)
nplurals=1 # Japanese language has ONE form!
# Always returns 0:
get_plural_id = lambda n: 0
# Construct and return plural form of *word* using
# *plural_id* (which ALWAYS>0). This function will be executed
# for words (or phrases) not fo... | [
[
14,
0,
0.3571,
0.0714,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.5714,
0.0714,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=1 # Japanese language has ONE form!",
"get_plural_id = lambda n: 0"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for cs (Czech)
nplurals=3 # Czech language has 3 forms:
# 1 singular and 2 plurals
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: (... | [
[
14,
0,
0.2632,
0.0526,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6316,
0.1579,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=3 # Czech language has 3 forms:",
"get_plural_id = lambda n: ( 0 if n==1 else\n 1 if 2<=n<=4 else\n 2 )"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for id (Malay)
nplurals=2 # Malay language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: in... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Malay language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for af (Afrikaans (South Africa))
nplurals=2 # Afrikaans language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_p... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Afrikaans language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for sk (Slovak (Slovakia))
nplurals=3 # Slovak language has 3 forms:
# 1 singular and 2 plurals
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = ... | [
[
14,
0,
0.25,
0.05,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.625,
0.2,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=3 # Slovak language has 3 forms:",
"get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else\n 1 if n % 10 >= 2 and n % 10 <= 4 and\n (n % 100 < 10 or n % 100 >= 20) else\n 2)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for uk (Ukrainian)
nplurals=3 # Ukrainian language has 3 forms:
# 1 singular and 2 plurals
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambd... | [
[
14,
0,
0.2381,
0.0476,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.5952,
0.1905,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=3 # Ukrainian language has 3 forms:",
"get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else\n 1 if n % 10 >= 2 and n % 10 <= 4 and\n (n % 100 < 10 or n % 100 >= 20) else\n 2)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for pl (Polish)
nplurals=3 # Polish language has 3 forms:
# 1 singular and 2 plurals
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: (... | [
[
14,
0,
0.2632,
0.0526,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6316,
0.1579,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=3 # Polish language has 3 forms:",
"get_plural_id = lambda n: (0 if n==1 else\n 1 if 2<=n<=4 else\n 2)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for ru (Russian)
nplurals=3 # Russian language has 3 forms:
# 1 singular and 2 plurals
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n:... | [
[
14,
0,
0.25,
0.05,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.625,
0.2,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=3 # Russian language has 3 forms:",
"get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else\n 1 if n % 10 >= 2 and n % 10 <= 4 and\n (n % 100 < 10 or n % 100 >= 20) else\n 2)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for de (Deutsch)
nplurals=2 # German language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n:... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # German language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for bg (Bulgarian)
nplurals=2 # Bulgarian language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lamb... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Bulgarian language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for pt (Portuguese)
nplurals=2 # Portuguese has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: i... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Portuguese has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for en (English)
nplurals=2 # English language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n... | [
[
14,
0,
0.25,
0.05,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.55,
0.05,
0,
0.66,
0.5,
283,
9,
0,
0,
0,
0,
0,
1
],
[
14,
0,
0.875,
0.2,
0,
0.66,
1,
... | [
"nplurals=2 # English language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)",
"construct_plural_form = lambda word, plural_id: (word +\n ('es' if word[-1:] in ('s','x','o') or\n word[-2:] in ('sh','ch')\n else 's'))"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for sl (Slovenian)
nplurals=4 # Slovenian language has 4 forms:
# 1 singular and 3 plurals
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambd... | [
[
14,
0,
0.25,
0.05,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.625,
0.2,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=4 # Slovenian language has 4 forms:",
"get_plural_id = lambda n: (0 if n % 100 == 1 else\n 1 if n % 100 == 2 else\n 2 if n % 100 in (3,4) else\n 3)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for he (Hindi)
nplurals=2 # Hindi has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: int(n != 1)... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Hindi has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for hu (Hungarian)
nplurals=2 # Hungarian language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lamb... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Hungarian language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for he (Hebrew)
nplurals=2 # Hebrew language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: ... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Hebrew language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for fr (French))
nplurals=2 # French language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n:... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # French language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for ro (Romanian)
nplurals=2 # Romanian has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: int(n... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Romanian has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for tr (Turkish)
nplurals=1 # Turkish language has ONE form!
# Always returns 0:
get_plural_id = lambda n: 0
# Construct and return plural form of *word* using
# *plural_id* (which ALWAYS>0). This function will be executed
# for words (or phrases) not foun... | [
[
14,
0,
0.3571,
0.0714,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.5714,
0.0714,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=1 # Turkish language has ONE form!",
"get_plural_id = lambda n: 0"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for lt (Lithuanian)
nplurals=3 # Lithuanian language has 3 forms:
# 1 singular and 2 plurals
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lam... | [
[
14,
0,
0.2632,
0.0526,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6316,
0.1579,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
0
]
] | [
"nplurals=3 # Lithuanian language has 3 forms:",
"get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else\n 1 if n % 10 >= 2 and (n % 100 < 10 or n % 100 >= 20) else\n 2)"
] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for id (Indonesian)
nplurals=2 # Indonesian language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = la... | [
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0,
795,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.6471,
0.0588,
0,
0.66,
1,
283,
9,
0,
0,
0,
0,
0,
1
]
] | [
"nplurals=2 # Indonesian language has 2 forms:",
"get_plural_id = lambda n: int(n != 1)"
] |
"""
Usage: in web2py models/db.py
from gluon.contrib.heroku import get_db
db = get_db()
"""
import os
from gluon import *
from gluon.dal import ADAPTERS, UseDatabaseStoredFile,PostgreSQLAdapter
class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):
drivers = ('psycopg2',)
uploads_in_blob = Tru... | [
[
8,
0,
0.1379,
0.2414,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2759,
0.0345,
0,
0.66,
0.1667,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3103,
0.0345,
0,
0.66... | [
"\"\"\"\nUsage: in web2py models/db.py\n\nfrom gluon.contrib.heroku import get_db\ndb = get_db()\n\n\"\"\"",
"import os",
"from gluon import *",
"from gluon.dal import ADAPTERS, UseDatabaseStoredFile,PostgreSQLAdapter",
"class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter):\n drivers = ('... |
# -*- coding: utf-8 -*-
"""
pbkdf2
~~~~~~
This module implements pbkdf2 for Python. It also has some basic
tests that ensure that it works. The implementation is straightforward
and uses stdlib only stuff and can be easily be copy/pasted into
your favourite application.
Use this as repla... | [
[
8,
0,
0.1705,
0.3178,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3333,
0.0078,
0,
0.66,
0.1,
993,
0,
1,
0,
0,
993,
0,
0
],
[
1,
0,
0.3411,
0.0078,
0,
0.66,
... | [
"\"\"\"\n pbkdf2\n ~~~~~~\n\n This module implements pbkdf2 for Python. It also has some basic\n tests that ensure that it works. The implementation is straightforward\n and uses stdlib only stuff and can be easily be copy/pasted into\n your favourite application.",
"import hmac",
"import ha... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This module provides a simple API for Paymentech(c) payments
# The original code was taken from this web2py issue post
# http://code.google.com/p/web2py/issues/detail?id=1170 by Adnan Smajlovic
#
# Copyright (C) <2012> Alan Etkin <spametki@gmail.com>
# License: BS... | [
[
1,
0,
0.0351,
0.0029,
0,
0.66,
0,
509,
0,
4,
0,
0,
509,
0,
0
],
[
1,
0,
0.038,
0.0029,
0,
0.66,
0.5,
770,
0,
1,
0,
0,
770,
0,
0
],
[
3,
0,
0.5249,
0.9532,
0,
0.66... | [
"import sys, httplib, urllib, urllib2",
"from xml.dom.minidom import parseString",
"class PaymenTech(object):\n \"\"\"\n The base class for connecting to the Paymentech service\n\n Format notes\n ============\n\n - Credit card expiration date (exp argument) must be of mmyyyy form",
" \"\"\"\... |
# -*- coding: utf-8 -*-
#######################################################################
#
# Put this file in yourapp/modules/images.py
#
# Given the model
#
# db.define_table("table_name", Field("picture", "upload"), Field("thumbnail", "upload"))
#
# # to resize the picture on upload
#
# from images import RES... | [
[
1,
0,
0.377,
0.0164,
0,
0.66,
0,
826,
0,
1,
0,
0,
826,
0,
0
],
[
3,
0,
0.582,
0.3279,
0,
0.66,
0.5,
42,
0,
2,
0,
0,
186,
0,
7
],
[
2,
1,
0.4508,
0.0328,
1,
0.25,
... | [
"from gluon import current",
"class RESIZE(object):\n def __init__(self, nx=160, ny=80, error_message=' image resize'):\n (self.nx, self.ny, self.error_message) = (nx, ny, error_message)\n\n def __call__(self, value):\n if isinstance(value, str) and len(value) == 0:\n return (value,... |
# pyuca - Unicode Collation Algorithm
# Version: 2012-06-21
#
# James Tauber
# http://jtauber.com/
# Copyright (c) 2006-2012 James Tauber and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | [
[
8,
0,
0.2604,
0.1389,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.3611,
0.0347,
0,
0.66,
0.3333,
345,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.3681,
0.0208,
1,
0.36,
... | [
"\"\"\"\nPreliminary implementation of the Unicode Collation Algorithm.\n\nThis only implements the simple parts of the algorithm but I have successfully\ntested it using the Default Unicode Collation Element Table (DUCET) to collate\nAncient Greek correctly.\n\nUsage example:",
"class Node:\n \n def __init... |
import os
import pyuca
unicode_collator = None
def set_unicode_collator(file):
global unicode_collator
unicode_collator = pyuca.Collator(file)
set_unicode_collator(os.path.join(os.path.dirname(__file__), 'allkeys.txt'))
| [
[
1,
0,
0.1,
0.1,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2,
0.1,
0,
0.66,
0.25,
557,
0,
1,
0,
0,
557,
0,
0
],
[
14,
0,
0.4,
0.1,
0,
0.66,
0.5,
... | [
"import os",
"import pyuca",
"unicode_collator = None",
"def set_unicode_collator(file):\n global unicode_collator\n unicode_collator = pyuca.Collator(file)",
" unicode_collator = pyuca.Collator(file)",
"set_unicode_collator(os.path.join(os.path.dirname(__file__), 'allkeys.txt'))"
] |
#!/usr/bin/python
#
# Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | [
[
8,
0,
0.0102,
0.003,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0124,
0.0005,
0,
0.66,
0.0323,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0134,
0.0005,
0,
0.66,
... | [
"\"\"\"A fast, lightweight IPv4/IPv6 manipulation library in Python.\n\nThis library is used to create/poke/manipulate IPv4 and IPv6 addresses\nand networks.\n\n\"\"\"",
"__version__ = 'branches/3144'",
"import struct",
"IPV4LENGTH = 32",
"IPV6LENGTH = 128",
"class AddressValueError(ValueError):\n \"\"... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"FPDF for python (a.k.a. pyfpdf)"
# Read more about this http://code.google.com/p/pyfpdf
# Please note that new package name is fpdf (to avoid some naming conflicts)
# import fpdf into pyfpdf for backward compatibility (prior web2py 2.0):
from fpdf import *
# import warni... | [
[
8,
0,
0.3636,
0.0909,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.7273,
0.0909,
0,
0.66,
1,
957,
0,
1,
0,
0,
957,
0,
0
]
] | [
"\"FPDF for python (a.k.a. pyfpdf)\"",
"from fpdf import *"
] |
import re
import cPickle
import random
import datetime
IUP = {'shoebill':{'a':1,'187':1},'trout-like':{'parr':1},'fig.':{'19':1},'mcintosh.':{'the':1,'illustration':1},'chiasmodon':{'niger':2},'yellow':{'and':4,'giant':1,'green':2,'red':1,'spots':1},'four':{'brightly':1,'hundred':1,'haunts':1,'feet':1,'solutions':2,'h... | [
[
1,
0,
0.0037,
0.0037,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0074,
0.0037,
0,
0.66,
0.0909,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.0111,
0.0037,
0,
... | [
"import re",
"import cPickle",
"import random",
"import datetime",
"IUP = {'shoebill':{'a':1,'187':1},'trout-like':{'parr':1},'fig.':{'19':1},'mcintosh.':{'the':1,'illustration':1},'chiasmodon':{'niger':2},'yellow':{'and':4,'giant':1,'green':2,'red':1,'spots':1},'four':{'brightly':1,'hundred':1,'haunts':1,'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Plural subsystem is created by Vladyslav Kozlovskyy (Ukraine)
<dbdevelop@gma... | [
[
8,
0,
0.0079,
0.0084,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0137,
0.0011,
0,
0.66,
0.0145,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0147,
0.0011,
0,
0.66... | [
"\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\nPlural subsystem is created by Vladyslav Kozlovskyy (Ukraine)\n <dbdevelop@gmail.com>\n\"\"\"",
"import os",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import sys
import cPickle
import traceback
import types
import os
import logging
from storage import S... | [
[
8,
0,
0.0186,
0.0155,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.031,
0.0031,
0,
0.66,
0.0625,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0341,
0.0031,
0,
0.66,... | [
"\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\"\"\"",
"import sys",
"import cPickle",
"import traceback",
"import types",
"import os",
"import logging",
"from storage import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Web2Py framework modules
========================
"""
__all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT'... | [
[
8,
0,
0.1591,
0.2045,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2955,
0.0227,
0,
0.66,
0.1111,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.3409,
0.0227,
0,
0.66,... | [
"\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\n\nWeb2Py framework modules\n========================",
"__all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT', 'CENTER', 'CLEANUP', 'CODE', ... |
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import datetime
import decimal
from storage import Storage
from html import TAG, XmlComponent
from html import xmlescape
from languages import lazyT
im... | [
[
8,
0,
0.0165,
0.0275,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.033,
0.0055,
0,
0.66,
0.0476,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0385,
0.0055,
0,
0.66,... | [
"\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\"\"\"",
"import datetime",
"import decimal",
"from storage import Storage",
"from html import TAG, XmlComponent",
"from html import ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import re
import cgi
__all__ = ['highlight']
class Highlighter(object):
"""
Do syntax highl... | [
[
8,
0,
0.0174,
0.0145,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0291,
0.0029,
0,
0.66,
0.1667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.032,
0.0029,
0,
0.66,... | [
"\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\"\"\"",
"import re",
"import cgi",
"__all__ = ['highlight']",
"class Highlighter(object):\n\n \"\"\"\n Do syntax highlighting.\n... |
#!/usr/bin/env python
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This file is not strictly required by web2py. It is used for three purposes:
1) check that all required modules are installed prop... | [
[
8,
0,
0.078,
0.1101,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1468,
0.0092,
0,
0.66,
0.0833,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.156,
0.0092,
0,
0.66,
... | [
"\"\"\"\nThis file is part of the web2py Web Framework\nCopyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>\nLicense: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)\n\nThis file is not strictly required by web2py. It is used for three purposes:\n\n1) check that all required modules are installed properly",
... |
import time
import sys
import urllib2
import urllib2
n = int(sys.argv[1])
url = sys.argv[2]
headers = {"Accept-Language": "en"}
req = urllib2.Request(url, None, headers)
t0 = time.time()
for k in xrange(n):
data = urllib2.urlopen(req).read()
print (time.time() - t0) / n
if n == 1:
print data
| [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.125,
0.0625,
0,
0.66,
0.0909,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1875,
0.0625,
0,
0... | [
"import time",
"import sys",
"import urllib2",
"import urllib2",
"n = int(sys.argv[1])",
"url = sys.argv[2]",
"headers = {\"Accept-Language\": \"en\"}",
"req = urllib2.Request(url, None, headers)",
"t0 = time.time()",
"for k in xrange(n):\n data = urllib2.urlopen(req).read()",
" data = url... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from time import mktime
from time import sleep
from time import time
DB_URI = 'sqlite://sessions.sqlite'
EXPIRATION_MINUTES = 60
SLEEP_MINUTES = 5
while 1: # Infinite loop
now = time() # get current Unix timestamp
for row in db().... | [
[
1,
0,
0.16,
0.04,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.2,
0.04,
0,
0.66,
0.1429,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.24,
0.04,
0,
0.66,
0.2... | [
"from datetime import datetime",
"from time import mktime",
"from time import sleep",
"from time import time",
"DB_URI = 'sqlite://sessions.sqlite'",
"EXPIRATION_MINUTES = 60",
"SLEEP_MINUTES = 5",
"while 1: # Infinite loop\n now = time() # get current Unix timestamp\n\n for row in db().select... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## launch with python web2py.py -S myapp -R scripts/zip_static_files.py
import os
import gzip
def zip_static(filelist=[]):
tsave = 0
for fi in filelist:
extension = os.path.splitext(fi)
extension = len(extension) > 1 and extension[1] or None
... | [
[
1,
0,
0.1489,
0.0213,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1702,
0.0213,
0,
0.66,
0.3333,
967,
0,
1,
0,
0,
967,
0,
0
],
[
2,
0,
0.5106,
0.5745,
0,
... | [
"import os",
"import gzip",
"def zip_static(filelist=[]):\n tsave = 0\n for fi in filelist:\n extension = os.path.splitext(fi)\n extension = len(extension) > 1 and extension[1] or None\n if not extension or extension not in ALLOWED_EXTS:\n print('skipping %s' % os.path.base... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import time
import stat
import datetime
from gluon.utils import md5_hash
from gluon.restricted import RestrictedError, TicketStorage
from gluon import DAL
SLEEP_MINUTES = 5
errors_path = os.path.join(request.folder, 'errors')
try:
db_string = op... | [
[
1,
0,
0.0784,
0.0196,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.098,
0.0196,
0,
0.66,
0.0625,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1176,
0.0196,
0,
0... | [
"import sys",
"import os",
"import time",
"import stat",
"import datetime",
"from gluon.utils import md5_hash",
"from gluon.restricted import RestrictedError, TicketStorage",
"from gluon import DAL",
"SLEEP_MINUTES = 5",
"errors_path = os.path.join(request.folder, 'errors')",
"try:\n db_strin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.