code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
"""Implementation of JSONEncoder
"""
import re
try:
from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
... | [
[
8,
0,
0.0035,
0.0046,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0069,
0.0023,
0,
0.66,
0.0667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
7,
0,
0.015,
0.0092,
0,
0.66,... | [
"\"\"\"Implementation of JSONEncoder\n\"\"\"",
"import re",
"try:\n from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii\nexcept ImportError:\n c_encode_basestring_ascii = None",
" from simplejson._speedups import encode_basestring_ascii as 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.1582,
0.3133,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3165,
0.0032,
0,
0.66,
0.1,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3244,
0.0127,
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
# encoding: utf-8
# waf 1.6.10
VERSION='0.3.3'
import sys
APPNAME='p2t'
top = '.'
out = 'build'
CPP_SOURCES = ['poly2tri/common/shapes.cc',
'poly2tri/sweep/cdt.cc',
'poly2tri/sweep/advancing_front.cc',
'poly2tri/sweep/sweep_context.cc',
... | [
[
14,
0,
0.1111,
0.0222,
0,
0.66,
0,
557,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.0909,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.1556,
0.0222,
0,
... | [
"VERSION='0.3.3'",
"import sys",
"APPNAME='p2t'",
"top = '.'",
"out = 'build'",
"CPP_SOURCES = ['poly2tri/common/shapes.cc',\n 'poly2tri/sweep/cdt.cc',\n 'poly2tri/sweep/advancing_front.cc',\n 'poly2tri/sweep/sweep_context.cc',\n 'poly2tri/sweep/swee... |
#!/usr/bin/env python
import codecs
import re
import jinja2
import markdown
def process_slides():
with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:
md = codecs.open('slides.md', encoding='utf8').read()
md_slides = md.split('\n---\n')
print 'Compiled %s slides.' % len(m... | [
[
1,
0,
0.0526,
0.0175,
0,
0.66,
0,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.0702,
0.0175,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0877,
0.0175,
0,
... | [
"import codecs",
"import re",
"import jinja2",
"import markdown",
"def process_slides():\n with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:\n md = codecs.open('slides.md', encoding='utf8').read()\n md_slides = md.split('\\n---\\n')\n print('Compiled %s slides.' ... |
# Copyright (c) 2009 John Schember
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distri... | [
[
1,
0,
0.1746,
0.0079,
0,
0.66,
0,
570,
0,
5,
0,
0,
570,
0,
0
],
[
3,
0,
0.4643,
0.5397,
0,
0.66,
0.5,
650,
0,
4,
0,
0,
317,
0,
42
],
[
2,
1,
0.2262,
0.0476,
1,
0.... | [
"from PyQt4.Qt import QFrame, QWidget, QTextEdit, QHBoxLayout, QPainter",
"class NumberBar(QWidget):\n def __init__(self, *args):\n QWidget.__init__(self, *args)\n self.edit = None\n # This is used to update the width of the control.\n # It is the highest line that is currently visi... |
from robot import Robot
class TheRobot(Robot):
def respond(self):
self.ping()
self.ping_react()
def ping_react(self):
kind, angle, dist = self.sensors['PING']
if kind == 'w':
# Pinged a wall
if dist < 2:
self.force(-30)
... | [
[
1,
0,
0.0333,
0.0333,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.55,
0.9333,
0,
0.66,
1,
111,
0,
2,
0,
0,
440,
0,
10
],
[
2,
1,
0.1667,
0.1,
1,
0.26,
... | [
"from robot import Robot",
"class TheRobot(Robot):\n def respond(self):\n self.ping()\n self.ping_react()\n\n def ping_react(self):\n kind, angle, dist = self.sensors['PING']",
" def respond(self):\n self.ping()\n self.ping_react()",
" self.ping()",
" ... |
from robot import Robot
class TheRobot(Robot):
def initialize(self):
self._spinning = False
def respond(self):
if self._spinning:
self.spin()
self.ping()
self.ping_react()
def spin(self, n=None):
# Spin for n ticks, then stop
if n is not None:
... | [
[
1,
0,
0.0196,
0.0196,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.5294,
0.9608,
0,
0.66,
1,
111,
0,
4,
0,
0,
440,
0,
14
],
[
2,
1,
0.0882,
0.0392,
1,
0.57... | [
"from robot import Robot",
"class TheRobot(Robot):\n def initialize(self):\n self._spinning = False\n\n def respond(self):\n if self._spinning:\n self.spin()",
" def initialize(self):\n self._spinning = False",
" self._spinning = False",
" def respond(self)... |
import random
from robot import Robot
class TheRobot(Robot):
def initialize(self):
self._state = 'FORWARD'
self._fwdfor_ticks = None
self._rightfor_ticks = None
self._unstick_freq = 12
self._unstickfor_ticks = None
def respond(self):
self.controller()
def ... | [
[
1,
0,
0.0094,
0.0094,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0189,
0.0094,
0,
0.66,
0.5,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.5236,
0.9623,
0,
0.6... | [
"import random",
"from robot import Robot",
"class TheRobot(Robot):\n def initialize(self):\n self._state = 'FORWARD'\n self._fwdfor_ticks = None\n self._rightfor_ticks = None\n self._unstick_freq = 12\n self._unstickfor_ticks = None",
" def initialize(self):\n ... |
from robot import Robot
class TheRobot(Robot):
def initialize(self):
self.health = 100
self._turnto = 5
self._moveto_choices = [70, 70, -70, -70]
def respond(self):
tick = self.sensors['TICK']
if tick == 100:
self.start_logging()
elif tick == 200:
... | [
[
1,
0,
0.0139,
0.0139,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.5208,
0.9722,
0,
0.66,
1,
111,
0,
5,
0,
0,
440,
0,
14
],
[
2,
1,
0.0903,
0.0833,
1,
0.71... | [
"from robot import Robot",
"class TheRobot(Robot):\n def initialize(self):\n self.health = 100\n\n self._turnto = 5\n\n self._moveto_choices = [70, 70, -70, -70]",
" def initialize(self):\n self.health = 100\n\n self._turnto = 5\n\n self._moveto_choices = [70, 70,... |
from robot import Robot
class TheRobot(Robot):
def initialize(self):
# Try to get in to a corner
self.forseconds(5, self.force, 50)
self.forseconds(0.9, self.force, -10)
self.forseconds(0.7, self.torque, 100)
self.forseconds(6, self.force, 50)
# Then look around and... | [
[
1,
0,
0.0149,
0.0149,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.5224,
0.9701,
0,
0.66,
1,
111,
0,
2,
0,
0,
440,
0,
15
],
[
2,
1,
0.1567,
0.209,
1,
0.11,... | [
"from robot import Robot",
"class TheRobot(Robot):\n def initialize(self):\n # Try to get in to a corner\n self.forseconds(5, self.force, 50)\n self.forseconds(0.9, self.force, -10)\n self.forseconds(0.7, self.torque, 100)\n self.forseconds(6, self.force, 50)",
" def ini... |
# This example was used in verifying the problem outlined
# in issue #5 in the bug tracker.
from robot import Robot
class TheRobot(Robot):
def respond(self):
self.turret(0)
self.pingcheck()
def pingcheck(self):
g = self.sensors['GYRO']
if -2 <= g <= 2:
self.ping()
... | [
[
1,
0,
0.1905,
0.0476,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.6429,
0.7619,
0,
0.66,
1,
111,
0,
2,
0,
0,
440,
0,
7
],
[
2,
1,
0.381,
0.1429,
1,
0.78,
... | [
"from robot import Robot",
"class TheRobot(Robot):\n def respond(self):\n self.turret(0)\n self.pingcheck()\n\n def pingcheck(self):\n g = self.sensors['GYRO']\n if -2 <= g <= 2:",
" def respond(self):\n self.turret(0)\n self.pingcheck()",
" self.turre... |
from robot import Robot
class TheRobot(Robot):
def initialize(self):
self.health = 100
self._movefor = 0
self._moveforce = 0
self._turnto = 0
def respond(self):
self.turnto()
self.scan_and_fire()
# Move away if damaged
health = self.sensors['HEA... | [
[
1,
0,
0.0192,
0.0192,
0,
0.66,
0,
735,
0,
1,
0,
0,
735,
0,
0
],
[
3,
0,
0.5288,
0.9615,
0,
0.66,
1,
111,
0,
4,
0,
0,
440,
0,
9
],
[
2,
1,
0.1154,
0.0962,
1,
0.97,... | [
"from robot import Robot",
"class TheRobot(Robot):\n def initialize(self):\n self.health = 100\n self._movefor = 0\n self._moveforce = 0\n self._turnto = 0\n\n def respond(self):",
" def initialize(self):\n self.health = 100\n self._movefor = 0\n self._m... |
import random
from math import pi
from robot import Robot
class TheRobot(Robot):
def initialize(self):
self.ctrlr = self.controller()
def respond(self):
try:
self.ctrlr.next()
except StopIteration:
self.finished()
def controller(self):
'Set up a ge... | [
[
1,
0,
0.0115,
0.0115,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.023,
0.0115,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.046,
0.0115,
0,
0.... | [
"import random",
"from math import pi",
"from robot import Robot",
"class TheRobot(Robot):\n def initialize(self):\n self.ctrlr = self.controller()\n\n def respond(self):\n try:\n self.ctrlr.next()\n except StopIteration:",
" def initialize(self):\n self.ctrlr... |
class Fake(object):
def __init__(self, a=None, b=None):
pass
def setpos(self, pos):
pass
def set_rotation(self, ang):
pass
def kill(self):
pass
def step(self, n=None):
pass
class Robot(Fake):
def set_turr_rot(self, ang):
pass
class Turret(Fa... | [
[
3,
0,
0.129,
0.2419,
0,
0.66,
0,
120,
0,
5,
0,
0,
186,
0,
0
],
[
2,
1,
0.0403,
0.0323,
1,
0.52,
0,
555,
0,
3,
0,
0,
0,
0,
0
],
[
2,
1,
0.0887,
0.0323,
1,
0.52,
... | [
"class Fake(object):\n def __init__(self, a=None, b=None):\n pass\n\n def setpos(self, pos):\n pass\n\n def set_rotation(self, ang):",
" def __init__(self, a=None, b=None):\n pass",
" def setpos(self, pos):\n pass",
" def set_rotation(self, ang):\n pass",
... |
#!/usr/bin/env python
# Copyright 2009 Lee Harr
#
# This file is part of pybotwar.
#
# Pybotwar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | [
[
1,
0,
0.1338,
0.0064,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1401,
0.0064,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1465,
0.0064,
0,
0... | [
"import os",
"import sys",
"import glob",
"from PyQt4 import QtCore, QtGui, uic",
"from PyQt4.Qt import QFrame, QWidget, QHBoxLayout, QPainter",
"import util",
"import conf",
"uidir = 'data/ui'",
"class CombatantsEditor(QtGui.QMainWindow):\n def __init__(self, parent):\n self.parent = pare... |
# Copyright 2009 Lee Harr
#
# This file is part of pybotwar.
#
# Pybotwar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pybotwar ... | [
[
1,
0,
0.0918,
0.0048,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
7,
0,
0.1232,
0.0483,
0,
0.66,
0.0714,
0,
0,
1,
0,
0,
0,
0,
2
],
[
1,
1,
0.1063,
0.0048,
1,
0.65... | [
"import time",
"try:\n import conf\nexcept ImportError:\n import util\n util.makeconf()\n\n import stats\n stats.dbcheck()",
" import conf",
" import util",
" util.makeconf()",
" import stats",
" stats.dbcheck()",
"import util",
"import viewselect",
"def setup_logging... |
import sqlite3
import os
import hashlib
import conf
import util
dbversion = 3
dbversion_reset = dbversion
def fullpath():
rdirs = util.get_robot_dirs()
if conf.dbfile.startswith('~'):
fname = os.path.expanduser(conf.dbfile)
elif not rdirs:
fname = conf.dbfile
else:
fdir = rd... | [
[
1,
0,
0.0028,
0.0028,
0,
0.66,
0,
790,
0,
1,
0,
0,
790,
0,
0
],
[
1,
0,
0.0056,
0.0028,
0,
0.66,
0.0455,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0084,
0.0028,
0,
... | [
"import sqlite3",
"import os",
"import hashlib",
"import conf",
"import util",
"dbversion = 3",
"dbversion_reset = dbversion",
"def fullpath():\n rdirs = util.get_robot_dirs()\n\n if conf.dbfile.startswith('~'):\n fname = os.path.expanduser(conf.dbfile)\n elif not rdirs:\n fname... |
# Copyright 2009 Lee Harr
#
# This file is part of pybotwar.
#
# Pybotwar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pybotwar ... | [
[
1,
0,
0.0619,
0.0033,
0,
0.66,
0,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0651,
0.0033,
0,
0.66,
0.0833,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0684,
0.0033,
0,
... | [
"import subprocess",
"from subprocess import PIPE",
"import time",
"import random",
"import logging",
"logger = logging.getLogger('PybotwarLogger')",
"import viewselect",
"view = viewselect.get_view_module()",
"import world",
"from world import box2d",
"import stats",
"import conf",
"class G... |
#!/usr/bin/env python
"""
highlightedtextedit.py
A PyQt custom widget example for Qt Designer.
Copyright (C) 2006 David Boddie <david@boddie.org.uk>
Copyright (C) 2005-2006 Trolltech ASA. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General ... | [
[
8,
0,
0.0672,
0.1095,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1294,
0.005,
0,
0.66,
0.25,
154,
0,
2,
0,
0,
154,
0,
0
],
[
3,
0,
0.2488,
0.2139,
0,
0.66,
... | [
"\"\"\"\nhighlightedtextedit.py\n\nA PyQt custom widget example for Qt Designer.\n\nCopyright (C) 2006 David Boddie <david@boddie.org.uk>\nCopyright (C) 2005-2006 Trolltech ASA. All rights reserved.",
"from PyQt4 import QtCore, QtGui",
"class HighlightedTextEdit(QtGui.QTextEdit):\n\n \"\"\"HighlightedTextEdi... |
def select_view_module(name):
global selectedview
if name == 'pygame':
import pgview
selectedview = pgview
elif name == 'pyqt':
import qt4view
selectedview = qt4view
elif name == 'none':
import noview
selectedview = noview
def get_view_module():
glo... | [
[
2,
0,
0.4118,
0.7647,
0,
0.66,
0,
808,
0,
1,
0,
0,
0,
0,
0
],
[
4,
1,
0.4706,
0.6471,
1,
0.34,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
[
1,
2,
0.2353,
0.0588,
2,
0.45,
0... | [
"def select_view_module(name):\n global selectedview\n if name == 'pygame':\n import pgview\n selectedview = pgview\n\n elif name == 'pyqt':\n import qt4view",
" if name == 'pygame':\n import pgview\n selectedview = pgview\n\n elif name == 'pyqt':\n import ... |
import os
def makeconf():
'create an empty conf file'
conf_file = 'conf.py'
if os.path.exists(conf_file):
print 'conf.py already exists'
raise SystemExit
contents = '''\
# Change configuration settings here.
# See defaults.py for the default settings
from defaults import *
'''
... | [
[
1,
0,
0.0182,
0.0182,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.2636,
0.4364,
0,
0.66,
0.25,
869,
0,
0,
0,
0,
0,
0,
7
],
[
8,
1,
0.0727,
0.0182,
1,
0.32... | [
"import os",
"def makeconf():\n 'create an empty conf file'\n\n conf_file = 'conf.py'\n\n if os.path.exists(conf_file):\n print('conf.py already exists')\n raise SystemExit",
" 'create an empty conf file'",
" conf_file = 'conf.py'",
" if os.path.exists(conf_file):\n pr... |
# Robot subprocess
subproc_python = '/usr/bin/python'
subproc_main = 'control.py'
init_timeout = 1.0
tick_timeout = 0.015
# Robot selection
robot_dirs = ['robots', 'robots/examples'] # In this order, in case of dup name
r1 = 'robot01'
r2 = 'robot02'
r3 = 'robot03'
r4 = 'robot04'
r5 = 'robot05'
r6 = 'robot06'
r7 = 'r... | [
[
14,
0,
0.025,
0.0125,
0,
0.66,
0,
207,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0375,
0.0125,
0,
0.66,
0.0238,
650,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0625,
0.0125,
0,
0.... | [
"subproc_python = '/usr/bin/python'",
"subproc_main = 'control.py'",
"init_timeout = 1.0",
"tick_timeout = 0.015",
"robot_dirs = ['robots', 'robots/examples'] # In this order, in case of dup name",
"r1 = 'robot01'",
"r2 = 'robot02'",
"r3 = 'robot03'",
"r4 = 'robot04'",
"r5 = 'robot05'",
"r6 = 'r... |
# Copyright 2009 Lee Harr
#
# This file is part of pybotwar.
#
# Pybotwar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pybotwar ... | [
[
1,
0,
0.0833,
0.0044,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0877,
0.0044,
0,
0.66,
0.2,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0921,
0.0044,
0,
0.6... | [
"import os",
"import random",
"from time import sleep",
"from util import defaultNonedict",
"import conf",
"class Robot(object):\n def __init__(self, name):\n self.name = name\n\n self._overtime_count = 0\n\n self.sensors = defaultNonedict()",
" def __init__(self, name):\n ... |
# Copyright 2009 Lee Harr
#
# This file is part of pybotwar.
#
# Pybotwar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pybotwar ... | [
[
1,
0,
0.0266,
0.0014,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.028,
0.0014,
0,
0.66,
0.0278,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0294,
0.0014,
0,
0... | [
"import os",
"import sys",
"import math",
"pi = math.pi",
"import logging",
"logger = logging.getLogger('PybotwarLogger')",
"from PyQt4 import QtCore, QtGui, QtSvg, uic",
"from editor import TextEditor",
"from combatants import CombatantsEditor",
"import util",
"import stats",
"import conf",
... |
# Copyright 2009 Lee Harr
#
# This file is part of pybotwar.
#
# Pybotwar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pybotwar ... | [
[
1,
0,
0.1022,
0.0054,
0,
0.66,
0,
87,
0,
1,
0,
0,
87,
0,
0
],
[
1,
0,
0.1129,
0.0054,
0,
0.66,
0.0526,
632,
0,
1,
0,
0,
632,
0,
0
],
[
1,
0,
0.1183,
0.0054,
0,
0.... | [
"import pygame",
"from pygsear.Game import Game",
"from pygsear.Drawable import RotatedImage, Square, Rectangle, Stationary, Multi, Image, String, Circle",
"from pygsear.Widget import ProgressBar",
"from pygsear.locals import RED, ORANGE, YELLOW",
"import pygsear.conf",
"pygsear.conf.MAX_FPS = 60",
"m... |
#!/usr/bin/env ptyhon
import sys
if '__main__' == __name__:
full = open('alexa.out', 'r')
lost = open('titlegot', 'r')
arr = [[],[]]
while True:
str = full.readline()
if not str:
break
str = str.strip('\n')
arr[0].append(str)
while True:
str = lo... | [
[
1,
0,
0.0652,
0.0217,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.5435,
0.9348,
0,
0.66,
1,
0,
0,
0,
0,
0,
0,
0,
24
],
[
14,
1,
0.1087,
0.0217,
1,
0.04,
... | [
"import sys",
"if '__main__' == __name__:\n full = open('alexa.out', 'r')\n lost = open('titlegot', 'r')\n\n arr = [[],[]]\n while True:\n str = full.readline()\n if not str:",
" full = open('alexa.out', 'r')",
" lost = open('titlegot', 'r')",
" arr = [[],[]]",
" whil... |
#!/usr/bin/python
import re, sys, glob, os, os.path, errno, shutil, ftplib
CHECKSUM_RE = re.compile(r'checksum\s*=\s*([\w]+)')
PROP_RE = re.compile(r'(.*)=(.*)')
BASEDIR='memory_layouts'
def getProps(file):
creds = {}
path = os.path.expanduser(file)
f = open(path, 'r')
lines = f.readlines()
f... | [
[
1,
0,
0.026,
0.013,
0,
0.66,
0,
540,
0,
8,
0,
0,
540,
0,
0
],
[
14,
0,
0.0519,
0.013,
0,
0.66,
0.125,
588,
3,
1,
0,
0,
821,
10,
1
],
[
14,
0,
0.0649,
0.013,
0,
0.... | [
"import re, sys, glob, os, os.path, errno, shutil, ftplib",
"CHECKSUM_RE = re.compile(r'checksum\\s*=\\s*([\\w]+)')",
"PROP_RE = re.compile(r'(.*)=(.*)')",
"BASEDIR='memory_layouts'",
"def getProps(file):\n\tcreds = {}\n\t\n\tpath = os.path.expanduser(file)\n\t\n\tf = open(path, 'r')\n\tlines = f.readlines(... |
#!/usr/bin/python
import re, sys, glob, os, os.path, errno, shutil, ftplib
PROP_RE = re.compile(r'(.*)=(.*)')
BASEDIR='apt'
def getProps(file):
creds = {}
path = os.path.expanduser(file)
f = open(path, 'r')
lines = f.readlines()
f.close()
for l in lines:
m = PROP_RE.match(l)
if m is not None:
cred... | [
[
1,
0,
0.0339,
0.0169,
0,
0.66,
0,
540,
0,
8,
0,
0,
540,
0,
0
],
[
14,
0,
0.0678,
0.0169,
0,
0.66,
0.2,
611,
3,
1,
0,
0,
821,
10,
1
],
[
14,
0,
0.1017,
0.0169,
0,
... | [
"import re, sys, glob, os, os.path, errno, shutil, ftplib",
"PROP_RE = re.compile(r'(.*)=(.*)')",
"BASEDIR='apt'",
"def getProps(file):\n\tcreds = {}\n\t\n\tpath = os.path.expanduser(file)\n\t\n\tf = open(path, 'r')\n\tlines = f.readlines()\n\tf.close()",
"\tcreds = {}",
"\tpath = os.path.expanduser(file)... |
#!/usr/bin/python
import re, sys, shutil, os, os.path, subprocess, hashlib
from datetime import datetime
VERSIONS = { 'oneiric': '11.10', 'lucid': '10.04' }
DATE_FORMAT = '%a, %d %b %Y %H:%M:%S UTC'
def collectFiles(directory):
files = set()
for path, dirs, filenames in os.walk(directory):
for f in filenames:
... | [
[
1,
0,
0.0204,
0.0102,
0,
0.66,
0,
540,
0,
7,
0,
0,
540,
0,
0
],
[
1,
0,
0.0306,
0.0102,
0,
0.66,
0.0909,
426,
0,
1,
0,
0,
426,
0,
0
],
[
14,
0,
0.051,
0.0102,
0,
... | [
"import re, sys, shutil, os, os.path, subprocess, hashlib",
"from datetime import datetime",
"VERSIONS = { 'oneiric': '11.10', 'lucid': '10.04' }",
"DATE_FORMAT = '%a, %d %b %Y %H:%M:%S UTC'",
"def collectFiles(directory):\n\tfiles = set()\n\tfor path, dirs, filenames in os.walk(directory):\n\t\tfor f in fi... |
import logging
import urllib
from xml.etree import ElementTree as ET
from pprint import pformat
xml_to_dict_map = {
'CountryCode': 'country',
'RegionName': 'region_name',
'RegionCode': 'region_code',
'City': 'city'
}
def ip_info(ip):
"""
<?xml version="1.0" encoding="UTF-8"?>
<Respo... | [
[
1,
0,
0.0182,
0.0182,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0364,
0.0182,
0,
0.66,
0.2,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0545,
0.0182,
0,
0.6... | [
"import logging",
"import urllib",
"from xml.etree import ElementTree as ET",
"from pprint import pformat",
"xml_to_dict_map = {\n 'CountryCode': 'country',\n 'RegionName': 'region_name',\n 'RegionCode': 'region_code',\n 'City': 'city'\n}",
"def ip_info(ip):\n \"\"\"\n<?xml version=\"1.0\" ... |
import datetime
from google.appengine.ext import db
class MetricEntry(db.Model):
ip = db.StringProperty()
city = db.StringProperty()
region_code = db.StringProperty()
region_name = db.StringProperty()
country = db.StringProperty()
dt_version_major = db.IntegerProperty()
dt_version... | [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.125,
0.0625,
0,
0.66,
0.5,
167,
0,
1,
0,
0,
167,
0,
0
],
[
3,
0,
0.5938,
0.75,
0,
0.66,
... | [
"import datetime",
"from google.appengine.ext import db",
"class MetricEntry(db.Model):\n ip = db.StringProperty()\n city = db.StringProperty()\n region_code = db.StringProperty()\n region_name = db.StringProperty()\n country = db.StringProperty()\n dt_version_major = db.IntegerProperty()\n ... |
from google.appengine.ext import webapp
from google.appengine.api import memcache
from google.appengine.ext.webapp.util import run_wsgi_app
from versionhandler import VersionHandler
from metrichandler import MetricHandler
class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers... | [
[
1,
0,
0.0435,
0.0435,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.087,
0.0435,
0,
0.66,
0.1111,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.1304,
0.0435,
0,
0... | [
"from google.appengine.ext import webapp",
"from google.appengine.api import memcache",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from versionhandler import VersionHandler",
"from metrichandler import MetricHandler",
"class MainPage(webapp.RequestHandler):\n def get(self):\n ... |
import logging
import pprint
import re
from google.appengine.ext import webapp
from metricentry import MetricEntry
from utils import ip_info
CURRENT_VERSION = "0.6.12"
RX_VERSION_CHUNKER = re.compile(r"\s*DwarfTherapist\s+(\d+)\.(\d+)\.(\d+)\s*")
class VersionHandler(webapp.RequestHandler):
def get(self,... | [
[
1,
0,
0.0312,
0.0312,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0625,
0.0312,
0,
0.66,
0.125,
276,
0,
1,
0,
0,
276,
0,
0
],
[
1,
0,
0.0938,
0.0312,
0,
0... | [
"import logging",
"import pprint",
"import re",
"from google.appengine.ext import webapp",
"from metricentry import MetricEntry",
"from utils import ip_info",
"CURRENT_VERSION = \"0.6.12\"",
"RX_VERSION_CHUNKER = re.compile(r\"\\s*DwarfTherapist\\s+(\\d+)\\.(\\d+)\\.(\\d+)\\s*\")",
"class VersionHan... |
from google.appengine.ext import webapp
import pprint
import logging
class MetricHandler(webapp.RequestHandler):
def get(self, *args):
self.response.headers['Content-Type'] = 'text/html'
info = ip_info("96.253.131.222")
self.response.out.write("Metrics must be posted! %s<br/>%s" % (... | [
[
1,
0,
0.0588,
0.0588,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.1176,
0.0588,
0,
0.66,
0.3333,
276,
0,
1,
0,
0,
276,
0,
0
],
[
1,
0,
0.1765,
0.0588,
0,
... | [
"from google.appengine.ext import webapp",
"import pprint",
"import logging",
"class MetricHandler(webapp.RequestHandler):\n def get(self, *args):\n self.response.headers['Content-Type'] = 'text/html'\n info = ip_info(\"96.253.131.222\")\n self.response.out.write(\"Metrics must be post... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | [
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.1224,
0.0102,
0,
0.66,
0.0714,
792,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1531,
0.0102,
0,
... | [
"import os, re, mimetypes, sys",
"SOURCE = sys.argv[1:]",
"COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)",
"COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)",
"COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)",
"EXCLUDE_TYPES = [\n \"application/xml\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from distutils.cmd import Command
import doctest
from glob import glob
import ... | [
[
1,
0,
0.0637,
0.0064,
0,
0.66,
0,
662,
0,
1,
0,
0,
662,
0,
0
],
[
1,
0,
0.0701,
0.0064,
0,
0.66,
0.0833,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0764,
0.0064,
0,
... | [
"from distutils.cmd import Command",
"import doctest",
"from glob import glob",
"import os",
"import sys",
"try:\n from setuptools import setup\n has_setuptools = True\nexcept ImportError:\n from distutils.core import setup\n has_setuptools = False",
" from setuptools import setup",
" ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Mapping from raw JSON data structures to Python objects and vice versa.
>>> from couchdb import ... | [
[
8,
0,
0.0463,
0.0695,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0831,
0.0014,
0,
0.66,
0.0385,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.0858,
0.0014,
0,
0.66... | [
"\"\"\"Mapping from raw JSON data structures to Python objects and vice versa.\n\n>>> from couchdb import Server\n>>> server = Server()\n>>> db = server.create('python-tests')\n\nTo define a document mapping, you declare a Python class inherited from\n`Document`, and add any number of `Field` attributes:",
"impor... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Python client API for CouchDB.
>>> server = Server()
>>> db = server.create('python-tests')
>>> ... | [
[
8,
0,
0.0133,
0.0129,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.021,
0.0008,
0,
0.66,
0.0417,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.0218,
0.0008,
0,
0.66,... | [
"\"\"\"Python client API for CouchDB.\n\n>>> server = Server()\n>>> db = server.create('python-tests')\n>>> doc_id, doc_rev = db.save({'type': 'Person', 'name': 'John Doe'})\n>>> doc = db[doc_id]\n>>> doc['type']\n'Person'",
"import itertools",
"import mimetypes",
"import os",
"from types import FunctionTyp... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Thin abstraction layer over the different available modules for decoding
and encoding JSON data.
This... | [
[
8,
0,
0.1404,
0.1644,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2329,
0.0068,
0,
0.66,
0.0909,
272,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.2466,
0.0068,
0,
0.66,... | [
"\"\"\"Thin abstraction layer over the different available modules for decoding\nand encoding JSON data.\n\nThis module currently supports the following JSON modules:\n - ``simplejson``: http://code.google.com/p/simplejson/\n - ``cjson``: http://pypi.python.org/pypi/python-cjson\n - ``json``: This is the version of... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import unittest
from StringIO import StringIO
from couchdb import Unauthorized
from couchdb.tools imp... | [
[
1,
0,
0.234,
0.0213,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.2553,
0.0213,
0,
0.66,
0.125,
609,
0,
1,
0,
0,
609,
0,
0
],
[
1,
0,
0.2979,
0.0213,
0,
0.66... | [
"import unittest",
"from StringIO import StringIO",
"from couchdb import Unauthorized",
"from couchdb.tools import load, dump",
"from couchdb.tests import testutil",
"class ToolLoadTestCase(testutil.TempDatabaseMixin, unittest.TestCase):\n\n def test_handle_credentials(self):\n # Issue 194: couc... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from datetime import datetime
import doctest
import os
import os.path
import shutil
from StringIO im... | [
[
1,
0,
0.0111,
0.0012,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0124,
0.0012,
0,
0.66,
0.05,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0136,
0.0012,
0,
0.... | [
"from datetime import datetime",
"import doctest",
"import os",
"import os.path",
"import shutil",
"from StringIO import StringIO",
"import time",
"import tempfile",
"import threading",
"import unittest",
"import urlparse",
"from couchdb import client, http",
"from couchdb.tests import testu... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import doctest
import socket
import time
import unittest
from StringIO import StringIO
from couchdb impo... | [
[
1,
0,
0.0989,
0.011,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.1099,
0.011,
0,
0.66,
0.0909,
687,
0,
1,
0,
0,
687,
0,
0
],
[
1,
0,
0.1209,
0.011,
0,
0.6... | [
"import doctest",
"import socket",
"import time",
"import unittest",
"from StringIO import StringIO",
"from couchdb import http",
"from couchdb.tests import testutil",
"class SessionTestCase(testutil.TempDatabaseMixin, unittest.TestCase):\n\n def test_timeout(self):\n dbname, db = self.temp_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import unittest
from couchdb.http import ResourceConflict, ResourceNotFound
f... | [
[
1,
0,
0.0402,
0.004,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0482,
0.004,
0,
0.66,
0.2,
554,
0,
2,
0,
0,
554,
0,
0
],
[
1,
0,
0.0522,
0.004,
0,
0.66,
... | [
"import unittest",
"from couchdb.http import ResourceConflict, ResourceNotFound",
"from couchdb.tests import testutil",
"class CouchTests(testutil.TempDatabaseMixin, unittest.TestCase):\n\n def _create_test_docs(self, num):\n for i in range(num):\n self.db[str(i)] = {'a': i + 1, 'b': (i +... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | [
[
1,
0,
0.1957,
0.0217,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.2174,
0.0217,
0,
0.66,
0.3333,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2391,
0.0217,
0,
... | [
"import random",
"import sys",
"from couchdb import client",
"class TempDatabaseMixin(object):\n\n temp_dbs = None\n _db = None\n\n def setUp(self):\n self.server = client.Server(full_commit=False)",
" temp_dbs = None",
" _db = None",
" def setUp(self):\n self.server = cl... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import doctest
import unittest
from couchdb import design
from couchdb.tests import testutil
class Des... | [
[
1,
0,
0.15,
0.0167,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.1667,
0.0167,
0,
0.66,
0.1667,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.2,
0.0167,
0,
0.66,
... | [
"import doctest",
"import unittest",
"from couchdb import design",
"from couchdb.tests import testutil",
"class DesignTestCase(testutil.TempDatabaseMixin, unittest.TestCase):\n\n def test_options(self):\n options = {'collation': 'raw'}\n view = design.ViewDefinition(\n 'foo', 'fo... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import doctest
from StringIO import StringIO
import unittest
from couchdb import multipart
class ... | [
[
1,
0,
0.0405,
0.0045,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.045,
0.0045,
0,
0.66,
0.1429,
609,
0,
1,
0,
0,
609,
0,
0
],
[
1,
0,
0.0495,
0.0045,
0,
0... | [
"import doctest",
"from StringIO import StringIO",
"import unittest",
"from couchdb import multipart",
"class ReadMultipartTestCase(unittest.TestCase):\n\n def test_flat(self):\n text = '''\\\nContent-Type: multipart/mixed; boundary=\"===============1946781859==\"\n\n--===============1946781859==\... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import doctest
from StringIO import StringIO
import unittest
from couchdb import view
class ViewS... | [
[
1,
0,
0.0789,
0.0088,
0,
0.66,
0,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0877,
0.0088,
0,
0.66,
0.1667,
609,
0,
1,
0,
0,
609,
0,
0
],
[
1,
0,
0.0965,
0.0088,
0,
... | [
"import doctest",
"from StringIO import StringIO",
"import unittest",
"from couchdb import view",
"class ViewServerTestCase(unittest.TestCase):\n\n def test_reset(self):\n input = StringIO('[\"reset\"]\\n')\n output = StringIO()\n view.run(input=input, output=output)\n self.as... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import unittest
from couchdb.tests import client, couch_tests, design, http, multipart, \
... | [
[
1,
0,
0.3,
0.0333,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.3833,
0.0667,
0,
0.66,
0.3333,
132,
0,
9,
0,
0,
132,
0,
0
],
[
2,
0,
0.6833,
0.4,
0,
0.66,
... | [
"import unittest",
"from couchdb.tests import client, couch_tests, design, http, multipart, \\\n mapping, view, package, tools",
"def suite():\n suite = unittest.TestSuite()\n suite.addTest(client.suite())\n suite.addTest(design.suite())\n suite.addTest(http.suite())\n su... |
# -*- coding: utf-8 -*-
import unittest
import couchdb
class PackageTestCase(unittest.TestCase):
def test_exports(self):
expected = set([
# couchdb.client
'Server', 'Database', 'Document',
# couchdb.http
'HTTPError', 'PreconditionFailed', 'ResourceNotFound'... | [
[
1,
0,
0.1071,
0.0357,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.1429,
0.0357,
0,
0.66,
0.25,
437,
0,
1,
0,
0,
437,
0,
0
],
[
3,
0,
0.4286,
0.4643,
0,
0.66... | [
"import unittest",
"import couchdb",
"class PackageTestCase(unittest.TestCase):\n\n def test_exports(self):\n expected = set([\n # couchdb.client\n 'Server', 'Database', 'Document',\n # couchdb.http\n 'HTTPError', 'PreconditionFailed', 'ResourceNotFound',",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Maximillian Dornseif <md@hudora.de>
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""
This script replicates databases from one CouchDB server to an other.
This is mainly f... | [
[
8,
0,
0.1089,
0.0806,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1613,
0.0081,
0,
0.66,
0.1,
437,
0,
2,
0,
0,
437,
0,
0
],
[
1,
0,
0.1694,
0.0081,
0,
0.66,
... | [
"\"\"\"\nThis script replicates databases from one CouchDB server to an other.\n\nThis is mainly for backup purposes or \"priming\" a new server before\nsetting up trigger based replication. But you can also use the\n'--continuous' option to set up automatic replication on newer\nCouchDB versions.",
"from couchdb... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Utility for dumping a snapshot of a CouchDB database to a multipart MIME
fi... | [
[
8,
0,
0.1294,
0.0353,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1647,
0.0118,
0,
0.66,
0.1,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.1765,
0.0118,
0,
0.66,
... | [
"\"\"\"Utility for dumping a snapshot of a CouchDB database to a multipart MIME\nfile.\n\"\"\"",
"from base64 import b64decode",
"from optparse import OptionParser",
"import sys",
"from couchdb import __version__ as VERSION",
"from couchdb import json",
"from couchdb.client import Database",
"from cou... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
| [] | [] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Utility code for managing design documents."""
from copy import deepcopy
from inspect import get... | [
[
8,
0,
0.0421,
0.0047,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0514,
0.0047,
0,
0.66,
0.1,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.0561,
0.0047,
0,
0.66,
... | [
"\"\"\"Utility code for managing design documents.\"\"\"",
"from copy import deepcopy",
"from inspect import getsource",
"from itertools import groupby",
"from operator import attrgetter",
"from textwrap import dedent",
"from types import FunctionType",
"__all__ = ['ViewDefinition']",
"__docformat__... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Support for streamed reading and writing of multipart MIME content."""
from base64 import b64enc... | [
[
8,
0,
0.0352,
0.0039,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.043,
0.0039,
0,
0.66,
0.0909,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0469,
0.0039,
0,
0.66,... | [
"\"\"\"Support for streamed reading and writing of multipart MIME content.\"\"\"",
"from base64 import b64encode",
"from cgi import parse_header",
"from email import header",
"try:\n from hashlib import md5\nexcept ImportError:\n from md5 import new as md5",
" from hashlib import md5",
" fro... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from couchdb.client import Database, Document, Server
from couchdb.http import HTTPError, PreconditionFai... | [
[
1,
0,
0.5625,
0.0625,
0,
0.66,
0,
464,
0,
3,
0,
0,
464,
0,
0
],
[
1,
0,
0.6562,
0.125,
0,
0.66,
0.5,
554,
0,
8,
0,
0,
554,
0,
0
],
[
7,
0,
0.9062,
0.25,
0,
0.66,
... | [
"from couchdb.client import Database, Document, Server",
"from couchdb.http import HTTPError, PreconditionFailed, Resource, \\\n ResourceConflict, ResourceNotFound, ServerError, Session, Unauthorized",
"try:\n __version__ = __import__('pkg_resources').get_distribution('CouchDB').version\nexcept:\n ... |
# -*- coding: utf-8 -*-
import Globals
# 히스토리 리스트에 넣을때:
# cmd = {커맨드타입:redo/undo 함수에 인자로 건네어질 data}
# self.AddCmd(cmd)
#
# ex)
# cmd = {CMD_INSERT:{"pos" : pos, "word" : word}}
# self.AddCmd(cmd)
#
# 커맨드는 CMD_INSERT, CMD_DELETE, CMD_REPLACE 만 있으면 되지 않을까
# 생각해보면 CMD_REPLACE로 다 되지 않을까?
# CMD_INSE... | [
[
1,
0,
0.0148,
0.0074,
0,
0.66,
0,
512,
0,
1,
0,
0,
512,
0,
0
],
[
14,
0,
0.1704,
0.0074,
0,
0.66,
0.25,
532,
3,
1,
0,
0,
816,
10,
1
],
[
14,
0,
0.1778,
0.0074,
0,
... | [
"import Globals",
"(CMD_INSERT, CMD_DELETE, CMD_REPLACE) = range(3)",
"(REDO_FUNC, UNDO_FUNC) = range(2)",
"(POSITION, VALUE, VALUE_NEW) = (\"pos\", \"value\", \"value_new\")",
"class HistoryManager:\n redoUndoFuncs = {\n CMD_INSERT : {REDO_FUNC : \"RedoInsert\"\n ... |
# -*- coding: utf-8 -*-
import os
import wx
import Globals
import History
appName = "메모장"
class NotepadFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, title=title, size=(600, 400))
self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_NOHIDES... | [
[
1,
0,
0.0043,
0.0021,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0064,
0.0021,
0,
0.66,
0.125,
666,
0,
1,
0,
0,
666,
0,
0
],
[
1,
0,
0.0085,
0.0021,
0,
0... | [
"import os",
"import wx",
"import Globals",
"import History",
"appName = \"메모장\"",
"class NotepadFrame(wx.Frame):\n def __init__(self, parent, title):\n wx.Frame.__init__(self, parent, title=title, size=(600, 400))\n self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_NOHIDESEL... |
'''
Created on 2011. 8. 28.
@author: bleuiz
'''
import os
#path = os.path.join("e:\\", "2.txt")
num = 100
path = "%d.txt" % num
f = open(path, 'w')
for i in range(1,num):
f.write("line : %d created.\n" % i)
f.close() | [
[
8,
0,
0.2143,
0.3571,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4286,
0.0714,
0,
0.66,
0.1667,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.6429,
0.0714,
0,
0.6... | [
"'''\nCreated on 2011. 8. 28.\n\n@author: bleuiz\n'''",
"import os",
"num = 100",
"path = \"%d.txt\" % num",
"f = open(path, 'w')",
"for i in range(1,num):\n f.write(\"line : %d created.\\n\" % i)",
" f.write(\"line : %d created.\\n\" % i)",
"f.close()"
] |
# -*- coding: utf-8 -*-
mainFrame = None
textControl = None | [
[
14,
0,
0.75,
0.25,
0,
0.66,
0,
562,
1,
0,
0,
0,
0,
9,
0
],
[
14,
0,
1,
0.25,
0,
0.66,
1,
146,
1,
0,
0,
0,
0,
9,
0
]
] | [
"mainFrame = None",
"textControl = None"
] |
from googlevoice import Voice, util
from os import path, remove
from unittest import TestCase, main
class VoiceTest(TestCase):
voice = Voice()
voice.login()
outgoing = util.input('Outgoing number (blank to ignore call tests): ')
forwarding = None
if outgoing:
forwarding = util.input('Forwar... | [
[
1,
0,
0.0179,
0.0179,
0,
0.66,
0,
348,
0,
2,
0,
0,
348,
0,
0
],
[
1,
0,
0.0357,
0.0179,
0,
0.66,
0.25,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.0536,
0.0179,
0,
0.... | [
"from googlevoice import Voice, util",
"from os import path, remove",
"from unittest import TestCase, main",
"class VoiceTest(TestCase):\n voice = Voice()\n voice.login()\n outgoing = util.input('Outgoing number (blank to ignore call tests): ')\n forwarding = None\n if outgoing:\n forwar... |
DEFAULT_CONFIG = """
[auth]
# Google Account email address (one associated w/ your Voice account)
email=
# Raw password used or login
password=
[gvoice]
# Number to place calls from (eg, your google voice number)
forwardingNumber=
# Default phoneType for your forwardingNumber as defined below
# 1 - Home
# 2 - Mobi... | [
[
14,
0,
0.1887,
0.3585,
0,
0.66,
0,
769,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3962,
0.0189,
0,
0.66,
0.0333,
309,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.4151,
0.0189,
0,
0... | [
"DEFAULT_CONFIG = \"\"\"\n[auth]\n# Google Account email address (one associated w/ your Voice account)\nemail=\n\n# Raw password used or login\npassword=",
"DEBUG = False",
"LOGIN = 'https://accounts.google.com/ServiceLoginAuth?service=grandcentral'",
"FEEDS = ('inbox', 'starred', 'all', 'spam', 'trash', 'vo... |
import re
from sys import stdout
from xml.parsers.expat import ParserCreate
from time import gmtime
from datetime import datetime
from pprint import pprint
try:
from urllib.request import build_opener, install_opener, HTTPCookieProcessor, Request, urlopen
from urllib.parse import urlencode, quote
except ImportE... | [
[
1,
0,
0.0032,
0.0032,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0064,
0.0032,
0,
0.66,
0.04,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0096,
0.0032,
0,
0.... | [
"import re",
"from sys import stdout",
"from xml.parsers.expat import ParserCreate",
"from time import gmtime",
"from datetime import datetime",
"from pprint import pprint",
"try:\n from urllib.request import build_opener, install_opener, HTTPCookieProcessor, Request, urlopen\n from urllib.parse i... |
from ConfigParser import ConfigParser, NoOptionError
import os
from . import settings
class Config(ConfigParser):
"""
``ConfigParser`` subclass that looks into your home folder for a file named
``.gvoice`` and parses configuration data from it.
"""
def __init__(self):
self.fname = os.path.... | [
[
1,
0,
0.0182,
0.0182,
0,
0.66,
0,
272,
0,
2,
0,
0,
272,
0,
0
],
[
1,
0,
0.0364,
0.0182,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0545,
0.0182,
0,
0.... | [
"from ConfigParser import ConfigParser, NoOptionError",
"import os",
"from . import settings",
"class Config(ConfigParser):\n \"\"\"\n ``ConfigParser`` subclass that looks into your home folder for a file named\n ``.gvoice`` and parses configuration data from it.\n \"\"\"\n def __init__(self):\... |
from .conf import config
from .util import *
from . import settings
import os
if settings.DEBUG:
import logging
logging.basicConfig()
log = logging.getLogger('PyGoogleVoice')
log.setLevel(logging.DEBUG)
else:
log = None
class Voice(object):
"""
Main voice instance for interacting with the ... | [
[
1,
0,
0.004,
0.004,
0,
0.66,
0,
433,
0,
1,
0,
0,
433,
0,
0
],
[
1,
0,
0.008,
0.004,
0,
0.66,
0.2,
811,
0,
1,
0,
0,
811,
0,
0
],
[
1,
0,
0.012,
0.004,
0,
0.66,
... | [
"from .conf import config",
"from .util import *",
"from . import settings",
"import os",
"if settings.DEBUG:\n import logging\n logging.basicConfig()\n log = logging.getLogger('PyGoogleVoice')\n log.setLevel(logging.DEBUG)\nelse:\n log = None",
" import logging",
" logging.basicCon... |
"""
This project aims to bring the power of the Google Voice API to the Python language in a simple,
easy-to-use manner. Currently it allows you to place calls, send sms,
download voicemails/recorded messages, and search the various folders of your Google Voice Accounts.
You can use the Python API or command line scrip... | [
[
8,
0,
0.2778,
0.5,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.5556,
0.0556,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6111,
0.0556,
0,
0.66,
... | [
"\"\"\"\nThis project aims to bring the power of the Google Voice API to the Python language in a simple,\neasy-to-use manner. Currently it allows you to place calls, send sms,\ndownload voicemails/recorded messages, and search the various folders of your Google Voice Accounts.\nYou can use the Python API or comman... |
from distutils.core import setup
README = """Python Google Voice
====================
Joe McCall & Justin Quick
Exposing the Google Voice "API" to the Python language
-------------------------------------------------------
Google Voice for Python Allows you to place calls, send sms, download voicemail, and check t... | [
[
1,
0,
0.0345,
0.0345,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
14,
0,
0.3621,
0.4828,
0,
0.66,
0.5,
366,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
0.8276,
0.3793,
0,
0.66... | [
"from distutils.core import setup",
"README = \"\"\"Python Google Voice\n====================\n\nJoe McCall & Justin Quick\n\nExposing the Google Voice \"API\" to the Python language\n-------------------------------------------------------",
"setup(\n name = \"pygooglevoice\",\n version = '0.5',\n url ... |
from googlevoice import Voice
from googlevoice.util import input
voice = Voice()
voice.login()
outgoingNumber = input('Number to call: ')
forwardingNumber = input('Number to call from [optional]: ') or None
voice.call(outgoingNumber, forwardingNumber)
if input('Calling now... cancel?[y/N] ').lower() == 'y':
voi... | [
[
1,
0,
0.0769,
0.0769,
0,
0.66,
0,
348,
0,
1,
0,
0,
348,
0,
0
],
[
1,
0,
0.1538,
0.0769,
0,
0.66,
0.1429,
416,
0,
1,
0,
0,
416,
0,
0
],
[
14,
0,
0.3077,
0.0769,
0,
... | [
"from googlevoice import Voice",
"from googlevoice.util import input",
"voice = Voice()",
"voice.login()",
"outgoingNumber = input('Number to call: ')",
"forwardingNumber = input('Number to call from [optional]: ') or None",
"voice.call(outgoingNumber, forwardingNumber)",
"if input('Calling now... can... |
from googlevoice import Voice,util,settings
voice = Voice()
voice.login()
for feed in settings.FEEDS:
util.print_(feed.title())
for message in getattr(voice, feed)().messages:
util.print_('\t', message) | [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
348,
0,
3,
0,
0,
348,
0,
0
],
[
14,
0,
0.3333,
0.1111,
0,
0.66,
0.3333,
429,
3,
0,
0,
0,
55,
10,
1
],
[
8,
0,
0.4444,
0.1111,
0,
... | [
"from googlevoice import Voice,util,settings",
"voice = Voice()",
"voice.login()",
"for feed in settings.FEEDS:\n util.print_(feed.title())\n for message in getattr(voice, feed)().messages:\n util.print_('\\t', message)",
" util.print_(feed.title())",
" for message in getattr(voice, fee... |
from googlevoice import Voice,util
voice = Voice()
voice.login()
for message in voice.voicemail().messages:
util.print_(message) | [
[
1,
0,
0.1429,
0.1429,
0,
0.66,
0,
348,
0,
2,
0,
0,
348,
0,
0
],
[
14,
0,
0.4286,
0.1429,
0,
0.66,
0.3333,
429,
3,
0,
0,
0,
55,
10,
1
],
[
8,
0,
0.5714,
0.1429,
0,
... | [
"from googlevoice import Voice,util",
"voice = Voice()",
"voice.login()",
"for message in voice.voicemail().messages:\n util.print_(message)",
" util.print_(message)"
] |
from googlevoice import Voice
from googlevoice.util import input
voice = Voice()
voice.login()
phoneNumber = input('Number to send message to: ')
text = input('Message text: ')
voice.send_sms(phoneNumber, text) | [
[
1,
0,
0.1,
0.1,
0,
0.66,
0,
348,
0,
1,
0,
0,
348,
0,
0
],
[
1,
0,
0.2,
0.1,
0,
0.66,
0.1667,
416,
0,
1,
0,
0,
416,
0,
0
],
[
14,
0,
0.4,
0.1,
0,
0.66,
0.3333,... | [
"from googlevoice import Voice",
"from googlevoice.util import input",
"voice = Voice()",
"voice.login()",
"phoneNumber = input('Number to send message to: ')",
"text = input('Message text: ')",
"voice.send_sms(phoneNumber, text)"
] |
from googlevoice import Voice,util
voice = Voice()
voice.login()
util.pprint(voice.settings) | [
[
1,
0,
0.1429,
0.1429,
0,
0.66,
0,
348,
0,
2,
0,
0,
348,
0,
0
],
[
14,
0,
0.5714,
0.1429,
0,
0.66,
0.3333,
429,
3,
0,
0,
0,
55,
10,
1
],
[
8,
0,
0.7143,
0.1429,
0,
... | [
"from googlevoice import Voice,util",
"voice = Voice()",
"voice.login()",
"util.pprint(voice.settings)"
] |
from googlevoice import Voice
download_dir = '.'
voice = Voice()
voice.login()
for message in voice.voicemail().messages:
message.download(download_dir) | [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
348,
0,
1,
0,
0,
348,
0,
0
],
[
14,
0,
0.3333,
0.1111,
0,
0.66,
0.25,
893,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.5556,
0.1111,
0,
0.... | [
"from googlevoice import Voice",
"download_dir = '.'",
"voice = Voice()",
"voice.login()",
"for message in voice.voicemail().messages:\n message.download(download_dir)",
" message.download(download_dir)"
] |
from googlevoice import Voice
voice = Voice()
voice.login()
for message in voice.sms().messages:
if message.isRead:
message.delete() | [
[
1,
0,
0.125,
0.125,
0,
0.66,
0,
348,
0,
1,
0,
0,
348,
0,
0
],
[
14,
0,
0.375,
0.125,
0,
0.66,
0.3333,
429,
3,
0,
0,
0,
55,
10,
1
],
[
8,
0,
0.5,
0.125,
0,
0.66,
... | [
"from googlevoice import Voice",
"voice = Voice()",
"voice.login()",
"for message in voice.sms().messages:\n if message.isRead:\n message.delete()",
" if message.isRead:\n message.delete()",
" message.delete()"
] |
from googlevoice import Voice,util
voice = Voice()
voice.login()
folder = voice.search(util.input('Search query: '))
util.print_('Found %s messages: ', len(folder))
util.pprint(folder.messages) | [
[
1,
0,
0.1,
0.1,
0,
0.66,
0,
348,
0,
2,
0,
0,
348,
0,
0
],
[
14,
0,
0.4,
0.1,
0,
0.66,
0.2,
429,
3,
0,
0,
0,
55,
10,
1
],
[
8,
0,
0.5,
0.1,
0,
0.66,
0.4,
7... | [
"from googlevoice import Voice,util",
"voice = Voice()",
"voice.login()",
"folder = voice.search(util.input('Search query: '))",
"util.print_('Found %s messages: ', len(folder))",
"util.pprint(folder.messages)"
] |
#
#SMS test via Google Voice
#
#John Nagle
# nagle@animats.com
#
from googlevoice import Voice
import sys
import BeautifulSoup
def extractsms(htmlsms) :
"""
extractsms -- extract SMS messages from BeautifulSoup tree of Google Voice SMS HTML.
Output is a list of dictionaries, one per me... | [
[
1,
0,
0.175,
0.025,
0,
0.66,
0,
348,
0,
1,
0,
0,
348,
0,
0
],
[
1,
0,
0.2,
0.025,
0,
0.66,
0.1429,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.225,
0.025,
0,
0.66,
... | [
"from googlevoice import Voice",
"import sys",
"import BeautifulSoup",
"def extractsms(htmlsms) :\n \"\"\"\n extractsms -- extract SMS messages from BeautifulSoup tree of Google Voice SMS HTML.\n\n Output is a list of dictionaries, one per message.\n \"\"\"\n msgitems = []\t\t\t\t\t\t\t\t\t\t... |
from googlevoice import Voice,util
voice = Voice()
voice.login()
util.pprint(voice.phones) | [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
348,
0,
2,
0,
0,
348,
0,
0
],
[
14,
0,
0.5,
0.1667,
0,
0.66,
0.3333,
429,
3,
0,
0,
0,
55,
10,
1
],
[
8,
0,
0.6667,
0.1667,
0,
0.... | [
"from googlevoice import Voice,util",
"voice = Voice()",
"voice.login()",
"util.pprint(voice.phones)"
] |
#!/usr/bin/env python
import glob
import imp
import logging
import os
import sys
import unittest
from trace import fullmodname
logging.basicConfig(level=logging.CRITICAL)
APP_ENGINE_PATH='../google_appengine'
# Conditional import of cleanup function
try:
from tests.utils import cleanup
except:
def cleanup():
... | [
[
1,
0,
0.0541,
0.027,
0,
0.66,
0,
958,
0,
1,
0,
0,
958,
0,
0
],
[
1,
0,
0.0811,
0.027,
0,
0.66,
0.0667,
201,
0,
1,
0,
0,
201,
0,
0
],
[
1,
0,
0.1081,
0.027,
0,
0.6... | [
"import glob",
"import imp",
"import logging",
"import os",
"import sys",
"import unittest",
"from trace import fullmodname",
"logging.basicConfig(level=logging.CRITICAL)",
"APP_ENGINE_PATH='../google_appengine'",
"try:\n from tests.utils import cleanup\nexcept:\n def cleanup():\n pass",
" ... |
#!/usr/bin/env python
#
# Copyright 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
[
8,
0,
0.056,
0.0172,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.069,
0.0029,
0,
0.66,
0.0417,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0747,
0.0029,
0,
0.66,
... | [
"\"\"\"Create documentation for generate API surfaces.\n\nCommand-line tool that creates documentation for all APIs listed in discovery.\nThe documentation is generated from a combination of the discovery document and\nthe generated API surface itself.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.2394,
0.0704,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2817,
0.0141,
0,
0.66,
0.1,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.338,
0.0704,
0,
0.66,
... | [
"\"\"\"Setup script for Google API Python client.\n\nAlso installs included versions of third party libraries, if those libraries\nare not already installed.\n\"\"\"",
"from setuptools import setup",
"packages = [\n 'apiclient',\n 'oauth2client',\n 'uritemplate',\n ]",
"install_requires = [\n 'httplib2... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
[
8,
0,
0.1048,
0.0568,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1397,
0.0044,
0,
0.66,
0.0556,
273,
0,
1,
0,
0,
273,
0,
0
],
[
1,
0,
0.1441,
0.0044,
0,
0.66... | [
"\"\"\"Build wiki page with a list of all samples.\n\nThe information for the wiki page is built from data found in all the README\nfiles in the samples. The format of the README file is:\n\n\n Description is everything up to the first blank line.",
"import httplib2",
"import itertools",
"import json",
"i... |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | [
[
8,
0,
0.0437,
0.0741,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0847,
0.0026,
0,
0.66,
0.0588,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0899,
0.0026,
0,
0.66,... | [
"\"\"\"Multi-credential file store with lock support.\n\nThis module implements a JSON credential store where multiple\ncredentials can be stored in one file. That file supports locking\nboth in a single process and across processes.\n\nThe credential themselves are keyed off of:\n* client_id",
"__author__ = 'jb... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.014,
0.0034,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.017,
0.0008,
0,
0.66,
0.0238,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0187,
0.0008,
0,
0.66,
... | [
"\"\"\"An OAuth 2.0 client.\n\nTools for interacting with OAuth 2.0 protected resources.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import base64",
"import clientsecrets",
"import copy",
"import datetime",
"import httplib2",
"import logging",
"import os",
"import sys",
"im... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1604,
0.0472,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1981,
0.0094,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.217,
0.0094,
0,
0.66,
... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 2.0\ncredentials.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import os",
"import stat",
"import threading",
"from anyjson import simplejson",
"from client import Storage as BaseStorage",
"from clien... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1371,
0.0403,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1694,
0.0081,
0,
0.66,
0.1111,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1855,
0.0081,
0,
0.66,... | [
"\"\"\"OAuth 2.0 utilities for Django.\n\nUtilities for using OAuth 2.0 in conjunction with\nthe Django datastore.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import oauth2client",
"import base64",
"import pickle",
"from django.db import models",
"from oauth2client.client import St... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
[
1,
0,
0.0732,
0.0041,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0772,
0.0041,
0,
0.66,
0.0588,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.0813,
0.0041,
0,
... | [
"import base64",
"import hashlib",
"import logging",
"import time",
"from OpenSSL import crypto",
"from anyjson import simplejson",
"logger = logging.getLogger(__name__)",
"CLOCK_SKEW_SECS = 300 # 5 minutes in seconds",
"AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds",
"MAX_TOKEN_LIFETIME... |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1133,
0.0333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.14,
0.0067,
0,
0.66,
0.0833,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.16,
0.0067,
0,
0.66,
... | [
"\"\"\"Utilities for reading OAuth 2.0 client secret files.\n\nA client_secrets.json file contains all the information needed to interact with\nan OAuth 2.0 protected service.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"from anyjson import simplejson",
"TYPE_WEB = 'web'",
"TYPE_INSTALL... |
__version__ = "1.0c2"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__ = \"1.0c2\""
] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.5312,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6562,
0.0312,
0,
0.66,
0.5,
777,
1,
0,
0,
0,
0,
3,
0
],
[
7,
0,
0.875,
0.2812,
0,
0.66,
... | [
"\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"try: # pragma: no cover\n # Should work for Python2.6 and higher.\n import json as simplejson\nexcept ImportError: #... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
[
8,
0,
0.3108,
0.1486,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4054,
0.0135,
0,
0.66,
0.0833,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4324,
0.0135,
0,
0.66,... | [
"\"\"\"Generate command-line samples from stubs.\n\nGenerates a command-line client sample application from a set of files\nthat contain only the relevant portions that change between each API.\nThis allows all the common code to go into a template.\n\nUsage:\n python sample_generator.py",
"__author__ = 'jcgrego... |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | [
[
8,
0,
0.0814,
0.1105,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1453,
0.0058,
0,
0.66,
0.0833,
162,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1512,
0.0058,
0,
0.66... | [
"\"\"\"MIME-Type Parser\n\nThis module provides basic functions for handling mime-types. It can handle\nmatching mime-types against a list of media-ranges. See section 14.1 of the\nHTTP specification [RFC 2616] for a complete explanation.\n\n http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1",
"__v... |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
[
8,
0,
0.0519,
0.0182,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0649,
0.0026,
0,
0.66,
0.0625,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0701,
0.0026,
0,
0.66,... | [
"\"\"\"Model objects for requests and responses.\n\nEach API may support one or more serializations, such\nas JSON, Atom, etc. The model classes are responsible\nfor converting between the wire format and the Python\nobject representation.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import... |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
[
8,
0,
0.1545,
0.0407,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.187,
0.0081,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2114,
0.0081,
0,
0.66,
... | [
"\"\"\"Errors for the library.\n\nAll exceptions defined by the library\nshould be defined in this file.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"from oauth2client.anyjson import simplejson",
"class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass",
" \"\"\"Base... |
__version__ = "1.0c2"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__ = \"1.0c2\""
] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1189,
0.1433,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.202,
0.0033,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2085,
0.0033,
0,
0.66,
... | [
"\"\"\"Schema processing for discovery based APIs\n\nSchemas holds an APIs discovery schemas. It can return those schema as\ndeserialized JSON objects, or pretty print them as prototype objects that\nconform to the schema.\n\nFor example, given the schema:",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
... |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | [
[
1,
0,
0.0204,
0.0068,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0272,
0.0068,
0,
0.66,
0.0833,
614,
0,
1,
0,
0,
614,
0,
0
],
[
14,
0,
0.0408,
0.0068,
0,
... | [
"import re",
"import urllib",
"RESERVED = \":/?#[]@!$&'()*+,;=\"",
"OPERATOR = \"+./;?|!@\"",
"EXPLODE = \"*+\"",
"MODIFIER = \":^\"",
"TEMPLATE = re.compile(r\"{(?P<operator>[\\+\\./;\\?|!@])?(?P<varlist>[^}]+)}\", re.UNICODE)",
"VAR = re.compile(r\"^(?P<varname>[^=\\+\\*:\\^]+)((?P<explode>[\\+\\*])... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.2615,
0.0769,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3077,
0.0154,
0,
0.66,
0.1,
182,
0,
1,
0,
0,
182,
0,
0
],
[
14,
0,
0.3538,
0.0462,
0,
0.66,
... | [
"\"\"\"Setup script for oauth2client.\n\nAlso installs included versions of third party libraries, if those libraries\nare not already installed.\n\"\"\"",
"from setuptools import setup",
"packages = [\n 'oauth2client',\n]",
"install_requires = [\n 'httplib2>=0.7.4',\n 'python-gflags',\n ]",
"need... |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
[
8,
0,
0.2151,
0.0753,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2688,
0.0108,
0,
0.66,
0.0714,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2903,
0.0108,
0,
0.66,... | [
"\"\"\"This example gets all custom channels an ad unit has been added to.\n\nTo get ad clients, run get_all_ad_clients.py. To get ad units, run\nget_all_ad_units.py.\n\nTags: customchannels.list\n\"\"\"",
"__author__ = 'sergio.gomes@google.com (Sergio Gomes)'",
"import sys",
"import gflags",
"from oauth2cl... |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
[
8,
0,
0.3364,
0.0727,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4,
0.0182,
0,
0.66,
0.1429,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4364,
0.0182,
0,
0.66,
... | [
"\"\"\"This example gets all accounts for the logged in user.\n\nTags: accounts.list\n\"\"\"",
"__author__ = 'sergio.gomes@google.com (Sergio Gomes)'",
"import sys",
"from oauth2client.client import AccessTokenRefreshError",
"import sample_utils",
"MAX_PAGE_SIZE = 50",
"def main(argv):\n sample_utils.p... |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
[
8,
0,
0.2468,
0.0759,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3038,
0.0127,
0,
0.66,
0.1,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3291,
0.0127,
0,
0.66,
... | [
"\"\"\"This example gets all custom channels in an ad client.\n\nTo get ad clients, run get_all_ad_clients.py.\n\nTags: customchannels.list\n\"\"\"",
"__author__ = 'sergio.gomes@google.com (Sergio Gomes)'",
"import sys",
"import gflags",
"from oauth2client.client import AccessTokenRefreshError",
"import s... |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
[
8,
0,
0.2826,
0.087,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3478,
0.0145,
0,
0.66,
0.1,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3768,
0.0145,
0,
0.66,
... | [
"\"\"\"This example gets a specific account for the logged in user.\n\nThis includes the full tree of sub-accounts.\n\nTags: accounts.get\n\"\"\"",
"__author__ = 'sergio.gomes@google.com (Sergio Gomes)'",
"import sys",
"import gflags",
"from oauth2client.client import AccessTokenRefreshError",
"import sam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.