code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
"""
>>> import _testfuncs
>>> connection = _testfuncs.connection()
>>> connection.putrequest('GET', '/hello_world.wsgi')
>>> connection.endheaders()
>>> response = connection.getresponse()
>>> response.status
200
>>> response.getheader('Content-Length')
'12'
>>> response.read()
'Hello World!'
"""
def application(env... | [
[
8,
0,
0.32,
0.6,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.84,
0.36,
0,
0.66,
1,
244,
0,
2,
1,
0,
0,
0,
3
],
[
14,
1,
0.72,
0.04,
1,
0.21,
0,
699,
... | [
"\"\"\"\n\n>>> import _testfuncs\n>>> connection = _testfuncs.connection()\n>>> connection.putrequest('GET', '/hello_world.wsgi')\n>>> connection.endheaders()\n>>> response = connection.getresponse()\n>>> response.status",
"def application(environ, start_response):\n status = '200 OK' \n output = 'Hello Wor... |
"""
>>> import _testfuncs
>>> connection = _testfuncs.connection()
>>> messages = _testfuncs.messages()
>>> connection.putrequest('GET', '/exceptions-1f.wsgi')
>>> connection.endheaders()
>>> response = connection.getresponse()
>>> response.status
500
>>> messages[-2] # doctest: +ELLIPSIS
"[error] ... Exception occurr... | [
[
8,
0,
0.3333,
0.6296,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.8519,
0.3333,
0,
0.66,
1,
244,
0,
2,
1,
0,
0,
0,
3
],
[
14,
1,
0.7407,
0.037,
1,
0.88,
0... | [
"\"\"\"\n\n>>> import _testfuncs\n>>> connection = _testfuncs.connection()\n>>> messages = _testfuncs.messages()\n>>> connection.putrequest('GET', '/exceptions-1f.wsgi')\n>>> connection.endheaders()\n>>> response = connection.getresponse()",
"def application(environ, start_response):\n status = '200 OK' \n ... |
"""
>>> import _testfuncs
>>> connection = _testfuncs.connection()
>>> connection.putrequest('GET', '/start_response-1e.wsgi')
>>> connection.endheaders()
>>> response = connection.getresponse()
>>> response.status
200
>>> response.getheader('Content-Length')
'12'
>>> response.read()
'Hello World!'
"""
def applicati... | [
[
8,
0,
0.32,
0.6,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.84,
0.36,
0,
0.66,
1,
244,
0,
2,
1,
0,
0,
0,
3
],
[
14,
1,
0.72,
0.04,
1,
0.46,
0,
699,
... | [
"\"\"\"\n\n>>> import _testfuncs\n>>> connection = _testfuncs.connection()\n>>> connection.putrequest('GET', '/start_response-1e.wsgi')\n>>> connection.endheaders()\n>>> response = connection.getresponse()\n>>> response.status",
"def application(environ, start_response):\n status = '200 ' \n output = 'Hello... |
"""
>>> import _testfuncs
>>> connection = _testfuncs.connection()
>>> messages = _testfuncs.messages()
>>> connection.putrequest('GET', '/start_response-1f.wsgi')
>>> connection.endheaders()
>>> response = connection.getresponse()
>>> response.status
500
>>> messages[-1]
'[error] ValueError: control character present... | [
[
8,
0,
0.3125,
0.5833,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.8333,
0.375,
0,
0.66,
1,
244,
0,
2,
1,
0,
0,
0,
3
],
[
14,
1,
0.7083,
0.0417,
1,
0.83,
0... | [
"\"\"\"\n\n>>> import _testfuncs\n>>> connection = _testfuncs.connection()\n>>> messages = _testfuncs.messages()\n>>> connection.putrequest('GET', '/start_response-1f.wsgi')\n>>> connection.endheaders()\n>>> response = connection.getresponse()",
"def application(environ, start_response):\n status = '200 OK\\r\... |
"""
>>> import _testfuncs
>>> connection = _testfuncs.connection()
>>> messages = _testfuncs.messages()
>>> connection.putrequest('GET', '/start_response-1c.wsgi')
>>> connection.endheaders()
>>> response = connection.getresponse()
>>> response.status
500
>>> messages[-1]
'[error] ValueError: status code is not a 3 di... | [
[
8,
0,
0.3125,
0.5833,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.8333,
0.375,
0,
0.66,
1,
244,
0,
2,
1,
0,
0,
0,
3
],
[
14,
1,
0.7083,
0.0417,
1,
0.09,
0... | [
"\"\"\"\n\n>>> import _testfuncs\n>>> connection = _testfuncs.connection()\n>>> messages = _testfuncs.messages()\n>>> connection.putrequest('GET', '/start_response-1c.wsgi')\n>>> connection.endheaders()\n>>> response = connection.getresponse()",
"def application(environ, start_response):\n status = '2000 OK' \... |
"""
>>> import _testfuncs
>>> connection = _testfuncs.connection()
>>> messages = _testfuncs.messages()
>>> connection.putrequest('GET', '/exceptions-1e.wsgi')
>>> connection.endheaders()
>>> response = connection.getresponse()
>>> response.status
200
>>> response.getheader('Content-Length')
'12'
>>> response.read()
'... | [
[
8,
0,
0.2821,
0.5385,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.6667,
0.1795,
0,
0.66,
0.5,
621,
0,
3,
0,
0,
0,
0,
1
],
[
2,
1,
0.6282,
0.0513,
1,
0.23,
... | [
"\"\"\"\n\n>>> import _testfuncs\n>>> connection = _testfuncs.connection()\n>>> messages = _testfuncs.messages()\n>>> connection.putrequest('GET', '/exceptions-1e.wsgi')\n>>> connection.endheaders()\n>>> response = connection.getresponse()",
"class Iterable:\n def __init__(self, output):\n self.__output... |
import os
import httplib
import re
import time
host = 'wsgi-tests.example.com'
port = '11111'
host = os.environ.get('WSGI_TESTS_HOST', host)
port = int(os.environ.get('WSGI_TESTS_PORT', port))
log_file = '/var/log/apache2/%s-error_log' % host
log_delay = '0.1'
log_file = os.environ.get('WSGI_TEST_LOG_FILE', log_fil... | [
[
1,
0,
0.0169,
0.0169,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0339,
0.0169,
0,
0.66,
0.0714,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.0508,
0.0169,
0,
0.66... | [
"import os",
"import httplib",
"import re",
"import time",
"host = 'wsgi-tests.example.com'",
"port = '11111'",
"host = os.environ.get('WSGI_TESTS_HOST', host)",
"port = int(os.environ.get('WSGI_TESTS_PORT', port))",
"log_file = '/var/log/apache2/%s-error_log' % host",
"log_delay = '0.1'",
"log_... |
import os
import string
def application(environ, start_response):
status = '200 OK'
response_headers = [('Content-type', 'text/plain'),]
start_response(status, response_headers)
filelike = open('/tmp/filetest-a.txt', 'w+')
filelike.write(string.ascii_lowercase)
filelike.flush()
fi... | [
[
1,
0,
0.0526,
0.0526,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1053,
0.0526,
0,
0.66,
0.5,
890,
0,
1,
0,
0,
890,
0,
0
],
[
2,
0,
0.6053,
0.8421,
0,
0.6... | [
"import os",
"import string",
"def application(environ, start_response):\n status = '200 OK'\n \n response_headers = [('Content-type', 'text/plain'),]\n start_response(status, response_headers)\n \n filelike = open('/tmp/filetest-a.txt', 'w+')\n filelike.write(string.ascii_lowercase)",
" ... |
#!/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>[\\+\\*])... |
from data import *
from ui import *
import client
import theme
# In case you want to redesign this gump, keep in mind that at this point, you can not
# access any uo data (e.g. art.mul graphics, hues), as the mul files are not loaded yet.
def create(args):
g = GumpMenu("shardlist", 400, 300)
g.closable = Fals... | [
[
1,
0,
0.037,
0.0185,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0556,
0.0185,
0,
0.66,
0.125,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0741,
0.0185,
0,
0.... | [
"from data import *",
"from ui import *",
"import client",
"import theme",
"def create(args):\n g = GumpMenu(\"shardlist\", 400, 300)\n g.closable = False\n\n shardlist = args[\"shardlist\"]\n if len(shardlist) > 0:\n g.onEnter = selectFirst\n g.store[\"firstName\"] = shardlist[0]"... |
from ui import *
from data import *
import client
import theme
#In case you want to redesign this gump, keep in mind that at this point, you can not
#access any uo data (e.g. art.mul graphics, hues), as the mul files are not loaded yet.
def create(args):
g = GumpMenu("createshard", 400, 300)
g.draggable = Fal... | [
[
1,
0,
0.0417,
0.0208,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0625,
0.0208,
0,
0.66,
0.1429,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0833,
0.0208,
0,
... | [
"from ui import *",
"from data import *",
"import client",
"import theme",
"def create(args):\n g = GumpMenu(\"createshard\", 400, 300)\n g.draggable = False\n g.onEnter = createShard\n theme.setFont(g)\n\n g.addImage((0, 0), Texture(TextureSource.THEME, \"images/background_350x190.png\"))",
... |
from ui import *
from data import *
import theme
import client
import world
def create(args):
g = GumpMenu("skills", args.get("x", 100), args.get("y", 100))
g.mobile = args["mobile"]
g.onPropertyUpdate = updateSkillValues
g.addBackground((0, 0, 400, 400), 3000)
scroll = theme.addScrollArea(g, (5,... | [
[
1,
0,
0.026,
0.013,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.039,
0.013,
0,
0.66,
0.1111,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0519,
0.013,
0,
0.66,... | [
"from ui import *",
"from data import *",
"import theme",
"import client",
"import world",
"def create(args):\n g = GumpMenu(\"skills\", args.get(\"x\", 100), args.get(\"y\", 100))\n g.mobile = args[\"mobile\"]\n g.onPropertyUpdate = updateSkillValues\n\n g.addBackground((0, 0, 400, 400), 3000... |
import ui
import theme
import client
import data
def create(args):
g = ui.GumpMenu("objectpropertylist", args["x"], args["y"])
g.draggable = False
g.closable = False
g.addBackground((0, 0, 250, len(args["lines"]) * 16 + 10), 3000)
y = 5
# lines is a list of strings
for cur in args["lines... | [
[
1,
0,
0.1111,
0.0556,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.1667,
0.0556,
0,
0.66,
0.25,
844,
0,
1,
0,
0,
844,
0,
0
],
[
1,
0,
0.2222,
0.0556,
0,
0.... | [
"import ui",
"import theme",
"import client",
"import data",
"def create(args):\n g = ui.GumpMenu(\"objectpropertylist\", args[\"x\"], args[\"y\"])\n g.draggable = False\n g.closable = False\n\n g.addBackground((0, 0, 250, len(args[\"lines\"]) * 16 + 10), 3000)\n\n y = 5",
" g = ui.GumpM... |
from data import *
from ui import *
import client
import theme
def create(args):
g = GumpMenu("serverlist", 400, 300)
g.closable = False
print args
serverList = args["serverlist"]
# serverlist is a list of tuples (index, name)
if len(serverList) > 0:
g.onEnter = selectFirst
g... | [
[
1,
0,
0.0364,
0.0182,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0545,
0.0182,
0,
0.66,
0.125,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0727,
0.0182,
0,
0... | [
"from data import *",
"from ui import *",
"import client",
"import theme",
"def create(args):\n g = GumpMenu(\"serverlist\", 400, 300)\n g.closable = False\n\n print(args)\n\n serverList = args[\"serverlist\"]\n # serverlist is a list of tuples (index, name)",
" g = GumpMenu(\"serverlist... |
from ui import *
from data import *
import world
def create(args):
g = GumpMenu("status", args.get("x", 100), args.get("y", 100))
g.mobile = args["mobile"]
if g.mobile == world.getPlayer():
g.addImage((0, 0), Texture(TextureSource.GUMPART, 10860))
l = g.addPropertyLabel((83, 45, 295, 20),... | [
[
1,
0,
0.023,
0.0115,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0345,
0.0115,
0,
0.66,
0.2,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.046,
0.0115,
0,
0.66,... | [
"from ui import *",
"from data import *",
"import world",
"def create(args):\n g = GumpMenu(\"status\", args.get(\"x\", 100), args.get(\"y\", 100))\n g.mobile = args[\"mobile\"]\n\n if g.mobile == world.getPlayer():\n g.addImage((0, 0), Texture(TextureSource.GUMPART, 10860))\n l = g.add... |
# this gump is opened after receiving packet 0x7C and can be either
# just a question or a gump to pick an item
from ui import *
from data import *
import client
import theme
def create(args):
g = GumpMenu("", 250, 150)
g.store["serial"] = args["serial"] # to be included in the response
g.store["menuid"]... | [
[
1,
0,
0.1136,
0.0227,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.1364,
0.0227,
0,
0.66,
0.2,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.1591,
0.0227,
0,
0.6... | [
"from ui import *",
"from data import *",
"import client",
"import theme",
"def create(args):\n g = GumpMenu(\"\", 250, 150)\n g.store[\"serial\"] = args[\"serial\"] # to be included in the response\n g.store[\"menuid\"] = args[\"menuid\"] # to be included in the response\n\n g.addBackground((0,... |
from ui import *
from data import *
import client
import theme
def create(args):
g = GumpMenu("login", 387, 320)
g.setFont("Devinne Swash", 16)
g.onEnter = onGumpEnter
g.onEscape = onGumpEscape
g.addImage((0, 0), Texture(TextureSource.THEME, "images/background_250x125.png"))
label = g.addLab... | [
[
1,
0,
0.069,
0.0345,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.1034,
0.0345,
0,
0.66,
0.1429,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.1379,
0.0345,
0,
0... | [
"from ui import *",
"from data import *",
"import client",
"import theme",
"def create(args):\n g = GumpMenu(\"login\", 387, 320)\n g.setFont(\"Devinne Swash\", 16)\n g.onEnter = onGumpEnter\n g.onEscape = onGumpEscape\n\n g.addImage((0, 0), Texture(TextureSource.THEME, \"images/background_25... |
import ui
from data import Texture, TextureSource
import client
import theme
def create(args):
g = ui.GumpMenu("yesnobox", 300, 300)
g.onEnter = choiceYes
g.onEscape = choiceNo
g.store["callbackYes"] = args["callbackYes"]
g.store["callbackNo"] = args["callbackNo"]
g.store["callbackArgs"] = arg... | [
[
1,
0,
0.0556,
0.0278,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0833,
0.0278,
0,
0.66,
0.1667,
929,
0,
2,
0,
0,
929,
0,
0
],
[
1,
0,
0.1111,
0.0278,
0,
... | [
"import ui",
"from data import Texture, TextureSource",
"import client",
"import theme",
"def create(args):\n g = ui.GumpMenu(\"yesnobox\", 300, 300)\n g.onEnter = choiceYes\n g.onEscape = choiceNo\n g.store[\"callbackYes\"] = args[\"callbackYes\"]\n g.store[\"callbackNo\"] = args[\"callbackN... |
import ui
from data import Texture, TextureSource, rgba
import client
def create(args):
g = ui.GumpMenu("spellbook", 100, 100)
g.setFont("Devinne Swash", 16)
g.addPage(0)
g.addImage((0, 0), Texture(TextureSource.GUMPART, 2220))
# circle numbers
g.addPageButton((58, 175), Texture(TextureSourc... | [
[
1,
0,
0.0163,
0.0081,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0244,
0.0081,
0,
0.66,
0.1667,
929,
0,
3,
0,
0,
929,
0,
0
],
[
1,
0,
0.0325,
0.0081,
0,
... | [
"import ui",
"from data import Texture, TextureSource, rgba",
"import client",
"def create(args):\n g = ui.GumpMenu(\"spellbook\", 100, 100)\n g.setFont(\"Devinne Swash\", 16)\n\n g.addPage(0)\n g.addImage((0, 0), Texture(TextureSource.GUMPART, 2220))\n\n # circle numbers",
" g = ui.GumpMe... |
from data import *
from ui import *
import client
import theme
def create(args):
g = GumpMenu("characterlist", 400, 300)
g.closable = False
charList = args["characterlist"]
# characterlist is a list of tuples (index, name, password)
if len(charList) > 0:
g.onEnter = selectFirst
g.... | [
[
1,
0,
0.0235,
0.0118,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0353,
0.0118,
0,
0.66,
0.0909,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0471,
0.0118,
0,
... | [
"from data import *",
"from ui import *",
"import client",
"import theme",
"def create(args):\n g = GumpMenu(\"characterlist\", 400, 300)\n g.closable = False\n\n charList = args[\"characterlist\"]\n # characterlist is a list of tuples (index, name, password)\n if len(charList) > 0:\n ... |
# -*- coding: utf-8 -*-
from ui import *
from data import *
import time
def onButtonClick(button):
print "onButtonClick"
button.rgba = (1.0, 0.0, 1.0)
print button.name
button.halign = HAlign.RIGHT
button.valign = VAlign.TOP
button.gump.component("i1").hue = 90
print button.gump.store
print button.gump.sto... | [
[
1,
0,
0.0469,
0.0156,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0625,
0.0156,
0,
0.66,
0.25,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0938,
0.0156,
0,
0.... | [
"from ui import *",
"from data import *",
"import time",
"def onButtonClick(button):\n\tprint(\"onButtonClick\")\n\tbutton.rgba = (1.0, 0.0, 1.0)\n\tprint(button.name)\n\tbutton.halign = HAlign.RIGHT\n\tbutton.valign = VAlign.TOP\n\n\tbutton.gump.component(\"i1\").hue = 90",
"\tprint(\"onButtonClick\")",
... |
from ui import *
from data import *
import client
def create(args):
g = GumpMenu("minimap", args.get("x", 120), args.get("y", 120))
width = args.get("width", 300)
height = args.get("height", 300)
g.addBackground((0, 0, width + 6, height + 6), 2620)
mmv = g.addMiniMapView((3, 3, width, height))
... | [
[
1,
0,
0.0714,
0.0357,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.1071,
0.0357,
0,
0.66,
0.2,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.1429,
0.0357,
0,
0.6... | [
"from ui import *",
"from data import *",
"import client",
"def create(args):\n g = GumpMenu(\"minimap\", args.get(\"x\", 120), args.get(\"y\", 120))\n\n width = args.get(\"width\", 300)\n height = args.get(\"height\", 300)\n\n g.addBackground((0, 0, width + 6, height + 6), 2620)\n mmv = g.addM... |
from ui import *
from data import *
import client
def create(args):
g = GumpMenu("gamewindow", args.get("x", 20), args.get("y", 20), True)
g.closable = False
g.onEnter = showSpeechEntry
width = args.get("width", 800)
height = args.get("height", 600)
g.addPage(0)
g.addBackground((0, 0, wi... | [
[
1,
0,
0.0351,
0.0175,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0526,
0.0175,
0,
0.66,
0.1429,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0702,
0.0175,
0,
... | [
"from ui import *",
"from data import *",
"import client",
"def create(args):\n g = GumpMenu(\"gamewindow\", args.get(\"x\", 20), args.get(\"y\", 20), True)\n g.closable = False\n g.onEnter = showSpeechEntry\n\n width = args.get(\"width\", 800)\n height = args.get(\"height\", 600)",
" g = ... |
import ui
import world
def create(args):
g = ui.GumpMenu("container", args.get("x", 100), args.get("y", 100))
cont = g.addContainerView((0, 0), args["item"])
cont.background = args["background"]
g.store["serial"] = args["item"].serial
g.store["background"] = args["background"]
def save(gump):
... | [
[
1,
0,
0.0714,
0.0357,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.1071,
0.0357,
0,
0.66,
0.25,
939,
0,
1,
0,
0,
939,
0,
0
],
[
2,
0,
0.3036,
0.2857,
0,
0.... | [
"import ui",
"import world",
"def create(args):\n g = ui.GumpMenu(\"container\", args.get(\"x\", 100), args.get(\"y\", 100))\n\n cont = g.addContainerView((0, 0), args[\"item\"])\n cont.background = args[\"background\"]\n\n g.store[\"serial\"] = args[\"item\"].serial\n g.store[\"background\"] = a... |
import ui
import theme
import client
import data
def create(args):
g = ui.GumpMenu("contextmenu", 50, 50)
g.draggable = False
g.store["serial"] = args["serial"]
y = 0
# entries is a list of tuples
# (entry id, cliloc id)
for cur in args["entries"]:
bt = theme.addPythonButton(g, (... | [
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.125,
0.0417,
0,
0.66,
0.2,
844,
0,
1,
0,
0,
844,
0,
0
],
[
1,
0,
0.1667,
0.0417,
0,
0.66... | [
"import ui",
"import theme",
"import client",
"import data",
"def create(args):\n g = ui.GumpMenu(\"contextmenu\", 50, 50)\n g.draggable = False\n\n g.store[\"serial\"] = args[\"serial\"]\n\n y = 0\n # entries is a list of tuples",
" g = ui.GumpMenu(\"contextmenu\", 50, 50)",
" g.dr... |
from ui import *
from data import *
import world
def create(args):
g = GumpMenu("profile", args.get("x", 100), args.get("y", 100))
g.mobile = args["mobile"]
# TODO: make this look like the uo one
g.addImage((0, 0), Texture(TextureSource.THEME, "images/background_250x250.png"))
# TODO: editable f... | [
[
1,
0,
0.0606,
0.0303,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0909,
0.0303,
0,
0.66,
0.2,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.1212,
0.0303,
0,
0.6... | [
"from ui import *",
"from data import *",
"import world",
"def create(args):\n g = GumpMenu(\"profile\", args.get(\"x\", 100), args.get(\"y\", 100))\n g.mobile = args[\"mobile\"]\n\n # TODO: make this look like the uo one\n g.addImage((0, 0), Texture(TextureSource.THEME, \"images/background_250x25... |
from world import *
from ui import *
from data import *
import client
import theme
def create(args):
g = GumpMenu("login", 337, 289, True)
theme.setFont(g)
g.closable = False
g.addImage((0, 0), Texture(TextureSource.THEME, "images/background_350x190.png"))
g.addLabel((15, 16), "IP/Hostname:")
... | [
[
1,
0,
0.0333,
0.0167,
0,
0.66,
0,
939,
0,
1,
0,
0,
939,
0,
0
],
[
1,
0,
0.05,
0.0167,
0,
0.66,
0.1429,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0667,
0.0167,
0,
0.... | [
"from world import *",
"from ui import *",
"from data import *",
"import client",
"import theme",
"def create(args):\n g = GumpMenu(\"login\", 337, 289, True)\n theme.setFont(g)\n g.closable = False\n\n g.addImage((0, 0), Texture(TextureSource.THEME, \"images/background_350x190.png\"))\n\n ... |
from ui import *
from data import *
def init(gump):
gump.setFont("unifont1", 12, False)
def addHtmlBackground(gump, geom):
return gump.addBackground(geom, 3000)
def addHtmlScrollbar(gump, geom):
scroll = gump.addScrollArea(geom)
scroll.marginLeft = 3
scroll.marginTop = 3
scroll.marginRight =... | [
[
1,
0,
0.0741,
0.037,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.1111,
0.037,
0,
0.66,
0.25,
929,
0,
1,
0,
0,
929,
0,
0
],
[
2,
0,
0.2037,
0.0741,
0,
0.66... | [
"from ui import *",
"from data import *",
"def init(gump):\n gump.setFont(\"unifont1\", 12, False)",
" gump.setFont(\"unifont1\", 12, False)",
"def addHtmlBackground(gump, geom):\n return gump.addBackground(geom, 3000)",
" return gump.addBackground(geom, 3000)",
"def addHtmlScrollbar(gump, g... |
from ui import *
from data import *
import client
import world
def create(args):
g = GumpMenu("paperdoll", args.get("x", 50), args.get("y", 50))
g.mobile = args["mobile"]
g.onWarmodeChanged = onWarmodeChanged
g.addImage((0, 0), Texture(TextureSource.GUMPART, 2000))
g.addPaperdollView((3, 9, 240, ... | [
[
1,
0,
0.0204,
0.0102,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0306,
0.0102,
0,
0.66,
0.0769,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.0408,
0.0102,
0,
... | [
"from ui import *",
"from data import *",
"import client",
"import world",
"def create(args):\n g = GumpMenu(\"paperdoll\", args.get(\"x\", 50), args.get(\"y\", 50))\n g.mobile = args[\"mobile\"]\n g.onWarmodeChanged = onWarmodeChanged\n\n g.addImage((0, 0), Texture(TextureSource.GUMPART, 2000))... |
import ui
from data import *
import world
# mapping between the id sent by the server and the id in gumpart.mul
BUFF_ICONS = {
0x3e9: 0x754C,
0x3ea: 0x754A,
0x3ed: 0x755E,
0x3ee: 0x7549,
0x3ef: 0x7551,
0x3f0: 0x7556,
0x3f1: 0x753A,
0x3f2: 0x754D,
0x3f3: 0x754E,
0x3f4: 0x7565,
... | [
[
1,
0,
0.025,
0.0125,
0,
0.66,
0,
303,
0,
1,
0,
0,
303,
0,
0
],
[
1,
0,
0.0375,
0.0125,
0,
0.66,
0.1667,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.05,
0.0125,
0,
0.6... | [
"import ui",
"from data import *",
"import world",
"BUFF_ICONS = {\n 0x3e9: 0x754C,\n 0x3ea: 0x754A,\n 0x3ed: 0x755E,\n 0x3ee: 0x7549,\n 0x3ef: 0x7551,\n 0x3f0: 0x7556,\n 0x3f1: 0x753A,",
"def populateGump(g):\n bufflist = world.getPlayer().buffs\n\n g.addBackground((0, 0, len(buf... |
from data import *
def themeTest():
print "I am the default theme!"
def setFont(obj):
obj.setFont("Devinne Swash", 16)
def addPythonButton(gump, coordinates, callback):
b = gump.addPythonButton(coordinates, Texture(TextureSource.THEME, "images/button.png"), callback)
styleButton(b)
return b
def... | [
[
1,
0,
0.0377,
0.0189,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
],
[
2,
0,
0.0849,
0.0377,
0,
0.66,
0.125,
11,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.0943,
0.0189,
1,
0.93... | [
"from data import *",
"def themeTest():\n print(\"I am the default theme!\")",
" print(\"I am the default theme!\")",
"def setFont(obj):\n obj.setFont(\"Devinne Swash\", 16)",
" obj.setFont(\"Devinne Swash\", 16)",
"def addPythonButton(gump, coordinates, callback):\n b = gump.addPythonButto... |
from data import *
def themeTest():
print "I am the preshard theme!"
def setFont(obj):
obj.setFont("Devinne Swash", 16)
def addPythonButton(gump, coordinates, callback):
b = gump.addPythonButton(coordinates, Texture(TextureSource.THEME, "images/button.png"), callback)
styleButton(b)
return b
de... | [
[
1,
0,
0.0377,
0.0189,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
],
[
2,
0,
0.0849,
0.0377,
0,
0.66,
0.125,
11,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.0943,
0.0189,
1,
0.12... | [
"from data import *",
"def themeTest():\n print(\"I am the preshard theme!\")",
" print(\"I am the preshard theme!\")",
"def setFont(obj):\n obj.setFont(\"Devinne Swash\", 16)",
" obj.setFont(\"Devinne Swash\", 16)",
"def addPythonButton(gump, coordinates, callback):\n b = gump.addPythonBut... |
#! /usr/bin/pythonw
import wx
app = wx.PySimpleApp()
frame = wx.Frame(None, -1, "Hello Python")
frame.Show(1)
app.MainLoop() | [
[
1,
0,
0.3333,
0.1667,
0,
0.66,
0,
666,
0,
1,
0,
0,
666,
0,
0
],
[
14,
0,
0.5,
0.1667,
0,
0.66,
0.25,
494,
3,
0,
0,
0,
909,
10,
1
],
[
14,
0,
0.6667,
0.1667,
0,
0.... | [
"import wx",
"app = wx.PySimpleApp()",
"frame = wx.Frame(None, -1, \"Hello Python\")",
"frame.Show(1)",
"app.MainLoop()"
] |
#! /usr/bin/pythonw
import wx
app = wx.PySimpleApp()
frame = wx.Frame(None, -1, "Hello Python")
frame.Show(1)
app.MainLoop() | [
[
1,
0,
0.3333,
0.1667,
0,
0.66,
0,
666,
0,
1,
0,
0,
666,
0,
0
],
[
14,
0,
0.5,
0.1667,
0,
0.66,
0.25,
494,
3,
0,
0,
0,
909,
10,
1
],
[
14,
0,
0.6667,
0.1667,
0,
0.... | [
"import wx",
"app = wx.PySimpleApp()",
"frame = wx.Frame(None, -1, \"Hello Python\")",
"frame.Show(1)",
"app.MainLoop()"
] |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | [
[
1,
0,
0.3514,
0.0135,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3649,
0.0135,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.3784,
0.0135,
0,
... | [
"import os",
"import re",
"import tempfile",
"import shutil",
"ignore_pattern = re.compile('^(.svn|target|bin|classes)')",
"java_pattern = re.compile('^.*\\.java')",
"annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')",
"def process_dir(dir):\n files = os.listdir(dir)\n for... |
#!/usr/bin/env python
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import threading, urllib, json, socket
from base64 import standard_b64encode as b64encode
from http.cookiejar import CookieJar, DefaultCookiePolicy
try: from lxml import etree
except: import xml.etr... | [
[
1,
0,
0.0337,
0.0112,
0,
0.66,
0,
332,
0,
2,
0,
0,
332,
0,
0
],
[
1,
0,
0.0449,
0.0112,
0,
0.66,
0.1,
774,
0,
1,
0,
0,
774,
0,
0
],
[
1,
0,
0.0562,
0.0112,
0,
0.6... | [
"from http.server import HTTPServer, BaseHTTPRequestHandler",
"from socketserver import ThreadingMixIn",
"import threading, urllib, json, socket",
"from base64 import standard_b64encode as b64encode",
"from http.cookiejar import CookieJar, DefaultCookiePolicy",
"try: from lxml import etree\nexcept: import... |
import swacc
for lang in swacc.var['langs'].keys():
f = open('www/scripts/swaclangs/'+lang+'.js', 'w')
f.write('''self.lang = '''+str(swacc.var['langs'][lang])+''';\n
self.onmessage = function(event){
self.postMessage(self.lang[event.data]);
};''')
f.close()
| [
[
1,
0,
0.125,
0.125,
0,
0.66,
0,
858,
0,
1,
0,
0,
858,
0,
0
],
[
6,
0,
0.625,
0.875,
0,
0.66,
1,
312,
3,
0,
0,
0,
0,
0,
5
],
[
14,
1,
0.375,
0.125,
1,
0.31,
0,... | [
"import swacc",
"for lang in swacc.var['langs'].keys():\n f = open('www/scripts/swaclangs/'+lang+'.js', 'w')\n f.write('''self.lang = '''+str(swacc.var['langs'][lang])+''';\\n\n self.onmessage = function(event){\n self.postMessage(self.lang[event.data]);\n };''')\n ... |
#!/usr/bin/env python
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import threading, urllib, json, socket, time
from base64 import standard_b64encode as b64encode
from http.cookiejar import CookieJar, DefaultCookiePolicy
try: from lxml import etree
except: import x... | [
[
1,
0,
0.0229,
0.0076,
0,
0.66,
0,
332,
0,
2,
0,
0,
332,
0,
0
],
[
1,
0,
0.0305,
0.0076,
0,
0.66,
0.0714,
774,
0,
1,
0,
0,
774,
0,
0
],
[
1,
0,
0.0382,
0.0076,
0,
... | [
"from http.server import HTTPServer, BaseHTTPRequestHandler",
"from socketserver import ThreadingMixIn",
"import threading, urllib, json, socket, time",
"from base64 import standard_b64encode as b64encode",
"from http.cookiejar import CookieJar, DefaultCookiePolicy",
"try: from lxml import etree\nexcept: ... |
from google.appengine.ext import db
class Level(db.Model):
"""Holds meta-data for a level in the game."""
owner = db.UserProperty()
level = db.StringProperty(required=True)
next_level = db.StringProperty(default='')
base_rows = db.IntegerProperty(required=True)
static_blocks = db.TextProperty(required=Tru... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
3,
0,
0.4038,
0.5385,
0,
0.66,
0.5,
476,
0,
0,
0,
0,
697,
0,
12
],
[
8,
1,
0.1923,
0.0385,
1,
0.... | [
"from google.appengine.ext import db",
"class Level(db.Model):\n \"\"\"Holds meta-data for a level in the game.\"\"\"\n owner = db.UserProperty()\n level = db.StringProperty(required=True)\n next_level = db.StringProperty(default='')\n base_rows = db.IntegerProperty(required=True)\n static_blocks = db.TextP... |
# Copyright 2011 Google Inc. All Rights Reserved.
# pylint: disable-msg=C6409,C6203
"""Separate models module for IAP Hello World."""
__author__ = 'dhermes@google.com (Danny Hermes)'
# standard library imports
import os
import pickle
import time
# third-party imports
from google.appengine.api import users
from goo... | [
[
8,
0,
0.009,
0.0018,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0126,
0.0018,
0,
0.66,
0.04,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.018,
0.0018,
0,
0.66,
... | [
"\"\"\"Separate models module for IAP Hello World.\"\"\"",
"__author__ = 'dhermes@google.com (Danny Hermes)'",
"import os",
"import pickle",
"import time",
"from google.appengine.api import users",
"from google.appengine.ext import db",
"from google.appengine.ext import webapp",
"from google.appengi... |
OPEN_ID_PROVIDERS = (
('Google', 'google.com/accounts/o8/id'),
('Yahoo', 'yahoo.com'),
('MySpace', 'myspace.com'),
('AOL', 'aol.com'),
('MyOpenID', 'myopenid.com'),
)
POSTBACK_URL = 'http://iap-hello-world.appspot.com/postback-verify'
| [
[
14,
0,
0.5,
0.875,
0,
0.66,
0,
645,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
1,
0.125,
0,
0.66,
1,
890,
1,
0,
0,
0,
0,
3,
0
]
] | [
"OPEN_ID_PROVIDERS = (\n ('Google', 'google.com/accounts/o8/id'),\n ('Yahoo', 'yahoo.com'),\n ('MySpace', 'myspace.com'),\n ('AOL', 'aol.com'),\n ('MyOpenID', 'myopenid.com'),\n)",
"POSTBACK_URL = 'http://iap-hello-world.appspot.com/postback-verify'"
] |
""" JSON Web Token implementation
Minimum implementation based on this spec:
http://self-issued.info/docs/draft-jones-json-web-token-01.html
"""
import base64
import hashlib
import hmac
try:
import json
except ImportError:
import simplejson as json
__all__ = ['encode', 'decode', 'DecodeError']
class Dec... | [
[
8,
0,
0.0417,
0.0694,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0139,
0,
0.66,
0.0833,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0972,
0.0139,
0,
0.66... | [
"\"\"\" JSON Web Token implementation\n\nMinimum implementation based on this spec:\nhttp://self-issued.info/docs/draft-jones-json-web-token-01.html\n\"\"\"",
"import base64",
"import hashlib",
"import hmac",
"try:\n import json\nexcept ImportError:\n import simplejson as json",
" import json",
... |
SELLER_ID = "BOGUS_ID"
SELLER_SECRET = "BOGUS_KEY"
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
232,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
1,
0.5,
0,
0.66,
1,
57,
1,
0,
0,
0,
0,
3,
0
]
] | [
"SELLER_ID = \"BOGUS_ID\"",
"SELLER_SECRET = \"BOGUS_KEY\""
] |
from main import DBPIckle
from models import Level
level_one = Level(level='1', next_level='2', base_rows=4,
static_blocks=DBPIckle({7: [4, 5], 13: [4], 17: [4, 5]}),
move_blocks=DBPIckle({2: [4], 10: [4]}),
door=DBPIckle({'row': 4, 'column': 23}),
... | [
[
1,
0,
0.0192,
0.0192,
0,
0.66,
0,
624,
0,
1,
0,
0,
624,
0,
0
],
[
1,
0,
0.0385,
0.0192,
0,
0.66,
0.0909,
495,
0,
1,
0,
0,
495,
0,
0
],
[
14,
0,
0.1346,
0.0962,
0,
... | [
"from main import DBPIckle",
"from models import Level",
"level_one = Level(level='1', next_level='2', base_rows=4,\n static_blocks=DBPIckle({7: [4, 5], 13: [4], 17: [4, 5]}),\n move_blocks=DBPIckle({2: [4], 10: [4]}),\n door=DBPIckle({'row': 4, 'column': 23}),... |
from google.appengine.ext import db
import models
messages = models.Message.all()
db.delete(messages)
| [
[
1,
0,
0.1429,
0.1429,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.4286,
0.1429,
0,
0.66,
0.3333,
495,
0,
1,
0,
0,
495,
0,
0
],
[
14,
0,
0.8571,
0.1429,
0,
... | [
"from google.appengine.ext import db",
"import models",
"messages = models.Message.all()",
"db.delete(messages)"
] |
import logging
from google.appengine.ext import db
_log = logging.getLogger(__name__)
class Video(db.Model):
created = db.DateTimeProperty(auto_now_add=True, required=True)
modified = db.DateTimeProperty(auto_now=True, required=True)
question = db.StringProperty(required=True, indexed=False)... | [
[
1,
0,
0.0357,
0.0357,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1071,
0.0357,
0,
0.66,
0.2,
167,
0,
1,
0,
0,
167,
0,
0
],
[
14,
0,
0.2143,
0.0357,
0,
0.... | [
"import logging",
"from google.appengine.ext import db",
"_log = logging.getLogger(__name__)",
"class Video(db.Model):\n created = db.DateTimeProperty(auto_now_add=True, required=True)\n modified = db.DateTimeProperty(auto_now=True, required=True)\n question = db.StringProperty(required=True, indexed... |
#!/usr/bin/env python
#
# 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 o... | [
[
1,
0,
0.3958,
0.0208,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4375,
0.0208,
0,
0.66,
0.1667,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.4583,
0.0208,
0,
... | [
"import logging",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp import util",
"import handlers",
"_log = logging.getLogger(__name__)",
"def main():\n urls = (\n ('/', handlers.HomeHandler),\n ('/login', handlers.LoginHa... |
#!/usr/bin/env python
#
# 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 o... | [
[
1,
0,
0.3958,
0.0208,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4375,
0.0208,
0,
0.66,
0.1667,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.4583,
0.0208,
0,
... | [
"import logging",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp import util",
"import handlers",
"_log = logging.getLogger(__name__)",
"def main():\n urls = (\n ('/', handlers.HomeHandler),\n ('/login', handlers.LoginHa... |
import datetime
import logging
import os
import time
import urlparse
from django.utils import simplejson
from google.appengine.api import users
from google.appengine.api import xmpp
from google.appengine.ext import db
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
... | [
[
1,
0,
0.0049,
0.0049,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0098,
0.0049,
0,
0.66,
0.037,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0147,
0.0049,
0,
0... | [
"import datetime",
"import logging",
"import os",
"import time",
"import urlparse",
"from django.utils import simplejson",
"from google.appengine.api import users",
"from google.appengine.api import xmpp",
"from google.appengine.ext import db",
"from google.appengine.ext.webapp import template",
... |
import code
import getpass
import optparse
import os
import sys
def main():
"""Launch a Python shell connected to Social Butterfly's datastore."""
# Parse the command-line arguments:
parser = _config_parser()
app_id, host, auth_domain, email, base_dir = _parse_args(parser)
# Set the ... | [
[
1,
0,
0.0088,
0.0088,
0,
0.66,
0,
44,
0,
1,
0,
0,
44,
0,
0
],
[
1,
0,
0.0175,
0.0088,
0,
0.66,
0.0909,
784,
0,
1,
0,
0,
784,
0,
0
],
[
1,
0,
0.0263,
0.0088,
0,
0.... | [
"import code",
"import getpass",
"import optparse",
"import os",
"import sys",
"def main():\n \"\"\"Launch a Python shell connected to Social Butterfly's datastore.\"\"\"\n # Parse the command-line arguments:\n parser = _config_parser()\n app_id, host, auth_domain, email, base_dir = _parse_arg... |
import functools
import logging
from google.appengine.api import users
_log = logging.getLogger(__name__)
def require_admin(method):
"""Require that the user be logged in as an administrator.
Google App Engine provides similar functionality:
from google.appengine.ext.webapp.util i... | [
[
1,
0,
0.0256,
0.0256,
0,
0.66,
0,
711,
0,
1,
0,
0,
711,
0,
0
],
[
1,
0,
0.0513,
0.0256,
0,
0.66,
0.25,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1026,
0.0256,
0,
0.... | [
"import functools",
"import logging",
"from google.appengine.api import users",
"_log = logging.getLogger(__name__)",
"def require_admin(method):\n \"\"\"Require that the user be logged in as an administrator.\n \n Google App Engine provides similar functionality:\n from google.appengine.ext... |
import logging
import os
_log = logging.getLogger(__name__)
# Programmatically determine whether to turn on debug mode. If we're running
# on the SDK, then turn on debug mode. Otherwise we're running on the cloud,
# so turn off debug mode. (Debug mode enables more verbose logging, but also
# makes the ... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0769,
0.0385,
0,
0.66,
0.1111,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1923,
0.0385,
0,
... | [
"import logging",
"import os",
"_log = logging.getLogger(__name__)",
"_SERVER_SOFTWARE = os.getenv('SERVER_SOFTWARE', '')",
"DEBUG = _SERVER_SOFTWARE.split('/', 1)[0] == 'Development'",
"_log.debug('turning %s debug mode' % ('on' if DEBUG else 'off'))",
"_CURRENT_PATH = os.path.dirname(__file__)",
"TE... |
import os
from google.appengine.ext.webapp import template
import cgi
from google.appengine.ext.webapp.util import login_required
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from goog... | [
[
1,
0,
0.0156,
0.0156,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0312,
0.0156,
0,
0.66,
0.0714,
8,
0,
1,
0,
0,
8,
0,
0
],
[
1,
0,
0.0469,
0.0156,
0,
0.66... | [
"import os",
"from google.appengine.ext.webapp import template",
"import cgi",
"from google.appengine.ext.webapp.util import login_required",
"from google.appengine.api import users",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from google.a... |
SECRET_CODE = 'whateveryourcodeis'
| [
[
14,
0,
1,
0.5,
0,
0.66,
0,
52,
1,
0,
0,
0,
0,
3,
0
]
] | [
"SECRET_CODE = 'whateveryourcodeis'"
] |
import numpy as np
import socket
from time import sleep
TCP_IP = '127.0.0.1'
TCP_PORT = 5001
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((TCP_IP, TCP_PORT))
s.listen(1)
print "waiting for connection"
conn, addr = s.accept() # hangs until other en... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0317,
0.0159,
0,
0.66,
0.0833,
687,
0,
1,
0,
0,
687,
0,
0
],
[
1,
0,
0.0476,
0.0159,
0,
... | [
"import numpy as np",
"import socket",
"from time import sleep",
"TCP_IP = '127.0.0.1'",
"TCP_PORT = 5001",
"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)",
"s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)",
"s.bind((TCP_IP, TCP_PORT))",
"s.listen(1)",
"print(\"waiting for connecti... |
import numpy as np
import socket
class Wormhole:
def __init__(self):
TCP_IP = '127.0.0.1'
TCP_PORT = 5002
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((TCP_IP, TCP_PORT))
s.listen(1)
prin... | [
[
1,
0,
0.0189,
0.0189,
0,
0.66,
0,
954,
0,
1,
0,
0,
954,
0,
0
],
[
1,
0,
0.0377,
0.0189,
0,
0.66,
0.5,
687,
0,
1,
0,
0,
687,
0,
0
],
[
3,
0,
0.4811,
0.8302,
0,
0.6... | [
"import numpy as np",
"import socket",
"class Wormhole:\n def __init__(self):\n TCP_IP = '127.0.0.1'\n TCP_PORT = 5002\n s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n s.bind((TCP_IP, TCP_PORT))\n s.l... |
#!/usr/bin/env python
from distutils.core import setup
setup(name='Wormhole',
version='0.1',
description='Use python from matlab and matlab from python',
author='John Schulman',
author_email='john.d.schulman@gmail.com',
url='http://',
py_modules=['Wormhole'],
scripts=['open_w... | [
[
1,
0,
0.2308,
0.0769,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
8,
0,
0.6923,
0.6923,
0,
0.66,
1,
234,
3,
8,
0,
0,
0,
0,
1
]
] | [
"from distutils.core import setup",
"setup(name='Wormhole',\n version='0.1',\n description='Use python from matlab and matlab from python',\n author='John Schulman',\n author_email='john.d.schulman@gmail.com',\n url='http://',\n py_modules=['Wormhole'],\n scripts=['open_wormhole... |
#!/usr/bin/env python
import commands
pids = [line.split()[1] for line in commands.getoutput("ps aux").split("\n") if "open_wormhole" in line]
for pid in pids:
print "killing %s"%pid
commands.getoutput("kill %s"%pid)
| [
[
1,
0,
0.3333,
0.1667,
0,
0.66,
0,
760,
0,
1,
0,
0,
760,
0,
0
],
[
14,
0,
0.5,
0.1667,
0,
0.66,
0.5,
221,
5,
0,
0,
0,
0,
0,
3
],
[
6,
0,
0.8333,
0.5,
0,
0.66,
... | [
"import commands",
"pids = [line.split()[1] for line in commands.getoutput(\"ps aux\").split(\"\\n\") if \"open_wormhole\" in line]",
"for pid in pids:\n print(\"killing %s\"%pid)\n commands.getoutput(\"kill %s\"%pid)",
" print(\"killing %s\"%pid)",
" commands.getoutput(\"kill %s\"%pid)"
] |
#!/usr/bin/env python
from distutils.core import setup
setup(
name = "pyrtree",
packages = ["pyrtree"],
version = "0.50",
description = "2-Dimensional RTree spatial index",
author = "Dan Shoutis",
author_email = "dan@shoutis.org",
url="http://code.google.com/p/pyrtree",
long_descriptio... | [
[
1,
0,
0.15,
0.05,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
8,
0,
0.625,
0.8,
0,
0.66,
1,
234,
3,
8,
0,
0,
0,
0,
1
]
] | [
"from distutils.core import setup",
"setup(\n name = \"pyrtree\",\n packages = [\"pyrtree\"],\n version = \"0.50\",\n description = \"2-Dimensional RTree spatial index\",\n author = \"Dan Shoutis\",\n author_email = \"dan@shoutis.org\",\n url=\"http://code.google.com/p/pyrtree\","
] |
import math
class Rect(object):
"""
A rectangle class that stores: an axis aligned rectangle, and: two
flags (swapped_x and swapped_y). (The flags are stored
implicitly via swaps in the order of minx/y and maxx/y.)
"""
__slots__ = ("x","y","xx","yy", "swapped_x", "swapped_y")
def __ini... | [
[
1,
0,
0.0081,
0.0081,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
3,
0,
0.4715,
0.9024,
0,
0.66,
0.2,
333,
0,
15,
0,
0,
186,
0,
19
],
[
8,
1,
0.0488,
0.0407,
1,
0... | [
"import math",
"class Rect(object):\n \"\"\"\n A rectangle class that stores: an axis aligned rectangle, and: two\n flags (swapped_x and swapped_y). (The flags are stored\n implicitly via swaps in the order of minx/y and maxx/y.)\n \"\"\"\n\n __slots__ = (\"x\",\"y\",\"xx\",\"yy\", \"swapped_... |
def take(n,f,*args,**kwargs):
i = 0
while i < n:
yield f(*args,**kwargs)
i = i + 1
| [
[
2,
0,
0.6667,
0.8333,
0,
0.66,
0,
0,
0,
4,
0,
0,
0,
0,
1
],
[
14,
1,
0.5,
0.1667,
1,
0.09,
0,
826,
1,
0,
0,
0,
0,
1,
0
],
[
5,
1,
0.8333,
0.5,
1,
0.09,
1,
... | [
"def take(n,f,*args,**kwargs):\n i = 0\n while i < n:\n yield f(*args,**kwargs)\n i = i + 1",
" i = 0",
" while i < n:\n yield f(*args,**kwargs)\n i = i + 1",
" yield f(*args,**kwargs)",
" i = i + 1"
] |
# Like bench_rtree but uses the libspatialindex c library. For comparison!
# http://pypi.python.org/pypi/Rtree
# TODO: path hackery.
if __name__ == "__main__":
import sys, os
mypath = os.path.dirname(sys.argv[0])
sys.path.append(os.path.abspath(os.path.join(mypath, "../../")))
from pyrtree.bench.bench_rtr... | [
[
4,
0,
0.1912,
0.1176,
0,
0.66,
0,
0,
0,
0,
0,
0,
0,
0,
4
],
[
1,
1,
0.1765,
0.0294,
1,
0.9,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
1,
0.2059,
0.0294,
1,
0.9,
... | [
"if __name__ == \"__main__\":\n import sys, os\n mypath = os.path.dirname(sys.argv[0])\n sys.path.append(os.path.abspath(os.path.join(mypath, \"../../\")))",
" import sys, os",
" mypath = os.path.dirname(sys.argv[0])",
" sys.path.append(os.path.abspath(os.path.join(mypath, \"../../\")))",
... |
import gc
# TODO: path hackery.
if __name__ == "__main__":
import sys, os
mypath = os.path.dirname(sys.argv[0])
sys.path.append(os.path.abspath(os.path.join(mypath, "../../")))
from pyrtree.rtree import RTree
from pyrtree.tests.test_rtree import RectangleGen,TstO
import time
# TODO: make these command-li... | [
[
1,
0,
0.0192,
0.0192,
0,
0.66,
0,
92,
0,
1,
0,
0,
92,
0,
0
],
[
4,
0,
0.0865,
0.0769,
0,
0.66,
0.1,
0,
0,
0,
0,
0,
0,
0,
4
],
[
1,
1,
0.0769,
0.0192,
1,
0.81,
... | [
"import gc",
"if __name__ == \"__main__\":\n import sys, os\n mypath = os.path.dirname(sys.argv[0])\n sys.path.append(os.path.abspath(os.path.join(mypath, \"../../\")))",
" import sys, os",
" mypath = os.path.dirname(sys.argv[0])",
" sys.path.append(os.path.abspath(os.path.join(mypath, \".... |
#!/usr/bin/env python
# quick'n'dirty benchmark viewer.
import pylab as pl
import sys, csv
if (__name__ == "__main__"):
file_counts = len(sys.argv) - 1
def pos(row,col):
rr= (row * file_counts) + col
return rr + 1
for (column_number, filename) in enumerate(sys.argv[1:]):
... | [
[
1,
0,
0.122,
0.0244,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
1,
0,
0.1463,
0.0244,
0,
0.66,
0.5,
509,
0,
2,
0,
0,
509,
0,
0
],
[
4,
0,
0.6098,
0.8049,
0,
0.66... | [
"import pylab as pl",
"import sys, csv",
"if (__name__ == \"__main__\"):\n\n\n file_counts = len(sys.argv) - 1\n \n\n def pos(row,col):\n rr= (row * file_counts) + col",
" file_counts = len(sys.argv) - 1",
" def pos(row,col):\n rr= (row * file_counts) + col\n return rr + ... |
__all__ = ["rtree","rect"]
import rect
import rtree
Rect = rect.Rect
RTree = rtree.RTree
| [
[
14,
0,
0.25,
0.125,
0,
0.66,
0,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.5,
0.125,
0,
0.66,
0.25,
902,
0,
1,
0,
0,
902,
0,
0
],
[
1,
0,
0.625,
0.125,
0,
0.66,
0.... | [
"__all__ = [\"rtree\",\"rect\"]",
"import rect",
"import rtree",
"Rect = rect.Rect",
"RTree = rtree.RTree"
] |
## R-tree.
# see doc/ref/r-tree-clustering-split-algo.pdf
MAXCHILDREN=10
MAX_KMEANS=5
import math, random, sys
import time
import array
from rect import Rect, union_all, NullRect
class RTree(object):
def __init__(self):
self.count = 0
self.stats = {
"overflow_f" : 0,
"avg... | [
[
14,
0,
0.0096,
0.0024,
0,
0.66,
0,
70,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.012,
0.0024,
0,
0.66,
0.0769,
147,
1,
0,
0,
0,
0,
1,
0
],
[
1,
0,
0.0144,
0.0024,
0,
0.66... | [
"MAXCHILDREN=10",
"MAX_KMEANS=5",
"import math, random, sys",
"import time",
"import array",
"from rect import Rect, union_all, NullRect",
"class RTree(object):\n def __init__(self):\n self.count = 0\n self.stats = { \n \"overflow_f\" : 0,\n \"avg_overflow_t_f\" : ... |
#!/usr/bin/env python
import codecs
import re
import jinja2
import markdown
def process_slides():
with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:
md = codecs.open('slides.md', encoding='utf8').read()
md_slides = md.split('\n---\n')
print 'Compiled %s slides.' % len(m... | [
[
1,
0,
0.0526,
0.0175,
0,
0.66,
0,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.0702,
0.0175,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0877,
0.0175,
0,
... | [
"import codecs",
"import re",
"import jinja2",
"import markdown",
"def process_slides():\n with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:\n md = codecs.open('slides.md', encoding='utf8').read()\n md_slides = md.split('\\n---\\n')\n print('Compiled %s slides.' ... |
#!/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... |
"""
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... |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.