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... | [
[
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... |
#!/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.0664,
0.0233,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0831,
0.0033,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0897,
0.0033,
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.2639,
0.0694,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3194,
0.0139,
0,
0.66,
0.1667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3611,
0.0139,
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 anyjson import simplejson",
"class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass",
" \"\"\"Base error for th... |
"""
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.0364,
0.0705,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.0841,
0.0205,
0,
0.66,
0.0455,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0977,
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\nmodification, are permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright ... |
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | [
[
8,
0,
0.0252,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0504,
0.0084,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
7,
0,
0.1134,
0.0672,
0,
0.66,... | [
"\"\"\"Drop-in replacement for collections.OrderedDict by Raymond Hettinger\n\nhttp://code.activestate.com/recipes/576693/\n\n\"\"\"",
"from UserDict import DictMixin",
"try:\n all\nexcept NameError:\n def all(seq):\n for elem in seq:\n if not elem:\n return False\n ... |
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | [
[
8,
0,
0.0195,
0.026,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.039,
0.013,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.0844,
0.0779,
0,
0.66,
... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"def _import_c_make_scanner():\n try:\n from simplejson._speedups import make_scanner\n return make_scanner\n except ImportError:\n return None",
" try:\n from simplejson._speedups import make_scanner\n return make_sc... |
import unittest
import doctest
class OptionalExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
run = unittest.TestSuite.run
run(self, result)
simplejson._toggle_speedups(False)
run(self, result)
simplejson._toggle_speedups(True)
... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0317,
0.0159,
0,
0.66,
0.1667,
614,
0,
1,
0,
0,
614,
0,
0
],
[
3,
0,
0.1429,
0.1429,
0,
0.... | [
"import unittest",
"import doctest",
"class OptionalExtensionTestSuite(unittest.TestSuite):\n def run(self, result):\n import simplejson\n run = unittest.TestSuite.run\n run(self, result)\n simplejson._toggle_speedups(False)\n run(self, result)\n simplejson._toggle_s... |
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | [
[
8,
0,
0.003,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.006,
0.002,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"from decimal import Decimal",
"def _import_speedups():\n try:\n from simplejson import _speedups\n return _speedups.encode_basestring_ascii, _speedups.make_encoder\n except ImportError:\n return None, None",
" try:\n ... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | [
[
8,
0,
0.1144,
0.2265,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2288,
0.0023,
0,
0.66,
0.0625,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2357,
0.0114,
0,
0.66... | [
"r\"\"\"JSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\n:mod:`simplejson` exposes an API familiar to users of the standard library\n:mod:`marshal` and :mod:`pickle` modules. It is the externally maintaine... |
# 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 flags.py's docstring for a usage manual.\n\"\"\"",
"__author__ = 'olexiy@google.com (Olexiy Oryeshko)'",
"class Error(Exception):\n \"\"\"Thrown If vali... |
#!/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... | [
[
14,
0,
0.1818,
0.0101,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.202,
0.0101,
0,
0.66,
0.0625,
273,
0,
1,
0,
0,
273,
0,
0
],
[
1,
0,
0.2121,
0.0101,
0,
0.... | [
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import httplib2",
"import inspect",
"import os",
"import pydoc",
"import re",
"from apiclient.discovery import build",
"from apiclient.anyjson import simplejson",
"from google.appengine.api import memcache",
"from google.appengine.ext 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.054,
0.0185,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0679,
0.0031,
0,
0.66,
0.0714,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0756,
0.0123,
0,
0.66,... | [
"\"\"\"Classes to encapsulate a single HTTP request.\n\nThe classes implement a command pattern, with every\nobject supporting an execute() method that does the\nactuall HTTP request.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"__all__ = [\n 'HttpRequest', 'RequestMockBuilder', 'HttpMoc... |
# 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.0487,
0.0118,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.059,
0.0029,
0,
0.66,
0.05,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0678,
0.0029,
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... |
#!/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.0664,
0.0233,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0831,
0.0033,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0897,
0.0033,
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.2639,
0.0694,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3194,
0.0139,
0,
0.66,
0.1667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3611,
0.0139,
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 anyjson import simplejson",
"class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass",
" \"\"\"Base error for th... |
"""
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.0364,
0.0705,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.0841,
0.0205,
0,
0.66,
0.0455,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0977,
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\nmodification, are permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright ... |
"""
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... |
"""
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.0163,
0.0313,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.034,
0.0014,
0,
0.66,
0.0357,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0354,
0.0014,
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... |
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | [
[
8,
0,
0.0252,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0504,
0.0084,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
7,
0,
0.1134,
0.0672,
0,
0.66,... | [
"\"\"\"Drop-in replacement for collections.OrderedDict by Raymond Hettinger\n\nhttp://code.activestate.com/recipes/576693/\n\n\"\"\"",
"from UserDict import DictMixin",
"try:\n all\nexcept NameError:\n def all(seq):\n for elem in seq:\n if not elem:\n return False\n ... |
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | [
[
8,
0,
0.0195,
0.026,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.039,
0.013,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.0844,
0.0779,
0,
0.66,
... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"def _import_c_make_scanner():\n try:\n from simplejson._speedups import make_scanner\n return make_scanner\n except ImportError:\n return None",
" try:\n from simplejson._speedups import make_scanner\n return make_sc... |
import unittest
import doctest
class OptionalExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
run = unittest.TestSuite.run
run(self, result)
simplejson._toggle_speedups(False)
run(self, result)
simplejson._toggle_speedups(True)
... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0317,
0.0159,
0,
0.66,
0.1667,
614,
0,
1,
0,
0,
614,
0,
0
],
[
3,
0,
0.1429,
0.1429,
0,
0.... | [
"import unittest",
"import doctest",
"class OptionalExtensionTestSuite(unittest.TestSuite):\n def run(self, result):\n import simplejson\n run = unittest.TestSuite.run\n run(self, result)\n simplejson._toggle_speedups(False)\n run(self, result)\n simplejson._toggle_s... |
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | [
[
8,
0,
0.003,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.006,
0.002,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"from decimal import Decimal",
"def _import_speedups():\n try:\n from simplejson import _speedups\n return _speedups.encode_basestring_ascii, _speedups.make_encoder\n except ImportError:\n return None, None",
" try:\n ... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | [
[
8,
0,
0.1144,
0.2265,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2288,
0.0023,
0,
0.66,
0.0625,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2357,
0.0114,
0,
0.66... | [
"r\"\"\"JSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\n:mod:`simplejson` exposes an API familiar to users of the standard library\n:mod:`marshal` and :mod:`pickle` modules. It is the externally maintaine... |
# 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/python2.4
# -*- coding: utf-8 -*-
#
# Copyright 2010 Google Inc. All Rights Reserved.
"""Simple command-line example for running against a
local server.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
# Enable this sample to be run from the top-level directory
import os
import sys
sys.path.inse... | [
[
8,
0,
0.2027,
0.1081,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2973,
0.027,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3784,
0.027,
0,
0.66,
... | [
"\"\"\"Simple command-line example for running against a\n local server.\n\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import os",
"import sys",
"sys.path.insert(0, os.getcwd())",
"from apiclient.discovery import build",
"import httplib2",
"import pickle",
"import pprint",
"... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# 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 ... | [
[
8,
0,
0.4432,
0.0909,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.5227,
0.0227,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.5682,
0.0227,
0,
0.66,
... | [
"\"\"\"Simple command-line example for Custom Search.\n\nCommand-line application that does a search.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import pprint",
"from apiclient.discovery import build",
"def main():\n # Build a service object for interacting with the API. Visit\n # t... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright 2010 Google Inc. All Rights Reserved.
"""Simple command-line example for Buzz.
Command-line application that retrieves the users
latest content and then adds a new entry.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
from apiclient.discovery impor... | [
[
8,
0,
0.186,
0.1163,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2791,
0.0233,
0,
0.66,
0.1429,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3256,
0.0233,
0,
0.66,
... | [
"\"\"\"Simple command-line example for Buzz.\n\nCommand-line application that retrieves the users\nlatest content and then adds a new entry.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"from apiclient.discovery import build_from_document",
"import httplib2",
"import os",
"import pprin... |
#!/usr/bin/env python
#
# 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 ... | [
[
8,
0,
0.3208,
0.0189,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3585,
0.0189,
0,
0.66,
0.1667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4151,
0.0189,
0,
0.66,... | [
"\"\"\"Setup script for the Google TaskQueue API command-line tool.\"\"\"",
"__version__ = '1.0.2'",
"import sys",
"try:\n from setuptools import setup\n print('Loaded setuptools')\nexcept ImportError:\n from distutils.core import setup\n print('Loaded distutils.core')",
" from setuptools imp... |
#!/usr/bin/env python
#
# 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 ... | [
[
8,
0,
0.12,
0.0067,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.14,
0.0067,
0,
0.66,
0.0909,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1667,
0.0067,
0,
0.66,
... | [
"\"\"\"Commands to interact with the Task object of the TaskQueue API.\"\"\"",
"__version__ = '0.0.1'",
"from gtaskqueue.taskqueue_cmd_base import GoogleTaskCommand",
"from google.apputils import app",
"from google.apputils import appcommands",
"import gflags as flags",
"FLAGS = flags.FLAGS",
"class G... |
#!/usr/bin/env python
#
# 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 ... | [
[
8,
0,
0.3396,
0.0189,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3774,
0.0189,
0,
0.66,
0.0833,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.434,
0.0189,
0,
0.66,
... | [
"\"\"\"Command line tool for interacting with Google TaskQueue API.\"\"\"",
"__version__ = '0.0.1'",
"import logging",
"from gtaskqueue import task_cmds",
"from gtaskqueue import taskqueue_cmds",
"from google.apputils import appcommands",
"import gflags as flags",
"LOG_LEVELS = [logging.DEBUG,\n ... |
#!/usr/bin/env python
#
# 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 ... | [
[
8,
0,
0.3036,
0.0179,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3571,
0.0179,
0,
0.66,
0.1429,
162,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4286,
0.0179,
0,
0.66,... | [
"\"\"\"Commands to interact with the TaskQueue object of the TaskQueue API.\"\"\"",
"__version__ = '0.0.1'",
"from gtaskqueue.taskqueue_cmd_base import GoogleTaskQueueCommand",
"from google.apputils import appcommands",
"import gflags as flags",
"FLAGS = flags.FLAGS",
"class GetTaskQueueCommand(GoogleTa... |
#!/usr/bin/env python
#
# 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 writing, softwa... | [
[
8,
0,
0.1535,
0.0526,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2105,
0.0088,
0,
0.66,
0.0909,
326,
0,
1,
0,
0,
326,
0,
0
],
[
1,
0,
0.2193,
0.0088,
0,
0.66... | [
"\"\"\"Tool to get an Access Token to access an auth protected Appengine end point.\n\nThis tool talks to the appengine end point, and gets an Access Token that is\nstored in a file. This token can be used by a tool to do authorized access to\nan appengine end point.\n\"\"\"",
"from google.apputils import app",
... |
#!/usr/bin/env python
#
# 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 ... | [
[
8,
0,
0.3148,
0.0185,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3889,
0.0185,
0,
0.66,
0.1111,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4074,
0.0185,
0,
0.66... | [
"\"\"\"Log settings for taskqueue_puller module.\"\"\"",
"import logging",
"import logging.config",
"from google.apputils import app",
"import gflags as flags",
"FLAGS = flags.FLAGS",
"flags.DEFINE_string(\n 'log_output_file',\n '/tmp/taskqueue-puller.log',\n 'Logfile name for taskq... |
# 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.1977,
0.0581,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2326,
0.0116,
0,
0.66,
0.1,
439,
0,
1,
0,
0,
439,
0,
0
],
[
14,
0,
0.2558,
0.0116,
0,
0.66,
... | [
"\"\"\"Setup script for Google API Python client.\n\nAlso installs included versions of third party libraries, if those libraries\nare not already installed.\n\"\"\"",
"import setup_utils",
"has_setuptools = False",
"try:\n from setuptools import setup\n has_setuptools = True\nexcept ImportError:\n from di... |
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | [
[
8,
0,
0.0252,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0504,
0.0084,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
7,
0,
0.1134,
0.0672,
0,
0.66,... | [
"\"\"\"Drop-in replacement for collections.OrderedDict by Raymond Hettinger\n\nhttp://code.activestate.com/recipes/576693/\n\n\"\"\"",
"from UserDict import DictMixin",
"try:\n all\nexcept NameError:\n def all(seq):\n for elem in seq:\n if not elem:\n return False\n ... |
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | [
[
8,
0,
0.0195,
0.026,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.039,
0.013,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.0844,
0.0779,
0,
0.66,
... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"def _import_c_make_scanner():\n try:\n from simplejson._speedups import make_scanner\n return make_scanner\n except ImportError:\n return None",
" try:\n from simplejson._speedups import make_scanner\n return make_sc... |
import unittest
import doctest
class OptionalExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
run = unittest.TestSuite.run
run(self, result)
simplejson._toggle_speedups(False)
run(self, result)
simplejson._toggle_speedups(True)
... | [
[
1,
0,
0.0159,
0.0159,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0317,
0.0159,
0,
0.66,
0.1667,
614,
0,
1,
0,
0,
614,
0,
0
],
[
3,
0,
0.1429,
0.1429,
0,
0.... | [
"import unittest",
"import doctest",
"class OptionalExtensionTestSuite(unittest.TestSuite):\n def run(self, result):\n import simplejson\n run = unittest.TestSuite.run\n run(self, result)\n simplejson._toggle_speedups(False)\n run(self, result)\n simplejson._toggle_s... |
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _im... | [
[
8,
0,
0.003,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.006,
0.002,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"from decimal import Decimal",
"def _import_speedups():\n try:\n from simplejson import _speedups\n return _speedups.encode_basestring_ascii, _speedups.make_encoder\n except ImportError:\n return None, None",
" try:\n ... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | [
[
8,
0,
0.1144,
0.2265,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2288,
0.0023,
0,
0.66,
0.0625,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2357,
0.0114,
0,
0.66... | [
"r\"\"\"JSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\n:mod:`simplejson` exposes an API familiar to users of the standard library\n:mod:`marshal` and :mod:`pickle` modules. It is the externally maintaine... |
#!/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... | [
[
14,
0,
0.2073,
0.0122,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2317,
0.0122,
0,
0.66,
0.25,
78,
0,
1,
0,
0,
78,
0,
0
],
[
1,
0,
0.2439,
0.0122,
0,
0.66,... | [
"__author__ = 'ade@google.com (Ade Oshineye)'",
"import apiclient.discovery",
"import httplib2",
"import logging",
"class SimpleWrapper(object):\n \"Simple client that exposes the bare minimum set of common Buzz operations\"\n\n def __init__(self, api_key=None, credentials=None):\n self.http = httplib2... |
# 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.0867,
0.0058,
0,
0.66,
0,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.0925,
0.0058,
0,
0.66,
0.125,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.104,
0.0058,
0,
0.... | [
"from google.appengine.api import users",
"from google.appengine.ext import db",
"import apiclient.ext.appengine",
"import logging",
"import simple_wrapper",
"class Flow(db.Model):\n flow = apiclient.ext.appengine.FlowThreeLeggedProperty()",
" flow = apiclient.ext.appengine.FlowThreeLeggedProperty()",... |
# 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/python2.4
# -*- coding: utf-8 -*-
#
# 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 ... | [
[
8,
0,
0.3651,
0.1746,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4762,
0.0159,
0,
0.66,
0.0833,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.5079,
0.0159,
0,
0.66,... | [
"\"\"\"Generate command-line samples from stubs.\n\nGenerates a command-line client sample application from a set of files\nthat contain only the relevant portions that change between each API.\nThis allows all the common code to go into a template.\n\nUsage:\n python sample_generator.py",
"__author__ = 'jcgrego... |
#!/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... | [
[
14,
0,
0.2698,
0.0159,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3016,
0.0159,
0,
0.66,
0.0909,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3175,
0.0159,
0,
0... | [
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import os",
"import pydoc",
"import re",
"import sys",
"import httplib2",
"from apiclient.anyjson import simplejson",
"from apiclient.discovery import build",
"BASE = 'docs/dyn'",
"def document(resource, path):\n print(path)\n collections =... |
# 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.3365,
0.1154,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4231,
0.0192,
0,
0.66,
0.1429,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4615,
0.0192,
0,
0.66,... | [
"\"\"\"Generate a skeleton discovery extras document.\n\nFor the given API, retrieve the discovery document,\nstrip out the guts of each method description\nand put :\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import os",
"import os.path",
"import sys",
"from anyjson import simplejs... |
# 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.2885,
0.0192,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3462,
0.0192,
0,
0.66,
0.3333,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3846,
0.0192,
0,
0.66,... | [
"\"\"\"Utility functions for setup.py file(s).\"\"\"",
"__author__ = 'tom.h.miller@gmail.com (Tom Miller)'",
"import sys",
"def is_missing(packages):\n \"\"\"Return True if a package can't be imported.\"\"\"\n\n retval = True\n sys_path_original = sys.path[:]\n # Remove the current directory from the list... |
#!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | [
[
8,
0,
0.2076,
0.0089,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2188,
0.0045,
0,
0.66,
0.0833,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2277,
0.0045,
0,
0.66,... | [
"\"\"\"Google Code file uploader script.\n\"\"\"",
"__author__ = 'danderson@google.com (David Anderson)'",
"import httplib",
"import os.path",
"import optparse",
"import getpass",
"import base64",
"import sys",
"def upload(file, project_name, user_name, password, summary, labels=None):\n \"\"\"Uplo... |
import cgi
import datetime
import urllib
import wsgiref.handlers
import random
import datetime
from django.utils import simplejson
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class Score(db.Model):
name=db.StringProperty()
... | [
[
1,
0,
0.0072,
0.0072,
0,
0.66,
0,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0144,
0.0072,
0,
0.66,
0.0556,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0216,
0.0072,
0,
... | [
"import cgi",
"import datetime",
"import urllib",
"import wsgiref.handlers",
"import random",
"import datetime",
"from django.utils import simplejson",
"from google.appengine.ext import db",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"... |
print 'Content-Type: text/plain'
print ''
print 'You probably want /tetris ...'
| [
[
8,
0,
0.3333,
0.3333,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,... | [
"print('Content-Type: text/plain')",
"print('')",
"print('You probably want /tetris ...')"
] |
"""
def main():
window = MyDotWindow()
window.set_dotcode(dotcode)
window.connect('destroy', gtk.main_quit)
gtk.main()
if __name__ == '__main__':
main()
| [
[
2,
0,
0.4,
0.5,
0,
0.66,
0,
624,
0,
0,
0,
0,
0,
0,
4
],
[
14,
1,
0.3,
0.1,
1,
0.53,
0,
114,
3,
0,
0,
0,
345,
10,
1
],
[
8,
1,
0.4,
0.1,
1,
0.53,
0.3333,
4... | [
"def main():\n window = MyDotWindow()\n window.set_dotcode(dotcode)\n window.connect('destroy', gtk.main_quit)\n gtk.main()",
" window = MyDotWindow()",
" window.set_dotcode(dotcode)",
" window.connect('destroy', gtk.main_quit)",
" gtk.main()",
"if __name__ == '__main__':\n main... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gtk
import gtk.gdk
import xdot2
class MyDotWindow(xdot2.DotWindow):
def __init__(self):
xdot2.DotWindow.__init__(self)
self.widget.connect('clicked', self.on_url_clicked)
def on_url_clicked(self, widget, url, event):
dialog = gtk.... | [
[
1,
0,
0.058,
0.0145,
0,
0.66,
0,
166,
0,
1,
0,
0,
166,
0,
0
],
[
1,
0,
0.0725,
0.0145,
0,
0.66,
0.1667,
589,
0,
1,
0,
0,
589,
0,
0
],
[
1,
0,
0.1014,
0.0145,
0,
0... | [
"import gtk",
"import gtk.gdk",
"import xdot2",
"class MyDotWindow(xdot2.DotWindow):\n\n def __init__(self):\n xdot2.DotWindow.__init__(self)\n self.widget.connect('clicked', self.on_url_clicked)\n\n def on_url_clicked(self, widget, url, event):\n dialog = gtk.MessageDialog(",
" ... |
#!/usr/bin/env python
import gtk
import gtk.gdk
import xdot
class MyDotWindow(xdot.DotWindow):
def __init__(self):
xdot.DotWindow.__init__(self)
self.widget.connect('clicked', self.on_url_clicked)
def on_url_clicked(self, widget, url, event):
dialog = gtk.MessageDialog(
... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
166,
0,
1,
0,
0,
166,
0,
0
],
[
1,
0,
0.0769,
0.0385,
0,
0.66,
0.25,
589,
0,
1,
0,
0,
589,
0,
0
],
[
1,
0,
0.1538,
0.0385,
0,
0.... | [
"import gtk",
"import gtk.gdk",
"import xdot",
"class MyDotWindow(xdot.DotWindow):\n\n def __init__(self):\n xdot.DotWindow.__init__(self)\n self.widget.connect('clicked', self.on_url_clicked)\n\n def on_url_clicked(self, widget, url, event):\n dialog = gtk.MessageDialog(",
" d... |
#!/usr/bin/env python
import os
import gtk
import gtk.gdk
import xdot
class MyDotWindow(xdot.DotWindow):
def __init__(self):
xdot.DotWindow.__init__(self)
self.widget.connect('clicked', self.on_url_clicked)
def on_url_clicked(self, widget, url, event):
# dialog = gtk.MessageDialog(
... | [
[
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.25,
166,
0,
1,
0,
0,
166,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.66,... | [
"import os",
"import gtk",
"import gtk.gdk",
"import xdot",
"class MyDotWindow(xdot.DotWindow):\n\n def __init__(self):\n xdot.DotWindow.__init__(self)\n self.widget.connect('clicked', self.on_url_clicked)\n\n def on_url_clicked(self, widget, url, event):\n# dialog = gtk.MessageDi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# example of xdot with multiline support
# author: F. Manuel Hevia (fructu@gmail.com)
# part of abidos_cpp https://github.com/fructu/abidos_cpp
#
# original code_
# http://code.google.com/p/jrfonseca/wiki/XDot
# Copyright 2008 Jose Fonseca
#
import os
import sys
import... | [
[
1,
0,
0.2031,
0.0156,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2188,
0.0156,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2344,
0.0156,
0,
... | [
"import os",
"import sys",
"import gtk",
"import gtk.gdk",
"import xdot",
"class MyDotWindow(xdot.DotWindow):\n\n def __init__(self):\n #activate/desactivate the feature here:\n self.multi_line = 1\n xdot.DotWindow.__init__(self, self.multi_line)\n self.widget.connect('click... |
'''
Created on July 1, 2011
@author: ppa
'''
from setuptools import setup
from setupCommand import TestCommand, CleanCommand
version = '1.0.1'
setup(name='ultrafinance',
version=version,
description="python project for finance: realtime data collection, analyze, algorithmic trading",
l... | [
[
8,
0,
0.0714,
0.119,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1429,
0.0238,
0,
0.66,
0.25,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.1667,
0.0238,
0,
0.66,
... | [
"'''\nCreated on July 1, 2011\n\n@author: ppa\n'''",
"from setuptools import setup",
"from setupCommand import TestCommand, CleanCommand",
"version = '1.0.1'",
"setup(name='ultrafinance',\n version=version,\n description=\"python project for finance: realtime data collection, analyze, algorithmic ... |
'''
Created on Dec 18, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
from matplotlib import pyplot
from datetime import datetime
import pylab
import logging
LOG = logging.getLogger(__name__)
class PlotStockOutputer(BaseModule):
''' Default feeder '''
def __i... | [
[
8,
0,
0.0938,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1875,
0.0312,
0,
0.66,
0.1429,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.2188,
0.0312,
0,
0.66,
... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"from matplotlib import pyplot",
"from datetime import datetime",
"import pylab",
"import logging",
"LOG = logging.getLogger(__name__)",
"class PlotStockOutputer(BaseModule):\n ''' De... |
'''
Created on Dec 18, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
import logging
LOG = logging.getLogger(__name__)
class DefaultOutputer(BaseModule):
''' Default feeder '''
def __init__(self):
''' constructor '''
super(DefaultOutputer, self... | [
[
8,
0,
0.15,
0.25,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3,
0.05,
0,
0.66,
0.25,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.4,
0.05,
0,
0.66,
0.5,
715... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"import logging",
"LOG = logging.getLogger(__name__)",
"class DefaultOutputer(BaseModule):\n ''' Default feeder '''\n def __init__(self):\n ''' constructor '''\n super(Defa... |
'''
Created on Dec 19, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
import json, smtplib
import logging
LOG = logging.getLogger(__name__)
gmail_user = "your@gmail.com"
gmail_pwd = "y... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.1,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.1778,
0.0222,
0,
0.66,
... | [
"'''\nCreated on Dec 19, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"from email.MIMEMultipart import MIMEMultipart",
"from email.MIMEText import MIMEText",
"import json, smtplib",
"import logging",
"LOG = logging.getLogger(__name__)",
"gmail_user = \"you... |
'''
Created on Dec 18, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
from ultrafinance.lib.plotDateValueDict import PlotDateValueDict
import logging
LOG = logging.getLogger(__name__)
class PlotYearlyOutputer(BaseModule):
''' Default feeder '''
def __init__(sel... | [
[
8,
0,
0.1364,
0.2273,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2727,
0.0455,
0,
0.66,
0.2,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.3182,
0.0455,
0,
0.66,
... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"from ultrafinance.lib.plotDateValueDict import PlotDateValueDict",
"import logging",
"LOG = logging.getLogger(__name__)",
"class PlotYearlyOutputer(BaseModule):\n ''' Default feeder '''\... |
""" outputer package """ | [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"\"\"\" outputer package \"\"\""
] |
'''
Created on Dec 18, 2010
@author: ppa
'''
import abc
from threading import Thread
from pydispatch.dispatcher import send
from ultrafinance.lib.util import deCapitalize
import logging
LOG = logging.getLogger(__name__)
class BaseModule(object):
'''
Base class for a feeder, processor and outpu... | [
[
8,
0,
0.0545,
0.0909,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1091,
0.0182,
0,
0.66,
0.1429,
38,
0,
1,
0,
0,
38,
0,
0
],
[
1,
0,
0.1273,
0.0182,
0,
0.66,
... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"import abc",
"from threading import Thread",
"from pydispatch.dispatcher import send",
"from ultrafinance.lib.util import deCapitalize",
"import logging",
"LOG = logging.getLogger(__name__)",
"class BaseModule(object):\n '''\n Base class for ... |
'''
Created on Jan 30, 2011
@author: ppa
'''
from ultrafinance.lib.excelLib import ExcelLib
from ultrafinance.processChain.baseModule import BaseModule
from ultrafinance.lib.dataType import DateValueType
from os.path import join
import logging
LOG = logging.getLogger(__name__)
class IndexDataFeeder(Base... | [
[
8,
0,
0.0811,
0.1351,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1622,
0.027,
0,
0.66,
0.125,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.1892,
0.027,
0,
0.66,
... | [
"'''\nCreated on Jan 30, 2011\n\n@author: ppa\n'''",
"from ultrafinance.lib.excelLib import ExcelLib",
"from ultrafinance.processChain.baseModule import BaseModule",
"from ultrafinance.lib.dataType import DateValueType",
"from os.path import join",
"import logging",
"LOG = logging.getLogger(__name__)",
... |
'''
Created on Dec 18, 2010
@author: ppa
'''
from datetime import date
from ultrafinance.lib.yahooFinance import YahooFinance
from ultrafinance.processChain.baseModule import BaseModule
import logging
LOG = logging.getLogger(__name__)
class HistoricalDataFeeder(BaseModule):
'''
feeder that ge... | [
[
8,
0,
0.1154,
0.1923,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2308,
0.0385,
0,
0.66,
0.1667,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.3077,
0.0385,
0,
0.66... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from datetime import date",
"from ultrafinance.lib.yahooFinance import YahooFinance",
"from ultrafinance.processChain.baseModule import BaseModule",
"import logging",
"LOG = logging.getLogger(__name__)",
"class HistoricalDataFeeder(BaseModule):\n ... |
'''
Created on Jan 30, 2010
@author: ppa
'''
from ultrafinance.lib.excelLib import ExcelLib
from ultrafinance.processChain.baseModule import BaseModule
from ultrafinance.lib.dataType import DateValueType
from os.path import join
import logging
LOG = logging.getLogger(__name__)
class ExcelDataFeeder(Base... | [
[
8,
0,
0.0612,
0.102,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1224,
0.0204,
0,
0.66,
0.125,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.1429,
0.0204,
0,
0.66,
... | [
"'''\nCreated on Jan 30, 2010\n\n@author: ppa\n'''",
"from ultrafinance.lib.excelLib import ExcelLib",
"from ultrafinance.processChain.baseModule import BaseModule",
"from ultrafinance.lib.dataType import DateValueType",
"from os.path import join",
"import logging",
"LOG = logging.getLogger(__name__)",
... |
'''
Created on Dec 18, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
import logging
LOG = logging.getLogger(__name__)
class DefaultFeeder(BaseModule):
''' Default feeder '''
def __init__(self):
''' Constructor '''
super(DefaultFeeder, self).__... | [
[
8,
0,
0.1429,
0.2381,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2857,
0.0476,
0,
0.66,
0.25,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.381,
0.0476,
0,
0.66,
... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"import logging",
"LOG = logging.getLogger(__name__)",
"class DefaultFeeder(BaseModule):\n ''' Default feeder '''\n def __init__(self):\n ''' Constructor '''\n super(Defaul... |
""" feeder package """ | [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"\"\"\" feeder package \"\"\""
] |
'''
Created on Dec 18, 2010
@author: ppa
'''
from ultrafinance.processChain.pluginManager import PluginManager
from ultrafinance.processChain.configuration import Configuration
import threading
import time
import logging
LOG = logging.getLogger(__name__)
#TODO: use singleton pattern
class ProcessChain(... | [
[
8,
0,
0.0882,
0.1471,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1765,
0.0294,
0,
0.66,
0.125,
478,
0,
1,
0,
0,
478,
0,
0
],
[
1,
0,
0.2059,
0.0294,
0,
0.66,... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.pluginManager import PluginManager",
"from ultrafinance.processChain.configuration import Configuration",
"import threading",
"import time",
"import logging",
"LOG = logging.getLogger(__name__)",
"class ProcessChain(t... |
'''
Created on Dec 18, 2010
@author: ppa
'''
import ConfigParser
from os import path
import logging
LOG = logging.getLogger(__name__)
class Configuration(object):
''' class that handles configuration '''
def __init__(self, configFileName=None):
''' Constructor '''
if configFile... | [
[
8,
0,
0.06,
0.1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.12,
0.02,
0,
0.66,
0.1667,
272,
0,
1,
0,
0,
272,
0,
0
],
[
1,
0,
0.14,
0.02,
0,
0.66,
0.3333,... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"import ConfigParser",
"from os import path",
"import logging",
"LOG = logging.getLogger(__name__)",
"class Configuration(object):\n ''' class that handles configuration '''\n def __init__(self, configFileName=None):\n ''' Constructor '''\n... |
'''
Created on Dec 18, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
import logging
LOG = logging.getLogger(__name__)
class DefaultProcessor(BaseModule):
def __init__(self):
''' constructor '''
super(DefaultProcessor, self).__init__()
def ex... | [
[
8,
0,
0.1579,
0.2632,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3158,
0.0526,
0,
0.66,
0.25,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.4211,
0.0526,
0,
0.66,
... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"import logging",
"LOG = logging.getLogger(__name__)",
"class DefaultProcessor(BaseModule):\n def __init__(self):\n ''' constructor '''\n super(DefaultProcessor, self).__init_... |
'''
Created on Feb 26, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
from ultrafinance.lib.tradingStrategyFactory import TradingStrategyFactory
from ultrafinance.lib.tradingStrategy.automaticInvestmentPlan import adjustFixAmountPerPeriod
from ultrafinance.lib.tradingStrategy... | [
[
8,
0,
0.0938,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1875,
0.0312,
0,
0.66,
0.125,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.2188,
0.0312,
0,
0.66,
... | [
"'''\nCreated on Feb 26, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"from ultrafinance.lib.tradingStrategyFactory import TradingStrategyFactory",
"from ultrafinance.lib.tradingStrategy.automaticInvestmentPlan import adjustFixAmountPerPeriod",
"from ultrafinanc... |
""" processor package """ | [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"\"\"\" processor package \"\"\""
] |
'''
Created on Dec 18, 2010
@author: ppa
'''
from ultrafinance.processChain.baseModule import BaseModule
from ultrafinance.lib.stockMeasurement import StockMeasurement
import logging
LOG = logging.getLogger(__name__)
class AvgDivProcessor(BaseModule):
''' Calculate average and standard deviation '''
... | [
[
8,
0,
0.12,
0.2,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.24,
0.04,
0,
0.66,
0.2,
77,
0,
1,
0,
0,
77,
0,
0
],
[
1,
0,
0.28,
0.04,
0,
0.66,
0.4,
962... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"from ultrafinance.processChain.baseModule import BaseModule",
"from ultrafinance.lib.stockMeasurement import StockMeasurement",
"import logging",
"LOG = logging.getLogger(__name__)",
"class AvgDivProcessor(BaseModule):\n ''' Calculate average and st... |
'''
Created on Dec 25, 2010
@author: ppa
'''
import os
import fnmatch
from pydispatch.dispatcher import connect, send
from ultrafinance.lib.util import import_class, splitByComma
import logging
LOG = logging.getLogger(__name__)
class PluginManager(object):
''' plugin manager that init and run all... | [
[
8,
0,
0.0323,
0.0538,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0753,
0.0108,
0,
0.66,
0.1429,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.086,
0.0108,
0,
0.66,... | [
"'''\nCreated on Dec 25, 2010\n\n@author: ppa\n'''",
"import os",
"import fnmatch",
"from pydispatch.dispatcher import connect, send",
"from ultrafinance.lib.util import import_class, splitByComma",
"import logging",
"LOG = logging.getLogger(__name__)",
"class PluginManager(object):\n ''' plugin ma... |
''' processChain ''' | [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"''' processChain '''"
] |
'''
Created on Jan 3, 2011
@author: ppa
'''
import copy
import numpy
from ultrafinance.lib.yahooFinance import YahooFinance
from ultrafinance.lib.errors import UfException, Errors
import logging
LOG = logging.getLogger(__name__)
class StockMeasurement():
''' measurement of a single stock/index ''... | [
[
8,
0,
0.0333,
0.0556,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0667,
0.0111,
0,
0.66,
0.1429,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.0778,
0.0111,
0,
0.66... | [
"'''\nCreated on Jan 3, 2011\n\n@author: ppa\n'''",
"import copy",
"import numpy",
"from ultrafinance.lib.yahooFinance import YahooFinance",
"from ultrafinance.lib.errors import UfException, Errors",
"import logging",
"LOG = logging.getLogger(__name__)",
"class StockMeasurement():\n ''' measurement... |
'''
Created on Feb 20, 2011
@author: ppa
'''
from matplotlib import pyplot
import math
from ultrafinance.lib.errors import UfException, Errors
import logging
LOG = logging.getLogger(__name__)
class PlotPortfolio(object):
''' plot portfolio curve. only two are supported '''
def __init__(self, la... | [
[
8,
0,
0.0577,
0.0962,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1154,
0.0192,
0,
0.66,
0.1667,
75,
0,
1,
0,
0,
75,
0,
0
],
[
1,
0,
0.1346,
0.0192,
0,
0.66,
... | [
"'''\nCreated on Feb 20, 2011\n\n@author: ppa\n'''",
"from matplotlib import pyplot",
"import math",
"from ultrafinance.lib.errors import UfException, Errors",
"import logging",
"LOG = logging.getLogger(__name__)",
"class PlotPortfolio(object):\n ''' plot portfolio curve. only two are supported '''\n... |
'''
Created on Jan 30, 2011
@author: ppa
'''
from xlrd import open_workbook
from ultrafinance.lib.errors import UfException, Errors
import logging
LOG = logging.getLogger(__name__)
class ExcelLib():
''' lib for aceesing excel '''
def __init__(self, fileName=None, sheetNumber=0, sheetName=None):
... | [
[
8,
0,
0.037,
0.0617,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0741,
0.0123,
0,
0.66,
0.2,
785,
0,
1,
0,
0,
785,
0,
0
],
[
1,
0,
0.0864,
0.0123,
0,
0.66,
... | [
"'''\nCreated on Jan 30, 2011\n\n@author: ppa\n'''",
"from xlrd import open_workbook",
"from ultrafinance.lib.errors import UfException, Errors",
"import logging",
"LOG = logging.getLogger(__name__)",
"class ExcelLib():\n ''' lib for aceesing excel '''\n def __init__(self, fileName=None, sheetNumber... |
'''
Created on Feb 5, 2011
@author: ppa
'''
from collections import namedtuple
DateValueType = namedtuple('DateValue', 'date, value')
StockDailyType = namedtuple('StockDailyType', 'date, open, high, low, close, volume, adjClose')
| [
[
8,
0,
0.3,
0.5,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6,
0.1,
0,
0.66,
0.3333,
193,
0,
1,
0,
0,
193,
0,
0
],
[
14,
0,
0.8,
0.1,
0,
0.66,
0.6667,
... | [
"'''\nCreated on Feb 5, 2011\n\n@author: ppa\n'''",
"from collections import namedtuple",
"DateValueType = namedtuple('DateValue', 'date, value')",
"StockDailyType = namedtuple('StockDailyType', 'date, open, high, low, close, volume, adjClose')"
] |
'''
Created on Mar 20, 2011
@author: ppa
'''
from datetime import date
from xlwt import Workbook
import time
import traceback
from ultrafinance.lib.errors import UfException, Errors
from ultrafinance.lib.yahooFinance import YahooFinance
import logging
LOG = logging.getLogger(__name__)
class Historic... | [
[
8,
0,
0.04,
0.0667,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.08,
0.0133,
0,
0.66,
0.1111,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0933,
0.0133,
0,
0.66,
... | [
"'''\nCreated on Mar 20, 2011\n\n@author: ppa\n'''",
"from datetime import date",
"from xlwt import Workbook",
"import time",
"import traceback",
"from ultrafinance.lib.errors import UfException, Errors",
"from ultrafinance.lib.yahooFinance import YahooFinance",
"import logging",
"LOG = logging.getL... |
'''
Created on May 6, 2011
@author: ppa
'''
import traceback
class Errors(object):
""" class hosts error code constants """
# general errors
UNKNOWN_ERROR = 1
NETWORK_ERROR = 100
NETWORK_400_ERROR = 101
INDEX_RANGE_ERROR = 200
STOCK_SYMBOL_ERROR = 300
STOCK_PARSING_ERROR = 301
... | [
[
8,
0,
0.0556,
0.0926,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1111,
0.0185,
0,
0.66,
0.3333,
423,
0,
1,
0,
0,
423,
0,
0
],
[
3,
0,
0.3796,
0.4815,
0,
0.66... | [
"'''\nCreated on May 6, 2011\n\n@author: ppa\n'''",
"import traceback",
"class Errors(object):\n \"\"\" class hosts error code constants \"\"\"\n # general errors\n UNKNOWN_ERROR = 1\n\n NETWORK_ERROR = 100\n NETWORK_400_ERROR = 101",
" \"\"\" class hosts error code constants \"\"\"",
" ... |
'''
Created on Dec 21, 2010
@author: ppa
Thanks to Corey Goldberg, this module is based http://www.goldb.org/ystockquote.html
sample usage:
>>> import YahooFinance
>>> print YahooFinance.get_price('GOOG')
529.46
'''
import urllib
import traceback
from operator import itemgetter
from ultrafinance.lib.dat... | [
[
8,
0,
0.0385,
0.0705,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0769,
0.0064,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0833,
0.0064,
0,
0.66,... | [
"'''\nCreated on Dec 21, 2010\n\n@author: ppa\n\nThanks to Corey Goldberg, this module is based http://www.goldb.org/ystockquote.html\nsample usage:\n>>> import YahooFinance",
"import urllib",
"import traceback",
"from operator import itemgetter",
"from ultrafinance.lib.dataType import StockDailyType",
"f... |
'''
Created on July 31, 2011
@author: ppa
'''
import urllib2
from BeautifulSoup import BeautifulSoup
import traceback
from operator import itemgetter
from ultrafinance.lib.util import convertGoogCSVDate, findPatthen
from ultrafinance.lib.dataType import StockDailyType
from ultrafinance.lib.errors import UfE... | [
[
8,
0,
0.0181,
0.0301,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0361,
0.006,
0,
0.66,
0.0769,
345,
0,
1,
0,
0,
345,
0,
0
],
[
1,
0,
0.0422,
0.006,
0,
0.66,
... | [
"'''\nCreated on July 31, 2011\n\n@author: ppa\n'''",
"import urllib2",
"from BeautifulSoup import BeautifulSoup",
"import traceback",
"from operator import itemgetter",
"from ultrafinance.lib.util import convertGoogCSVDate, findPatthen",
"from ultrafinance.lib.dataType import StockDailyType",
"from u... |
'''
Created on Feb 26, 2011
@author: ppa
'''
import logging
LOG = logging.getLogger(__name__)
def fixAmountPerPeriod(dateValues, interval):
''' fix amount investment for each time period'''
amount = float(100)
share = sum([amount/dateValues[index].value for index in range(len(dateValues)/interv... | [
[
8,
0,
0.075,
0.125,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.15,
0.025,
0,
0.66,
0.2,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.175,
0.025,
0,
0.66,
0.4... | [
"'''\nCreated on Feb 26, 2011\n\n@author: ppa\n'''",
"import logging",
"LOG = logging.getLogger(__name__)",
"def fixAmountPerPeriod(dateValues, interval):\n ''' fix amount investment for each time period'''\n amount = float(100)\n share = sum([amount/dateValues[index].value for index in range(len(dat... |
''' trading strategy '''
import os, sys
mainSrc = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(mainSrc) | [
[
8,
0,
0.2,
0.2,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.3333,
688,
0,
2,
0,
0,
688,
0,
0
],
[
14,
0,
0.8,
0.2,
0,
0.66,
0.6667,
... | [
"''' trading strategy '''",
"import os, sys",
"mainSrc = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))",
"sys.path.append(mainSrc)"
] |
'''
Created on Mar 27, 2011
@author: ppa
'''
from datetime import date
from operator import itemgetter
from ultrafinance.lib.excelLib import ExcelLib
import logging
LOG = logging.getLogger(__name__)
class TradeInWeek():
'''
trade in one week. Which day to buy and sell is best
'''
WEEK... | [
[
8,
0,
0.0536,
0.0893,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1071,
0.0179,
0,
0.66,
0.1429,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.125,
0.0179,
0,
0.66,... | [
"'''\nCreated on Mar 27, 2011\n\n@author: ppa\n'''",
"from datetime import date",
"from operator import itemgetter",
"from ultrafinance.lib.excelLib import ExcelLib",
"import logging",
"LOG = logging.getLogger(__name__)",
"class TradeInWeek():\n '''\n trade in one week. Which day to buy and sell i... |
'''
Created on Feb 26, 2011
@author: ppa
'''
from ultrafinance.lib.errors import UfException, Errors
import traceback
import logging
LOG = logging.getLogger()
class TradingStrategyFactory():
''' Factory method for trading Strategies '''
def __init__(self, strategy):
''' constructor '''
... | [
[
8,
0,
0.12,
0.2,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.24,
0.04,
0,
0.66,
0.2,
55,
0,
2,
0,
0,
55,
0,
0
],
[
1,
0,
0.28,
0.04,
0,
0.66,
0.4,
423... | [
"'''\nCreated on Feb 26, 2011\n\n@author: ppa\n'''",
"from ultrafinance.lib.errors import UfException, Errors",
"import traceback",
"import logging",
"LOG = logging.getLogger()",
"class TradingStrategyFactory():\n ''' Factory method for trading Strategies '''\n def __init__(self, strategy):\n ... |
'''
Created on Dec 18, 2010
@author: ppa
'''
import sys
from BeautifulSoup import BeautifulSoup
from datetime import datetime
import time
import logging
LOG = logging.getLogger()
googCSVDateformat = "%d-%b-%y"
def import_class(path, fileName, className=None):
''' dynamically import class '''
... | [
[
8,
0,
0.0455,
0.0758,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0909,
0.0152,
0,
0.66,
0.0667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1061,
0.0152,
0,
0.66... | [
"'''\nCreated on Dec 18, 2010\n\n@author: ppa\n'''",
"import sys",
"from BeautifulSoup import BeautifulSoup",
"from datetime import datetime",
"import time",
"import logging",
"LOG = logging.getLogger()",
"googCSVDateformat = \"%d-%b-%y\"",
"def import_class(path, fileName, className=None):\n '''... |
'''
Created on May 6, 2011
@author: ppa
'''
import traceback
class Errors(object):
""" class hosts error code constants """
# general errors
UNKNOWN_ERROR = 1
FILE_NOT_EXIST = 2
FILE_EXIST = 3
UNDEFINED_METHOD = 4
NETWORK_ERROR = 100
NETWORK_400_ERROR = 101
INDEX_RANGE_ERROR = 20... | [
[
8,
0,
0.038,
0.0633,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0759,
0.0127,
0,
0.66,
0.3333,
423,
0,
1,
0,
0,
423,
0,
0
],
[
3,
0,
0.4241,
0.6582,
0,
0.66,... | [
"'''\nCreated on May 6, 2011\n\n@author: ppa\n'''",
"import traceback",
"class Errors(object):\n \"\"\" class hosts error code constants \"\"\"\n # general errors\n UNKNOWN_ERROR = 1\n FILE_NOT_EXIST = 2\n FILE_EXIST = 3\n UNDEFINED_METHOD = 4",
" \"\"\" class hosts error code constants \... |
'''
Created on Sep 27, 2011
@author: ppa
'''
import sys
from thrift import Thrift
from thrift.transport import TSocket, TTransport
from thrift.protocol import TBinaryProtocol
from hbase import ttypes
from hbase.Hbase import Client, ColumnDescriptor, Mutation
from ultrafinance.lib.errors import UfExcepti... | [
[
8,
0,
0.0226,
0.0376,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0451,
0.0075,
0,
0.66,
0.0909,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0602,
0.0075,
0,
0.66... | [
"'''\nCreated on Sep 27, 2011\n\n@author: ppa\n'''",
"import sys",
"from thrift import Thrift",
"from thrift.transport import TSocket, TTransport",
"from thrift.protocol import TBinaryProtocol",
"from hbase import ttypes",
"from hbase.Hbase import Client, ColumnDescriptor, Mutation",
"from ultrafinanc... |
''' ultraFinance lib '''
import os, sys
import logging
LOG = logging.getLogger(__name__)
'''
mainSrc = os.path.join(os.path.dirname( (os.path.dirname(os.path.abspath(__file__)))))
sys.path.append(mainSrc)
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s.%(msecs)03d %(leveln... | [
[
8,
0,
0.0667,
0.0667,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0667,
0,
0.66,
0.25,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.2667,
0.0667,
0,
0.66,
... | [
"''' ultraFinance lib '''",
"import os, sys",
"import logging",
"LOG = logging.getLogger(__name__)",
"'''\nmainSrc = os.path.join(os.path.dirname( (os.path.dirname(os.path.abspath(__file__)))))\nsys.path.append(mainSrc)\n\nlogging.basicConfig(level=logging.DEBUG,\n format='%(asctime)s.%(m... |
'''
Created on Jan 3, 2011
@author: ppa
'''
from matplotlib import pyplot
from datetime import datetime
from ultrafinance.lib.errors import UfException, Errors
import logging
LOG = logging.getLogger(__name__)
class PlotDateValueDict(object):
''' plot dict with date value '''
def __init__(self, ... | [
[
8,
0,
0.05,
0.0833,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1,
0.0167,
0,
0.66,
0.1667,
75,
0,
1,
0,
0,
75,
0,
0
],
[
1,
0,
0.1167,
0.0167,
0,
0.66,
0... | [
"'''\nCreated on Jan 3, 2011\n\n@author: ppa\n'''",
"from matplotlib import pyplot",
"from datetime import datetime",
"from ultrafinance.lib.errors import UfException, Errors",
"import logging",
"LOG = logging.getLogger(__name__)",
"class PlotDateValueDict(object):\n ''' plot dict with date value '''... |
'''
Created on Apr 24, 2011
@author: ppa
'''
from operator import itemgetter
import time
import os
from ultrafinance.lib.stockMeasurement import StockMeasurement
from ultrafinance.lib.historicalDataStorage import HistoricalDataStorage
from ultrafinance.lib.yahooFinance import YahooFinance
from ultrafinanc... | [
[
8,
0,
0.0252,
0.042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0504,
0.0084,
0,
0.66,
0.0667,
616,
0,
1,
0,
0,
616,
0,
0
],
[
1,
0,
0.0588,
0.0084,
0,
0.66,... | [
"'''\nCreated on Apr 24, 2011\n\n@author: ppa\n'''",
"from operator import itemgetter",
"import time",
"import os",
"from ultrafinance.lib.stockMeasurement import StockMeasurement",
"from ultrafinance.lib.historicalDataStorage import HistoricalDataStorage",
"from ultrafinance.lib.yahooFinance import Yah... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.