code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# 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) 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... |
# 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... |
#!/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 (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... |
__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.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: #... |
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 ... |
# 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.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... |
#!/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... |
# 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... |
# 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",
"... |
#!/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... |
__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.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... |
# 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>[\\+\\*])... |
#!/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... |
"""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 ... |
"""
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_... |
#! /usr/bin/env python
import sys, os
import tarfile, zipfile, gzip, bz2
from optparse import OptionParser
"""
Builds packaged releases of DebugKit so I don't have to do things manually.
Excludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.
"""
def main():
parser = OptionParser... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.125,
223,
0,
4,
0,
0,
223,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
0... | [
"import sys, os",
"import tarfile, zipfile, gzip, bz2",
"from optparse import OptionParser",
"\"\"\"\nBuilds packaged releases of DebugKit so I don't have to do things manually.\n\nExcludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.\n\"\"\"",
"def main():\n parser = O... |
#! /usr/bin/env python
import sys, os
import tarfile, zipfile, gzip, bz2
from optparse import OptionParser
"""
Builds packaged releases of DebugKit so I don't have to do things manually.
Excludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.
"""
def main():
parser = OptionParser... | [
[
1,
0,
0.0231,
0.0077,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
1,
0,
0.0308,
0.0077,
0,
0.66,
0.125,
223,
0,
4,
0,
0,
223,
0,
0
],
[
1,
0,
0.0385,
0.0077,
0,
0... | [
"import sys, os",
"import tarfile, zipfile, gzip, bz2",
"from optparse import OptionParser",
"\"\"\"\nBuilds packaged releases of DebugKit so I don't have to do things manually.\n\nExcludes itself (build.py), .gitignore, .DS_Store and the .git folder from the archives.\n\"\"\"",
"def main():\n parser = O... |
#!/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>[\\+\\*])... |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | [
[
1,
0,
0.3514,
0.0135,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3649,
0.0135,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.3784,
0.0135,
0,
... | [
"import os",
"import re",
"import tempfile",
"import shutil",
"ignore_pattern = re.compile('^(.svn|target|bin|classes)')",
"java_pattern = re.compile('^.*\\.java')",
"annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')",
"def process_dir(dir):\n files = os.listdir(dir)\n for... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
import sys
sys.path.append("c:\\projects\\sharpduino\\sharpduino\\bin\\debug")
import clr
clr.AddReference("Sharpduino")
# Import namespaces that we need
from Sharpduino import *
from Sharpduino.SerialProviders import *
from Sharpduino.Messages import *
from Sharpduino.Constants import *
ard = ArduinoUno("... | [
[
1,
0,
0.0312,
0.0312,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.0625,
0.0312,
0,
0.66,
0.0625,
243,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.0938,
0.0312,
0,
0.... | [
"import sys",
"sys.path.append(\"c:\\\\projects\\\\sharpduino\\\\sharpduino\\\\bin\\\\debug\")",
"import clr",
"clr.AddReference(\"Sharpduino\")",
"from Sharpduino import *",
"from Sharpduino.SerialProviders import *",
"from Sharpduino.Messages import *",
"from Sharpduino.Constants import *",
"ard =... |
#This is for
# Get the Suitable references
import sys
sys.path.append("c:\\projects\\sharpduino\\sharpduino\\bin\\debug")
import clr
clr.AddReference("Sharpduino")
# Import namespaces that we need
from Sharpduino import *
from Sharpduino.SerialProviders import *
from Sharpduino.Messages import *
from Sha... | [
[
1,
0,
0.1,
0.025,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.125,
0.025,
0,
0.66,
0.0526,
243,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.15,
0.025,
0,
0.66,
0... | [
"import sys",
"sys.path.append(\"c:\\\\projects\\\\sharpduino\\\\sharpduino\\\\bin\\\\debug\")",
"import clr",
"clr.AddReference(\"Sharpduino\")",
"from Sharpduino import *",
"from Sharpduino.SerialProviders import *",
"from Sharpduino.Messages import *",
"from Sharpduino.Constants import *",
"port ... |
import os
sources="""
aaac.cpp
aarj.cpp
aarq.cpp
AssociationRejection.cpp
Buffer.cpp
Cdimse.cpp
ClientConnection.cpp
CommandSets.cpp
DataDictionary.cpp
Decoder.cpp
Dumper.cpp
Encoder.cpp
Exceptions.cpp
File.cpp
FileMetaInformation.cpp
GroupLength.cpp
Ndimse.cpp
pdata.cpp
Presentat... | [
[
1,
0,
0.0222,
0.0222,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.3667,
0.6667,
0,
0.66,
0.1429,
648,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.7333,
0.0222,
0,
... | [
"import os",
"sources=\"\"\"\n\taaac.cpp\n\taarj.cpp\n\taarq.cpp\n\tAssociationRejection.cpp\n\tBuffer.cpp\n\tCdimse.cpp\n\tClientConnection.cpp",
"mylibs='/usr/local/lib_tm'",
"boost_libs=mylibs+ '/boost_1_31_0/bin/boost/libs'",
"cpppath=['..']",
"cpppath.append(mylibs + '/boost_1_31_0')",
"env = Envir... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import time
import sys
import yaml
import pprint
class YamlUrlData(object):
def getURLData(self, filename):
with open(filename, 'r') as f:
data = yaml.load(f)
return data
| [
[
1,
0,
0.125,
0.0625,
0,
0.66,
0,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.1875,
0.0625,
0,
0.66,
0.2,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.25,
0.0625,
0,
0.66,
... | [
"from __future__ import with_statement",
"import time",
"import sys",
"import yaml",
"import pprint",
"class YamlUrlData(object):\n def getURLData(self, filename):\n with open(filename, 'r') as f:\n data = yaml.load(f)\n return data",
" def getURLData(self, filename):\n ... |
from rdflib.Graph import ConjunctiveGraph
import uuid
class RdfDataExporter(object):
def __init__(self):
self.g = ConjunctiveGraph()
def export(self, mainSubject, params, tuples):
if params.has_key('subpredicate'):
databag = mainSubject+"/"+str(uuid.uuid4())
self.g.add((... | [
[
1,
0,
0.0286,
0.0286,
0,
0.66,
0,
964,
0,
1,
0,
0,
964,
0,
0
],
[
1,
0,
0.0571,
0.0286,
0,
0.66,
0.5,
9,
0,
1,
0,
0,
9,
0,
0
],
[
3,
0,
0.5429,
0.8857,
0,
0.66,
... | [
"from rdflib.Graph import ConjunctiveGraph",
"import uuid",
"class RdfDataExporter(object):\n def __init__(self):\n self.g = ConjunctiveGraph()\n\n def export(self, mainSubject, params, tuples):\n if params.has_key('subpredicate'):\n databag = mainSubject+\"/\"+str(uuid.uuid4())\n ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#http://blog.motane.lu/2009/07/07/downloading-a-pages-content-with-python-and-webkit/
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import signal
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import QWebPage
class WebkitDownloader(QWe... | [
[
1,
0,
0.1538,
0.0385,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.1923,
0.0385,
0,
0.66,
0.1429,
959,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.2308,
0.0385,
0,
0.... | [
"import sys",
"reload(sys)",
"sys.setdefaultencoding('utf-8')",
"import signal",
"from PyQt4.QtCore import *",
"from PyQt4.QtGui import *",
"from PyQt4.QtWebKit import QWebPage",
"class WebkitDownloader(QWebPage): \n def __init__(self, callback):\n self.app = QApplication(sys.argv)\n ... |
import urllib2
class Urllib2Downloader(object):
def __init__(self, callback):
self.callback = callback
def download(self, url):
response = urllib2.urlopen(url)
html = response.read()
self.callback(html)
| [
[
1,
0,
0.0833,
0.0833,
0,
0.66,
0,
345,
0,
1,
0,
0,
345,
0,
0
],
[
3,
0,
0.5417,
0.6667,
0,
0.66,
1,
152,
0,
2,
0,
0,
186,
0,
3
],
[
2,
1,
0.375,
0.1667,
1,
0.07,
... | [
"import urllib2",
"class Urllib2Downloader(object):\n def __init__(self, callback):\n self.callback = callback\n\n def download(self, url):\n response = urllib2.urlopen(url)\n html = response.read() \n self.callback(html)",
" def __init__(self, callback):\n self.c... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010, Mats Skillingstad <mats.gls@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... | [
[
1,
0,
0.0941,
0.005,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.099,
0.005,
0,
0.66,
0.0909,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.104,
0.005,
0,
0.66,... | [
"import os",
"import sys",
"from lxml import etree",
"from lxml import html",
"import yaml",
"from urldata import YamlUrlData",
"from dataexporter import RdfDataExporter",
"from dataformatter import DataFormatter",
"import itertools",
"class Parser():\n def extractSemantics(self, htm):\n ... |
#http://blog.tomeuvizoso.net/2009/01/embedding-mozilla.html
import hulahop
import os
hulahop.startup(os.path.expanduser('~/.hulahop_profile'))
from hulahop.webview import WebView
import xpcom
import gobject
from xpcom.components import interfaces
import gtk
class ProgressListener(gobject.GObject):
_com_interfaces_... | [
[
1,
0,
0.0444,
0.0222,
0,
0.66,
0,
817,
0,
1,
0,
0,
817,
0,
0
],
[
1,
0,
0.0667,
0.0222,
0,
0.66,
0.1111,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.0889,
0.0222,
0,
... | [
"import hulahop",
"import os",
"hulahop.startup(os.path.expanduser('~/.hulahop_profile'))",
"from hulahop.webview import WebView",
"import xpcom",
"import gobject",
"from xpcom.components import interfaces",
"import gtk",
"class ProgressListener(gobject.GObject):\n _com_interfaces_ = interfaces.n... |
# -*- coding: utf-8 -*-
import re
import calendar
import parsedatetime.parsedatetime as pdt
import parsedatetime.parsedatetime_consts as pdc
class DataFormatter(object):
data = {}
def date(self, value):
c = pdc.Constants()
p = pdt.Calendar(c)
return p.parse(value)
def timespan(s... | [
[
1,
0,
0.0488,
0.0244,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0732,
0.0244,
0,
0.66,
0.1,
917,
0,
1,
0,
0,
917,
0,
0
],
[
1,
0,
0.0976,
0.0244,
0,
0.6... | [
"import re",
"import calendar",
"import parsedatetime.parsedatetime as pdt",
"import parsedatetime.parsedatetime_consts as pdc",
"class DataFormatter(object):\n data = {}\n\n def date(self, value):\n c = pdc.Constants()\n p = pdt.Calendar(c)\n return p.parse(value)",
" data =... |
#Copyright (C) Qtcollege I.P. 2012-2013
{
'name': 'Qtcollege Module',
'version': '2.4.0.1',
'author': 'Qtcollege',
'email': 'mohammad@qtcollege.com',
'website': 'http://www.qtcollege.com/',
'description': '''
Party Module
This module will create the base functions of the Qtcolleg... | [
[
8,
0,
0.5357,
0.9643,
0,
0.66,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
] | [
"{\n 'name': 'Qtcollege Module',\n 'version': '2.4.0.1',\n 'author': 'Qtcollege',\n 'email': 'mohammad@qtcollege.com',\n 'website': 'http://www.qtcollege.com/',\n 'description': '''\n Party Module"
] |
# -*- coding: utf-8 -*-
##############################################################################
#
# Qt College: The Free Campus and Student Information System
# Copyright (C) 2012-2013 Qtcollege <admin@qtcollege.com>
#
# This program is free software: you can redistribute it and/or modify
# it under... | [
[
1,
0,
0.1273,
0.0061,
0,
0.66,
0,
728,
0,
3,
0,
0,
728,
0,
0
],
[
1,
0,
0.1333,
0.0061,
0,
0.66,
0.0667,
758,
0,
4,
0,
0,
758,
0,
0
],
[
1,
0,
0.1394,
0.0061,
0,
... | [
"from trytond.model import ModelView, ModelSQL, fields",
"from trytond.pyson import Eval, Bool, Not, Get",
"from trytond.transaction import Transaction",
"from trytond.pool import Pool",
"class Teacher(ModelSQL, ModelView):\n 'Teacher'\n _name = 'qtcollege.teacher'\n\n name = fields.Many2One('party... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Qt College: The Free Campus and Student Information System
# Copyright (C) 2012-2013 Qtcollege <admin@qtcollege.com>
#
# This program is free software: you can redistribute it and/or modify
# it under... | [
[
1,
0,
0.92,
0.04,
0,
0.66,
0,
637,
0,
1,
0,
0,
637,
0,
0
]
] | [
"from college import *"
] |
#!/usr/bin/python
import polib
import sys
po = polib.pofile(sys.argv[1])
poupdate = polib.pofile(sys.argv[2])
for origentry in po.fuzzy_entries():
for updateentry in poupdate.translated_entries():
if origentry.msgctxt is None and origentry.msgid == updateentry.msgid:
origentry.msgstr = update... | [
[
1,
0,
0.1034,
0.0345,
0,
0.66,
0,
905,
0,
1,
0,
0,
905,
0,
0
],
[
1,
0,
0.1379,
0.0345,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.2069,
0.0345,
0,
... | [
"import polib",
"import sys",
"po = polib.pofile(sys.argv[1])",
"poupdate = polib.pofile(sys.argv[2])",
"for origentry in po.fuzzy_entries():\n for updateentry in poupdate.translated_entries():\n if origentry.msgctxt is None and origentry.msgid == updateentry.msgid:\n origentry.msgstr =... |
#!/usr/bin/python
'''
Script to automatically merge pending translations from Pootle into po files.
It only accepts those, which are not translated or fuzzy.
'''
import polib
import sys
po = polib.pofile(sys.argv[1])
poupdate = polib.pofile(sys.argv[2])
for updateentry in poupdate:
msgid = updateentry.msgid.spl... | [
[
8,
0,
0.129,
0.1613,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2581,
0.0323,
0,
0.66,
0.1667,
905,
0,
1,
0,
0,
905,
0,
0
],
[
1,
0,
0.2903,
0.0323,
0,
0.66,... | [
"'''\nScript to automatically merge pending translations from Pootle into po files.\n\nIt only accepts those, which are not translated or fuzzy.\n'''",
"import polib",
"import sys",
"po = polib.pofile(sys.argv[1])",
"poupdate = polib.pofile(sys.argv[2])",
"for updateentry in poupdate:\n msgid = updatee... |
#!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# 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... | [
[
8,
0,
0.0807,
0.0045,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0897,
0.0045,
0,
0.66,
0.0455,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0987,
0.0045,
0,
0.66,... | [
"\"\"\"Build the ScriptCover Extension.\"\"\"",
"__author__ = 'ekamenskaya@google.com (Ekaterina Kamenskaya)'",
"import logging",
"import optparse",
"import os",
"import shutil",
"import subprocess",
"import urllib",
"import zipfile",
"CHECKOUT_CLOSURE_COMMAND = ('svn checkout http://closure-libra... |
#
# This file defines how to build PyMite using Scons (www.scons.org)
# Usage:
# scons tags
# scons docs
# scons PLATFORM=<platform>
#
import os, string
supported_platforms = Glob("src/platform/*")
allowed_platforms = [os.path.split(x)[1] for x in map(str, supported_platforms)]
vars = Variables()
# BUILD ... | [
[
1,
0,
0.1493,
0.0149,
0,
0.66,
0,
688,
0,
2,
0,
0,
688,
0,
0
],
[
14,
0,
0.194,
0.0149,
0,
0.66,
0.25,
922,
3,
1,
0,
0,
753,
10,
1
],
[
14,
0,
0.209,
0.0149,
0,
0... | [
"import os, string",
"supported_platforms = Glob(\"src/platform/*\")",
"allowed_platforms = [os.path.split(x)[1] for x in map(str, supported_platforms)]",
"vars = Variables()",
"if \"tags\" in COMMAND_LINE_TARGETS or \"TAGS\" in COMMAND_LINE_TARGETS:\n vmfiles = Glob(\"src/vm/*\")\n ctags = Command('t... |
import sys
Import("env", "vars")
SOURCES = Glob("*.c")
PMSTDLIB_SOURCES = ["../lib/list.py",
"../lib/dict.py",
"../lib/__bi.py",
"../lib/sys.py",
"../lib/string.py",]
if env["IPM"] == True:
PMSTDLIB_SOURCES.append("../lib/ipm.py")
... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.1538,
0.0385,
0,
0.66,
0.1111,
248,
3,
2,
0,
0,
0,
0,
1
],
[
14,
0,
0.2308,
0.0385,
0,
0... | [
"import sys",
"Import(\"env\", \"vars\")",
"SOURCES = Glob(\"*.c\")",
"PMSTDLIB_SOURCES = [\"../lib/list.py\",\n \"../lib/dict.py\",\n \"../lib/__bi.py\",\n \"../lib/sys.py\",\n \"../lib/string.py\",]",
"if env[\"IPM\"] == True:\n ... |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
2,
0,
0.6667,
0.5,
0,
0.66,
0,
102,
0,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.6667,
0.4333,
1,
0.1,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.9833,
0.0667,
0,
0.66,
1,
... | [
"def bar1():\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n\n /* If wrong number of args, raise TypeError */\n if (NATIVE_GET_NUM_ARGS() != 0)\n {\n PM_RAISE(retval, PM_RET_EX_TYPE);",
" \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n\n /* If wrong number of args, raise TypeError ... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.6897,
0.0345,
0,
0.66,
0,
475,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.7241,
0.0345,
0,
0.66,
0.1111,
756,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.7586,
0.0345,
0,
0... | [
"a = \"123\\x08456\"",
"b = 987",
"c = [a,b]",
"d = {a:b}",
"e = (c,d)",
"print(a)",
"print(b)",
"print(c)",
"print(d)",
"print(e)"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.5862,
0.0345,
0,
0.66,
0,
938,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.6207,
0.0345,
0,
0.66,
0.2,
0,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6897,
0.0345,
0,
0.66,
... | [
"d1 = {}",
"d1[1] = \"one\"",
"d2 = {}",
"d2[2] = \"two\"",
"import dict",
"rv = dict.update(d1, d2)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.7097,
0.0323,
0,
0.66,
0,
773,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.7742,
0.0323,
0,
0.66,
0.3333,
658,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.871,
0.0323,
0,
0.... | [
"n = 1",
"n0 = +n",
"n1 = ~n",
"n2 = -n"
] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.5806,
0.0323,
0,
0.66,
0,
745,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6129,
0.0323,
0,
0.66,
0.2,
448,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7419,
0.0323,
0,
0.66... | [
"s1 = \"test\"",
"s2 = s1[:]",
"t1 = (1,2,3)",
"t2 = t1[:]",
"l1 = [1,2,3]",
"l2 = l1[:]"
] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.8182,
0.0455,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
],
[
8,
0,
0.8636,
0.0455,
0,
0.66,
0.5,
535,
3,
2,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.0455,
0,
0.66,
1... | [
"x = 1.1",
"print(\"1.1 = \", x)",
"print(\"1.1 + 1.1 == \", x+x, \" Endian test passes.\")"
] |
# Anything that starts with a # is a comment!
# Use lots of comments in your code to explain what you're doing.
# Use the PIC-specific Python libraries
import t114 as pic
line_sensor_right = pic.digital_io(1, 8, True)
right_wheel_stopped = 938
print "Running..."
i = 0;
while i < 10:
i = i + 1
# Print ou... | [
[
1,
0,
0.3125,
0.0625,
0,
0.66,
0,
423,
0,
1,
0,
0,
423,
0,
0
],
[
14,
0,
0.4375,
0.0625,
0,
0.66,
0.2,
927,
3,
3,
0,
0,
928,
10,
1
],
[
14,
0,
0.5,
0.0625,
0,
0.6... | [
"import t114 as pic",
"line_sensor_right = pic.digital_io(1, 8, True)",
"right_wheel_stopped = 938",
"print(\"Running...\")",
"i = 0;",
"while i < 10:\n i = i + 1\n # Print out line following diags\n if line_sensor_right.get():\n pass",
" i = i + 1",
" if line_sensor_right.g... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.4615,
0.0256,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5128,
0.0256,
0,
0.66,
0.2,
97,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.6538,
0.1538,
0,
0.66,... | [
"import sys",
"sharedVar = 42",
"def f1():\n global sharedVar\n print(\"f1: sharedVar is \", sharedVar)\n while sharedVar == 42:\n pass\n print(\"f1: sharedVar is \", sharedVar)",
" print(\"f1: sharedVar is \", sharedVar)",
" while sharedVar == 42:\n pass",
" print(\"f1:... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.9474,
0.0526,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.0526,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"import sys",
"print(sys.heap())"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.9545,
0.0455,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(\"Expect AssertionError:\")"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.5312,
0.0312,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.5938,
0.0312,
0,
0.66,
0.125,
475,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.625,
0.0312,
0,
0.66... | [
"print(\"hex(42) == %x\" % 42)",
"a = 42",
"s = \"%x\" % a",
"print(s)",
"S = \"%X\" % a",
"print(S)",
"print(\"Expect TypeError\")",
"b = 3.14",
"p = \"%x\" % b"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.7826,
0.0435,
0,
0.66,
0,
430,
0,
1,
0,
0,
430,
0,
0
],
[
14,
0,
0.8696,
0.0435,
0,
0.66,
0.5,
810,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.913,
0.0435,
0,
0.66... | [
"import list",
"l=[]",
"rv = list.append(l, 42)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
2,
0,
0.8409,
0.0909,
0,
0.66,
0,
528,
0,
1,
1,
0,
0,
0,
0
],
[
13,
1,
0.8636,
0.0455,
1,
0.16,
0,
0,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.9545,
0.0455,
0,
0.66,
... | [
"def foo(n):\n return n * 1",
" return n * 1",
"print(\"Expecting a TypeError\")",
"foo(1, 2)"
] |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.3469,
0.0204,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
1,
0,
0.3878,
0.0204,
0,
0.66,
0.1429,
890,
0,
1,
0,
0,
890,
0,
0
],
[
14,
0,
0.551,
0.0204,
0,
0.... | [
"print(\"Exercising string.join()\")",
"import string",
"e1 = ()",
"e2 = []",
"t = (\"check\", \"this\", \"out\")",
"l = [\"check\", \"this\", \"out\"]",
"j = ('', '\\x00', '\\x04', '\\n', ' ', '!', '\\xff', \"foo\")",
"for c in j:\n je1 = string.join(e1, c)\n je2 = string.join(e2, c)\n asser... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.2088,
0.011,
0,
0.66,
0,
890,
0,
2,
0,
0,
890,
0,
0
]
] | [
"import string, sys"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.5,
0.0278,
0,
0.66,
0,
810,
5,
0,
0,
0,
0,
0,
1
],
[
14,
0,
0.5833,
0.0278,
0,
0.66,
0.6667,
810,
5,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.6111,
0.0278,
0,
0.66,... | [
"l = [x for x in range(5)]",
"l = [x*2 for x in range(5)]",
"print(\"[x*2 for x in range(5)] = \", l)",
"mat = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
1,
0,
0.8182,
0.0455,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.9091,
0.0455,
0,
0.66,
0.5,
553,
1,
0,
0,
0,
0,
3,
0
],
[
4,
0,
0.9773,
0.0909,
0,
0.66... | [
"import sys",
"s = \"test\"",
"if s[0] != 't':\n sys.exit(1)",
" sys.exit(1)"
] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [] | [] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
2,
0,
0.5385,
0.1282,
0,
0.66,
0,
475,
0,
2,
1,
0,
0,
0,
0
],
[
8,
1,
0.5385,
0.0769,
1,
0.42,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
13,
1,
0.5897,
0.0256,
1,
0.42,
... | [
"def a(a1, a2):\n \"\"\"\n Return the sum of a1 and a2.\n \"\"\"\n return a1 + a2",
" \"\"\"\n Return the sum of a1 and a2.\n \"\"\"",
" return a1 + a2",
"def b(b1, b2):\n \"\"\"\n Return the difference between b1 and b2.\n \"\"\"\n return b1 - b2",
" \"\"\"\n Retur... |
# This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.6061,
0.0303,
0,
0.66,
0,
355,
0,
0,
0,
0,
0,
6,
0
],
[
6,
0,
0.6818,
0.0606,
0,
0.66,
0.3333,
826,
2,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.7576,
0.0303,
0,
0.... | [
"d = {0:None, 1:\"one\", 2:\"two\"}",
"for i in d:\n assert i in d",
"k1,k2,k3 = d",
"s = sum(d)"
] |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
8,
0,
0.1961,
0.0294,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.5931,
0.7255,
0,
0.66,
0.2,
491,
0,
2,
0,
0,
0,
0,
0
],
[
2,
1,
0.4461,
0.3922,
1,
0.45,
... | [
"\"\"\"__NATIVE__\n#include <stdio.h>\n\"\"\"",
"class File():\n\n def __init__(self, fn):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmObj_t pfn;\n pPmObj_t pn;\n pPmObj_t pattrs;",
" def __init__(self, fn):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmOb... |
# This file is Copyright 2003 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [] | [] |
# This file is Copyright 2009 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | [
[
14,
0,
0.1939,
0.0102,
0,
0.66,
0,
492,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.2041,
0.0102,
0,
0.66,
0.0435,
25,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.2143,
0.0102,
0,
0.... | [
"callback_table = {}",
"HOOK_1S = 1002",
"HOOK_ADC = 1003",
"def doNothing(f):\n print(\"in doNothing\")\n return f",
" print(\"in doNothing\")",
" return f",
"def setHook(event):\n print(\"in setHook\")\n def _sh(f):\n print(\"in _sh\")\n callback_table[event] = f\n ... |
# Anything that starts with a # is a comment!
# Use lots of comments in your code to explain what you're doing.
# Use the PIC-specific Python libraries
import t108b as pic
###############################################################
# Set up line sensors, distance sensor, motors
#################################... | [
[
1,
0,
0.1562,
0.0312,
0,
0.66,
0,
781,
0,
1,
0,
0,
781,
0,
0
],
[
14,
0,
0.375,
0.0312,
0,
0.66,
0.1429,
927,
3,
3,
0,
0,
928,
10,
1
],
[
14,
0,
0.4062,
0.0312,
0,
... | [
"import t108b as pic",
"line_sensor_right = pic.digital_io(1, 8, True)",
"right_wheel_stopped = 938",
"def drive_forward():\n right_wheel.setCounts(right_wheel_forward)",
" right_wheel.setCounts(right_wheel_forward)",
"def stop_driving():\n right_wheel.setCounts(right_wheel_stopped)",
" ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.