code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from google.appengine.ext import webapp
from notifiy import constants
class Home(webapp.RequestHandler):
def get(self):
self.redirect(constants.ROBOT_HOME_PAGE)
| [
[
1,
0,
0.3636,
0.0909,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.5455,
0.0909,
0,
0.66,
0.5,
36,
0,
1,
0,
0,
36,
0,
0
],
[
3,
0,
0.9091,
0.2727,
0,
0.66,... | [
"from google.appengine.ext import webapp",
"from notifiy import constants",
"class Home(webapp.RequestHandler):\n def get(self):\n self.redirect(constants.ROBOT_HOME_PAGE)",
" def get(self):\n self.redirect(constants.ROBOT_HOME_PAGE)",
" self.redirect(constants.ROBOT_HOME_PAGE)"
] |
# -*- coding: UTF-8 -*-
import base64
import urllib
def get_url(participant, wave_id):
domain = participant.split('@')[1]
if wave_id:
wave_id = urllib.quote(urllib.quote(wave_id))
if wave_id and domain == 'googlewave.com':
return 'https://wave.google.com/wave/#restored:wave:%s' % wave_id... | [
[
1,
0,
0.0411,
0.0137,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0548,
0.0137,
0,
0.66,
0.1429,
614,
0,
1,
0,
0,
614,
0,
0
],
[
2,
0,
0.1644,
0.1507,
0,
... | [
"import base64",
"import urllib",
"def get_url(participant, wave_id):\n domain = participant.split('@')[1]\n if wave_id:\n wave_id = urllib.quote(urllib.quote(wave_id))\n\n if wave_id and domain == 'googlewave.com':\n return 'https://wave.google.com/wave/#restored:wave:%s' % wave_id\n ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import urllib
import datetime
from google.appengine.ext import webapp
from google.appengine.ext import deferred
from waveapi import simplejson
from notifiy import model
from notifiy import general
from notifiy import preferences
from notifiy.robot import create_robot
... | [
[
1,
0,
0.0381,
0.0095,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0476,
0.0095,
0,
0.66,
0.1,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0667,
0.0095,
0,
0.6... | [
"import urllib",
"import datetime",
"from google.appengine.ext import webapp",
"from google.appengine.ext import deferred",
"from waveapi import simplejson",
"from notifiy import model",
"from notifiy import general",
"from notifiy import preferences",
"from notifiy.robot import create_robot",
"cl... |
# -*- coding: UTF-8 -*-
ME = 'cesar.izurieta@googlewave.com'
ROBOT_NAME = 'notifiy'
ROBOT_ID = 'wave-email-notifications'
ROBOT_ADDRESS = '%s@appspot.com' % ROBOT_ID
ROBOT_BASE_URL = 'http://%s.appspot.com' % ROBOT_ID
ROBOT_EMAIL = '%s@ecuarock.net' % ROBOT_ID
ROBOT_HOME_PAGE = 'http://%s.googlecode.com' % ROBOT_ID
R... | [
[
14,
0,
0.1765,
0.0588,
0,
0.66,
0,
917,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0.1111,
987,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3529,
0.0588,
0,
0... | [
"ME = 'cesar.izurieta@googlewave.com'",
"ROBOT_NAME = 'notifiy'",
"ROBOT_ID = 'wave-email-notifications'",
"ROBOT_ADDRESS = '%s@appspot.com' % ROBOT_ID",
"ROBOT_BASE_URL = 'http://%s.appspot.com' % ROBOT_ID",
"ROBOT_EMAIL = '%s@ecuarock.net' % ROBOT_ID",
"ROBOT_HOME_PAGE = 'http://%s.googlecode.com' % R... |
# -*- coding: UTF-8 -*-
import logging
from waveapi import appengine_robot_runner
from waveapi import events
from waveapi.robot import Robot
from notifiy import constants
from notifiy import model
from notifiy import notifications
from notifiy import preferences
from notifiy import templates
from notifiy import gene... | [
[
1,
0,
0.0234,
0.0078,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0391,
0.0078,
0,
0.66,
0.0588,
326,
0,
1,
0,
0,
326,
0,
0
],
[
1,
0,
0.0469,
0.0078,
0,
... | [
"import logging",
"from waveapi import appengine_robot_runner",
"from waveapi import events",
"from waveapi.robot import Robot",
"from notifiy import constants",
"from notifiy import model",
"from notifiy import notifications",
"from notifiy import preferences",
"from notifiy import templates",
"f... |
# -*- coding: UTF-8 -*-
import logging
from waveapi.element import Gadget
from notifiy import constants
from notifiy import model
from notifiy import preferences
GADGET_URL = '%s/%s.xml' % (constants.ROBOT_BASE_URL, constants.ROBOT_ID)
def is_gadget_present(wavelet):
return bool(wavelet.root_blip.first(Gadget... | [
[
1,
0,
0.0789,
0.0263,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1316,
0.0263,
0,
0.66,
0.1111,
665,
0,
1,
0,
0,
665,
0,
0
],
[
1,
0,
0.1842,
0.0263,
0,
... | [
"import logging",
"from waveapi.element import Gadget",
"from notifiy import constants",
"from notifiy import model",
"from notifiy import preferences",
"GADGET_URL = '%s/%s.xml' % (constants.ROBOT_BASE_URL, constants.ROBOT_ID)",
"def is_gadget_present(wavelet):\n return bool(wavelet.root_blip.first(... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import random
from google.appengine.ext import db
# TODO from google.appengine.api import memcache
from migrationmodel import MigratingModel, get_by_pk
NOTIFY_NONE = 0
NOTIFY_ONCE = 1
NOTIFY_ALL = 2
NOTIFY_TYPE_COUNT = 3
class Phone(MigratingModel):
migration_ver... | [
[
1,
0,
0.0303,
0.0076,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0455,
0.0076,
0,
0.66,
0.0833,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.0682,
0.0076,
0,
... | [
"import random",
"from google.appengine.ext import db",
"from migrationmodel import MigratingModel, get_by_pk",
"NOTIFY_NONE = 0",
"NOTIFY_ONCE = 1",
"NOTIFY_ALL = 2",
"NOTIFY_TYPE_COUNT = 3",
"class Phone(MigratingModel):\n migration_version = 1\n\n phone_type = db.StringProperty(required=True)... |
# -*- coding: UTF-8 -*-
import logging
from waveapi import element
from notifiy import constants
from notifiy import model
from notifiy import templates
PARTICIPANT_DATA_DOC = '%s/participant' % constants.ROBOT_ADDRESS
VERSION_DATA_DOC = '%s/preferencesVersion' % constants.ROBOT_ADDRESS
PREFERENCES_VERSION = '14'
... | [
[
1,
0,
0.0165,
0.0055,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0275,
0.0055,
0,
0.66,
0.0625,
326,
0,
1,
0,
0,
326,
0,
0
],
[
1,
0,
0.0385,
0.0055,
0,
... | [
"import logging",
"from waveapi import element",
"from notifiy import constants",
"from notifiy import model",
"from notifiy import templates",
"PARTICIPANT_DATA_DOC = '%s/participant' % constants.ROBOT_ADDRESS",
"VERSION_DATA_DOC = '%s/preferencesVersion' % constants.ROBOT_ADDRESS",
"PREFERENCES_VERS... |
# -*- coding: UTF-8 -*-
###################################################
# General mail template
###################################################
MESSAGE_TEMPLATE = u'''\
%s
---
Reply to this message to add a blip to the wave
Visit this wave: %s
Change global notification preferences: %s
To unsubscribe please ... | [
[
14,
0,
0.1341,
0.1098,
0,
0.66,
0,
755,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2317,
0.061,
0,
0.66,
0.0667,
373,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3293,
0.0122,
0,
0.... | [
"MESSAGE_TEMPLATE = u'''\\\n%s\n\n---\nReply to this message to add a blip to the wave\nVisit this wave: %s\nChange global notification preferences: %s\nTo unsubscribe please visit your preferences or send an email to: %s",
"NOTIFY_ONCE_TEMPLATE = u'''\\\n%s\n\n[NOTE: you will not recive further messages until yo... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0791,
0.0047,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.093,
0.0047,
0,
0.66,
0.1667,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0977,
0.0047,
0,
0.66,... | [
"\"\"\"Unit tests for the element module.\"\"\"",
"import base64",
"import unittest",
"import element",
"import util",
"class TestElement(unittest.TestCase):\n \"\"\"Tests for the element.Element class.\"\"\"\n\n def testProperties(self):\n el = element.Element(element.Gadget.class_type,\n ... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.1172,
0.0069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1379,
0.0069,
0,
0.66,
0.1667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1586,
0.0069,
0,
0.66,... | [
"\"\"\"Unit tests for the util module.\"\"\"",
"__author__ = 'davidbyttow@google.com (David Byttow)'",
"import unittest",
"import ops",
"import util",
"class TestUtils(unittest.TestCase):\n \"\"\"Tests utility functions.\"\"\"\n\n def testIsIterable(self):\n self.assertTrue(util.is_iterable([]))\n ... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
1,
0,
0.0191,
0.0011,
0,
0.66,
0,
736,
0,
1,
0,
0,
736,
0,
0
],
[
1,
0,
0.0202,
0.0011,
0,
0.66,
0.1429,
841,
0,
1,
0,
0,
841,
0,
0
],
[
1,
0,
0.0225,
0.0011,
0,
... | [
"import element",
"import errors",
"import util",
"class Annotation(object):\n \"\"\"Models an annotation on a document.\n\n Annotations are key/value pairs over a range of content. Annotations\n can be used to store data or to be interpreted by a client when displaying\n the data.\n \"\"\"",
" \"\"\"... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0651,
0.0038,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0728,
0.0038,
0,
0.66,
0.0714,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0805,
0.0038,
0,
0.66,
... | [
"\"\"\"Unit tests for the robot module.\"\"\"",
"import unittest",
"import events",
"import ops",
"import robot",
"import simplejson",
"BLIP_JSON = ('{\"wdykLROk*13\":'\n '{\"lastModifiedTime\":1242079608457,'\n '\"contributors\":[\"someguy@test.com\"],'\n '\"wa... |
#!/usr/bin/python2.4
#
# Copyright 2009 Google Inc. All Rights Reserved.
"""Run robot from the commandline for testing.
This robot_runner let's you define event handlers using flags and takes the
json input from the std in and writes out the json output to stdout.
for example
cat events | commandline_robot_runner.... | [
[
8,
0,
0.1304,
0.1304,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2174,
0.0145,
0,
0.66,
0.0526,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2464,
0.0145,
0,
0.66,... | [
"\"\"\"Run robot from the commandline for testing.\n\nThis robot_runner let's you define event handlers using flags and takes the\njson input from the std in and writes out the json output to stdout.\n\nfor example\n cat events | commandline_robot_runner.py \\\n --eventdef-blip_submitted=\"wavelet.title='titl... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0651,
0.0038,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0728,
0.0038,
0,
0.66,
0.0714,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0805,
0.0038,
0,
0.66,
... | [
"\"\"\"Unit tests for the robot module.\"\"\"",
"import unittest",
"import events",
"import ops",
"import robot",
"import simplejson",
"BLIP_JSON = ('{\"wdykLROk*13\":'\n '{\"lastModifiedTime\":1242079608457,'\n '\"contributors\":[\"someguy@test.com\"],'\n '\"wa... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.096,
0.0056,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.113,
0.0056,
0,
0.66,
0.0909,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.1243,
0.0056,
0,
0.66,
... | [
"\"\"\"Unit tests for the wavelet module.\"\"\"",
"import unittest",
"import blip",
"import element",
"import ops",
"import wavelet",
"import simplejson",
"ROBOT_NAME = 'robot@appspot.com'",
"TEST_WAVELET_DATA = {\n 'creator': ROBOT_NAME,\n 'creationTime': 100,\n 'lastModifiedTime': 101,\n ... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.76,
0.2,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.98,
0.08,
0,
0.66,
1,
529,
0,
0,
0,
0,
645,
0,
0
],
[
8,
1,
1,
0.04,
1,
0.97,
0,
0,
1... | [
"\"\"\"Contains various API-specific exception classes.\n\nThis module contains various specific exception classes that are raised by\nthe library back to the client.\n\"\"\"",
"class Error(Exception):\n \"\"\"Base library error type.\"\"\"",
" \"\"\"Base library error type.\"\"\""
] |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0407,
0.0024,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0455,
0.0024,
0,
0.66,
0.1429,
134,
0,
1,
0,
0,
134,
0,
0
],
[
1,
0,
0.0478,
0.0024,
0,
0.66... | [
"\"\"\"Defines classes that are needed to model a wavelet.\"\"\"",
"import blip",
"import errors",
"import util",
"class DataDocs(object):\n \"\"\"Class modeling a bunch of data documents in pythonic way.\"\"\"\n\n def __init__(self, init_docs, wave_id, wavelet_id, operation_queue):\n self._docs = init... |
#!/usr/bin/python2.4
#
# Copyright 2009 Google Inc. All Rights Reserved.
"""Tests for google3.walkabout.externalagents.api.commandline_robot_runner."""
__author__ = 'douwe@google.com (Douwe Osinga)'
import StringIO
from google3.pyglib import app
from google3.pyglib import flags
from google3.testing.pybase import g... | [
[
8,
0,
0.0658,
0.0132,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0921,
0.0132,
0,
0.66,
0.0667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1184,
0.0132,
0,
0.66,... | [
"\"\"\"Tests for google3.walkabout.externalagents.api.commandline_robot_runner.\"\"\"",
"__author__ = 'douwe@google.com (Douwe Osinga)'",
"import StringIO",
"from google3.pyglib import app",
"from google3.pyglib import flags",
"from google3.testing.pybase import googletest",
"from google3.walkabout.exte... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.3864,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4545,
0.0227,
0,
0.66,
0.1111,
740,
0,
1,
0,
0,
740,
0,
0
],
[
1,
0,
0.4773,
0.0227,
0,
0.66... | [
"\"\"\"Script to run all unit tests in this package.\"\"\"",
"import blip_test",
"import element_test",
"import module_test_runner",
"import ops_test",
"import robot_test",
"import util_test",
"import wavelet_test",
"def RunUnitTests():\n \"\"\"Runs all registered unit tests.\"\"\"\n test_runner =... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.1172,
0.0069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1379,
0.0069,
0,
0.66,
0.1667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1586,
0.0069,
0,
0.66,... | [
"\"\"\"Unit tests for the util module.\"\"\"",
"__author__ = 'davidbyttow@google.com (David Byttow)'",
"import unittest",
"import ops",
"import util",
"class TestUtils(unittest.TestCase):\n \"\"\"Tests utility functions.\"\"\"\n\n def testIsIterable(self):\n self.assertTrue(util.is_iterable([]))\n ... |
#!/usr/bin/python2.4
#
# Copyright 2009 Google Inc. All Rights Reserved.
"""Run robot from the commandline for testing.
This robot_runner let's you define event handlers using flags and takes the
json input from the std in and writes out the json output to stdout.
for example
cat events | commandline_robot_runner.... | [
[
8,
0,
0.1304,
0.1304,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2174,
0.0145,
0,
0.66,
0.0526,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2464,
0.0145,
0,
0.66,... | [
"\"\"\"Run robot from the commandline for testing.\n\nThis robot_runner let's you define event handlers using flags and takes the\njson input from the std in and writes out the json output to stdout.\n\nfor example\n cat events | commandline_robot_runner.py \\\n --eventdef-blip_submitted=\"wavelet.title='titl... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0453,
0.0119,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0549,
0.0024,
0,
0.66,
0.0476,
841,
0,
1,
0,
0,
841,
0,
0
],
[
1,
0,
0.0573,
0.0024,
0,
0.66... | [
"\"\"\"Support for operations that can be applied to the server.\n\nContains classes and utilities for creating operations that are to be\napplied on the server.\n\"\"\"",
"import errors",
"import random",
"import util",
"import sys",
"PROTOCOL_VERSION = '0.21'",
"WAVELET_APPEND_BLIP = 'wavelet.appendBl... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0846,
0.005,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0995,
0.005,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1045,
0.005,
0,
0.66,
... | [
"\"\"\"A module to run wave robots on app engine.\"\"\"",
"import logging",
"import sys",
"import events",
"from google.appengine.api import urlfetch",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"class CapabilitiesHandler(webapp.RequestHandl... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.2537,
0.0149,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2985,
0.0149,
0,
0.66,
0.2,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.3284,
0.0149,
0,
0.66,
... | [
"\"\"\"Unit tests for the ops module.\"\"\"",
"import unittest",
"import ops",
"class TestOperation(unittest.TestCase):\n \"\"\"Test case for Operation class.\"\"\"\n\n def testFields(self):\n op = ops.Operation(ops.WAVELET_SET_TITLE, 'opid02',\n {'waveId': 'wavelet-id',\n ... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.1069,
0.0063,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1195,
0.0063,
0,
0.66,
0.0714,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.1321,
0.0063,
0,
0.6... | [
"\"\"\"Utility library containing various helpers used by the API.\"\"\"",
"import re",
"CUSTOM_SERIALIZE_METHOD_NAME = 'serialize'",
"MARKUP_RE = re.compile(r'<([^>]*?)>')",
"def force_unicode(object):\n \"\"\" Return the Unicode string version of object, with UTF-8 encoding. \"\"\"\n if isinstance(objec... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
1,
0.0588,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"\"\"\"Declares the api package.\"\"\""
] |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0455,
0.0027,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0535,
0.0027,
0,
0.66,
0.1,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0588,
0.0027,
0,
0.66,
... | [
"\"\"\"Unit tests for the blip module.\"\"\"",
"import unittest",
"import blip",
"import element",
"import ops",
"import simplejson",
"TEST_BLIP_DATA = {\n 'childBlipIds': [],\n 'content': '\\nhello world!\\nanother line',\n 'contributors': ['robot@test.com', 'user@test.com'],\n 'creator': '... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.425,
0.025,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5,
0.025,
0,
0.66,
0.5,
88,
0,
1,
0,
0,
88,
0,
0
],
[
3,
0,
0.7875,
0.45,
0,
0.66,
1,
... | [
"\"\"\"Module defines the ModuleTestRunnerClass.\"\"\"",
"import unittest",
"class ModuleTestRunner(object):\n \"\"\"Responsible for executing all test cases in a list of modules.\"\"\"\n\n def __init__(self, module_list=None, module_test_settings=None):\n self.modules = module_list or []\n self.setting... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0648,
0.0199,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.1063,
0.0498,
0,
0.66,
0.05,
560,
0,
0,
0,
0,
186,
0,
0
],
[
8,
1,
0.0864,
0.0033,
1,
0.64,
... | [
"\"\"\"Defines event types that are sent from the wave server.\n\nThis module defines all of the event types currently supported by the wave\nserver. Each event type is sub classed from Event and has its own\nproperties depending on the type.\n\"\"\"",
"class Context(object):\n \"\"\"Specifies constants represen... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
1,
0,
0.0191,
0.0011,
0,
0.66,
0,
736,
0,
1,
0,
0,
736,
0,
0
],
[
1,
0,
0.0202,
0.0011,
0,
0.66,
0.1429,
841,
0,
1,
0,
0,
841,
0,
0
],
[
1,
0,
0.0225,
0.0011,
0,
... | [
"import element",
"import errors",
"import util",
"class Annotation(object):\n \"\"\"Models an annotation on a document.\n\n Annotations are key/value pairs over a range of content. Annotations\n can be used to store data or to be interpreted by a client when displaying\n the data.\n \"\"\"",
" \"\"\"... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0504,
0.0109,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0627,
0.0027,
0,
0.66,
0.05,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0654,
0.0027,
0,
0.66,
... | [
"\"\"\"Elements are non-text bits living in blips like images, gadgets etc.\n\nThis module defines the Element class and the derived classes.\n\"\"\"",
"import base64",
"import logging",
"import sys",
"import util",
"class Element(object):\n \"\"\"Elements are non-text content within a document.\n\n The... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0791,
0.0047,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.093,
0.0047,
0,
0.66,
0.1667,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0977,
0.0047,
0,
0.66,... | [
"\"\"\"Unit tests for the element module.\"\"\"",
"import base64",
"import unittest",
"import element",
"import util",
"class TestElement(unittest.TestCase):\n \"\"\"Tests for the element.Element class.\"\"\"\n\n def testProperties(self):\n el = element.Element(element.Gadget.class_type,\n ... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0407,
0.0024,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0455,
0.0024,
0,
0.66,
0.1429,
134,
0,
1,
0,
0,
134,
0,
0
],
[
1,
0,
0.0478,
0.0024,
0,
0.66... | [
"\"\"\"Defines classes that are needed to model a wavelet.\"\"\"",
"import blip",
"import errors",
"import util",
"class DataDocs(object):\n \"\"\"Class modeling a bunch of data documents in pythonic way.\"\"\"\n\n def __init__(self, init_docs, wave_id, wavelet_id, operation_queue):\n self._docs = init... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0504,
0.0109,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0627,
0.0027,
0,
0.66,
0.05,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0654,
0.0027,
0,
0.66,
... | [
"\"\"\"Elements are non-text bits living in blips like images, gadgets etc.\n\nThis module defines the Element class and the derived classes.\n\"\"\"",
"import base64",
"import logging",
"import sys",
"import util",
"class Element(object):\n \"\"\"Elements are non-text content within a document.\n\n The... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.3864,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4545,
0.0227,
0,
0.66,
0.1111,
740,
0,
1,
0,
0,
740,
0,
0
],
[
1,
0,
0.4773,
0.0227,
0,
0.66... | [
"\"\"\"Script to run all unit tests in this package.\"\"\"",
"import blip_test",
"import element_test",
"import module_test_runner",
"import ops_test",
"import robot_test",
"import util_test",
"import wavelet_test",
"def RunUnitTests():\n \"\"\"Runs all registered unit tests.\"\"\"\n test_runner =... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0846,
0.005,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0995,
0.005,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1045,
0.005,
0,
0.66,
... | [
"\"\"\"A module to run wave robots on app engine.\"\"\"",
"import logging",
"import sys",
"import events",
"from google.appengine.api import urlfetch",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"class CapabilitiesHandler(webapp.RequestHandl... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.0455,
0.0027,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0535,
0.0027,
0,
0.66,
0.1,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0588,
0.0027,
0,
0.66,
... | [
"\"\"\"Unit tests for the blip module.\"\"\"",
"import unittest",
"import blip",
"import element",
"import ops",
"import simplejson",
"TEST_BLIP_DATA = {\n 'childBlipIds': [],\n 'content': '\\nhello world!\\nanother line',\n 'contributors': ['robot@test.com', 'user@test.com'],\n 'creator': '... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0453,
0.0119,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0549,
0.0024,
0,
0.66,
0.0476,
841,
0,
1,
0,
0,
841,
0,
0
],
[
1,
0,
0.0573,
0.0024,
0,
0.66... | [
"\"\"\"Support for operations that can be applied to the server.\n\nContains classes and utilities for creating operations that are to be\napplied on the server.\n\"\"\"",
"import errors",
"import random",
"import util",
"import sys",
"PROTOCOL_VERSION = '0.21'",
"WAVELET_APPEND_BLIP = 'wavelet.appendBl... |
#!/usr/bin/python2.4
#
# Copyright 2009 Google Inc. All Rights Reserved.
"""Tests for google3.walkabout.externalagents.api.commandline_robot_runner."""
__author__ = 'douwe@google.com (Douwe Osinga)'
import StringIO
from google3.pyglib import app
from google3.pyglib import flags
from google3.testing.pybase import g... | [
[
8,
0,
0.0658,
0.0132,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0921,
0.0132,
0,
0.66,
0.0667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1184,
0.0132,
0,
0.66,... | [
"\"\"\"Tests for google3.walkabout.externalagents.api.commandline_robot_runner.\"\"\"",
"__author__ = 'douwe@google.com (Douwe Osinga)'",
"import StringIO",
"from google3.pyglib import app",
"from google3.pyglib import flags",
"from google3.testing.pybase import googletest",
"from google3.walkabout.exte... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.2537,
0.0149,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2985,
0.0149,
0,
0.66,
0.2,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.3284,
0.0149,
0,
0.66,
... | [
"\"\"\"Unit tests for the ops module.\"\"\"",
"import unittest",
"import ops",
"class TestOperation(unittest.TestCase):\n \"\"\"Test case for Operation class.\"\"\"\n\n def testFields(self):\n op = ops.Operation(ops.WAVELET_SET_TITLE, 'opid02',\n {'waveId': 'wavelet-id',\n ... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.1069,
0.0063,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1195,
0.0063,
0,
0.66,
0.0714,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.1321,
0.0063,
0,
0.6... | [
"\"\"\"Utility library containing various helpers used by the API.\"\"\"",
"import re",
"CUSTOM_SERIALIZE_METHOD_NAME = 'serialize'",
"MARKUP_RE = re.compile(r'<([^>]*?)>')",
"def force_unicode(object):\n \"\"\" Return the Unicode string version of object, with UTF-8 encoding. \"\"\"\n if isinstance(objec... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.425,
0.025,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5,
0.025,
0,
0.66,
0.5,
88,
0,
1,
0,
0,
88,
0,
0
],
[
3,
0,
0.7875,
0.45,
0,
0.66,
1,
... | [
"\"\"\"Module defines the ModuleTestRunnerClass.\"\"\"",
"import unittest",
"class ModuleTestRunner(object):\n \"\"\"Responsible for executing all test cases in a list of modules.\"\"\"\n\n def __init__(self, module_list=None, module_test_settings=None):\n self.modules = module_list or []\n self.setting... |
import simplejson
import cgi
class JSONFilter(object):
def __init__(self, app, mime_type='text/x-json'):
self.app = app
self.mime_type = mime_type
def __call__(self, environ, start_response):
# Read JSON POST input to jsonfilter.json if matching mime type
response = {'status': ... | [
[
1,
0,
0.025,
0.025,
0,
0.66,
0,
386,
0,
1,
0,
0,
386,
0,
0
],
[
1,
0,
0.05,
0.025,
0,
0.66,
0.3333,
934,
0,
1,
0,
0,
934,
0,
0
],
[
3,
0,
0.5125,
0.85,
0,
0.66,
... | [
"import simplejson",
"import cgi",
"class JSONFilter(object):\n def __init__(self, app, mime_type='text/x-json'):\n self.app = app\n self.mime_type = mime_type\n\n def __call__(self, environ, start_response):\n # Read JSON POST input to jsonfilter.json if matching mime type\n r... |
"""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
try:
from 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.MULTILINE | re.DOTALL))
def py_make_scan... | [
[
8,
0,
0.0224,
0.0299,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0448,
0.0149,
0,
0.66,
0.1667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0821,
0.0597,
0,
0.66... | [
"\"\"\"JSON token scanner\n\"\"\"",
"import re",
"try:\n from simplejson._speedups import make_scanner as c_make_scanner\nexcept ImportError:\n c_make_scanner = None",
" from simplejson._speedups import make_scanner as c_make_scanner",
" c_make_scanner = None",
"__all__ = ['make_scanner']",
... |
"""Implementation of JSONEncoder
"""
import re
try:
from _speedups import encode_basestring_ascii as \
c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from _speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
from decoder... | [
[
8,
0,
0.0033,
0.0044,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0066,
0.0022,
0,
0.66,
0.0667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.0154,
0.011,
0,
0.66,... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"try:\n from _speedups import encode_basestring_ascii as \\\n c_encode_basestring_ascii\nexcept ImportError:\n c_encode_basestring_ascii = None",
" from _speedups import encode_basestring_ascii as \\\n c_encode_basestring_ascii... |
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.1232,
0.2438,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2463,
0.0025,
0,
0.66,
0.0769,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2537,
0.0123,
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... |
import cgi
import urllib
import time
import random
import urlparse
import hmac
import base64
VERSION = '1.0' # Hi Blaine!
HTTP_METHOD = 'GET'
SIGNATURE_METHOD = 'PLAINTEXT'
# Generic exception class
class OAuthError(RuntimeError):
def __init__(self, message='OAuth error occured.'):
self.message = message
... | [
[
1,
0,
0.0019,
0.0019,
0,
0.66,
0,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0038,
0.0019,
0,
0.66,
0.0435,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0057,
0.0019,
0,
... | [
"import cgi",
"import urllib",
"import time",
"import random",
"import urlparse",
"import hmac",
"import base64",
"VERSION = '1.0' # Hi Blaine!",
"HTTP_METHOD = 'GET'",
"SIGNATURE_METHOD = 'PLAINTEXT'",
"class OAuthError(RuntimeError):\n def __init__(self, message='OAuth error occured.'):\n ... |
#!/usr/bin/python2.4
#
# Copyright (C) 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 l... | [
[
8,
0,
0.096,
0.0056,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.113,
0.0056,
0,
0.66,
0.0909,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.1243,
0.0056,
0,
0.66,
... | [
"\"\"\"Unit tests for the wavelet module.\"\"\"",
"import unittest",
"import blip",
"import element",
"import ops",
"import wavelet",
"import simplejson",
"ROBOT_NAME = 'robot@appspot.com'",
"TEST_WAVELET_DATA = {\n 'creator': ROBOT_NAME,\n 'creationTime': 100,\n 'lastModifiedTime': 101,\n ... |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
1,
0.0588,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
]
] | [
"\"\"\"Declares the api package.\"\"\""
] |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.76,
0.2,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.98,
0.08,
0,
0.66,
1,
529,
0,
0,
0,
0,
645,
0,
0
],
[
8,
1,
1,
0.04,
1,
0.64,
0,
0,
1... | [
"\"\"\"Contains various API-specific exception classes.\n\nThis module contains various specific exception classes that are raised by\nthe library back to the client.\n\"\"\"",
"class Error(Exception):\n \"\"\"Base library error type.\"\"\"",
" \"\"\"Base library error type.\"\"\""
] |
#!/usr/bin/python
#
# Copyright (C) 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 ... | [
[
8,
0,
0.0648,
0.0199,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.1063,
0.0498,
0,
0.66,
0.05,
560,
0,
0,
0,
0,
186,
0,
0
],
[
8,
1,
0.0864,
0.0033,
1,
0.31,
... | [
"\"\"\"Defines event types that are sent from the wave server.\n\nThis module defines all of the event types currently supported by the wave\nserver. Each event type is sub classed from Event and has its own\nproperties depending on the type.\n\"\"\"",
"class Context(object):\n \"\"\"Specifies constants represen... |
#! /usr/bin/python
# -*- coding: UTF-8 -*-
from notifiy.robot import create_robot
if __name__ == '__main__':
create_robot()
| [
[
1,
0,
0.5,
0.125,
0,
0.66,
0,
413,
0,
1,
0,
0,
413,
0,
0
],
[
4,
0,
0.9375,
0.25,
0,
0.66,
1,
0,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
1,
0.125,
1,
0.83,
0,
641,... | [
"from notifiy.robot import create_robot",
"if __name__ == '__main__':\n create_robot()",
" create_robot()"
] |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from notifiy.home import Home
from notifiy.proc import Process
from notifiy.proc_phone import PhoneProcess
from notifiy.receive_email import ReceiveEmail
if __name__ == "__... | [
[
1,
0,
0.2353,
0.0588,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.2941,
0.0588,
0,
0.66,
0.1667,
327,
0,
1,
0,
0,
327,
0,
0
],
[
1,
0,
0.4118,
0.0588,
0,
... | [
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from notifiy.home import Home",
"from notifiy.proc import Process",
"from notifiy.proc_phone import PhoneProcess",
"from notifiy.receive_email import ReceiveEmail",
"if __name__ == \"__main__\":\n ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class Index(webapp.RequestHandler):
def get(self):
self.redirect('%s/index.html' % self.request.path)
if __name__ == "__main__":
run_wsgi_app(webapp.WSGIA... | [
[
1,
0,
0.25,
0.0625,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.3125,
0.0625,
0,
0.66,
0.3333,
327,
0,
1,
0,
0,
327,
0,
0
],
[
3,
0,
0.5938,
0.25,
0,
0.66... | [
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"class Index(webapp.RequestHandler):\n\n def get(self):\n self.redirect('%s/index.html' % self.request.path)",
" def get(self):\n self.redirect('%s/index.html' % self.request.path)",
"... |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | [
[
8,
0,
0.0319,
0.0532,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0745,
0.0106,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0851,
0.0106,
0,
0.66... | [
"'''\nModule which brings history information about files from Mercurial.\n\n@author: Rodrigo Damazio\n'''",
"import re",
"import subprocess",
"REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')",
"def _GetOutputLines(args):\n '''\n Runs an external process and returns its output as a list of lines... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | [
[
8,
0,
0.0417,
0.0521,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0104,
0,
0.66,
0.125,
640,
0,
1,
0,
0,
640,
0,
0
],
[
1,
0,
0.0938,
0.0104,
0,
0.66,... | [
"'''\nEntry point for My Tracks i18n tool.\n\n@author: Rodrigo Damazio\n'''",
"import mytracks.files",
"import mytracks.translate",
"import mytracks.validate",
"import sys",
"def Usage():\n print('Usage: %s <command> [<language> ...]\\n' % sys.argv[0])\n print('Commands are:')\n print(' cleanup')\n p... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | [
[
8,
0,
0.1905,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.7143,
0.619,
0,
0.66,
1,
229,
0,
2,
0,
0,
186,
0,
1
],
[
8,
1,
0.5238,
0.1429,
1,
0.33,
... | [
"'''\nModule which prompts the user for translations and saves them.\n\nTODO: implement\n\n@author: Rodrigo Damazio\n'''",
"class Translator(object):\n '''\n classdocs\n '''\n\n def __init__(self, language):\n '''\n Constructor",
" '''\n classdocs\n '''",
" def __init__(self, language):\n '''... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | [
[
8,
0,
0.0304,
0.0522,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0783,
0.0087,
0,
0.66,
... | [
"'''\nModule which compares languague files to the master file and detects\nissues.\n\n@author: Rodrigo Damazio\n'''",
"import os",
"from mytracks.parser import StringsParser",
"import mytracks.history",
"class Validator(object):\n\n def __init__(self, languages):\n '''\n Builds a strings file valida... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | [
[
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.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
... | [
"'''\nModule for dealing with resource files (but not their contents).\n\n@author: Rodrigo Damazio\n'''",
"import os.path",
"from glob import glob",
"import re",
"MYTRACKS_RES_DIR = 'MyTracks/res'",
"ANDROID_MASTER_VALUES = 'values'",
"ANDROID_VALUES_MASK = 'values-*'",
"def GetMyTracksDir():\n '''\n... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | [
[
8,
0,
0.0261,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0609,
0.0087,
0,
0.66,
0.3333,
573,
0,
1,
0,
0,
573,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66... | [
"'''\nModule which parses a string XML file.\n\n@author: Rodrigo Damazio\n'''",
"from xml.parsers.expat import ParserCreate",
"import re",
"class StringsParser(object):\n '''\n Parser for string XML files.\n\n This object is not thread-safe and should be used for parsing a single file at\n a time, only.\n... |
#
# Generate and deploy the jar and associated files to the Sonatype maven repository.
#
import os, re, tempfile, subprocess #, sys, datetime, zipfile
# Location of the source file that defines the current version
VERSION_FILE = '../src/com/caverock/androidsvg/SVG.java'
# Version regex
VERSION_RE = '\sVE... | [
[
1,
0,
0.0427,
0.0085,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.0684,
0.0085,
0,
0.66,
0.0833,
837,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.094,
0.0085,
0,
0... | [
"import os, re, tempfile, subprocess #, sys, datetime, zipfile",
"VERSION_FILE = '../src/com/caverock/androidsvg/SVG.java'",
"VERSION_RE = '\\sVERSION\\s*=\\s*\"([\\d.]+)\"'",
"ORIG_POM_FILE = 'src-pom.xml'",
"POM_VERSION_RE = '{{VERSION}}'",
"JAR_FILE = '../bin/androidsvg.jar'",
"SOURCES_JAR_FILE = '... |
import Download
pagelist=['http://www.economist.com/']
print("Starting ....")
crawler = Download.crawler('')
crawler.crawl(pagelist)
| [
[
1,
0,
0.1429,
0.1429,
0,
0.66,
0,
175,
0,
1,
0,
0,
175,
0,
0
],
[
14,
0,
0.4286,
0.1429,
0,
0.66,
0.25,
340,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.5714,
0.1429,
0,
0.6... | [
"import Download",
"pagelist=['http://www.economist.com/']",
"print(\"Starting ....\")",
"crawler = Download.crawler('')",
"crawler.crawl(pagelist)"
] |
import urllib
import re
urlArg = 'http://www.yahoo.com'
filehandle = urllib.urlopen(urlArg)
for lines in filehandle.readlines():
m = re.search('http\://[\w\./]+/\w+',lines)
if m:
print m.group(0)
filehandle.close()
| [
[
1,
0,
0.0667,
0.0667,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.1333,
0.0667,
0,
0.66,
0.2,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.2667,
0.0667,
0,
0.... | [
"import urllib",
"import re",
"urlArg = 'http://www.yahoo.com'",
"filehandle = urllib.urlopen(urlArg)",
"for lines in filehandle.readlines():\n\tm = re.search('http\\://[\\w\\./]+/\\w+',lines)\n\tif m:\n\t\tprint(m.group(0))",
"\tm = re.search('http\\://[\\w\\./]+/\\w+',lines)",
"\tif m:\n\t\tprint(m.gr... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.1881,
0.0891,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2574,
0.0099,
0,
0.66,
0.05,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2673,
0.0099,
0,
0.66,
... | [
"\"\"\"Main program for Rietveld.\n\nThis is also a template for running a Django app under Google App\nEngine, especially when using a newer version of Django than provided\nin the App Engine standard library.\n\nThe site-specific code is all in other files: urls.py, models.py,\nviews.py, settings.py.",
"import ... |
# Removes duplicate nicknames (issue99).
#
# To run this script:
# - Make sure App Engine library (incl. yaml) is in PYTHONPATH.
# - Make sure that the remote API is included in app.yaml.
# - Run "tools/appengine_console.py APP_ID".
# - Import this module.
# - update_accounts.run() updates accounts.
# - Use the o... | [
[
1,
0,
0.2097,
0.0161,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.2419,
0.0161,
0,
0.66,
0.25,
844,
0,
1,
0,
0,
844,
0,
0
],
[
2,
0,
0.4194,
0.2742,
0,
0.... | [
"from google.appengine.ext import db",
"from codereview import models",
"def fetch_accounts():\n query = models.Account.all()\n accounts = {}\n results = query.fetch(100)\n while results:\n last = None\n for account in results:\n if account.lower_nickname in accounts:",
" ... |
"""Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Custom A... | [
[
8,
0,
0.0244,
0.0244,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0732,
0.0244,
0,
0.66,
0.1111,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0976,
0.0244,
0,
0.66... | [
"\"\"\"Configuration.\"\"\"",
"import logging",
"import os",
"import re",
"from google.appengine.ext.appstats import recording",
"logging.info('Loading %s from %s', __name__, __file__)",
"def webapp_add_wsgi_middleware(app):\n app = recording.appstats_wsgi_middleware(app)\n return app",
" app = rec... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.2381,
0.0159,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2698,
0.0159,
0,
0.66,
0.1667,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3016,
0.0159,
0,
0.66... | [
"\"\"\"Test utils.\"\"\"",
"import os",
"from google.appengine.ext import testbed",
"from django.test import TestCase as _TestCase",
"FILES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'files')",
"class TestCase(_TestCase):\n \"\"\"Customized Django TestCase.\n\n This class disables th... |
#!/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 or ... | [
[
1,
0,
0.1345,
0.0084,
0,
0.66,
0,
44,
0,
1,
0,
0,
44,
0,
0
],
[
1,
0,
0.1429,
0.0084,
0,
0.66,
0.0435,
784,
0,
1,
0,
0,
784,
0,
0
],
[
1,
0,
0.1513,
0.0084,
0,
0.... | [
"import code",
"import getpass",
"import logging",
"import optparse",
"import os",
"import re",
"import sys",
"ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')",
"LIB = os.path.join(ROOT, '..', 'google_appengine', 'lib')",
"sys.path.insert(0, os.path.join(ROOT, '..', 'google_a... |
# Copyright 2008-2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.5357,
0.0357,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6429,
0.0357,
0,
0.66,
0.5,
341,
0,
1,
0,
0,
341,
0,
0
],
[
14,
0,
0.9464,
0.1429,
0,
0.66,
... | [
"\"\"\"Top-level URL mappings for Rietveld.\"\"\"",
"from django.conf.urls.defaults import *",
"urlpatterns = patterns(\n '',\n url(r'', include('codereview.urls')),\n )"
] |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.1948,
0.013,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2208,
0.013,
0,
0.66,
0.0417,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2468,
0.013,
0,
0.66,
... | [
"\"\"\"Minimal Django settings.\"\"\"",
"import os",
"from google.appengine.api import app_identity",
"APPEND_SLASH = False",
"DEBUG = os.environ['SERVER_SOFTWARE'].startswith('Dev')",
"INSTALLED_APPS = (\n 'codereview',\n)",
"MIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n... |
# 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 or agreed to in writing, ... | [
[
1,
0,
0.092,
0.0061,
0,
0.66,
0,
604,
0,
1,
0,
0,
604,
0,
0
],
[
1,
0,
0.1043,
0.0061,
0,
0.66,
0.0667,
211,
0,
1,
0,
0,
211,
0,
0
],
[
1,
0,
0.1104,
0.0061,
0,
0... | [
"import md5",
"from django.contrib.syndication.feeds import Feed",
"from django.core.exceptions import ObjectDoesNotExist",
"from django.core.urlresolvers import reverse",
"from django.utils.feedgenerator import Atom1Feed",
"from codereview import library",
"from codereview import models",
"class Base... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.0417,
0.0417,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0647,
0.0014,
0,
0.66,
0.037,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0661,
0.0014,
0,
0.66,... | [
"\"\"\"Intra-region diff utilities.\n\nIntra-region diff highlights the blocks of code which have been changed or\ndeleted within a region. So instead of highlighting the whole region marked as\nchanged, the user can see what exactly was changed within that region.\n\nTerminology:\n 'region' is a list of consecuti... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.0656,
0.0193,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0811,
0.0039,
0,
0.66,
0.0909,
866,
0,
1,
0,
0,
866,
0,
0
],
[
1,
0,
0.0849,
0.0039,
0,
0.66... | [
"\"\"\"Utility to read and apply a unified diff without forking patch(1).\n\nFor a discussion of the unified diff format, see my blog on Artima:\nhttp://www.artima.com/weblogs/viewpost.jsp?thread=164293\n\"\"\"",
"import difflib",
"import logging",
"import re",
"import sys",
"_CHUNK_RE = re.compile(r\"\"\... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.1485,
0.0099,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1782,
0.0099,
0,
0.66,
0.2,
341,
0,
1,
0,
0,
341,
0,
0
],
[
1,
0,
0.1881,
0.0099,
0,
0.66,
... | [
"\"\"\"URL mappings for the codereview package.\"\"\"",
"from django.conf.urls.defaults import *",
"import django.views.defaults",
"from codereview import feeds",
"urlpatterns = patterns(\n 'codereview.views',\n (r'^$', 'index'),\n (r'^all$', 'all'),\n (r'^mine$', 'mine'),\n (r'^starred$', 's... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.1807,
0.012,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2048,
0.012,
0,
0.66,
0.1,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.2289,
0.012,
0,
0.66,
... | [
"\"\"\"Custom middleware. Some of this may be generally useful.\"\"\"",
"import logging",
"from google.appengine.api import users",
"from google.appengine.runtime import apiproxy_errors",
"from google.appengine.runtime import DeadlineExceededError",
"from django.conf import settings",
"from django.http... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.1562,
0.0104,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1771,
0.0104,
0,
0.66,
0.1667,
857,
0,
1,
0,
0,
857,
0,
0
],
[
1,
0,
0.1979,
0.0104,
0,
0.66... | [
"\"\"\"Collection of helper functions.\"\"\"",
"import urlparse",
"from google.appengine.ext import db",
"from codereview.exceptions import FetchError",
"def make_url(base, filename, rev):\n \"\"\"Helper to construct the URL to fetch.\n\n Args:\n base: The base property of the Issue to which the Patch ... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.6522,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.8043,
0.087,
0,
0.66,
0.5,
654,
0,
0,
0,
0,
645,
0,
0
],
[
8,
1,
0.8261,
0.0435,
1,
0.55,
... | [
"\"\"\"Exception classes.\"\"\"",
"class RietveldError(Exception):\n \"\"\"Base class for all exceptions in this application.\"\"\"",
" \"\"\"Base class for all exceptions in this application.\"\"\"",
"class FetchError(RietveldError):\n \"\"\"Exception raised when fetching of remote files fails.\"\"\"",
... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.0575,
0.0038,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0651,
0.0038,
0,
0.66,
0.0526,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0728,
0.0038,
0,
0.66... | [
"\"\"\"Django template library for Rietveld.\"\"\"",
"import cgi",
"from google.appengine.api import memcache",
"from google.appengine.api import users",
"import django.template",
"import django.utils.safestring",
"from django.core.urlresolvers import reverse",
"from codereview import models",
"regi... |
# 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 or agreed to in writing, ... | [
[
8,
0,
0.0214,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0242,
0.0014,
0,
0.66,
0.0357,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0256,
0.0014,
0,
0.66... | [
"\"\"\"Diff rendering in HTML for Rietveld.\"\"\"",
"import cgi",
"import difflib",
"import re",
"from google.appengine.api import users",
"from django.conf import settings",
"from django.template import loader, RequestContext",
"from codereview import intra_region_diff",
"from codereview import mod... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | [
[
8,
0,
0.2802,
0.3736,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4835,
0.011,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4945,
0.011,
0,
0.66,
... | [
"\"\"\"Mimic pyquick exercise -- optional extra exercise.\nGoogle's Python Class\n\nRead in the file specified on the command line.\nDo a simple split() on whitespace to obtain all the words in the file.\nRather than read the file line by line, it's easier to read\nit into one giant string and split it once.",
"i... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... | [
[
2,
0,
0.2202,
0.0952,
0,
0.66,
0,
855,
0,
1,
1,
0,
0,
0,
2
],
[
14,
1,
0.1905,
0.0119,
1,
0.37,
0,
276,
0,
0,
0,
0,
0,
5,
0
],
[
14,
1,
0.2024,
0.0119,
1,
0.37,
... | [
"def remove_adjacent(nums):\n ans=[]\n i=0\n while i < len(nums):\n if nums[i] != nums[i-1]:\n ans.append(nums[i])\n i+=1\n return ans",
" ans=[]",
" i=0",
" while i < len(nums):\n if nums[i] != nums[i-1]:\n ans.append(nums[i])\n i+=1",
" if nums[i] != nums[i-1]:\n ans.a... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | [
[
8,
0,
0.2238,
0.2857,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.381,
0.0095,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.4952,
0.2,
0,
0.66,
... | [
"\"\"\"Wordcount exercise\nGoogle's Python class\n\nThe main() below is already defined and complete. It calls print_words()\nand print_top() functions which you write.\n\n1. For the --count flag, implement a print_words(filename) function that counts\nhow often each word appears in the text and prints:",
"import... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | [
[
8,
0,
0.2802,
0.3736,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4835,
0.011,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4945,
0.011,
0,
0.66,
... | [
"\"\"\"Mimic pyquick exercise -- optional extra exercise.\nGoogle's Python Class\n\nRead in the file specified on the command line.\nDo a simple split() on whitespace to obtain all the words in the file.\nRather than read the file line by line, it's easier to read\nit into one giant string and split it once.",
"i... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... | [
[
2,
0,
0.2202,
0.0952,
0,
0.66,
0,
855,
0,
1,
1,
0,
0,
0,
2
],
[
14,
1,
0.1905,
0.0119,
1,
0.96,
0,
276,
0,
0,
0,
0,
0,
5,
0
],
[
14,
1,
0.2024,
0.0119,
1,
0.96,
... | [
"def remove_adjacent(nums):\n ans=[]\n i=0\n while i < len(nums):\n if nums[i] != nums[i-1]:\n ans.append(nums[i])\n i+=1\n return ans",
" ans=[]",
" i=0",
" while i < len(nums):\n if nums[i] != nums[i-1]:\n ans.append(nums[i])\n i+=1",
" if nums[i] != nums[i-1]:\n ans.a... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | [
[
8,
0,
0.2238,
0.2857,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.381,
0.0095,
0,
0.66,
0.1667,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.4952,
0.2,
0,
0.66,
... | [
"\"\"\"Wordcount exercise\nGoogle's Python class\n\nThe main() below is already defined and complete. It calls print_words()\nand print_top() functions which you write.\n\n1. For the --count flag, implement a print_words(filename) function that counts\nhow often each word appears in the text and prints:",
"import... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... | [
[
2,
0,
0.2778,
0.1528,
0,
0.66,
0,
855,
0,
1,
1,
0,
0,
0,
2
],
[
4,
1,
0.2292,
0.0278,
1,
0.03,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
[
13,
2,
0.2361,
0.0139,
2,
0.48,
... | [
"def remove_adjacent(nums):\n if nums == []:\n return nums\n last = nums[0]\n mlist = []\n mlist.append(last)\n for i in nums[1:]:\n if i!= last:",
" if nums == []:\n return nums",
" return nums",
" last = nums[0]",
" mlist = []",
" mlist.append(last)",
" for i in nums[1:]:\n if... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | [
[
8,
0,
0.2398,
0.3061,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4082,
0.0102,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4184,
0.0102,
0,
0.66... | [
"\"\"\"Wordcount exercise\nGoogle's Python class\n\nThe main() below is already defined and complete. It calls print_words()\nand print_top() functions which you write.\n\n1. For the --count flag, implement a print_words(filename) function that counts\nhow often each word appears in the text and prints:",
"import... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... | [
[
2,
0,
0.2778,
0.1528,
0,
0.66,
0,
855,
0,
1,
1,
0,
0,
0,
2
],
[
4,
1,
0.2292,
0.0278,
1,
0.14,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
[
13,
2,
0.2361,
0.0139,
2,
0.06,
... | [
"def remove_adjacent(nums):\n if nums == []:\n return nums\n last = nums[0]\n mlist = []\n mlist.append(last)\n for i in nums[1:]:\n if i!= last:",
" if nums == []:\n return nums",
" return nums",
" last = nums[0]",
" mlist = []",
" mlist.append(last)",
" for i in nums[1:]:\n if... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | [
[
8,
0,
0.2398,
0.3061,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4082,
0.0102,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4184,
0.0102,
0,
0.66... | [
"\"\"\"Wordcount exercise\nGoogle's Python class\n\nThe main() below is already defined and complete. It calls print_words()\nand print_top() functions which you write.\n\n1. For the --count flag, implement a print_words(filename) function that counts\nhow often each word appears in the text and prints:",
"import... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | [
[
8,
0,
0.2602,
0.3469,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.449,
0.0102,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4592,
0.0102,
0,
0.66,... | [
"\"\"\"Mimic pyquick exercise -- optional extra exercise.\nGoogle's Python Class\n\nRead in the file specified on the command line.\nDo a simple split() on whitespace to obtain all the words in the file.\nRather than read the file line by line, it's easier to read\nit into one giant string and split it once.",
"i... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list ... | [
[
2,
0,
0.2535,
0.0986,
0,
0.66,
0,
855,
0,
1,
1,
0,
0,
0,
2
],
[
6,
1,
0.2676,
0.0423,
1,
0.44,
0,
190,
2,
0,
0,
0,
0,
0,
2
],
[
4,
2,
0.2746,
0.0282,
2,
0.82,
... | [
"def remove_adjacent(nums):\n # +++your code here+++\n \n for x in nums:\n if(nums.count(x) > 1):\n nums.remove(x)\n return nums",
" for x in nums:\n if(nums.count(x) > 1):\n nums.remove(x)",
" if(nums.count(x) > 1):\n nums.remove(x)",
" nums.remove(x)",
" return nums",
... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | [
[
8,
0,
0.2217,
0.283,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3774,
0.0094,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3868,
0.0094,
0,
0.66,
... | [
"\"\"\"Wordcount exercise\nGoogle's Python class\n\nThe main() below is already defined and complete. It calls print_words()\nand print_top() functions which you write.\n\n1. For the --count flag, implement a print_words(filename) function that counts\nhow often each word appears in the text and prints:",
"import... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | [
[
8,
0,
0.2602,
0.3469,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.449,
0.0102,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4592,
0.0102,
0,
0.66,... | [
"\"\"\"Mimic pyquick exercise -- optional extra exercise.\nGoogle's Python Class\n\nRead in the file specified on the command line.\nDo a simple split() on whitespace to obtain all the words in the file.\nRather than read the file line by line, it's easier to read\nit into one giant string and split it once.",
"i... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list ... | [
[
2,
0,
0.2535,
0.0986,
0,
0.66,
0,
855,
0,
1,
1,
0,
0,
0,
2
],
[
6,
1,
0.2676,
0.0423,
1,
0.85,
0,
190,
2,
0,
0,
0,
0,
0,
2
],
[
4,
2,
0.2746,
0.0282,
2,
0.79,
... | [
"def remove_adjacent(nums):\n # +++your code here+++\n \n for x in nums:\n if(nums.count(x) > 1):\n nums.remove(x)\n return nums",
" for x in nums:\n if(nums.count(x) > 1):\n nums.remove(x)",
" if(nums.count(x) > 1):\n nums.remove(x)",
" nums.remove(x)",
" return nums",
... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | [
[
8,
0,
0.2217,
0.283,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3774,
0.0094,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.3868,
0.0094,
0,
0.66,
... | [
"\"\"\"Wordcount exercise\nGoogle's Python class\n\nThe main() below is already defined and complete. It calls print_words()\nand print_top() functions which you write.\n\n1. For the --count flag, implement a print_words(filename) function that counts\nhow often each word appears in the text and prints:",
"import... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | [
[
8,
0,
0.2656,
0.3542,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4583,
0.0104,
0,
0.66,
0.1429,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.4688,
0.0104,
0,
0.66... | [
"\"\"\"Mimic pyquick exercise -- optional extra exercise.\nGoogle's Python Class\n\nRead in the file specified on the command line.\nDo a simple split() on whitespace to obtain all the words in the file.\nRather than read the file line by line, it's easier to read\nit into one giant string and split it once.",
"i... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic list exercises
# D. Given a list of numbers, return a list where
# al... | [
[
2,
0,
0.2687,
0.1045,
0,
0.66,
0,
855,
0,
1,
1,
0,
0,
0,
3
],
[
14,
1,
0.2388,
0.0149,
1,
0.62,
0,
826,
1,
0,
0,
0,
0,
1,
0
],
[
14,
1,
0.2537,
0.0149,
1,
0.62,
... | [
"def remove_adjacent(nums):\n i=1\n newlist=[]\n for i in range (len(nums)):\n if nums[i]!=nums[i-1]:\n newlist.append(nums[i])\n return newlist",
" i=1",
" newlist=[]",
" for i in range (len(nums)):\n if nums[i]!=nums[i-1]:\n newlist.append(nums[i])",
" if nums[i]!=nums[i-1]:\n ... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | [
[
8,
0,
0.2423,
0.3093,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4124,
0.0103,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4227,
0.0103,
0,
0.66... | [
"\"\"\"Wordcount exercise\nGoogle's Python class\n\nThe main() below is already defined and complete. It calls print_words()\nand print_top() functions which you write.\n\n1. For the --count flag, implement a print_words(filename) function that counts\nhow often each word appears in the text and prints:",
"import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.