code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def resolve_columns(self, row, fields=()):
values = []
index_extra_select = len(self.query.extra_select.keys())
for value, field in map(None, row[index_extra_select:], fields):
if (field an... | [
[
1,
0,
0.037,
0.037,
0,
0.66,
0,
841,
0,
1,
0,
0,
841,
0,
0
],
[
3,
0,
0.2778,
0.3704,
0,
0.66,
0.1667,
718,
0,
1,
0,
0,
749,
0,
7
],
[
2,
1,
0.2963,
0.3333,
1,
0.... | [
"from django.db.models.sql import compiler",
"class SQLCompiler(compiler.SQLCompiler):\n def resolve_columns(self, row, fields=()):\n values = []\n index_extra_select = len(self.query.extra_select.keys())\n for value, field in map(None, row[index_extra_select:], fields):\n if (f... |
import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
def runshell(self):
settings_dict = self.connection.settings_dict
args = [self.executable_name]
db = settings_dict['OPTIONS'].get('db',... | [
[
1,
0,
0.025,
0.025,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.05,
0.025,
0,
0.66,
0.3333,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1,
0.025,
0,
0.66,
... | [
"import os",
"import sys",
"from django.db.backends import BaseDatabaseClient",
"class DatabaseClient(BaseDatabaseClient):\n executable_name = 'mysql'\n\n def runshell(self):\n settings_dict = self.connection.settings_dict\n args = [self.executable_name]\n db = settings_dict['OPTION... |
from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__... | [
[
1,
0,
0.0154,
0.0154,
0,
0.66,
0,
340,
0,
1,
0,
0,
340,
0,
0
],
[
3,
0,
0.5231,
0.9692,
0,
0.66,
1,
625,
0,
3,
0,
0,
484,
0,
21
],
[
14,
1,
0.2923,
0.3538,
1,
0.7... | [
"from django.db.backends.creation import BaseDatabaseCreation",
"class DatabaseCreation(BaseDatabaseCreation):\n # This dictionary maps Field objects to their associated MySQL column\n # types, as strings. Column-type strings can contain format strings; they'll\n # be interpolated against the values of F... |
from django.db.backends import BaseDatabaseValidation
class DatabaseValidation(BaseDatabaseValidation):
def validate_field(self, errors, opts, f):
"""
There are some field length restrictions for MySQL:
- Prior to version 5.0.3, character fields could not exceed 255
chara... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
981,
0,
1,
0,
0,
981,
0,
0
],
[
3,
0,
0.5577,
0.9231,
0,
0.66,
1,
249,
0,
1,
0,
0,
818,
0,
5
],
[
2,
1,
0.5769,
0.8846,
1,
0.01,... | [
"from django.db.backends import BaseDatabaseValidation",
"class DatabaseValidation(BaseDatabaseValidation):\n def validate_field(self, errors, opts, f):\n \"\"\"\n There are some field length restrictions for MySQL:\n\n - Prior to version 5.0.3, character fields could not exceed 255\n ... |
from django.dispatch import Signal
connection_created = Signal(providing_args=["connection"])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
548,
0,
1,
0,
0,
548,
0,
0
],
[
14,
0,
1,
0.3333,
0,
0.66,
1,
848,
3,
1,
0,
0,
592,
10,
1
]
] | [
"from django.dispatch import Signal",
"connection_created = Signal(providing_args=[\"connection\"])"
] |
"""
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import *
from dja... | [
[
8,
0,
0.0804,
0.1429,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1786,
0.0179,
0,
0.66,
0.0909,
160,
0,
1,
0,
0,
160,
0,
0
],
[
1,
0,
0.1964,
0.0179,
0,
0.66... | [
"\"\"\"\nDummy database backend for Django.\n\nDjango uses this if the database ENGINE setting is empty (None or empty string).\n\nEach of these API functions, except connection.close(), raises\nImproperlyConfigured.\n\"\"\"",
"from django.core.exceptions import ImproperlyConfigured",
"from django.db.backends i... |
from django.db.backends import BaseDatabaseIntrospection
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
20: 'BigIntegerField',
21: 'SmallIntegerField',
23: 'IntegerField',
... | [
[
1,
0,
0.0114,
0.0114,
0,
0.66,
0,
981,
0,
1,
0,
0,
981,
0,
0
],
[
3,
0,
0.5114,
0.9659,
0,
0.66,
1,
77,
0,
4,
0,
0,
41,
0,
10
],
[
14,
1,
0.1477,
0.1932,
1,
0.85,... | [
"from django.db.backends import BaseDatabaseIntrospection",
"class DatabaseIntrospection(BaseDatabaseIntrospection):\n # Maps type codes to Django Field types.\n data_types_reverse = {\n 16: 'BooleanField',\n 20: 'BigIntegerField',\n 21: 'SmallIntegerField',\n 23: 'IntegerField',... |
import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'psql'
def runshell(self):
settings_dict = self.connection.settings_dict
args = [self.executable_name]
if settings_dict['USER']:
a... | [
[
1,
0,
0.0435,
0.0435,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.087,
0.0435,
0,
0.66,
0.3333,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1739,
0.0435,
0,
0... | [
"import os",
"import sys",
"from django.db.backends import BaseDatabaseClient",
"class DatabaseClient(BaseDatabaseClient):\n executable_name = 'psql'\n\n def runshell(self):\n settings_dict = self.connection.settings_dict\n args = [self.executable_name]\n if settings_dict['USER']:\n... |
import re
from django.db.backends import BaseDatabaseOperations
# This DatabaseOperations class lives in here instead of base.py because it's
# used by both the 'postgresql' and 'postgresql_psycopg2' backends.
class DatabaseOperations(BaseDatabaseOperations):
def __init__(self, connection):
supe... | [
[
1,
0,
0.0053,
0.0053,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.016,
0.0053,
0,
0.66,
0.5,
981,
0,
1,
0,
0,
981,
0,
0
],
[
3,
0,
0.5213,
0.9628,
0,
0.66... | [
"import re",
"from django.db.backends import BaseDatabaseOperations",
"class DatabaseOperations(BaseDatabaseOperations):\n def __init__(self, connection):\n super(DatabaseOperations, self).__init__()\n self._postgres_version = None\n self.connection = connection\n\n def _get_postgres_... |
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can contain format strings; they'... | [
[
1,
0,
0.0132,
0.0132,
0,
0.66,
0,
340,
0,
1,
0,
0,
340,
0,
0
],
[
1,
0,
0.0263,
0.0132,
0,
0.66,
0.5,
446,
0,
1,
0,
0,
446,
0,
0
],
[
3,
0,
0.5263,
0.9605,
0,
0.6... | [
"from django.db.backends.creation import BaseDatabaseCreation",
"from django.db.backends.util import truncate_name",
"class DatabaseCreation(BaseDatabaseCreation):\n # This dictionary maps Field objects to their associated PostgreSQL column\n # types, as strings. Column-type strings can contain format str... |
"""
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL 8.3.6
# EnterpriseDB 8.3
# PostgreSQL 8.3 beta4
# PostgreSQL 8.4beta1
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
... | [
[
8,
0,
0.0645,
0.0968,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1613,
0.0323,
0,
0.66,
0.25,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.4194,
0.0323,
0,
0.66,... | [
"\"\"\"\nExtracts the version of the PostgreSQL server.\n\"\"\"",
"import re",
"VERSION_RE = re.compile(r'\\S+ (\\d+)\\.(\\d+)\\.?(\\d+)?')",
"def _parse_version(text):\n \"Internal parsing method. Factored out for testing purposes.\"\n major, major2, minor = VERSION_RE.search(text).groups()\n try:\n... |
import datetime
import decimal
from time import time
from django.utils.hashcompat import md5_constructor
from django.utils.log import getLogger
logger = getLogger('django.db.backends')
class CursorDebugWrapper(object):
def __init__(self, cursor, db):
self.cursor = cursor
self.db = db ... | [
[
1,
0,
0.0072,
0.0072,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0144,
0.0072,
0,
0.66,
0.0667,
349,
0,
1,
0,
0,
349,
0,
0
],
[
1,
0,
0.0216,
0.0072,
0,
... | [
"import datetime",
"import decimal",
"from time import time",
"from django.utils.hashcompat import md5_constructor",
"from django.utils.log import getLogger",
"logger = getLogger('django.db.backends')",
"class CursorDebugWrapper(object):\n def __init__(self, cursor, db):\n self.cursor = cursor... |
import re
from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict(object):
# Maps SQL ... | [
[
1,
0,
0.0071,
0.0071,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0143,
0.0071,
0,
0.66,
0.3333,
981,
0,
1,
0,
0,
981,
0,
0
],
[
3,
0,
0.1643,
0.2357,
0,
... | [
"import re",
"from django.db.backends import BaseDatabaseIntrospection",
"class FlexibleFieldLookupDict(object):\n # Maps SQL types to Django Field types. Some of the SQL types have multiple\n # entries here because SQLite allows for anything and doesn't normalize the\n # field type; it uses whatever w... |
import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'sqlite3'
def runshell(self):
args = [self.executable_name,
self.connection.settings_dict['NAME']]
if os.name == 'nt':
sys... | [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.125,
0.0625,
0,
0.66,
0.3333,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.25,
0.0625,
0,
0.6... | [
"import os",
"import sys",
"from django.db.backends import BaseDatabaseClient",
"class DatabaseClient(BaseDatabaseClient):\n executable_name = 'sqlite3'\n\n def runshell(self):\n args = [self.executable_name,\n self.connection.settings_dict['NAME']]\n if os.name == 'nt':\n ... |
import decimal
from threading import local
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import util
from django.utils import datetime_safe
from django.utils.importlib import import_module
class BaseDatabaseWrapper(local):
"""
Represents a database connection.
"""
ops = No... | [
[
1,
0,
0.0014,
0.0014,
0,
0.66,
0,
349,
0,
1,
0,
0,
349,
0,
0
],
[
1,
0,
0.0028,
0.0014,
0,
0.66,
0.0909,
83,
0,
1,
0,
0,
83,
0,
0
],
[
1,
0,
0.0057,
0.0014,
0,
0.... | [
"import decimal",
"from threading import local",
"from django.db import DEFAULT_DB_ALIAS",
"from django.db.backends import util",
"from django.utils import datetime_safe",
"from django.utils.importlib import import_module",
"class BaseDatabaseWrapper(local):\n \"\"\"\n Represents a database connec... |
from django.db.backends import BaseDatabaseIntrospection
import cx_Oracle
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types.
data_... | [
[
1,
0,
0.0083,
0.0083,
0,
0.66,
0,
981,
0,
1,
0,
0,
981,
0,
0
],
[
1,
0,
0.0165,
0.0083,
0,
0.66,
0.25,
554,
0,
1,
0,
0,
554,
0,
0
],
[
1,
0,
0.0248,
0.0083,
0,
0.... | [
"from django.db.backends import BaseDatabaseIntrospection",
"import cx_Oracle",
"import re",
"foreign_key_re = re.compile(r\"\\sCONSTRAINT `[^`]*` FOREIGN KEY \\(`([^`]*)`\\) REFERENCES `([^`]*)` \\(`([^`]*)`\\)\")",
"class DatabaseIntrospection(BaseDatabaseIntrospection):\n # Maps type objects to Django... |
from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def resolve_columns(self, row, fields=()):
# If this query has limit/offset information, then we expect the
# first column to be an extra "_RN" column that we need to throw
# away.
if self.qu... | [
[
1,
0,
0.0147,
0.0147,
0,
0.66,
0,
841,
0,
1,
0,
0,
841,
0,
0
],
[
3,
0,
0.4118,
0.7206,
0,
0.66,
0.1667,
718,
0,
2,
0,
0,
749,
0,
11
],
[
2,
1,
0.1691,
0.2059,
1,
... | [
"from django.db.models.sql import compiler",
"class SQLCompiler(compiler.SQLCompiler):\n def resolve_columns(self, row, fields=()):\n # If this query has limit/offset information, then we expect the\n # first column to be an extra \"_RN\" column that we need to throw\n # away.\n if ... |
import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'sqlplus'
def runshell(self):
conn_string = self.connection._connect_string()
args = [self.executable_name, "-L", conn_string]
if os.name == 'n... | [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.125,
0.0625,
0,
0.66,
0.3333,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.25,
0.0625,
0,
0.6... | [
"import os",
"import sys",
"from django.db.backends import BaseDatabaseClient",
"class DatabaseClient(BaseDatabaseClient):\n executable_name = 'sqlplus'\n\n def runshell(self):\n conn_string = self.connection._connect_string()\n args = [self.executable_name, \"-L\", conn_string]\n i... |
from django.conf import settings
from django.core import signals
from django.core.exceptions import ImproperlyConfigured
from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \
DatabaseError, IntegrityError
from django.utils.functional import c... | [
[
1,
0,
0.0097,
0.0097,
0,
0.66,
0,
128,
0,
1,
0,
0,
128,
0,
0
],
[
1,
0,
0.0194,
0.0097,
0,
0.66,
0.0556,
913,
0,
1,
0,
0,
913,
0,
0
],
[
1,
0,
0.0291,
0.0097,
0,
... | [
"from django.conf import settings",
"from django.core import signals",
"from django.core.exceptions import ImproperlyConfigured",
"from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \\\n DatabaseError, IntegrityError",
"from django.uti... |
import re
import sys
from urlparse import urlsplit, urlunsplit
from xml.dom.minidom import parseString, Node
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import clear_url_caches
from django.db import transaction, co... | [
[
1,
0,
0.0016,
0.0016,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0032,
0.0016,
0,
0.66,
0.027,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0048,
0.0016,
0,
0... | [
"import re",
"import sys",
"from urlparse import urlsplit, urlunsplit",
"from xml.dom.minidom import parseString, Node",
"from django.conf import settings",
"from django.core import mail",
"from django.core.management import call_command",
"from django.core.urlresolvers import clear_url_caches",
"fr... |
from django.dispatch import Signal
template_rendered = Signal(providing_args=["template", "context"])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
548,
0,
1,
0,
0,
548,
0,
0
],
[
14,
0,
1,
0.3333,
0,
0.66,
1,
139,
3,
1,
0,
0,
592,
10,
1
]
] | [
"from django.dispatch import Signal",
"template_rendered = Signal(providing_args=[\"template\", \"context\"])"
] |
import sys
import time
import os
import warnings
from django.conf import settings
from django.core import mail
from django.core.mail.backends import locmem
from django.test import signals
from django.template import Template
from django.utils.translation import deactivate
__all__ = ('Approximate', 'ContextL... | [
[
1,
0,
0.0079,
0.0079,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0157,
0.0079,
0,
0.66,
0.0556,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0236,
0.0079,
0,
... | [
"import sys",
"import time",
"import os",
"import warnings",
"from django.conf import settings",
"from django.core import mail",
"from django.core.mail.backends import locmem",
"from django.test import signals",
"from django.template import Template",
"from django.utils.translation import deactiva... |
"""
Django Unit Test and Doctest framework.
"""
from django.test.client import Client, RequestFactory
from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature
from django.test.utils import Approximate
| [
[
8,
0,
0.2857,
0.4286,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.7143,
0.1429,
0,
0.66,
0.3333,
479,
0,
2,
0,
0,
479,
0,
0
],
[
1,
0,
0.8571,
0.1429,
0,
0.66... | [
"\"\"\"\nDjango Unit Test and Doctest framework.\n\"\"\"",
"from django.test.client import Client, RequestFactory",
"from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature",
"from django.test.utils import Approximate"
] |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
[
14,
0,
0.0557,
0.0033,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0689,
0.0033,
0,
0.66,
0.0333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0721,
0.0033,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import db",
"from google.appengine.ext.webapp import template",
"from apiclient.discovery import build_from_document",
"from apiclient.http import MediaUpload",
"from oauth2... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
[
14,
0,
0.0281,
0.0017,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0347,
0.0017,
0,
0.66,
0.0303,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.0364,
0.0017,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import sys",
"sys.path.insert(0, 'lib')",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from google.appengine.ext import db",
"from google... |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | [
[
8,
0,
0.1818,
0.0267,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2032,
0.0053,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.2219,
0.0107,
0,
0.66,
... | [
"\"\"\"Module to enforce different constraints on flags.\n\nA validator represents an invariant, enforced over a one or more flags.\nSee 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual.\n\"\"\"",
"__author__ = 'olexiy@google.com (Olexiy Oryeshko)'",
"class Error(Exception):\n \"\"\"Thrown If val... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
[
1,
0,
0.0738,
0.0041,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0779,
0.0041,
0,
0.66,
0.0625,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.082,
0.0041,
0,
0... | [
"import base64",
"import hashlib",
"import logging",
"import time",
"from OpenSSL import crypto",
"from anyjson import simplejson",
"CLOCK_SKEW_SECS = 300 # 5 minutes in seconds",
"AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds",
"MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds",
"cla... |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | [
[
8,
0,
0.0437,
0.0741,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0847,
0.0026,
0,
0.66,
0.0588,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0899,
0.0026,
0,
0.66,... | [
"\"\"\"Multi-credential file store with lock support.\n\nThis module implements a JSON credential store where multiple\ncredentials can be stored in one file. That file supports locking\nboth in a single process and across processes.\n\nThe credential themselves are keyed off of:\n* client_id",
"__author__ = 'jb... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.5312,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6562,
0.0312,
0,
0.66,
0.5,
777,
1,
0,
0,
0,
0,
3,
0
],
[
7,
0,
0.875,
0.2812,
0,
0.66,
... | [
"\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"try: # pragma: no cover\n # Should work for Python2.6 and higher.\n import json as simplejson\nexcept ImportError: #... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.0145,
0.0035,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0176,
0.0009,
0,
0.66,
0.0244,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0193,
0.0009,
0,
0.66,... | [
"\"\"\"An OAuth 2.0 client.\n\nTools for interacting with OAuth 2.0 protected resources.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import base64",
"import clientsecrets",
"import copy",
"import datetime",
"import httplib2",
"import logging",
"import os",
"import sys",
"im... |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1619,
0.0476,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2,
0.0095,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2286,
0.0095,
0,
0.66,
... | [
"\"\"\"Utilities for reading OAuth 2.0 client secret files.\n\nA client_secrets.json file contains all the information needed to interact with\nan OAuth 2.0 protected service.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"from anyjson import simplejson",
"TYPE_WEB = 'web'",
"TYPE_INSTALL... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1604,
0.0472,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1981,
0.0094,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.217,
0.0094,
0,
0.66,
... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 2.0\ncredentials.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import os",
"import stat",
"import threading",
"from anyjson import simplejson",
"from client import Storage as BaseStorage",
"from clien... |
__version__ = "1.0c2"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__ = \"1.0c2\""
] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1371,
0.0403,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1694,
0.0081,
0,
0.66,
0.1111,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1855,
0.0081,
0,
0.66,... | [
"\"\"\"OAuth 2.0 utilities for Django.\n\nUtilities for using OAuth 2.0 in conjunction with\nthe Django datastore.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import oauth2client",
"import base64",
"import pickle",
"from django.db import models",
"from oauth2client.client import St... |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | [
[
8,
0,
0.0814,
0.1105,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1453,
0.0058,
0,
0.66,
0.0833,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1512,
0.0058,
0,
0.66... | [
"\"\"\"MIME-Type Parser\n\nThis module provides basic functions for handling mime-types. It can handle\nmatching mime-types against a list of media-ranges. See section 14.1 of the\nHTTP specification [RFC 2616] for a complete explanation.\n\n http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1",
"__v... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1205,
0.1452,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2046,
0.0033,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2112,
0.0033,
0,
0.66,
... | [
"\"\"\"Schema processing for discovery based APIs\n\nSchemas holds an APIs discovery schemas. It can return those schema as\ndeserialized JSON objects, or pretty print them as prototype objects that\nconform to the schema.\n\nFor example, given the schema:",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.5312,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6562,
0.0312,
0,
0.66,
0.5,
777,
1,
0,
0,
0,
0,
3,
0
],
[
7,
0,
0.875,
0.2812,
0,
0.66,
... | [
"\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"try: # pragma: no cover\n import simplejson\nexcept ImportError: # pragma: no cover\n try:\n # Try to import from... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.0342,
0.0083,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0414,
0.0021,
0,
0.66,
0.0476,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0476,
0.0021,
0,
0.66,... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import copy",
"import httplib2",
"import logging",
"import oauth2 as oauth",
"import urllib",
"import urlparse",
"from anyjson import simplejson",
"tr... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1259,
0.037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1556,
0.0074,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1704,
0.0074,
0,
0.66,
... | [
"\"\"\"Utilities for Google App Engine\n\nUtilities for making it easier to use the\nGoogle API Client for Python on Google App Engine.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import pickle",
"from google.appengine.ext import db",
"from apiclient.oauth import OAuthCredentials",
"... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.2619,
0.0635,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3175,
0.0159,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3492,
0.0159,
0,
0.66,
... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 1.0 credentials.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import pickle",
"import threading",
"from apiclient.oauth import Storage as BaseStorage",
"class Storage(BaseStorage):\n \"\"\"Store and retr... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
1,
0,
0.2679,
0.0179,
0,
0.66,
0,
629,
0,
1,
0,
0,
629,
0,
0
],
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0.2,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.6... | [
"import apiclient",
"import base64",
"import pickle",
"from django.db import models",
"class OAuthCredentialsField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def db_type(self):\n return 'VARCHAR'\n\n def to_python(self, value):",
" __metaclass__ = models.SubfieldBase",
" def db_t... |
__version__ = "1.0c2"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__ = \"1.0c2\""
] |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
[
8,
0,
0.0519,
0.0182,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0649,
0.0026,
0,
0.66,
0.0625,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0701,
0.0026,
0,
0.66,... | [
"\"\"\"Model objects for requests and responses.\n\nEach API may support one or more serializations, such\nas JSON, Atom, etc. The model classes are responsible\nfor converting between the wire format and the Python\nobject representation.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import... |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
[
8,
0,
0.1545,
0.0407,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.187,
0.0081,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2114,
0.0081,
0,
0.66,
... | [
"\"\"\"Errors for the library.\n\nAll exceptions defined by the library\nshould be defined in this file.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"from oauth2client.anyjson import simplejson",
"class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass",
" \"\"\"Base... |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | [
[
8,
0,
0.0318,
0.0545,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0636,
0.0091,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0727,
0.0091,
0,
0.66... | [
"\"\"\"\niri2uri\n\nConverts an IRI to a URI.\n\n\"\"\"",
"__author__ = \"Joe Gregorio (joe@bitworking.org)\"",
"__copyright__ = \"Copyright 2006, Joe Gregorio\"",
"__contributors__ = []",
"__version__ = \"1.0.0\"",
"__license__ = \"MIT\"",
"__history__ = \"\"\"\n\"\"\"",
"import urlparse",
"escape_... |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | [
[
8,
0,
0.0365,
0.0708,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.0845,
0.0205,
0,
0.66,
0.04,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0982,
0.0023,
0,
0.66,
... | [
"\"\"\"SocksiPy - Python SOCKS module.\nVersion 1.00\n\nCopyright 2006 Dan-Haim. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright ... |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | [
[
1,
0,
0.006,
0.006,
0,
0.66,
0,
32,
0,
1,
0,
0,
32,
0,
0
],
[
1,
0,
0.0119,
0.006,
0,
0.66,
0.1,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0179,
0.006,
0,
0.66,
... | [
"import Cookie",
"import datetime",
"import time",
"import email.utils",
"import calendar",
"import base64",
"import hashlib",
"import hmac",
"import re",
"import logging",
"class LilCookies:\n\n @staticmethod\n def _utf8(s):\n if isinstance(s, unicode):\n return s.encode(\"utf-8\")\n ... |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | [
[
14,
0,
0.1667,
0.0556,
0,
0.66,
0,
189,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3889,
0.0556,
0,
0.66,
0.3333,
295,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6111,
0.0556,
0,
0... | [
"manual_verstr = \"1.5\"",
"auto_build_num = \"211\"",
"verstr = manual_verstr + \".\" + auto_build_num",
"try:\n from pyutil.version_class import Version as pyutil_Version\n __version__ = pyutil_Version(verstr)\nexcept (ImportError, ValueError):\n # Maybe there is no pyutil installed.\n from dist... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 limitation the ... | [
[
8,
0,
0.2927,
0.561,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6098,
0.0244,
0,
0.66,
0.25,
311,
0,
1,
0,
0,
311,
0,
0
],
[
1,
0,
0.6341,
0.0244,
0,
0.66,
... | [
"\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\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 withou... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 limitation the ... | [
[
8,
0,
0.3,
0.575,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.625,
0.025,
0,
0.66,
0.3333,
311,
0,
1,
0,
0,
311,
0,
0
],
[
1,
0,
0.65,
0.025,
0,
0.66,
0.6... | [
"\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\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 withou... |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | [
[
1,
0,
0.0204,
0.0068,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0272,
0.0068,
0,
0.66,
0.0833,
614,
0,
1,
0,
0,
614,
0,
0
],
[
14,
0,
0.0408,
0.0068,
0,
... | [
"import re",
"import urllib",
"RESERVED = \":/?#[]@!$&'()*+,;=\"",
"OPERATOR = \"+./;?|!@\"",
"EXPLODE = \"*+\"",
"MODIFIER = \":^\"",
"TEMPLATE = re.compile(r\"{(?P<operator>[\\+\\./;\\?|!@])?(?P<varlist>[^}]+)}\", re.UNICODE)",
"VAR = re.compile(r\"^(?P<varname>[^=\\+\\*:\\^]+)((?P<explode>[\\+\\*])... |
import os
print "lis.exe"
for n in range(5):
os.system(r'time ./lis.exe >> c_time.log')
print "java LisAlgorithm"
for n in range(5):
os.system(r'time java LisAlgorithm >> j_time.log')
| [
[
1,
0,
0.2308,
0.0769,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.3846,
0.0769,
0,
0.66,
0.25,
535,
3,
1,
0,
0,
0,
0,
1
],
[
6,
0,
0.5,
0.1538,
0,
0.66,
... | [
"import os",
"print(\"lis.exe\")",
"for n in range(5):\n\tos.system(r'time ./lis.exe >> c_time.log')",
"\tos.system(r'time ./lis.exe >> c_time.log')",
"print(\"java LisAlgorithm\")",
"for n in range(5):\n\tos.system(r'time java LisAlgorithm >> j_time.log')",
"\tos.system(r'time java LisAlgorithm >> j_ti... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qtBrowser.ui'
#
# Created: Fri Nov 19 20:47:11 2010
# by: PyQt4 UI code generator 4.8.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attri... | [
[
1,
0,
0.2222,
0.0222,
0,
0.66,
0,
154,
0,
2,
0,
0,
154,
0,
0
],
[
7,
0,
0.3,
0.0889,
0,
0.66,
0.25,
0,
0,
1,
0,
0,
0,
0,
0
],
[
14,
1,
0.2889,
0.0222,
1,
0.56,
... | [
"from PyQt4 import QtCore, QtGui",
"try:\n _fromUtf8 = QtCore.QString.fromUtf8\nexcept AttributeError:\n _fromUtf8 = lambda s: s",
" _fromUtf8 = QtCore.QString.fromUtf8",
" _fromUtf8 = lambda s: s",
"class Ui_Form(object):\n def setupUi(self, Form):\n Form.setObjectName(_fromUtf8(\"For... |
#!/usr/bin/env python
# coding=utf-8
import os
import logging
# set log
def get_file_log(logFileName):
logger = logging.getLogger(os.path.abspath(logFileName))
hdlr = logging.FileHandler(logFileName)
formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')
hdlr.setFormatter(... | [
[
1,
0,
0.2667,
0.0667,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3333,
0.0667,
0,
0.66,
0.5,
715,
0,
1,
0,
0,
715,
0,
0
],
[
2,
0,
0.7667,
0.5333,
0,
0.6... | [
"import os",
"import logging",
"def get_file_log(logFileName):\n logger = logging.getLogger(os.path.abspath(logFileName))\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n... |
#!/usr/bin/python
import os,sys
import re
import glob
def ProcSourceFile(filename, newfilename):
fp=open(filename,'r');
lines=fp.readlines()
fp.close()
addInfoLino = [];
for n in range(len(lines)-1):
# change ID
if re.match(r' \* @\(#\)\$Id:[^\n]*$\n', lines[n]):... | [
[
1,
0,
0.028,
0.0093,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0374,
0.0093,
0,
0.66,
0.2,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0467,
0.0093,
0,
0.66... | [
"import os,sys",
"import re",
"import glob",
"def ProcSourceFile(filename, newfilename):\n fp=open(filename,'r');\n lines=fp.readlines()\n fp.close()\n \n addInfoLino = [];\n for n in range(len(lines)-1):\n # change ID",
" fp=open(filename,'r');",
" lines=fp.readlines()",
... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import time
import anydbm
import zlib
def main():
if len(sys.argv) == 1:
return
if len(sys.argv) > 2:
num = int(sys.argv[2])
delFromDb = True
else:
num = 50
delFromDb = False
dbfn = sys.argv[1]
pt = os.path.split(os.path.abspath(dbfn))[0]
dbn ... | [
[
1,
0,
0.0851,
0.0213,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1064,
0.0213,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1277,
0.0213,
0,
... | [
"import os",
"import sys",
"import time",
"import anydbm",
"import zlib",
"def main():\n\tif len(sys.argv) == 1:\n\t\treturn\n\tif len(sys.argv) > 2:\n\t\tnum = int(sys.argv[2])\n\t\tdelFromDb = True\n\telse:\n\t\tnum = 50",
"\tif len(sys.argv) == 1:\n\t\treturn",
"\t\treturn",
"\tif len(sys.argv) >... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import time
import anydbm
import zlib
import glob
def main():
if len(sys.argv) == 1:
return
else:
dbfolder = sys.argv[1]
os.chdir(dbfolder)
dbns = (s[:-4] for s in glob.glob(r'*.dat'))
for dbn in dbns:
extract_db(dbn)
def extract_db(dbn):
db = a... | [
[
1,
0,
0.1143,
0.0286,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1429,
0.0286,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1714,
0.0286,
0,
0... | [
"import os",
"import sys",
"import time",
"import anydbm",
"import zlib",
"import glob",
"def main():\n\tif len(sys.argv) == 1:\n\t\treturn\n\telse:\n\t\tdbfolder = sys.argv[1]\n\tos.chdir(dbfolder)\n\tdbns = (s[:-4] for s in glob.glob(r'*.dat'))\n\tfor dbn in dbns:",
"\tif len(sys.argv) == 1:\n\t\tre... |
#!/usr/bin/env python
# coding=utf-8
CAPTURE_FOLDER = r'D:\captures'
DB_FILENAME = 'capturedb'
INTERVAL_CAPTURE = 60
import os
import time
import datetime
import anydbm
import zlib
import win32gui, win32ui, win32con, win32api
def window_capture():
hwnd = 0
hwndDC = win32gui.GetWindowDC(hwnd)
mfcDC=win32ui.CreateD... | [
[
14,
0,
0.0656,
0.0164,
0,
0.66,
0,
262,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.082,
0.0164,
0,
0.66,
0.0833,
139,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0984,
0.0164,
0,
0.... | [
"CAPTURE_FOLDER = r'D:\\captures'",
"DB_FILENAME = 'capturedb'",
"INTERVAL_CAPTURE = 60",
"import os",
"import time",
"import datetime",
"import anydbm",
"import zlib",
"import win32gui, win32ui, win32con, win32api",
"def window_capture():\n\thwnd = 0\n\thwndDC = win32gui.GetWindowDC(hwnd)\n\tmfcD... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import codecs
import pickle
import cPickle
from OffsetDump import KiwiDataManager
from VrDicCheck import *
import time
KIWI_INDEX_FILE = r'\\solar\data$\10Model\JB014\090213_SP2\INDEXDAT.KWI'
VR_DIC_FOLDER = r'\\solar\data$\10Model\JB01... | [
[
1,
0,
0.0702,
0.0175,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0877,
0.0175,
0,
0.66,
0.0667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1053,
0.0175,
0,
... | [
"import os",
"import sys",
"import re",
"import codecs",
"import pickle",
"import cPickle",
"from OffsetDump import KiwiDataManager",
"from VrDicCheck import *",
"import time",
"KIWI_INDEX_FILE = r'\\\\solar\\data$\\10Model\\JB014\\090213_SP2\\INDEXDAT.KWI'",
"VR_DIC_FOLDER = r'\\\\solar\\data$\... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
from smtplib import SMTP
from email.MIMEMultipart import MIMEMultipart
from email.mime.application import MIMEApplication
import time
GMAIL_ACCOUNT = r'user@gmail.com'
GMAIL_PASSWD = r'passwd'
def send_file_to_gmail(filename):
"""GMail file sen... | [
[
1,
0,
0.0606,
0.0152,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0758,
0.0152,
0,
0.66,
0.1111,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0909,
0.0152,
0,
... | [
"import os",
"import sys",
"from smtplib import SMTP",
"from email.MIMEMultipart import MIMEMultipart",
"from email.mime.application import MIMEApplication",
"import time",
"GMAIL_ACCOUNT = r'user@gmail.com'",
"GMAIL_PASSWD = r'passwd'",
"def send_file_to_gmail(filename):\n\t\"\"\"GMail file sender:... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import codecs
import string
import logging
import glob
# set log
logFileName = 'FilterRoads.log'
def init_log():
logger = logging.getLogger()
hdlr = logging.FileHandler(logFileName)
formatter = logging.Formatter('%(asctime)s %(leveln... | [
[
1,
0,
0.0392,
0.0098,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.049,
0.0098,
0,
0.66,
0.0625,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0588,
0.0098,
0,
0... | [
"import os",
"import sys",
"import codecs",
"import string",
"import logging",
"import glob",
"logFileName = 'FilterRoads.log'",
"def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import codecs
import string
import logging
import glob
# set log
logFileName = 'CheckEncoding.log'
def init_log():
logger = logging.getLogger()
hdlr = logging.FileHandler(logFileName)
formatter = logging.Formatter('%(asctime)s %(leve... | [
[
1,
0,
0.0556,
0.0139,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0694,
0.0139,
0,
0.66,
0.0833,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0833,
0.0139,
0,
... | [
"import os",
"import sys",
"import codecs",
"import string",
"import logging",
"import glob",
"logFileName = 'CheckEncoding.log'",
"def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s... |
#!/usr/bin/env python
# coding=utf-8
"""
Check A0000001.txt.
"""
import os
import sys
import re
import codecs
import CheckLog
log = CheckLog.get_file_log(r'checkA.log')
class DicItemA:
def __init__(self, s):
s = s.strip()
self._linestr = s
pat = re.match( \
r'^(\S+)\t([\w ]+)\t(0x[\dA... | [
[
8,
0,
0.0382,
0.0229,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0611,
0.0076,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0687,
0.0076,
0,
0.66,
... | [
"\"\"\"\nCheck A0000001.txt.\n\"\"\"",
"import os",
"import sys",
"import re",
"import codecs",
"import CheckLog",
"log = CheckLog.get_file_log(r'checkA.log')",
"class DicItemA:\n\tdef __init__(self, s):\n\t\ts = s.strip()\n\t\tself._linestr = s\n\t\tpat = re.match( \\\n\t\t\t\tr'^(\\S+)\\t([\\w ]+)\\... |
#!/usr/bin/env python
# coding=utf-8
import glob
import codecs
import random
# Keep KEEP_LINES_NUMBER lines in each *.txt
KEEP_LINES_NUMBER = 3
def main():
# get filename list
filenameList = tuple(glob.glob(r'*.txt'))
dicIdList = tuple(fn[:8] for fn in filenameList)
# make LoopBack.cfg file
loo... | [
[
1,
0,
0.1,
0.025,
0,
0.66,
0,
958,
0,
1,
0,
0,
958,
0,
0
],
[
1,
0,
0.125,
0.025,
0,
0.66,
0.2,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.15,
0.025,
0,
0.66,
0.... | [
"import glob",
"import codecs",
"import random",
"KEEP_LINES_NUMBER = 3",
"def main():\n\t# get filename list\n\tfilenameList = tuple(glob.glob(r'*.txt'))\n\tdicIdList = tuple(fn[:8] for fn in filenameList)\n\n\t# make LoopBack.cfg file\n\tloopBackCfg = open('LoopBack.cfg', 'w')\n\tfor dicId in dicIdList:",... |
#!/usr/bin/env python
# coding: utf-8
import os,sys
import re
import glob
import shutil
SECTIONS = {
'habitation': (
r'#street name dictionary start',
r'#district name dictionary end'
),
'num1':(
r'#1 digit number dictionary start',
r'#1 digit number dictionary end'
),
'num3':... | [
[
1,
0,
0.0199,
0.005,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0249,
0.005,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0299,
0.005,
0,
0.6... | [
"import os,sys",
"import re",
"import glob",
"import shutil",
"SECTIONS = {\n\t\t'habitation': (\n\t\t\tr'#street name dictionary start',\n\t\t\tr'#district name dictionary end'\n\t\t\t),\n\t\t'num1':(\n\t\t\tr'#1 digit number dictionary start',\n\t\t\tr'#1 digit number dictionary end'",
"START_LINE = r'#... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import optparse
import winsound
from os.path import join as pjoin
buildlog = open('build.log', 'w')
class ModelSrc:
""" manage the source of a model, mainly include download, update, build and delete.\n"""
# all the models
mode... | [
[
1,
0,
0.0606,
0.0152,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0758,
0.0152,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0909,
0.0152,
0,
... | [
"import os",
"import sys",
"import re",
"import optparse",
"import winsound",
"from os.path import join as pjoin",
"buildlog = open('build.log', 'w')",
"class ModelSrc:\n\t\"\"\" manage the source of a model, mainly include download, update, build and delete.\\n\"\"\"\n\n\t# all the models\n\tmodels =... |
#!/usr/bin/env python
# coding:utf-8
import os,sys
import codecs
import re
from WorkPath import *
import pyExcelerator as pE
LOG_FILE = codecs.open('log.txt','w','utf-8') #sys.stdout
def CColA2N(colName):
""" Convert excel colume to number"""
n = 0
for c in colName:
n = n*(ord('Z')-ord('A')+1) ... | [
[
1,
0,
0.042,
0.0084,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0504,
0.0084,
0,
0.66,
0.0455,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.0588,
0.0084,
0,
0... | [
"import os,sys",
"import codecs",
"import re",
"from WorkPath import *",
"import pyExcelerator as pE",
"LOG_FILE = codecs.open('log.txt','w','utf-8') #sys.stdout",
"def CColA2N(colName):\n\t\"\"\" Convert excel colume to number\"\"\"\n\tn = 0\n\tfor c in colName:\n\t\tn = n*(ord('Z')-ord('A')+1) + (ord(... |
#!/usr/bin/env python
WORK_DIR = r'D:\work'
DATA_DIR = WORK_DIR + r'\data'
PYCODE_DIR = WORK_DIR + r'\pycode'
| [
[
14,
0,
0.5,
0.1667,
0,
0.66,
0,
151,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6667,
0.1667,
0,
0.66,
0.5,
318,
4,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.8333,
0.1667,
0,
0.66,
... | [
"WORK_DIR = r'D:\\work'",
"DATA_DIR = WORK_DIR + r'\\data'",
"PYCODE_DIR = WORK_DIR + r'\\pycode'"
] |
#!/usr/bin/env python
# coding=utf-8
from urlparse import urljoin
from urllib import urlopen
from HTMLParser import HTMLParser
import os
import sys
import re
import codecs
HTML_FILEPATH = r'/home/ylb/tmp/yingchao1.htm'
class ScoreHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(s... | [
[
1,
0,
0.0506,
0.0127,
0,
0.66,
0,
857,
0,
1,
0,
0,
857,
0,
0
],
[
1,
0,
0.0633,
0.0127,
0,
0.66,
0.1,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0759,
0.0127,
0,
0.6... | [
"from urlparse import urljoin",
"from urllib import urlopen",
"from HTMLParser import HTMLParser",
"import os",
"import sys",
"import re",
"import codecs",
"HTML_FILEPATH = r'/home/ylb/tmp/yingchao1.htm'",
"class ScoreHTMLParser(HTMLParser):\n\tdef __init__(self):\n\t\tHTMLParser.__init__(self)\n\t\... |
#!/usr/bin/env python
# coding=utf-8
import datetime
class RepeatedRecordException(Exception):pass
class ScoreDB:
"""
Database to storage scores
"""
def __init__(self, filepath):
"""
Init class
@param filepath: file which to store the database
type: unicode
@exception IOError if ope... | [
[
1,
0,
0.061,
0.0122,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
3,
0,
0.0854,
0.0122,
0,
0.66,
0.5,
242,
0,
0,
0,
0,
645,
0,
0
],
[
3,
0,
0.5488,
0.8902,
0,
0.66... | [
"import datetime",
"class RepeatedRecordException(Exception):pass",
"class ScoreDB:\n\t\"\"\"\n\tDatabase to storage scores\n\t\"\"\"\n\tdef __init__(self, filepath):\n\t\t\"\"\"\n\t\tInit class\n\t\t@param filepath: file which to store the database",
"\t\"\"\"\n\tDatabase to storage scores\n\t\"\"\"",
"\td... |
#!/usr/bin/env python
# coding=utf-8
from urlparse import urljoin
from urllib import urlopen
from HTMLParser import HTMLParser
import os
import sys
import re
import codecs
import football_url
'''
Created on 2009-3-19
@author: ylb
'''
HTML_FILEPATH = r'D:\tmp\yingchao1.htm'
OUTPUT_FILE = open(r'D:... | [
[
1,
0,
0.0488,
0.0122,
0,
0.66,
0,
857,
0,
1,
0,
0,
857,
0,
0
],
[
1,
0,
0.061,
0.0122,
0,
0.66,
0.0769,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0732,
0.0122,
0,
0... | [
"from urlparse import urljoin",
"from urllib import urlopen",
"from HTMLParser import HTMLParser",
"import os",
"import sys",
"import re",
"import codecs",
"import football_url",
"'''\nCreated on 2009-3-19\n\n@author: ylb\n'''",
"HTML_FILEPATH = r'D:\\tmp\\yingchao1.htm'",
"OUTPUT_FILE = open(r'... |
#!/usr/bin/env python
# coding=utf-8
siteBaseUrl = r'http://www.spbo.com/'
yingChao = r'data/live.plex?fl=yingchao&p=1'
class UrlManager:
"""
Manage the urls of each league
"""
def __init__(self):
self._baseUrl = siteBaseUrl
self._urlsNum = {}
self._urlTailPattern = r'data/live.plex?fl=%(league)s&p=%(page... | [
[
14,
0,
0.0704,
0.0141,
0,
0.66,
0,
575,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0845,
0.0141,
0,
0.66,
0.3333,
538,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.4859,
0.7324,
0,
0.... | [
"siteBaseUrl = r'http://www.spbo.com/'",
"yingChao = r'data/live.plex?fl=yingchao&p=1'",
"class UrlManager:\n\t\"\"\"\n\tManage the urls of each league\n\t\"\"\"\n\tdef __init__(self):\n\t\tself._baseUrl = siteBaseUrl\n\t\tself._urlsNum = {}\n\t\tself._urlTailPattern = r'data/live.plex?fl=%(league)s&p=%(pagenum... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import codecs
import pickle
import cPickle
from OffsetDump import KiwiDataManager
# set log
import CheckLog
log = CheckLog.get_file_log('VrDicCheck.log')
class DicItemParamError(Exception): pass
class DicItem:
_folder = r''
_... | [
[
1,
0,
0.006,
0.0015,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0074,
0.0015,
0,
0.66,
0.0833,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0089,
0.0015,
0,
0... | [
"import os",
"import sys",
"import re",
"import codecs",
"import pickle",
"import cPickle",
"from OffsetDump import KiwiDataManager",
"import CheckLog",
"log = CheckLog.get_file_log('VrDicCheck.log')",
"class DicItemParamError(Exception): pass",
"class DicItem:\n\t_folder = r''\n\t_kiwiDataManag... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import codecs
import logging
import pyExcelerator as pE
xlsFileName = r'D:\ylb_work\data\je609_japan.xls'
headFileName = r'D:\ylb_work\data\waveID_Japan.h'
logFileName = r'makeconst_Japan.log'
sheets = range(1,6)
startLineNo = 9
... | [
[
1,
0,
0.0656,
0.0164,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.082,
0.0164,
0,
0.66,
0.0588,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0984,
0.0164,
0,
0... | [
"import os",
"import sys",
"import re",
"import codecs",
"import logging",
"import pyExcelerator as pE",
"xlsFileName = r'D:\\ylb_work\\data\\je609_japan.xls'",
"headFileName = r'D:\\ylb_work\\data\\waveID_Japan.h'",
"logFileName = r'makeconst_Japan.log'",
"sheets = range(1,6)",
"startLineNo = 9... |
#!/usr/bin/python
import os
######################################################################
# Question 1: See the demo*.jpg files in this directory
######################################################################
######################################################################
# Question 2: The i... | [
[
1,
0,
0.0172,
0.0057,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.0776,
0.0115,
0,
0.66,
0.0204,
280,
0,
0,
1,
0,
0,
0,
0
],
[
13,
1,
0.0805,
0.0057,
1,
0... | [
"import os",
"def newDot():\n return 'digraph g {\\n\\tordering = out\\n'",
" return 'digraph g {\\n\\tordering = out\\n'",
"def dotInsert(d, fr, to, info = None):\n d = d + '\\t' + '\"' + fr + '\"'+ ' -> ' + '\"' + to + '\"'\n if info != None:\n d = d + ' [label=\"%s\"];\\n' % info\n el... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import time
import struct
def print_data_file(filename):
# file struct
fileStruct = {'Version': '',
# Date (year, month, day, hour, minute, second, ms)
'Date': (),
'Declaration': '',
'OffsetToData': 0,
'Records': ... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
... | [
"import os",
"import sys",
"import re",
"import time",
"import struct",
"def print_data_file(filename):\n\t# file struct\n\tfileStruct = {'Version': '',\n\t\t\t# Date (year, month, day, hour, minute, second, ms)\n\t\t\t'Date': (),\n\t\t\t'Declaration': '',\n\t\t\t'OffsetToData': 0,\n\t\t\t'Records': {}",
... |
#!/usr/bin/env jython
# coding=utf-8
import os
import sys
import re
import logging
import glob
import codecs
# set log
logFileName = 'CheckLoopbackResult.log'
def init_log():
logger = logging.getLogger()
hdlr = logging.FileHandler(logFileName)
formatter = logging.Formatter('%(asctime)s %(le... | [
[
1,
0,
0.0244,
0.0061,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0305,
0.0061,
0,
0.66,
0.0667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0366,
0.0061,
0,
... | [
"import os",
"import sys",
"import re",
"import logging",
"import glob",
"import codecs",
"logFileName = 'CheckLoopbackResult.log'",
"def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message... |
#!/usr/bin/env python
# coding=utf-8
"""
Join records of two files.
For example:
file1:
A 1 2
B 4 3
file2:
B b
A a
CrossJoin.py file1 file2 file3
then
file3:
A 1 2 | A a
B 4 3 | B b
"""
import os
import sys
import codecs
import string
import logging
# set log
logFileName = 'CrossJoin... | [
[
8,
0,
0.142,
0.2045,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2614,
0.0114,
0,
0.66,
0.0769,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2727,
0.0114,
0,
0.66,... | [
"\"\"\"\nJoin records of two files.\nFor example:\nfile1:\nA\t1\t2\nB\t4\t3\n\nfile2:",
"import os",
"import sys",
"import codecs",
"import string",
"import logging",
"logFileName = 'CrossJoin.log'",
"def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler(logFileName)\n f... |
#!/usr/bin/env python
# coding=utf-8
import pyExcelerator as pE
import codecs
excel_filename = r'09Light_UC_tts_PhraseList081210.xls'
outfile = codecs.open('specials.log', 'w', 'utf-8')
ss = u'~!@#$%^&*()_+`=[]\\;/{}|:"<>?`-=【】、;‘,。/~!@#¥%……&×()——+{}|“:?》《'
ss = unicode(ss)
specialSymbols = list(ss)
spec... | [
[
1,
0,
0.1143,
0.0286,
0,
0.66,
0,
173,
0,
1,
0,
0,
173,
0,
0
],
[
1,
0,
0.1429,
0.0286,
0,
0.66,
0.1111,
220,
0,
1,
0,
0,
220,
0,
0
],
[
14,
0,
0.2,
0.0286,
0,
0.... | [
"import pyExcelerator as pE",
"import codecs",
"excel_filename = r'09Light_UC_tts_PhraseList081210.xls'",
"outfile = codecs.open('specials.log', 'w', 'utf-8')",
"ss = u'~!@#$%^&*()_+`=[]\\\\;/{}|:\"<>?`-=【】、;‘,。/~!@#¥%……&×()——+{}|“:?》《'",
"ss = unicode(ss)",
"specialSymbols = list(ss)",
"specialSymbol... |
#!/usr/bin/env python
# coding=utf-8
import re
import os
import logging
import sys
import codecs
def init_log():
logger = logging.getLogger()
hdlr = logging.FileHandler('link_check.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')
hdlr.setFormatter(formatter)
... | [
[
1,
0,
0.0727,
0.0182,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0909,
0.0182,
0,
0.66,
0.1111,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1091,
0.0182,
0,
... | [
"import re",
"import os",
"import logging",
"import sys",
"import codecs",
"def init_log():\n logger = logging.getLogger()\n hdlr = logging.FileHandler('link_check.log')\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHan... |
#!/usr/bin/env python
# coding=utf-8
import os
import codecs
import re
import time
from glob import glob
mp3FilePatterns = (u'*.mp3',)
listFilename = u'mp3list.txt'
def main():
mp3Filenames = []
for p in mp3FilePatterns:
mp3Filenames += glob(p)
mp3Renames = []
mp3Index = 1
for f in mp3File... | [
[
1,
0,
0.0976,
0.0244,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.122,
0.0244,
0,
0.66,
0.125,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.1463,
0.0244,
0,
0.... | [
"import os",
"import codecs",
"import re",
"import time",
"from glob import glob",
"mp3FilePatterns = (u'*.mp3',)",
"listFilename = u'mp3list.txt'",
"def main():\n\tmp3Filenames = []\n\tfor p in mp3FilePatterns:\n\t\tmp3Filenames += glob(p)\n\tmp3Renames = []\n\tmp3Index = 1\n\tfor f in mp3Filenames:\... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import time
import struct
def read_from_text(filename, version):
timeNow = time.localtime()[:6] + (int(time.time()%1 * 1000),)
# file struct
fileStruct = {'Version': version,
# Date (year, month, day, hour, minute, second, ms)
... | [
[
1,
0,
0.041,
0.0082,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0492,
0.0082,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0574,
0.0082,
0,
0.... | [
"import os",
"import sys",
"import re",
"import time",
"import struct",
"def read_from_text(filename, version):\n\ttimeNow = time.localtime()[:6] + (int(time.time()%1 * 1000),)\n\t# file struct\n\tfileStruct = {'Version': version,\n\t\t\t# Date (year, month, day, hour, minute, second, ms)\n\t\t\t'Date': t... |
#!/usr/bin/env python
# coding=utf-8
import os,sys
import shutil
projs = ('je609', 'nx005', 'nx007', 'jg500')
update_cmd = r'batch\DEV_AutoUpdate.bat'
getsln = lambda s:s+'.sln'
getfolder = lambda s:s
getbat = lambda s:s+'.bat'
targets = ('Rebuild', 'Build')
cfgs = ('Debug', 'Release')
platforms = ... | [
[
1,
0,
0.1429,
0.0357,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.1786,
0.0357,
0,
0.66,
0.1,
614,
0,
1,
0,
0,
614,
0,
0
],
[
14,
0,
0.2857,
0.0357,
0,
0.... | [
"import os,sys",
"import shutil",
"projs = ('je609', 'nx005', 'nx007', 'jg500')",
"update_cmd = r'batch\\DEV_AutoUpdate.bat'",
"getsln = lambda s:s+'.sln'",
"getfolder = lambda s:s",
"getbat = lambda s:s+'.bat'",
"targets = ('Rebuild', 'Build')",
"cfgs = ('Debug', 'Release')",
"platforms = (r'09Li... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import codecs
import pickle
# set log
import CheckLog
log = CheckLog.get_file_log('OffsetDump.log')
# the offset dump program
VR_DIC_OFFSET_DUMP_TOOL = r'VrDicOffsetDump.exe'
class FetchPlaceError(Exception):pass
class KiwiPl... | [
[
1,
0,
0.0172,
0.0043,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0216,
0.0043,
0,
0.66,
0.0833,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0259,
0.0043,
0,
... | [
"import os",
"import sys",
"import re",
"import codecs",
"import pickle",
"import CheckLog",
"log = CheckLog.get_file_log('OffsetDump.log')",
"VR_DIC_OFFSET_DUMP_TOOL = r'VrDicOffsetDump.exe'",
"class FetchPlaceError(Exception):pass",
"class KiwiPlace:\n\tdef __init__(self, name, offset, voiceId, ... |
#!/usr/bin/env python
# coding: utf-8
"""
make 09light beep file from .wav files
native endian
edit the following config variable:
BEEP_FILE_CONTENT
WAVE_DATA_PATH
OUTPUT_FILE_NAME
"""
#################################################
# edit the config variable BEEP_FILE_CONTENT
BEEP_FILE_CONTENT = {... | [
[
8,
0,
0.0721,
0.0769,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.226,
0.1731,
0,
0.66,
0.0769,
577,
0,
0,
0,
0,
0,
6,
0
],
[
2,
0,
0.3462,
0.0481,
0,
0.66,
... | [
"\"\"\"\nmake 09light beep file from .wav files\nnative endian\nedit the following config variable:\n\tBEEP_FILE_CONTENT\n\tWAVE_DATA_PATH\n\tOUTPUT_FILE_NAME\n\"\"\"",
"BEEP_FILE_CONTENT = {\n\t'Volume Label': 'OPERATION SOUND',\t\t# 16*char\n\t'Date': '200812151003',\t\t\t\t\t\t\t# 12*char\n\t'Version': '0.02',... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import re
import codecs
import logging
import pyExcelerator as pE
xlsFileName = r'D:\ylb_work\data\Voice_ID_list_V15.xls'
headerFileName = r'D:\ylb_work\data\waveID_Oversea.h'
logFileName = r'makeconst_Oversea.log'
def init_log():
log... | [
[
1,
0,
0.04,
0.008,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.048,
0.008,
0,
0.66,
0.0556,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.056,
0.008,
0,
0.66,
... | [
"import os",
"import sys",
"import re",
"import codecs",
"import logging",
"import pyExcelerator as pE",
"xlsFileName = r'D:\\ylb_work\\data\\Voice_ID_list_V15.xls'",
"headerFileName = r'D:\\ylb_work\\data\\waveID_Oversea.h'",
"logFileName = r'makeconst_Oversea.log'",
"def init_log():\n logger ... |
#!/usr/bin/env python
# coding=utf-8
import os,sys
import re
import codecs
import glob
import shutil
import pyExcelerator as pE
SECTIONS = {
'habitation': (
r'#street name dictionary start',
r'#district name dictionary end'
),
'num1':(
r'#1 digit number dictionary start',
r'#1 di... | [
[
1,
0,
0.0397,
0.0079,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0476,
0.0079,
0,
0.66,
0.0667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0556,
0.0079,
0,
... | [
"import os,sys",
"import re",
"import codecs",
"import glob",
"import shutil",
"import pyExcelerator as pE",
"SECTIONS = {\n\t\t'habitation': (\n\t\t\tr'#street name dictionary start',\n\t\t\tr'#district name dictionary end'\n\t\t\t),\n\t\t'num1':(\n\t\t\tr'#1 digit number dictionary start',\n\t\t\tr'#1... |
#! /usr/bin/env python
# coding=utf-8
#############################################################################
# #
# File: common.py #
# ... | [
[
1,
0,
0.549,
0.0196,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
2,
0,
0.6078,
0.0588,
0,
0.66,
0.0833,
663,
0,
0,
1,
0,
0,
0,
1
],
[
8,
1,
0.6078,
0.0196,
1,
0.8... | [
"import os, sys",
"def module_path():\n \"\"\" This will get us the program's directory\"\"\"\n return os.path.dirname(__file__)",
" \"\"\" This will get us the program's directory\"\"\"",
" return os.path.dirname(__file__)",
"dir = module_path()",
"LOAD_BALANCE = 'http://gappproxy-center.apps... |
#! /usr/bin/env python
# coding=utf-8
GAE_PROXY_APPLICATION = r'ylbproxy'
DEF_FETCH_SERVER = ''
| [
[
14,
0,
0.8,
0.2,
0,
0.66,
0,
415,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
1,
0.2,
0,
0.66,
1,
406,
1,
0,
0,
0,
0,
3,
0
]
] | [
"GAE_PROXY_APPLICATION = r'ylbproxy'",
"DEF_FETCH_SERVER = ''"
] |
#!/usr/bin/env python
# coding=utf-8
import os
import logging
# set log
def get_file_log(logFileName):
logger = logging.getLogger(os.path.abspath(logFileName))
hdlr = logging.FileHandler(logFileName)
formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')
hdlr.setFormatter(formatter)
... | [
[
1,
0,
0.1739,
0.0435,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2174,
0.0435,
0,
0.66,
0.5,
715,
0,
1,
0,
0,
715,
0,
0
],
[
2,
0,
0.6522,
0.6522,
0,
0.6... | [
"import os",
"import logging",
"def get_file_log(logFileName):\n logger = logging.getLogger(os.path.abspath(logFileName))\n hdlr = logging.FileHandler(logFileName)\n formatter = logging.Formatter('%(asctime)s %(levelname)s:: %(message)s')\n hdlr.setFormatter(formatter)\n logger.addHandler(hdlr)\n... |
#! /usr/bin/env python
# coding=utf-8
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.api import users
import accesslog
class MainHandler(webapp.RequestHandler):
def listPopDesti(self, count):
# format
self.response.headers['Content-Type'] = 'text/html'
... | [
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
0.66,
0.1667,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.0614,
0.0088,
0,
... | [
"import wsgiref.handlers",
"from google.appengine.ext import webapp",
"from google.appengine.api import users",
"import accesslog",
"class MainHandler(webapp.RequestHandler):\n def listPopDesti(self, count):\n # format\n self.response.headers['Content-Type'] = 'text/html'\n self.resp... |
#! /usr/bin/env python
# coding=utf-8
import os, sys
_this_file_dir = os.path.dirname(__file__)
VERSION = "1.2.0"
LOAD_BALANCE = 'http://gappproxy-center.appspot.com/available_fetchserver.py'
GOOGLE_PROXY = 'www.google.cn:80'
DEF_LISTEN_PORT = 8000
DEF_LOCAL_PROXY = ''
DEF_FETCH_SERVER = 'http://nettransit4ylb.ap... | [
[
1,
0,
0.125,
0.025,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
14,
0,
0.175,
0.025,
0,
0.66,
0.0714,
867,
3,
1,
0,
0,
959,
10,
1
],
[
14,
0,
0.225,
0.025,
0,
0.6... | [
"import os, sys",
"_this_file_dir = os.path.dirname(__file__)",
"VERSION = \"1.2.0\"",
"LOAD_BALANCE = 'http://gappproxy-center.appspot.com/available_fetchserver.py'",
"GOOGLE_PROXY = 'www.google.cn:80'",
"DEF_LISTEN_PORT = 8000",
"DEF_LOCAL_PROXY = ''",
"DEF_FETCH_SERVER = 'http://nettransit4ylb.apps... |
#! /usr/bin/env python
# coding=utf-8
from google.appengine.ext import db
class AccessDestination(db.Model):
desti = db.StringProperty(required=True)
counter = db.IntegerProperty(required=True)
class AccessFrom(db.Model):
fro = db.StringProperty(required=True)
counter = db.IntegerProperty(required=T... | [
[
1,
0,
0.0746,
0.0149,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
3,
0,
0.1194,
0.0448,
0,
0.66,
0.1,
296,
0,
0,
0,
0,
697,
0,
2
],
[
14,
1,
0.1194,
0.0149,
1,
0.... | [
"from google.appengine.ext import db",
"class AccessDestination(db.Model):\n desti = db.StringProperty(required=True)\n counter = db.IntegerProperty(required=True)",
" desti = db.StringProperty(required=True)",
" counter = db.IntegerProperty(required=True)",
"class AccessFrom(db.Model):\n fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Mp3Tag:
## Read and write mp3 tag
def __init__(self, mp3filepath):
self.__fp = mp3filepath
def read_title(self):
## Read mp3 title from file directly
# @return a str object, which keeps the original binary data
pass
def read_artist(sel... | [
[
3,
0,
0.5135,
0.7838,
0,
0.66,
0,
362,
0,
5,
0,
0,
0,
0,
2
],
[
2,
1,
0.2297,
0.0541,
1,
0.67,
0,
555,
0,
2,
0,
0,
0,
0,
0
],
[
14,
2,
0.2432,
0.027,
2,
0.19,
... | [
"class Mp3Tag:\n\t## Read and write mp3 tag\n\n\tdef __init__(self, mp3filepath):\n\t\tself.__fp = mp3filepath\n\t\n\tdef read_title(self):\n\t\t## Read mp3 title from file directly",
"\tdef __init__(self, mp3filepath):\n\t\tself.__fp = mp3filepath",
"\t\tself.__fp = mp3filepath",
"\tdef read_title(self):\n\t... |
#!/usr/bin/env python
# coding=utf-8
import os
import ID3
from optparse import OptionParser
from glob import glob
from PinyinConverter import PinyinConverter
fencs = ('utf-8', 'cp936', 'cp932', 'utf-16le', 'utf-16be')
# Oh! OO
class Mp3Info:
pinyinConverter = PinyinConverter()
def __init__(self, filepath):
if no... | [
[
1,
0,
0.0435,
0.0109,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0543,
0.0109,
0,
0.66,
0.1,
904,
0,
1,
0,
0,
904,
0,
0
],
[
1,
0,
0.0652,
0.0109,
0,
0.6... | [
"import os",
"import ID3",
"from optparse import OptionParser",
"from glob import glob",
"from PinyinConverter import PinyinConverter",
"fencs = ('utf-8', 'cp936', 'cp932', 'utf-16le', 'utf-16be')",
"class Mp3Info:\n\tpinyinConverter = PinyinConverter()\n\tdef __init__(self, filepath):\n\t\tif not os.pa... |
#!/usr/bin/env python
# coding=utf-8
import codecs
class PinyinConverter:
def __init__(self):
self._pinyinTable = PINYIN_TABLE
def char2pinyin(self, c):
## convert Chinese character to pinyin
## @exception: AssertionError, KeyError
assert isinstance(c, unicode)
assert len(c) == 1
return s... | [
[
1,
0,
0.0002,
0,
0,
0.66,
0,
220,
0,
1,
0,
0,
220,
0,
0
],
[
3,
0,
0.0007,
0.001,
0,
0.66,
0.5,
429,
0,
3,
0,
0,
0,
0,
4
],
[
2,
1,
0.0004,
0.0001,
1,
0.32,
0... | [
"import codecs",
"class PinyinConverter:\n\tdef __init__(self):\n\t\tself._pinyinTable = PINYIN_TABLE\n\n\tdef char2pinyin(self, c):\n\t\t## convert Chinese character to pinyin\n\t\t## @exception: AssertionError, KeyError\n\t\tassert isinstance(c, unicode)",
"\tdef __init__(self):\n\t\tself._pinyinTable = PINYI... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
[
14,
0,
0.0281,
0.0017,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0347,
0.0017,
0,
0.66,
0.0303,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.0364,
0.0017,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import sys",
"sys.path.insert(0, 'lib')",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from google.appengine.ext import db",
"from google... |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
[
14,
0,
0.0557,
0.0033,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0689,
0.0033,
0,
0.66,
0.0333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0721,
0.0033,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import db",
"from google.appengine.ext.webapp import template",
"from apiclient.discovery import build_from_document",
"from apiclient.http import MediaUpload",
"from oauth2... |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | [
[
14,
0,
0.1667,
0.0556,
0,
0.66,
0,
189,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3889,
0.0556,
0,
0.66,
0.3333,
295,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6111,
0.0556,
0,
0... | [
"manual_verstr = \"1.5\"",
"auto_build_num = \"211\"",
"verstr = manual_verstr + \".\" + auto_build_num",
"try:\n from pyutil.version_class import Version as pyutil_Version\n __version__ = pyutil_Version(verstr)\nexcept (ImportError, ValueError):\n # Maybe there is no pyutil installed.\n from dist... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 limitation the ... | [
[
8,
0,
0.3,
0.575,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.625,
0.025,
0,
0.66,
0.3333,
311,
0,
1,
0,
0,
311,
0,
0
],
[
1,
0,
0.65,
0.025,
0,
0.66,
0.6... | [
"\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\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 withou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.