code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/env python
array = [
{
'abbr': 'AL',
'name': 'Alabama',
'parties': {
'dem': { 'date': '02-05' },
'gop': { 'date': '02-05' }
}
},
{
'abbr': 'AK',
'name': 'Alaska',
'parties': {
'dem': { 'date': '02-05', 'type': 'caucus' },
'gop': { 'date': '02-05', 'type': 'caucus' }
}
},
{
... | [
[
14,
0,
0.4943,
0.977,
0,
0.66,
0,
80,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.9862,
0.0023,
0,
0.66,
0.25,
489,
0,
0,
0,
0,
0,
6,
0
],
[
6,
0,
0.9897,
0.0046,
0,
0.66,
... | [
"array = [\n\t{\n\t\t'abbr': 'AL',\n\t\t'name': 'Alabama',\n\t\t'parties': {\n\t\t\t'dem': { 'date': '02-05' },\n\t\t\t'gop': { 'date': '02-05' }\n\t\t}",
"byAbbr = {}",
"for state in array:\n\tbyAbbr[ state['abbr'] ] = state",
"\tbyAbbr[ state['abbr'] ] = state",
"byName = {}",
"for state in array:\n\tby... |
#!/usr/bin/env python
# shpUtils.py
# Original version by Zachary Forest Johnson
# http://indiemaps.com/blog/index.php/code/pyShapefile.txt
# This version modified by Michael Geary
from struct import unpack
import dbfUtils
XY_POINT_RECORD_LENGTH = 16
db = []
def loadShapefile( filename ):
# open dbf file and get fe... | [
[
1,
0,
0.0421,
0.0053,
0,
0.66,
0,
399,
0,
1,
0,
0,
399,
0,
0
],
[
1,
0,
0.0474,
0.0053,
0,
0.66,
0.0526,
699,
0,
1,
0,
0,
699,
0,
0
],
[
14,
0,
0.0526,
0.0053,
0,
... | [
"from struct import unpack",
"import dbfUtils",
"XY_POINT_RECORD_LENGTH = 16",
"db = []",
"def loadShapefile( filename ):\n\t# open dbf file and get features as a list\n\tglobal db\n\tdbfile = open( filename[0:-4] + '.dbf', 'rb' )\n\tdb = list( dbfUtils.dbfreader(dbfile) )\n\tdbfile.close()\n\t\n\tfp = open... |
#!/usr/bin/env python
# makepolys.py
import codecs
import json
import math
import os
import random
import re
import shutil
import stat
import sys
import time
from geo import Geo
import shpUtils
import states
#states = json.load( open('states.json') )
jsonpath = 'json'
shapespath = 'shapefiles'
geo = Geo()
keysep ... | [
[
1,
0,
0.0201,
0.004,
0,
0.66,
0,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.0241,
0.004,
0,
0.66,
0.0323,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.0281,
0.004,
0,
0.6... | [
"import codecs",
"import json",
"import math",
"import os",
"import random",
"import re",
"import shutil",
"import stat",
"import sys",
"import time",
"from geo import Geo",
"import shpUtils",
"import states",
"jsonpath = 'json'",
"shapespath = 'shapefiles'",
"geo = Geo()",
"keysep =... |
#!/usr/bin/env python
# dbfUtils.py
# By Raymond Hettinger
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715
import struct, datetime, decimal, itertools
def dbfreader(f):
"""Returns an iterator over records in a Xbase DBF file.
The first row returned contains the field names.
The second row contai... | [
[
1,
0,
0.0588,
0.0084,
0,
0.66,
0,
399,
0,
4,
0,
0,
399,
0,
0
],
[
2,
0,
0.2983,
0.4538,
0,
0.66,
0.5,
887,
0,
1,
0,
0,
0,
0,
25
],
[
8,
1,
0.1218,
0.084,
1,
0.18,... | [
"import struct, datetime, decimal, itertools",
"def dbfreader(f):\n\t\"\"\"Returns an iterator over records in a Xbase DBF file.\n\n\tThe first row returned contains the field names.\n\tThe second row contains field specs: (type, size, decimal places).\n\tSubsequent rows contain the data records.\n\tIf a record i... |
#!/usr/bin/env python
# get-strings.py
# By Michael Geary - http://mg.to/
# See UNLICENSE or http://unlicense.org/ for public domain notice.
# Reads the JSON feed for a Google Docs spreadsheet containing the
# localized strings for the Google Election Center gadget, then writes
# the strings for each language into a ... | [
[
1,
0,
0.4878,
0.0244,
0,
0.66,
0,
463,
0,
3,
0,
0,
463,
0,
0
],
[
14,
0,
0.5366,
0.0244,
0,
0.66,
0.2,
789,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.5854,
0.0244,
0,
0.6... | [
"import json, re, urllib2",
"url = 'https://spreadsheets.google.com/feeds/list/0AuiC0EUz_p_xdHE3R2U5cTE0aFdHcWpTVVhPQVlzUmc/1/public/values?alt=json'",
"langs = {}",
"feed = json.load( urllib2.urlopen(url) )['feed']",
"for entry in feed['entry']:\n\tid = entry['gsx$id']['$t']\n\tfor col in entry:\n\t\tmatch... |
#!/usr/bin/env python
# coding: utf-8
# make-hi.py - special HI processing for 2010
# Copyright (c) 2010 Michael Geary - http://mg.to/
# Use under either the MIT or GPL license
# http://www.opensource.org/licenses/mit-license.php
# http://www.opensource.org/licenses/gpl-2.0.php
import re
def convert( input, output )... | [
[
1,
0,
0.2941,
0.0294,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.5735,
0.4706,
0,
0.66,
0.3333,
438,
0,
2,
0,
0,
0,
0,
13
],
[
8,
1,
0.3824,
0.0294,
1,
0... | [
"import re",
"def convert( input, output ):\n\tprint('Converting %s to %s' %( input, output ))\n\tinput = open( input, 'r' )\n\toutput = open( output, 'wb' )\n\toutput.write( '{\\n' )\n\tfor line in input:\n\t\tline = line.rstrip('\\n').split('\\t')\n\t\tif len(line) > 12:",
"\tprint('Converting %s to %s' %( in... |
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Fre... | [
[
1,
0,
0.0486,
0.0026,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0512,
0.0026,
0,
0.66,
0.0222,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0537,
0.0026,
0,
... | [
"import sys",
"import os",
"import os.path",
"import pprint",
"import re",
"UPCASE_CHECK = True",
"ARGS = []",
"for i in range(len(sys.argv)):\n if not sys.argv[i].startswith('--'):\n ARGS.append(sys.argv[i])\n elif sys.argv[i].lower() == '--no-upcase-check':\n UPCASE_CHECK = False... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0233,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.026,
0.0014,
0,
0.66,
0.0263,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0328,
0.0014,
0,
0.66,... | [
"\"\"\"Mapreduce shuffler implementation.\"\"\"",
"from __future__ import with_statement",
"import gc",
"import heapq",
"import logging",
"import os",
"import time",
"from mapreduce.lib import pipeline",
"from mapreduce.lib.pipeline import common as pipeline_common",
"from mapreduce.lib import fil... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1753,
0.0103,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2165,
0.0103,
0,
0.66,
0.1667,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.268,
0.0103,
0,
0.66,
... | [
"\"\"\"API for controlling MapReduce execution outside of MapReduce framework.\"\"\"",
"__all__ = [\"start_map\"]",
"from mapreduce import base_handler",
"from mapreduce import handlers",
"from mapreduce import model",
"_DEFAULT_SHARD_COUNT = 8",
"def start_map(name,\n handler_spec,\n ... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.2079,
0.0891,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2871,
0.0099,
0,
0.66,
0.0909,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.3069,
0.0099,
0,
0.66... | [
"\"\"\"Main module for map-reduce implementation.\n\nThis module should be specified as a handler for mapreduce URLs in app.yaml:\n\n handlers:\n - url: /mapreduce(/.*)?\n login: admin\n script: mapreduce/main.py",
"import wsgiref.handlers",
"from google.appengine.ext import webapp",
"from mapreduce i... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0919,
0.0054,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1243,
0.0054,
0,
0.66,
0.25,
936,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1459,
0.0054,
0,
0.66,
... | [
"\"\"\"Simple quota system backed by memcache storage.\"\"\"",
"_QUOTA_NAMESPACE = \"quota\"",
"_OFFSET = 2**32",
"class QuotaManager(object):\n \"\"\"Simple quota system manager, backed by memcache storage.\n\n Since memcache storage is not reliable, this quota system is not reliable and\n best effort onl... |
#!/usr/bin/env python
#
# Copyright 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 o... | [] | [] |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0919,
0.0054,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1243,
0.0054,
0,
0.66,
0.25,
936,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1459,
0.0054,
0,
0.66,
... | [
"\"\"\"Simple quota system backed by memcache storage.\"\"\"",
"_QUOTA_NAMESPACE = \"quota\"",
"_OFFSET = 2**32",
"class QuotaManager(object):\n \"\"\"Simple quota system manager, backed by memcache storage.\n\n Since memcache storage is not reliable, this quota system is not reliable and\n best effort onl... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0287,
0.0017,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.032,
0.0017,
0,
0.66,
0.04,
777,
0,
1,
0,
0,
777,
0,
0
],
[
14,
0,
0.0464,
0.0169,
0,
0.66,
... | [
"\"\"\"Output writers for MapReduce.\"\"\"",
"from __future__ import with_statement",
"__all__ = [\n \"BlobstoreOutputWriter\",\n \"BlobstoreOutputWriterBase\",\n \"BlobstoreRecordsOutputWriter\",\n \"KeyValueBlobstoreOutputWriter\",\n \"COUNTER_IO_WRITE_BYTES\",\n \"COUNTER_IO_WRITE_MSEC\",\n... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0222,
0.0068,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0341,
0.0034,
0,
0.66,
0.0333,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0375,
0.0011,
0,
0.66,... | [
"\"\"\"Model classes which are used to communicate between parts of implementation.\n\nThese model classes are describing mapreduce, its current state and\ncommunication messages. They are either stored in the datastore or\nserialized to/from json and passed around with other means.\n\"\"\"",
"__all__ = [\"JsonMi... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1789,
0.0105,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2211,
0.0105,
0,
0.66,
0.1667,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.2737,
0.0105,
0,
0.66,... | [
"\"\"\"API for controlling MapReduce execution outside of MapReduce framework.\"\"\"",
"__all__ = [\"start_map\"]",
"from mapreduce import base_handler",
"from mapreduce import handlers",
"from mapreduce import model",
"_DEFAULT_SHARD_COUNT = 8",
"def start_map(name,\n handler_spec,\n ... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1545,
0.0091,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2091,
0.0091,
0,
0.66,
0.1667,
412,
0,
1,
0,
0,
412,
0,
0
],
[
1,
0,
0.2182,
0.0091,
0,
0.66... | [
"\"\"\"Pipelines for mapreduce library.\"\"\"",
"from mapreduce.lib import files",
"from mapreduce import base_handler",
"from mapreduce import control",
"from mapreduce import model",
"class MapperPipeline(base_handler.PipelineBase):\n \"\"\"Pipeline wrapper for mapper job.\n\n Args:\n job_name: map... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1809,
0.0106,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2234,
0.0106,
0,
0.66,
0.5,
272,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.6277,
0.7553,
0,
0.66,
... | [
"\"\"\"API allowing control over some mapreduce implementation details.\"\"\"",
"__all__ = [\"Hooks\"]",
"class Hooks(object):\n \"\"\"Allows subclasses to control some aspects of mapreduce execution.\n\n control.start_map accepts an optional \"hooks\" argument that can be passed a\n subclass of this class.\... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1,
0.0114,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1314,
0.0057,
0,
0.66,
0.0667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1371,
0.0057,
0,
0.66,
... | [
"\"\"\"Base handler class for all mapreduce handlers.\n\"\"\"",
"import logging",
"from mapreduce.lib import simplejson",
"try:\n from mapreduce.lib import pipeline\nexcept ImportError:\n pipeline = None",
" from mapreduce.lib import pipeline",
" pipeline = None",
"from google.appengine.ext import w... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0429,
0.0025,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.053,
0.0025,
0,
0.66,
0.0714,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.0556,
0.0025,
0,
0.66,... | [
"\"\"\"Represents a lexographic range of namespaces.\"\"\"",
"import itertools",
"import string",
"from google.appengine.api import datastore",
"from google.appengine.ext import db",
"from google.appengine.ext.db import metadata",
"NAMESPACE_CHARACTERS = ''.join(sorted(string.digits +\n ... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1545,
0.0091,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2091,
0.0091,
0,
0.66,
0.1667,
412,
0,
1,
0,
0,
412,
0,
0
],
[
1,
0,
0.2182,
0.0091,
0,
0.66... | [
"\"\"\"Pipelines for mapreduce library.\"\"\"",
"from mapreduce.lib import files",
"from mapreduce import base_handler",
"from mapreduce import control",
"from mapreduce import model",
"class MapperPipeline(base_handler.PipelineBase):\n \"\"\"Pipeline wrapper for mapper job.\n\n Args:\n job_name: map... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1753,
0.0103,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2165,
0.0103,
0,
0.66,
0.1667,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.268,
0.0103,
0,
0.66,
... | [
"\"\"\"API for controlling MapReduce execution outside of MapReduce framework.\"\"\"",
"__all__ = [\"start_map\"]",
"from mapreduce import base_handler",
"from mapreduce import handlers",
"from mapreduce import model",
"_DEFAULT_SHARD_COUNT = 8",
"def start_map(name,\n handler_spec,\n ... |
#!/usr/bin/env python
#
# Copyright 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 o... | [] | [] |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0233,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.026,
0.0014,
0,
0.66,
0.0263,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0328,
0.0014,
0,
0.66,... | [
"\"\"\"Mapreduce shuffler implementation.\"\"\"",
"from __future__ import with_statement",
"import gc",
"import heapq",
"import logging",
"import os",
"import time",
"from mapreduce.lib import pipeline",
"from mapreduce.lib.pipeline import common as pipeline_common",
"from mapreduce.lib import fil... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1809,
0.0106,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2234,
0.0106,
0,
0.66,
0.5,
272,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.6277,
0.7553,
0,
0.66,
... | [
"\"\"\"API allowing control over some mapreduce implementation details.\"\"\"",
"__all__ = [\"Hooks\"]",
"class Hooks(object):\n \"\"\"Allows subclasses to control some aspects of mapreduce execution.\n\n control.start_map accepts an optional \"hooks\" argument that can be passed a\n subclass of this class.\... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0983,
0.0112,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1292,
0.0056,
0,
0.66,
0.0667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
7,
0,
0.1433,
0.0225,
0,
0.66... | [
"\"\"\"Base handler class for all mapreduce handlers.\n\"\"\"",
"import logging",
"try:\n import json as simplejson\nexcept ImportError:\n from mapreduce.lib import simplejson",
" import json as simplejson",
" from mapreduce.lib import simplejson",
"try:\n from mapreduce.lib import pipeline\nexcept I... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.103,
0.0061,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1152,
0.0061,
0,
0.66,
0.0588,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.1515,
0.0061,
0,
0.66,... | [
"\"\"\"Pipelines for mapreduce library.\"\"\"",
"from __future__ import with_statement",
"from mapreduce.lib import pipeline",
"from mapreduce.lib.pipeline import common as pipeline_common",
"from mapreduce.lib import files",
"from mapreduce.lib.files import file_service_pb",
"from mapreduce import outp... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0222,
0.0068,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0341,
0.0034,
0,
0.66,
0.0333,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0375,
0.0011,
0,
0.66,... | [
"\"\"\"Model classes which are used to communicate between parts of implementation.\n\nThese model classes are describing mapreduce, its current state and\ncommunication messages. They are either stored in the datastore or\nserialized to/from json and passed around with other means.\n\"\"\"",
"__all__ = [\"JsonMi... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1223,
0.0072,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1511,
0.0072,
0,
0.66,
0.0909,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.1583,
0.0072,
0,
0.66... | [
"\"\"\"Utilities to aid in testing mapreduces.\"\"\"",
"import base64",
"import cgi",
"import os",
"import re",
"from mapreduce import main",
"from mapreduce import mock_webapp",
"from mapreduce import util",
"def decode_task_payload(task):\n \"\"\"Decodes POST task payload.\n\n Args:\n task: a... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0919,
0.0054,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1243,
0.0054,
0,
0.66,
0.25,
936,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1459,
0.0054,
0,
0.66,
... | [
"\"\"\"Simple quota system backed by memcache storage.\"\"\"",
"_QUOTA_NAMESPACE = \"quota\"",
"_OFFSET = 2**32",
"class QuotaManager(object):\n \"\"\"Simple quota system manager, backed by memcache storage.\n\n Since memcache storage is not reliable, this quota system is not reliable and\n best effort onl... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0287,
0.0017,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.032,
0.0017,
0,
0.66,
0.04,
777,
0,
1,
0,
0,
777,
0,
0
],
[
14,
0,
0.0464,
0.0169,
0,
0.66,
... | [
"\"\"\"Output writers for MapReduce.\"\"\"",
"from __future__ import with_statement",
"__all__ = [\n \"BlobstoreOutputWriter\",\n \"BlobstoreOutputWriterBase\",\n \"BlobstoreRecordsOutputWriter\",\n \"KeyValueBlobstoreOutputWriter\",\n \"COUNTER_IO_WRITE_BYTES\",\n \"COUNTER_IO_WRITE_MSEC\",\n... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1927,
0.0826,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2661,
0.0092,
0,
0.66,
0.0769,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.2844,
0.0092,
0,
0.66... | [
"\"\"\"Main module for map-reduce implementation.\n\nThis module should be specified as a handler for mapreduce URLs in app.yaml:\n\n handlers:\n - url: /mapreduce(/.*)?\n login: admin\n script: mapreduce/main.py",
"import wsgiref.handlers",
"from google.appengine.ext import webapp",
"from mapreduce i... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0641,
0.0197,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0888,
0.0099,
0,
0.66,
0.0667,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0987,
0.0033,
0,
0.66,... | [
"\"\"\"Mapreduce execution context.\n\nMapreduce context provides handler code with information about\ncurrent mapreduce execution and organizes utility data flow\nfrom handlers such as counters, log messages, mutation pools.\n\"\"\"",
"__all__ = [\"MAX_ENTITY_COUNT\", \"MAX_POOL_SIZE\", \"Context\", \"MutationPo... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0525,
0.0031,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0679,
0.0093,
0,
0.66,
0.05,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0802,
0.0031,
0,
0.66,
... | [
"\"\"\"Utility functions for use with the mapreduce library.\"\"\"",
"__all__ = [\"for_name\", \"is_generator_function\", \"get_short_name\", \"parse_bool\",\n \"create_datastore_write_config\",\n \"HugeTask\", \"HugeTaskHandler\"]",
"import base64",
"import cgi",
"import inspect",
"im... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.2742,
0.0161,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4113,
0.1613,
0,
0.66,
0.1111,
272,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.5242,
0.0323,
0,
0.66,... | [
"\"\"\"Map Reduce framework errors.\"\"\"",
"__all__ = [\n \"BadParamsError\",\n \"BadReaderParamsError\",\n \"BadWriterParamsError\",\n \"BadYamlError\",\n \"Error\",\n \"MissingYamlError\",\n \"MultipleDocumentsInMrYaml\",",
"class Error(Exception):\n \"\"\"Base-class for exceptions in t... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.2024,
0.0119,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2738,
0.0119,
0,
0.66,
0.25,
420,
0,
1,
0,
0,
420,
0,
0
],
[
1,
0,
0.2857,
0.0119,
0,
0.66,
... | [
"\"\"\"Pipelines for mapreduce library.\"\"\"",
"from mapreduce import base_handler",
"from mapreduce import control",
"from mapreduce import model",
"class MapperPipeline(base_handler.PipelineBase):\n \"\"\"Pipeline wrapper for mapper job.\n\n Args:\n job_name: mapper job name as string\n handler_s... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0429,
0.0025,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.053,
0.0025,
0,
0.66,
0.0714,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.0556,
0.0025,
0,
0.66,... | [
"\"\"\"Represents a lexographic range of namespaces.\"\"\"",
"import itertools",
"import string",
"from google.appengine.api import datastore",
"from google.appengine.ext import db",
"from google.appengine.ext.db import metadata",
"NAMESPACE_CHARACTERS = ''.join(sorted(string.digits +\n ... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0641,
0.0197,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0888,
0.0099,
0,
0.66,
0.0667,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0987,
0.0033,
0,
0.66,... | [
"\"\"\"Mapreduce execution context.\n\nMapreduce context provides handler code with information about\ncurrent mapreduce execution and organizes utility data flow\nfrom handlers such as counters, log messages, mutation pools.\n\"\"\"",
"__all__ = [\"MAX_ENTITY_COUNT\", \"MAX_POOL_SIZE\", \"Context\", \"MutationPo... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0525,
0.0031,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0679,
0.0093,
0,
0.66,
0.05,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0802,
0.0031,
0,
0.66,
... | [
"\"\"\"Utility functions for use with the mapreduce library.\"\"\"",
"__all__ = [\"for_name\", \"is_generator_function\", \"get_short_name\", \"parse_bool\",\n \"create_datastore_write_config\",\n \"HugeTask\", \"HugeTaskHandler\"]",
"import base64",
"import cgi",
"import inspect",
"im... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0305,
0.0018,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0341,
0.0018,
0,
0.66,
0.0476,
777,
0,
1,
0,
0,
777,
0,
0
],
[
14,
0,
0.0485,
0.0162,
0,
0.6... | [
"\"\"\"Output writers for MapReduce.\"\"\"",
"from __future__ import with_statement",
"__all__ = [\n \"BlobstoreOutputWriter\",\n \"BlobstoreOutputWriterBase\",\n \"BlobstoreRecordsOutputWriter\",\n \"COUNTER_IO_WRITE_BYTES\",\n \"COUNTER_IO_WRITE_MSEC\",\n \"OutputWriter\",\n \"RecordsPool... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0525,
0.0031,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0679,
0.0093,
0,
0.66,
0.05,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0802,
0.0031,
0,
0.66,
... | [
"\"\"\"Utility functions for use with the mapreduce library.\"\"\"",
"__all__ = [\"for_name\", \"is_generator_function\", \"get_short_name\", \"parse_bool\",\n \"create_datastore_write_config\",\n \"HugeTask\", \"HugeTaskHandler\"]",
"import base64",
"import cgi",
"import inspect",
"im... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.3696,
0.0217,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4565,
0.0217,
0,
0.66,
0.3333,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.5217,
0.0217,
0,
0.66,... | [
"\"\"\"Counters-related operations.\"\"\"",
"__all__ = ['Increment']",
"from mapreduce.operation import base",
"class Increment(base.Operation):\n \"\"\"Increment counter operation.\"\"\"\n\n def __init__(self, counter_name, delta=1):\n \"\"\"Constructor.\n\n Args:\n counter_name: name of the cou... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.629,
0.1935,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.871,
0.0323,
0,
0.66,
0.25,
761,
0,
1,
0,
0,
761,
0,
0
],
[
1,
0,
0.9032,
0.0323,
0,
0.66,
... | [
"\"\"\"Operations which can be yielded from mappers.\n\nOperation is callable that takes context.Context as a parameter.\nOperations are called during mapper execution immediately\non recieving from handler function.\n\"\"\"",
"import db",
"import counters",
"from base import Operation",
"__all__ = ['db', '... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.2361,
0.0139,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2917,
0.0139,
0,
0.66,
0.25,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.3333,
0.0139,
0,
0.66,
... | [
"\"\"\"DB-related operations.\"\"\"",
"__all__ = ['Put', 'Delete']",
"from mapreduce.operation import base",
"class Put(base.Operation):\n \"\"\"Put entity into datastore via mutation_pool.\n\n See mapreduce.context.MutationPool.\n \"\"\"\n\n def __init__(self, entity):\n \"\"\"Constructor.",
" \"\"... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.5152,
0.0303,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6364,
0.0303,
0,
0.66,
0.5,
272,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.8636,
0.303,
0,
0.66,
... | [
"\"\"\"Base operation class.\"\"\"",
"__all__ = ['Operation']",
"class Operation(object):\n \"\"\"Base class for all mapper operations.\n\n All operations should implement __call__(self, ctx) function, which will be\n called upon operation yield.\n \"\"\"\n\n def __call__(self, ctx):",
" \"\"\"Base clas... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.3696,
0.0217,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4565,
0.0217,
0,
0.66,
0.3333,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.5217,
0.0217,
0,
0.66,... | [
"\"\"\"Counters-related operations.\"\"\"",
"__all__ = ['Increment']",
"from mapreduce.operation import base",
"class Increment(base.Operation):\n \"\"\"Increment counter operation.\"\"\"\n\n def __init__(self, counter_name, delta=1):\n \"\"\"Constructor.\n\n Args:\n counter_name: name of the cou... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.2361,
0.0139,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2917,
0.0139,
0,
0.66,
0.25,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.3333,
0.0139,
0,
0.66,
... | [
"\"\"\"DB-related operations.\"\"\"",
"__all__ = ['Put', 'Delete']",
"from mapreduce.operation import base",
"class Put(base.Operation):\n \"\"\"Put entity into datastore via mutation_pool.\n\n See mapreduce.context.MutationPool.\n \"\"\"\n\n def __init__(self, entity):\n \"\"\"Constructor.",
" \"\"... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.5152,
0.0303,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6364,
0.0303,
0,
0.66,
0.5,
272,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.8636,
0.303,
0,
0.66,
... | [
"\"\"\"Base operation class.\"\"\"",
"__all__ = ['Operation']",
"class Operation(object):\n \"\"\"Base class for all mapper operations.\n\n All operations should implement __call__(self, ctx) function, which will be\n called upon operation yield.\n \"\"\"\n\n def __call__(self, ctx):",
" \"\"\"Base clas... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.629,
0.1935,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.871,
0.0323,
0,
0.66,
0.25,
761,
0,
1,
0,
0,
761,
0,
0
],
[
1,
0,
0.9032,
0.0323,
0,
0.66,
... | [
"\"\"\"Operations which can be yielded from mappers.\n\nOperation is callable that takes context.Context as a parameter.\nOperations are called during mapper execution immediately\non recieving from handler function.\n\"\"\"",
"import db",
"import counters",
"from base import Operation",
"__all__ = ['db', '... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.168,
0.072,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.232,
0.008,
0,
0.66,
0.0588,
709,
0,
1,
0,
0,
709,
0,
0
],
[
1,
0,
0.248,
0.008,
0,
0.66,
... | [
"\"\"\"Main module for map-reduce implementation.\n\nThis module should be specified as a handler for mapreduce URLs in app.yaml:\n\n handlers:\n - url: /mapreduce(/.*)?\n login: admin\n script: mapreduce/main.py",
"import wsgiref.handlers",
"from google.appengine.ext import webapp",
"from mapreduce i... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.2742,
0.0161,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4113,
0.1613,
0,
0.66,
0.1111,
272,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.5242,
0.0323,
0,
0.66,... | [
"\"\"\"Map Reduce framework errors.\"\"\"",
"__all__ = [\n \"BadParamsError\",\n \"BadReaderParamsError\",\n \"BadWriterParamsError\",\n \"BadYamlError\",\n \"Error\",\n \"MissingYamlError\",\n \"MultipleDocumentsInMrYaml\",",
"class Error(Exception):\n \"\"\"Base-class for exceptions in t... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0876,
0.0052,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0979,
0.0052,
0,
0.66,
0.0769,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.1289,
0.0052,
0,
0.66... | [
"\"\"\"Pipelines for mapreduce library.\"\"\"",
"from __future__ import with_statement",
"from mapreduce.lib import pipeline",
"from mapreduce.lib.pipeline import common as pipeline_common",
"from mapreduce.lib import files",
"from mapreduce import base_handler",
"from mapreduce import mapper_pipeline",... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0983,
0.0112,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1292,
0.0056,
0,
0.66,
0.0667,
715,
0,
1,
0,
0,
715,
0,
0
],
[
7,
0,
0.1433,
0.0225,
0,
0.66... | [
"\"\"\"Base handler class for all mapreduce handlers.\n\"\"\"",
"import logging",
"try:\n import json as simplejson\nexcept ImportError:\n from mapreduce.lib import simplejson",
" import json as simplejson",
" from mapreduce.lib import simplejson",
"try:\n from mapreduce.lib import pipeline\nexcept I... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.3036,
0.0179,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4464,
0.1607,
0,
0.66,
0.125,
272,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.5625,
0.0357,
0,
0.66,
... | [
"\"\"\"Map Reduce framework errors.\"\"\"",
"__all__ = [\n \"BadParamsError\",\n \"BadReaderParamsError\",\n \"BadWriterParamsError\",\n \"BadYamlError\",\n \"Error\",\n \"MissingYamlError\",\n \"MultipleDocumentsInMrYaml\",",
"class Error(Exception):\n \"\"\"Base-class for exceptions in t... |
#!/usr/bin/env python
#
# Copyright 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 o... | [] | [] |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0429,
0.0025,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.053,
0.0025,
0,
0.66,
0.0714,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.0556,
0.0025,
0,
0.66,... | [
"\"\"\"Represents a lexographic range of namespaces.\"\"\"",
"import itertools",
"import string",
"from google.appengine.api import datastore",
"from google.appengine.ext import db",
"from google.appengine.ext.db import metadata",
"NAMESPACE_CHARACTERS = ''.join(sorted(string.digits +\n ... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.103,
0.0061,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1152,
0.0061,
0,
0.66,
0.0588,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.1515,
0.0061,
0,
0.66,... | [
"\"\"\"Pipelines for mapreduce library.\"\"\"",
"from __future__ import with_statement",
"from mapreduce.lib import pipeline",
"from mapreduce.lib.pipeline import common as pipeline_common",
"from mapreduce.lib import files",
"from mapreduce.lib.files import file_service_pb",
"from mapreduce import outp... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0641,
0.0197,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0888,
0.0099,
0,
0.66,
0.0667,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0987,
0.0033,
0,
0.66,... | [
"\"\"\"Mapreduce execution context.\n\nMapreduce context provides handler code with information about\ncurrent mapreduce execution and organizes utility data flow\nfrom handlers such as counters, log messages, mutation pools.\n\"\"\"",
"__all__ = [\"MAX_ENTITY_COUNT\", \"MAX_POOL_SIZE\", \"Context\", \"MutationPo... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.1259,
0.0074,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1556,
0.0074,
0,
0.66,
0.0909,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.163,
0.0074,
0,
0.66,... | [
"\"\"\"Utilities to aid in testing mapreduces.\"\"\"",
"import base64",
"import cgi",
"import os",
"import re",
"from mapreduce import main",
"from testlib import mock_webapp",
"from mapreduce import util",
"def decode_task_payload(task):\n \"\"\"Decodes POST task payload.\n\n Args:\n task: a t... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0383,
0.0023,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0428,
0.0023,
0,
0.66,
0.04,
777,
0,
1,
0,
0,
777,
0,
0
],
[
1,
0,
0.0541,
0.0023,
0,
0.66,
... | [
"\"\"\"Mapreduce shuffler implementation.\"\"\"",
"from __future__ import with_statement",
"import gc",
"import heapq",
"import logging",
"import time",
"from mapreduce.lib import pipeline",
"from mapreduce.lib import files",
"from mapreduce.lib.files import file_service_pb",
"from mapreduce.lib.f... |
#!/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... | [
[
8,
0,
0.0348,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0391,
0.0014,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
7,
0,
0.0478,
0.0101,
0,
0.66,
... | [
"\"\"\"Key range representation and splitting.\"\"\"",
"import os",
"try:\n import json as simplejson\nexcept ImportError:\n try:\n from mapreduce.lib import simplejson\n except ImportError:\n simplejson = None",
" import json as simplejson",
" try:\n from mapreduce.lib import simplejson\n ex... |
#!/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... | [
[
8,
0,
0.0348,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0391,
0.0014,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
7,
0,
0.0478,
0.0101,
0,
0.66,
... | [
"\"\"\"Key range representation and splitting.\"\"\"",
"import os",
"try:\n import json as simplejson\nexcept ImportError:\n try:\n from mapreduce.lib import simplejson\n except ImportError:\n simplejson = None",
" import json as simplejson",
" try:\n from mapreduce.lib import simplejson\n ex... |
#!/usr/bin/env python
#
# Copyright 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 o... | [] | [] |
#!/usr/bin/env python
"""Implementation of JSONEncoder
"""
import re
try:
from mapreduce.lib.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from mapreduce.lib.simplejson._speedups import make_encoder as c_make_encod... | [
[
8,
0,
0.0058,
0.0046,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0093,
0.0023,
0,
0.66,
0.0667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0174,
0.0093,
0,
0.66... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"try:\n from mapreduce.lib.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii\nexcept ImportError:\n c_encode_basestring_ascii = None",
" from mapreduce.lib.simplejson._speedups import encode_basestring_ascii as... |
#!/usr/bin/env python
"""Implementation of JSONEncoder
"""
import re
try:
from mapreduce.lib.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from mapreduce.lib.simplejson._speedups import make_encoder as c_make_encod... | [
[
8,
0,
0.0058,
0.0046,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0093,
0.0023,
0,
0.66,
0.0667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0174,
0.0093,
0,
0.66... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"try:\n from mapreduce.lib.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii\nexcept ImportError:\n c_encode_basestring_ascii = None",
" from mapreduce.lib.simplejson._speedups import encode_basestring_ascii as... |
#!/usr/bin/env python
r"""A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
simplejson exposes an API familiar to uses of the standard library
marshal and pickle... | [
[
8,
0,
0.1576,
0.3057,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3121,
0.0032,
0,
0.66,
0.1,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3201,
0.0127,
0,
0.66,
... | [
"r\"\"\"A simple, fast, extensible JSON encoder and decoder\n\nJSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\nsimplejson exposes an API familiar to uses of the standard library\nmarshal and pickle module... |
#!/usr/bin/env python
"""JSON token scanner
"""
import re
try:
from mapreduce.lib.simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTI... | [
[
8,
0,
0.0379,
0.0303,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0606,
0.0152,
0,
0.66,
0.1667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0985,
0.0606,
0,
0.66... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"try:\n from mapreduce.lib.simplejson._speedups import make_scanner as c_make_scanner\nexcept ImportError:\n c_make_scanner = None",
" from mapreduce.lib.simplejson._speedups import make_scanner as c_make_scanner",
" c_make_scanner = None",
"__a... |
#!/usr/bin/env python
r"""A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
simplejson exposes an API familiar to uses of the standard library
marshal and pickle... | [
[
8,
0,
0.1576,
0.3057,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3121,
0.0032,
0,
0.66,
0.1,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3201,
0.0127,
0,
0.66,
... | [
"r\"\"\"A simple, fast, extensible JSON encoder and decoder\n\nJSON (JavaScript Object Notation) <http://json.org> is a subset of\nJavaScript syntax (ECMA-262 3rd edition) used as a lightweight data\ninterchange format.\n\nsimplejson exposes an API familiar to uses of the standard library\nmarshal and pickle module... |
#!/usr/bin/env python
"""JSON token scanner
"""
import re
try:
from mapreduce.lib.simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTI... | [
[
8,
0,
0.0379,
0.0303,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0606,
0.0152,
0,
0.66,
0.1667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0985,
0.0606,
0,
0.66... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"try:\n from mapreduce.lib.simplejson._speedups import make_scanner as c_make_scanner\nexcept ImportError:\n c_make_scanner = None",
" from mapreduce.lib.simplejson._speedups import make_scanner as c_make_scanner",
" c_make_scanner = None",
"__a... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.4868,
0.1053,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5789,
0.0263,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.6316,
0.0263,
0,
0.66... | [
"\"\"\"Web request dispatcher for the Google App Engine Pipeline API.\n\nIn a separate file from the core pipeline module to break circular dependencies.\n\"\"\"",
"import logging",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp import util as webapp_util",
"import pipeline",
... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0806,
0.0047,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.09,
0.0047,
0,
0.66,
0.1429,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.0948,
0.0047,
0,
0.66,
... | [
"\"\"\"Datastore models used by the Google App Engine Pipeline API.\"\"\"",
"from google.appengine.ext import db",
"from google.appengine.ext import blobstore",
"from mapreduce.lib import simplejson",
"class _PipelineRecord(db.Model):\n \"\"\"Represents a Pipeline.\n\n Properties:\n class_path: Path of... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.4868,
0.1053,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5789,
0.0263,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.6316,
0.0263,
0,
0.66... | [
"\"\"\"Web request dispatcher for the Google App Engine Pipeline API.\n\nIn a separate file from the core pipeline module to break circular dependencies.\n\"\"\"",
"import logging",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp import util as webapp_util",
"import pipeline",
... |
#!/usr/bin/env python
#
# Copyright 2009 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... | [
[
8,
0,
0.1957,
0.0109,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.25,
0.0109,
0,
0.66,
0.0833,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.2609,
0.0109,
0,
0.66,
... | [
"\"\"\"Test utilities for the Google App Engine Pipeline API.\"\"\"",
"import logging",
"import os",
"import sys",
"import tempfile",
"TEST_APP_ID = 'my-app-id'",
"TEST_VERSION_ID = 'my-version.1234'",
"os.environ['APPLICATION_ID'] = TEST_APP_ID",
"os.environ['CURRENT_VERSION_ID'] = TEST_VERSION_ID"... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.156,
0.0092,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1743,
0.0092,
0,
0.66,
0.2,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.2018,
0.0092,
0,
0.66,
... | [
"\"\"\"Utility functions for use with the Google App Engine Pipeline API.\"\"\"",
"__all__ = [\"for_name\", \"is_generator_function\"]",
"import inspect",
"import logging",
"def for_name(fq_name, recursive=False):\n \"\"\"Find class/function/method specified by its fully qualified name.\n\n Fully qualifie... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.0806,
0.0047,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.09,
0.0047,
0,
0.66,
0.1429,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.0948,
0.0047,
0,
0.66,
... | [
"\"\"\"Datastore models used by the Google App Engine Pipeline API.\"\"\"",
"from google.appengine.ext import db",
"from google.appengine.ext import blobstore",
"from mapreduce.lib import simplejson",
"class _PipelineRecord(db.Model):\n \"\"\"Represents a Pipeline.\n\n Properties:\n class_path: Path of... |
#!/usr/bin/env python
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from mapreduce.lib.simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_ba... | [
[
8,
0,
0.005,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.01,
0.002,
0,
0.66,
0... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"from decimal import Decimal",
"def _import_speedups():\n try:\n from mapreduce.lib.simplejson import _speedups\n return _speedups.encode_basestring_ascii, _speedups.make_encoder\n except ImportError:\n return None, None",
... |
#!/usr/bin/env python
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from mapreduce.lib.simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_ba... | [
[
8,
0,
0.005,
0.004,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.008,
0.002,
0,
0.66,
0.0588,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.01,
0.002,
0,
0.66,
0... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"from decimal import Decimal",
"def _import_speedups():\n try:\n from mapreduce.lib.simplejson import _speedups\n return _speedups.encode_basestring_ascii, _speedups.make_encoder\n except ImportError:\n return None, None",
... |
#!/usr/bin/env python
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 ... | [
[
8,
0,
0.1164,
0.226,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2306,
0.0023,
0,
0.66,
0.0667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2374,
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/env python
"""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:
... | [
[
8,
0,
0.0333,
0.0417,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0583,
0.0083,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
7,
0,
0.1208,
0.0667,
0,
0.66... | [
"\"\"\"Drop-in replacement for collections.OrderedDict by Raymond Hettinger\n\nhttp://code.activestate.com/recipes/576693/\n\n\"\"\"",
"from UserDict import DictMixin",
"try:\n all\nexcept NameError:\n def all(seq):\n for elem in seq:\n if not elem:\n return False\n ... |
#!/usr/bin/env python
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from mapreduce.lib.simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = ... | [
[
8,
0,
0.0321,
0.0256,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0513,
0.0128,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.0962,
0.0769,
0,
0.66... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"def _import_c_make_scanner():\n try:\n from mapreduce.lib.simplejson._speedups import make_scanner\n return make_scanner\n except ImportError:\n return None",
" try:\n from mapreduce.lib.simplejson._speedups import make_sca... |
#!/usr/bin/env python
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 ... | [
[
8,
0,
0.1164,
0.226,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2306,
0.0023,
0,
0.66,
0.0667,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2374,
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/env python
"""JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from mapreduce.lib.simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = ... | [
[
8,
0,
0.0321,
0.0256,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0513,
0.0128,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.0962,
0.0769,
0,
0.66... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"def _import_c_make_scanner():\n try:\n from mapreduce.lib.simplejson._speedups import make_scanner\n return make_scanner\n except ImportError:\n return None",
" try:\n from mapreduce.lib.simplejson._speedups import make_sca... |
#!/usr/bin/env python
"""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:
... | [
[
8,
0,
0.0333,
0.0417,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0583,
0.0083,
0,
0.66,
0.3333,
351,
0,
1,
0,
0,
351,
0,
0
],
[
7,
0,
0.1208,
0.0667,
0,
0.66... | [
"\"\"\"Drop-in replacement for collections.OrderedDict by Raymond Hettinger\n\nhttp://code.activestate.com/recipes/576693/\n\n\"\"\"",
"from UserDict import DictMixin",
"try:\n all\nexcept NameError:\n def all(seq):\n for elem in seq:\n if not elem:\n return False\n ... |
#!/usr/bin/env python
#
# Copyright 2009 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... | [
[
8,
0,
0.1957,
0.0109,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.25,
0.0109,
0,
0.66,
0.0833,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.2609,
0.0109,
0,
0.66,
... | [
"\"\"\"Test utilities for the Google App Engine Pipeline API.\"\"\"",
"import logging",
"import os",
"import sys",
"import tempfile",
"TEST_APP_ID = 'my-app-id'",
"TEST_VERSION_ID = 'my-version.1234'",
"os.environ['APPLICATION_ID'] = TEST_APP_ID",
"os.environ['CURRENT_VERSION_ID'] = TEST_VERSION_ID"... |
#!/usr/bin/env python
#
# Copyright 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 o... | [
[
8,
0,
0.156,
0.0092,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1743,
0.0092,
0,
0.66,
0.2,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.2018,
0.0092,
0,
0.66,
... | [
"\"\"\"Utility functions for use with the Google App Engine Pipeline API.\"\"\"",
"__all__ = [\"for_name\", \"is_generator_function\"]",
"import inspect",
"import logging",
"def for_name(fq_name, recursive=False):\n \"\"\"Find class/function/method specified by its fully qualified name.\n\n Fully qualifie... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.1393,
0.0082,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1557,
0.0082,
0,
0.66,
0.0833,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.1639,
0.0082,
0,
0.66... | [
"\"\"\"Code related to line charts.\"\"\"",
"import copy",
"import warnings",
"from mapreduce.lib.graphy import common",
"class LineStyle(object):\n\n \"\"\"Represents the style for a line on a line chart. Also provides some\n convenient presets.\n\n Object attributes (Passed directly to the Google Char... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.0955,
0.0056,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1067,
0.0056,
0,
0.66,
0.2,
358,
0,
1,
0,
0,
358,
0,
0
],
[
1,
0,
0.118,
0.0056,
0,
0.66,
... | [
"\"\"\"Code for pie charts.\"\"\"",
"import warnings",
"from mapreduce.lib.graphy import common",
"from mapreduce.lib.graphy import util",
"class Segment(common.DataSeries):\n \"\"\"A single segment of the pie chart.\n\n Object attributes:\n size: relative size of the segment\n label: label of the s... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.0994,
0.0058,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1111,
0.0058,
0,
0.66,
0.125,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.117,
0.0058,
0,
0.66,
... | [
"\"\"\"Code related to bar charts.\"\"\"",
"import copy",
"import warnings",
"from mapreduce.lib.graphy import common",
"from mapreduce.lib.graphy import util",
"class BarsStyle(object):\n \"\"\"Style of a series of bars in a BarChart\n\n Object Attributes:\n color: Hex string, like '00ff00' for gre... |
#!/usr/bin/env python
__version__='1.0'
| [
[
14,
0,
1,
0.5,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__='1.0'"
] |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.1224,
0.0729,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.2005,
0.0729,
0,
0.66,
0.2,
545,
0,
1,
0,
0,
0,
0,
2
],
[
8,
1,
0.1771,
0.0156,
1,
0.96,
... | [
"\"\"\"This module contains various formatters which can help format a chart\nobject. To use these, add them to your chart's list of formatters. For\nexample:\n chart.formatters.append(InlineLegend)\n chart.formatters.append(LabelSeparator(right=8))\n\nFeel free to write your own formatter. Formatters are just... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.0413,
0.0024,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0461,
0.0024,
0,
0.66,
0.1,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.0485,
0.0024,
0,
0.66,
... | [
"\"\"\"Code common to all chart types.\"\"\"",
"import copy",
"import warnings",
"from mapreduce.lib.graphy import formatters",
"from mapreduce.lib.graphy import util",
"class Marker(object):\n\n \"\"\"Represents an abstract marker, without position. You can attach these to\n a DataSeries.\n\n Object ... |
#!/usr/bin/env python
def _IsColor(color):
"""Try to determine if color is a hex color string.
Labels that look like hex colors will match too, unfortunately."""
if not isinstance(color, basestring):
return False
color = color.strip('#')
if len(color) != 3 and len(color) != 6:
return False
hex_let... | [
[
2,
0,
0.5714,
0.9286,
0,
0.66,
0,
459,
0,
1,
1,
0,
0,
0,
4
],
[
8,
1,
0.25,
0.1429,
1,
0.1,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
4,
1,
0.3929,
0.1429,
1,
0.1,
0.166... | [
"def _IsColor(color):\n \"\"\"Try to determine if color is a hex color string. \n Labels that look like hex colors will match too, unfortunately.\"\"\"\n if not isinstance(color, basestring):\n return False\n color = color.strip('#')\n if len(color) != 3 and len(color) != 6:\n return False",
" \"\"\"... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.1393,
0.0082,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1557,
0.0082,
0,
0.66,
0.0833,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.1639,
0.0082,
0,
0.66... | [
"\"\"\"Code related to line charts.\"\"\"",
"import copy",
"import warnings",
"from mapreduce.lib.graphy import common",
"class LineStyle(object):\n\n \"\"\"Represents the style for a line on a line chart. Also provides some\n convenient presets.\n\n Object attributes (Passed directly to the Google Char... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.1224,
0.0729,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.2005,
0.0729,
0,
0.66,
0.2,
545,
0,
1,
0,
0,
0,
0,
2
],
[
8,
1,
0.1771,
0.0156,
1,
0.65,
... | [
"\"\"\"This module contains various formatters which can help format a chart\nobject. To use these, add them to your chart's list of formatters. For\nexample:\n chart.formatters.append(InlineLegend)\n chart.formatters.append(LabelSeparator(right=8))\n\nFeel free to write your own formatter. Formatters are just... |
#!/usr/bin/env python
def _IsColor(color):
"""Try to determine if color is a hex color string.
Labels that look like hex colors will match too, unfortunately."""
if not isinstance(color, basestring):
return False
color = color.strip('#')
if len(color) != 3 and len(color) != 6:
return False
hex_let... | [
[
2,
0,
0.5714,
0.9286,
0,
0.66,
0,
459,
0,
1,
1,
0,
0,
0,
4
],
[
8,
1,
0.25,
0.1429,
1,
0.11,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
4,
1,
0.3929,
0.1429,
1,
0.11,
0.1... | [
"def _IsColor(color):\n \"\"\"Try to determine if color is a hex color string. \n Labels that look like hex colors will match too, unfortunately.\"\"\"\n if not isinstance(color, basestring):\n return False\n color = color.strip('#')\n if len(color) != 3 and len(color) != 6:\n return False",
" \"\"\"... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.0994,
0.0058,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1111,
0.0058,
0,
0.66,
0.125,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.117,
0.0058,
0,
0.66,
... | [
"\"\"\"Code related to bar charts.\"\"\"",
"import copy",
"import warnings",
"from mapreduce.lib.graphy import common",
"from mapreduce.lib.graphy import util",
"class BarsStyle(object):\n \"\"\"Style of a series of bars in a BarChart\n\n Object Attributes:\n color: Hex string, like '00ff00' for gre... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.0413,
0.0024,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0461,
0.0024,
0,
0.66,
0.1,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.0485,
0.0024,
0,
0.66,
... | [
"\"\"\"Code common to all chart types.\"\"\"",
"import copy",
"import warnings",
"from mapreduce.lib.graphy import formatters",
"from mapreduce.lib.graphy import util",
"class Marker(object):\n\n \"\"\"Represents an abstract marker, without position. You can attach these to\n a DataSeries.\n\n Object ... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.0955,
0.0056,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1067,
0.0056,
0,
0.66,
0.2,
358,
0,
1,
0,
0,
358,
0,
0
],
[
1,
0,
0.118,
0.0056,
0,
0.66,
... | [
"\"\"\"Code for pie charts.\"\"\"",
"import warnings",
"from mapreduce.lib.graphy import common",
"from mapreduce.lib.graphy import util",
"class Segment(common.DataSeries):\n \"\"\"A single segment of the pie chart.\n\n Object attributes:\n size: relative size of the segment\n label: label of the s... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.34,
0.02,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.38,
0.02,
0,
0.66,
0.1111,
380,
0,
1,
0,
0,
380,
0,
0
],
[
1,
0,
0.4,
0.02,
0,
0.66,
0.2222,... | [
"\"\"\"Backend which can generate charts using the Google Chart API.\"\"\"",
"from mapreduce.lib.graphy import line_chart",
"from mapreduce.lib.graphy import bar_chart",
"from mapreduce.lib.graphy import pie_chart",
"from mapreduce.lib.graphy.backends.google_chart_api import encoders",
"def _GetChartFacto... |
#!/usr/bin/env python
#
# Copyright 2008 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 ... | [
[
8,
0,
0.0419,
0.007,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0488,
0.0023,
0,
0.66,
0.1429,
358,
0,
1,
0,
0,
358,
0,
0
],
[
1,
0,
0.0512,
0.0023,
0,
0.66,... | [
"\"\"\"Display objects for the different kinds of charts.\n\nNot intended for end users, use the methods in __init__ instead.\"\"\"",
"import warnings",
"from mapreduce.lib.graphy.backends.google_chart_api import util",
"class BaseChartEncoder(object):\n\n \"\"\"Base class for encoders which turn chart objec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.