code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
import gamewidget
firstRun = True
def run(widgets, gameDic):
global firstRun
if firstRun:
initialize(widgets, gameDic)
firstRun = False
widgets["game_info"].show()
def initialize(widgets, gameDic):
gamemodel = gameDic[gamewidget.cur_gmwidg()]
widgets["event_entry"].set_text(gamemod... | [
[
1,
0,
0.0244,
0.0244,
0,
0.66,
0,
632,
0,
1,
0,
0,
632,
0,
0
],
[
14,
0,
0.0732,
0.0244,
0,
0.66,
0.3333,
351,
1,
0,
0,
0,
0,
4,
0
],
[
2,
0,
0.1585,
0.1463,
0,
0... | [
"import gamewidget",
"firstRun = True",
"def run(widgets, gameDic):\n global firstRun\n if firstRun:\n initialize(widgets, gameDic)\n firstRun = False\n widgets[\"game_info\"].show()",
" if firstRun:\n initialize(widgets, gameDic)\n firstRun = False",
" initial... |
import gtk
import pango
import math
import random
from gtk.gdk import pixbuf_new_from_file
from pychess.Players.Human import Human
from pychess.Players.engineNest import discoverer
from pychess.System import uistuff, conf
from pychess.System.glock import glock_connect_after
from pychess.System.prefix import addDataPr... | [
[
1,
0,
0.0039,
0.0039,
0,
0.66,
0,
166,
0,
1,
0,
0,
166,
0,
0
],
[
1,
0,
0.0078,
0.0039,
0,
0.66,
0.0455,
288,
0,
1,
0,
0,
288,
0,
0
],
[
1,
0,
0.0118,
0.0039,
0,
... | [
"import gtk",
"import pango",
"import math",
"import random",
"from gtk.gdk import pixbuf_new_from_file",
"from pychess.Players.Human import Human",
"from pychess.Players.engineNest import discoverer",
"from pychess.System import uistuff, conf",
"from pychess.System.glock import glock_connect_after"... |
import sys
import time
import math
import gtk
import gobject
import cairo
if sys.platform == 'win32':
from pychess.System.WinRsvg import rsvg
else:
import rsvg
from pychess.System.uistuff import addDataPrefix
from pychess.System.repeat import repeat_sleep
from pychess.System import glock
MAX_FPS = 20
RAD_PS... | [
[
1,
0,
0.0141,
0.0141,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0282,
0.0141,
0,
0.66,
0.0833,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0423,
0.0141,
0,
... | [
"import sys",
"import time",
"import math",
"import gtk",
"import gobject",
"import cairo",
"if sys.platform == 'win32':\n from pychess.System.WinRsvg import rsvg\nelse:\n import rsvg",
" from pychess.System.WinRsvg import rsvg",
" import rsvg",
"from pychess.System.uistuff import addD... |
import os.path
import gettext
import locale
from cStringIO import StringIO
from operator import attrgetter
from itertools import groupby
import gtk
from cairo import ImageSurface
try:
from gtksourceview import SourceBuffer
from gtksourceview import SourceView
from gtksourceview import SourceLanguagesManag... | [
[
1,
0,
0.0017,
0.0017,
0,
0.66,
0,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.0035,
0.0017,
0,
0.66,
0.0227,
723,
0,
1,
0,
0,
723,
0,
0
],
[
1,
0,
0.0052,
0.0017,
0,
0.... | [
"import os.path",
"import gettext",
"import locale",
"from cStringIO import StringIO",
"from operator import attrgetter",
"from itertools import groupby",
"import gtk",
"from cairo import ImageSurface",
"try:\n from gtksourceview import SourceBuffer\n from gtksourceview import SourceView\n ... |
from time import strftime, gmtime, localtime
import random
import gtk
from gtk.gdk import keyval_from_name
import pango
import gobject
from pychess.System import uistuff
from BorderBox import BorderBox
class ChatView (gtk.VPaned):
__gsignals__ = {
'messageAdded' : (gobject.SIGNAL_RUN_FIRST, None, (str,st... | [
[
1,
0,
0.0074,
0.0074,
0,
0.66,
0,
654,
0,
3,
0,
0,
654,
0,
0
],
[
1,
0,
0.0148,
0.0074,
0,
0.66,
0.125,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0296,
0.0074,
0,
0... | [
"from time import strftime, gmtime, localtime",
"import random",
"import gtk",
"from gtk.gdk import keyval_from_name",
"import pango",
"import gobject",
"from pychess.System import uistuff",
"from BorderBox import BorderBox",
"class ChatView (gtk.VPaned):\n __gsignals__ = {\n 'messageAdded... |
import gtk, cairo
from math import ceil as fceil
ceil = lambda f: int(fceil(f))
from __init__ import NORTH, EAST, SOUTH, WEST, CENTER
from OverlayWindow import OverlayWindow
class HighlightArea (OverlayWindow):
""" An entirely blue widget """
def __init__ (self, parent):
OverlayWindow.__init__(s... | [
[
1,
0,
0.0185,
0.0185,
0,
0.66,
0,
166,
0,
2,
0,
0,
166,
0,
0
],
[
1,
0,
0.0556,
0.0185,
0,
0.66,
0.2,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.0741,
0.0185,
0,
0.... | [
"import gtk, cairo",
"from math import ceil as fceil",
"ceil = lambda f: int(fceil(f))",
"from __init__ import NORTH, EAST, SOUTH, WEST, CENTER",
"from OverlayWindow import OverlayWindow",
"class HighlightArea (OverlayWindow):\n \"\"\" An entirely blue widget \"\"\"\n \n def __init__ (self, paren... |
import os
import re
import sys
import gtk
import cairo
if sys.platform == 'win32':
from pychess.System.WinRsvg import rsvg
else:
import rsvg
class OverlayWindow (gtk.Window):
""" This class knows about being an overlaywindow and some svg stuff """
cache = {} # Class global self.cache for svgPat... | [
[
1,
0,
0.0079,
0.0079,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0157,
0.0079,
0,
0.66,
0.1667,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0236,
0.0079,
0,
... | [
"import os",
"import re",
"import sys",
"import gtk",
"import cairo",
"if sys.platform == 'win32':\n from pychess.System.WinRsvg import rsvg\nelse:\n import rsvg",
" from pychess.System.WinRsvg import rsvg",
" import rsvg",
"class OverlayWindow (gtk.Window):\n \"\"\" This class knows ... |
from math import ceil as float_ceil
ceil = lambda f: int(float_ceil(f))
import gtk, cairo
import gobject
from OverlayWindow import OverlayWindow
POSITIONS_COUNT = 5
NORTH, EAST, SOUTH, WEST, CENTER = range(POSITIONS_COUNT)
DX_DY = ((0,-1), (1,0), (0,1), (-1,0), (0,0))
PADDING_X = 0.2 # Amount of button width
PADDING... | [
[
1,
0,
0.0053,
0.0053,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.0105,
0.0053,
0,
0.66,
0.0909,
211,
9,
0,
0,
0,
0,
0,
2
],
[
1,
0,
0.0211,
0.0053,
0,
0... | [
"from math import ceil as float_ceil",
"ceil = lambda f: int(float_ceil(f))",
"import gtk, cairo",
"import gobject",
"from OverlayWindow import OverlayWindow",
"POSITIONS_COUNT = 5",
"NORTH, EAST, SOUTH, WEST, CENTER = range(POSITIONS_COUNT)",
"DX_DY = ((0,-1), (1,0), (0,1), (-1,0), (0,0))",
"PADDIN... |
import gtk
#===============================================================================
# Composite Constants
#===============================================================================
POSITIONS_COUNT = 5
NORTH, EAST, SOUTH, WEST, CENTER = range(POSITIONS_COUNT)
#===========================================... | [
[
1,
0,
0.0075,
0.0075,
0,
0.66,
0,
166,
0,
1,
0,
0,
166,
0,
0
],
[
14,
0,
0.0526,
0.0075,
0,
0.66,
0.1429,
373,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.0602,
0.0075,
0,
... | [
"import gtk",
"POSITIONS_COUNT = 5",
"NORTH, EAST, SOUTH, WEST, CENTER = range(POSITIONS_COUNT)",
"class DockComponent (object):\n def dock (self, widget, position, title, id):\n raise NotImplementedError",
" def dock (self, widget, position, title, id):\n raise NotImplementedError",
"... |
import gtk, cairo
import gobject
from OverlayWindow import OverlayWindow
from __init__ import NORTH, EAST, SOUTH, WEST
class ArrowButton (OverlayWindow):
""" Leafs will connect to the drag-drop signal """
__gsignals__ = {
'dropped' : (gobject.SIGNAL_RUN_FIRST, None, (object,)),
'hovered'... | [
[
1,
0,
0.0093,
0.0093,
0,
0.66,
0,
166,
0,
2,
0,
0,
166,
0,
0
],
[
1,
0,
0.0185,
0.0093,
0,
0.66,
0.25,
90,
0,
1,
0,
0,
90,
0,
0
],
[
1,
0,
0.037,
0.0093,
0,
0.66,... | [
"import gtk, cairo",
"import gobject",
"from OverlayWindow import OverlayWindow",
"from __init__ import NORTH, EAST, SOUTH, WEST",
"class ArrowButton (OverlayWindow):\n \"\"\" Leafs will connect to the drag-drop signal \"\"\"\n \n __gsignals__ = {\n 'dropped' : (gobject.SIGNAL_RUN_FIRST, Non... |
import os
from xml.dom import minidom
import gtk
import gobject
from pychess.System.prefix import addDataPrefix
from PyDockLeaf import PyDockLeaf
from PyDockComposite import PyDockComposite
from ArrowButton import ArrowButton
from HighlightArea import HighlightArea
from __init__ import TopDock, DockLeaf, DockCompone... | [
[
1,
0,
0.0052,
0.0052,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0105,
0.0052,
0,
0.66,
0.0909,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0209,
0.0052,
0,
... | [
"import os",
"from xml.dom import minidom",
"import gtk",
"import gobject",
"from pychess.System.prefix import addDataPrefix",
"from PyDockLeaf import PyDockLeaf",
"from PyDockComposite import PyDockComposite",
"from ArrowButton import ArrowButton",
"from HighlightArea import HighlightArea",
"from... |
import sys
import gtk
from __init__ import DockComposite
from __init__ import NORTH, EAST, SOUTH, WEST, CENTER
class PyDockComposite (gtk.Alignment, DockComposite):
def __init__ (self, position):
gtk.Alignment.__init__(self, xscale=1, yscale=1)
if position == NORTH or position == SOUTH:
... | [
[
1,
0,
0.012,
0.012,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0361,
0.012,
0,
0.66,
0.25,
166,
0,
1,
0,
0,
166,
0,
0
],
[
1,
0,
0.0602,
0.012,
0,
0.66,
... | [
"import sys",
"import gtk",
"from __init__ import DockComposite",
"from __init__ import NORTH, EAST, SOUTH, WEST, CENTER",
"class PyDockComposite (gtk.Alignment, DockComposite):\n def __init__ (self, position):\n gtk.Alignment.__init__(self, xscale=1, yscale=1)\n \n if position == NO... |
""" This module intends to work as glue between the gamemodel and the gamewidget
taking care of stuff that is neither very offscreen nor very onscreen
like bringing up dialogs and """
import math
import gtk
from pychess.Utils.Offer import Offer
from pychess.Utils.const import *
from pychess.Utils.repr import... | [
[
8,
0,
0.0068,
0.0102,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0171,
0.0034,
0,
0.66,
0.04,
526,
0,
1,
0,
0,
526,
0,
0
],
[
1,
0,
0.0239,
0.0034,
0,
0.66,
... | [
"\"\"\" This module intends to work as glue between the gamemodel and the gamewidget\n taking care of stuff that is neither very offscreen nor very onscreen\n like bringing up dialogs and \"\"\"",
"import math",
"import gtk",
"from pychess.Utils.Offer import Offer",
"from pychess.Utils.const import *"... |
import re
from pychess.Utils.const import *
import time
import math
from pychess.System import conf
elemExpr = re.compile(r"([a-zA-Z])\s*([0-9\.,\s]*)\s+")
spaceExpr = re.compile(r"[\s,]+")
l = []
def parse(n, psize):
yield "def f(c):"
s = psize/size
for cmd, points in n:
pstr = ",".join(str(p*s)... | [
[
1,
0,
0.0082,
0.0082,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0164,
0.0082,
0,
0.66,
0.0556,
297,
0,
1,
0,
0,
297,
0,
0
],
[
1,
0,
0.0246,
0.0082,
0,
... | [
"import re",
"from pychess.Utils.const import *",
"import time",
"import math",
"from pychess.System import conf",
"elemExpr = re.compile(r\"([a-zA-Z])\\s*([0-9\\.,\\s]*)\\s+\")",
"spaceExpr = re.compile(r\"[\\s,]+\")",
"l = []",
"def parse(n, psize):\n yield \"def f(c):\"\n s = psize/size\n ... |
from gtk import icon_theme_get_default, ICON_LOOKUP_USE_BUILTIN
from pychess.System.Log import log
it = icon_theme_get_default()
def load_icon(size, *alternatives):
alternatives = list(alternatives)
name = alternatives.pop(0)
try:
return it.load_icon(name, size, ICON_LOOKUP_USE_BUILTIN)
except:... | [
[
1,
0,
0.0769,
0.0769,
0,
0.66,
0,
166,
0,
2,
0,
0,
166,
0,
0
],
[
1,
0,
0.1538,
0.0769,
0,
0.66,
0.3333,
954,
0,
1,
0,
0,
954,
0,
0
],
[
14,
0,
0.3077,
0.0769,
0,
... | [
"from gtk import icon_theme_get_default, ICON_LOOKUP_USE_BUILTIN",
"from pychess.System.Log import log",
"it = icon_theme_get_default()",
"def load_icon(size, *alternatives):\n alternatives = list(alternatives)\n name = alternatives.pop(0)\n try:\n return it.load_icon(name, size, ICON_LOOKUP_U... |
from const import *
import __builtin__
if '_' not in __builtin__.__dict__:
__builtin__.__dict__['_'] = lambda s: s
reprColor = [_("White"), _("Black")]
reprPiece = ["Empty", _("Pawn"), _("Knight"), _("Bishop"), _("Rook"), _("Queen"), _("King"), "BPawn"]
localReprSign = ["", _("P"), _("N"), _("B"), _("R"), _("Q... | [
[
1,
0,
0.0164,
0.0164,
0,
0.66,
0,
798,
0,
1,
0,
0,
798,
0,
0
],
[
1,
0,
0.0492,
0.0164,
0,
0.66,
0.1429,
364,
0,
1,
0,
0,
364,
0,
0
],
[
4,
0,
0.0738,
0.0328,
0,
... | [
"from const import *",
"import __builtin__",
"if '_' not in __builtin__.__dict__:\n __builtin__.__dict__['_'] = lambda s: s",
" __builtin__.__dict__['_'] = lambda s: s",
"reprColor = [_(\"White\"), _(\"Black\")]",
"reprPiece = [\"Empty\", _(\"Pawn\"), _(\"Knight\"), _(\"Bishop\"), _(\"Rook\"), _(\"Q... |
################################################################################
# This module is deprecated and uses no longer existing APIs.
# After work has been made towards supporting general book formats, its
# usefulness may also be disputed.
#####################################################################... | [
[
1,
0,
0.0497,
0.0062,
0,
0.66,
0,
336,
0,
1,
0,
0,
336,
0,
0
],
[
1,
0,
0.0559,
0.0062,
0,
0.66,
0.0556,
626,
0,
1,
0,
0,
626,
0,
0
],
[
1,
0,
0.0621,
0.0062,
0,
... | [
"from pychess.System import tsqlite",
"from pychess.System.ThreadPool import pool",
"from pychess.System.prefix import addDataPrefix",
"from pychess.Utils.const import *",
"from time import time",
"import atexit",
"import os.path",
"import re",
"import sys",
"path = os.path.join(addDataPrefix(\"op... |
""" This module contains chess logic functins for the pychess client. They are
based upon the lutils modules, but supports standard object types and is
therefore not as fast. """
from lutils import lmovegen
from lutils.validator import validateMove
from lutils.lmove import FCORD, TCORD
from lutils import ldraw... | [
[
8,
0,
0.0146,
0.0219,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0365,
0.0073,
0,
0.66,
0.0526,
839,
0,
1,
0,
0,
839,
0,
0
],
[
1,
0,
0.0438,
0.0073,
0,
0.66... | [
"\"\"\" This module contains chess logic functins for the pychess client. They are\n based upon the lutils modules, but supports standard object types and is\n therefore not as fast. \"\"\"",
"from lutils import lmovegen",
"from lutils.validator import validateMove",
"from lutils.lmove import FCORD, TCO... |
from pychess.Utils.const import *
import gobject
class Rating (gobject.GObject):
def __init__(self, ratingtype, elo, deviation=DEVIATION_NONE, wins=0,
losses=0, draws=0, bestElo=0, bestTime=0):
gobject.GObject.__init__(self)
self.type = ratingtype
for v in (elo, deviation, ... | [
[
1,
0,
0.0161,
0.0161,
0,
0.66,
0,
297,
0,
1,
0,
0,
297,
0,
0
],
[
1,
0,
0.0323,
0.0161,
0,
0.66,
0.5,
90,
0,
1,
0,
0,
90,
0,
0
],
[
3,
0,
0.5323,
0.9516,
0,
0.66,... | [
"from pychess.Utils.const import *",
"import gobject",
"class Rating (gobject.GObject):\n def __init__(self, ratingtype, elo, deviation=DEVIATION_NONE, wins=0,\n losses=0, draws=0, bestElo=0, bestTime=0):\n gobject.GObject.__init__(self)\n self.type = ratingtype\n for v i... |
from pychess.Utils.const import ACTIONS
class Offer:
def __init__(self, type_, param=None, index=None):
assert type_ in ACTIONS, "Offer.__init__(): type not in ACTIONS: %s" % repr(type_)
assert index is None or type(index) is int, \
"Offer.__init__(): index not int: %s" % repr(index)
... | [
[
1,
0,
0.04,
0.04,
0,
0.66,
0,
297,
0,
1,
0,
0,
297,
0,
0
],
[
3,
0,
0.56,
0.92,
0,
0.66,
1,
531,
0,
4,
0,
0,
0,
0,
12
],
[
2,
1,
0.28,
0.28,
1,
0.61,
0,
5... | [
"from pychess.Utils.const import ACTIONS",
"class Offer:\n def __init__(self, type_, param=None, index=None):\n assert type_ in ACTIONS, \"Offer.__init__(): type not in ACTIONS: %s\" % repr(type_)\n assert index is None or type(index) is int, \\\n \"Offer.__init__(): index not int: %s\... |
from bitboard import *
from attack import *
from pychess.Utils.const import *
from lmove import newMove
################################################################################
# Generate all moves #
####################################################... | [
[
1,
0,
0.0042,
0.0021,
0,
0.66,
0,
866,
0,
1,
0,
0,
866,
0,
0
],
[
1,
0,
0.0063,
0.0021,
0,
0.66,
0.125,
424,
0,
1,
0,
0,
424,
0,
0
],
[
1,
0,
0.0084,
0.0021,
0,
0... | [
"from bitboard import *",
"from attack import *",
"from pychess.Utils.const import *",
"from lmove import newMove",
"def genCastles (board):\n def generateOne (color, rooknum, king_after, rook_after):\n if rooknum == 0:\n castle = QUEEN_CASTLE\n else:\n castle = KING_C... |
from attack import getAttacks, staticExchangeEvaluate
from pychess.Utils.eval import pos as positionValues
from sys import maxint
from ldata import *
def getCaptureValue (board, move):
mpV = PIECE_VALUES[board.arBoard[move>>6 & 63]]
cpV = PIECE_VALUES[board.arBoard[move & 63]]
if mpV < cpV:
retur... | [
[
1,
0,
0.0263,
0.0132,
0,
0.66,
0,
424,
0,
2,
0,
0,
424,
0,
0
],
[
1,
0,
0.0395,
0.0132,
0,
0.66,
0.1429,
600,
0,
1,
0,
0,
600,
0,
0
],
[
1,
0,
0.0658,
0.0132,
0,
... | [
"from attack import getAttacks, staticExchangeEvaluate",
"from pychess.Utils.eval import pos as positionValues",
"from sys import maxint",
"from ldata import *",
"def getCaptureValue (board, move):\n mpV = PIECE_VALUES[board.arBoard[move>>6 & 63]]\n cpV = PIECE_VALUES[board.arBoard[move & 63]]\n if... |
from UserDict import UserDict
from pychess.Utils.const import hashfALPHA, hashfBETA, hashfEXACT, hashfBAD, WHITE
from ldata import MATE_VALUE
from pychess.System.LimitedDict import LimitedDict
from types import InstanceType
from lmove import TCORD, FCORD
class TranspositionTable:
def __init__ (self, maxSize):
... | [
[
1,
0,
0.0119,
0.0119,
0,
0.66,
0,
351,
0,
1,
0,
0,
351,
0,
0
],
[
1,
0,
0.0238,
0.0119,
0,
0.66,
0.1667,
297,
0,
5,
0,
0,
297,
0,
0
],
[
1,
0,
0.0357,
0.0119,
0,
... | [
"from UserDict import UserDict",
"from pychess.Utils.const import hashfALPHA, hashfBETA, hashfEXACT, hashfBAD, WHITE",
"from ldata import MATE_VALUE",
"from pychess.System.LimitedDict import LimitedDict",
"from types import InstanceType",
"from lmove import TCORD, FCORD",
"class TranspositionTable:\n ... |
from pychess.Utils.const import *
from pychess.Utils.lutils.attack import isAttacked
from pychess.Utils.lutils.bitboard import bitPosArray, clearBit
from pychess.Utils.lutils.ldata import moveArray, fromToRay
################################################################################
# Validate move ... | [
[
1,
0,
0.005,
0.005,
0,
0.66,
0,
297,
0,
1,
0,
0,
297,
0,
0
],
[
1,
0,
0.01,
0.005,
0,
0.66,
0.2,
763,
0,
1,
0,
0,
763,
0,
0
],
[
1,
0,
0.015,
0.005,
0,
0.66,
... | [
"from pychess.Utils.const import *",
"from pychess.Utils.lutils.attack import isAttacked",
"from pychess.Utils.lutils.bitboard import bitPosArray, clearBit",
"from pychess.Utils.lutils.ldata import moveArray, fromToRay",
"def validateMove (board, move):\n \n fcord = (move >> 6) & 63\n \n fpiece ... |
from array import array
from operator import or_
from pychess.Utils.const import *
#from pychess.Utils.lutils.lmove import RANK, FILE
from bitboard import *
def RANK (cord): return cord >> 3
def FILE (cord): return cord & 7
################################################################################
###############... | [
[
1,
0,
0.0017,
0.0017,
0,
0.66,
0,
80,
0,
1,
0,
0,
80,
0,
0
],
[
1,
0,
0.0033,
0.0017,
0,
0.66,
0.0095,
616,
0,
1,
0,
0,
616,
0,
0
],
[
1,
0,
0.005,
0.0017,
0,
0.6... | [
"from array import array",
"from operator import or_",
"from pychess.Utils.const import *",
"from bitboard import *",
"def RANK (cord): return cord >> 3",
"def RANK (cord): return cord >> 3",
"def FILE (cord): return cord & 7",
"def FILE (cord): return cord & 7",
"PAWN_VALUE = 100",
"KNIGHT_VALUE ... |
from time import time
from random import random
from heapq import heappush, heappop
from lmovegen import genAllMoves, genCheckEvasions, genCaptures
from pychess.Utils.const import *
from leval import evaluateComplete
from lsort import getCaptureValue, getMoveValue
from lmove import toSAN
from ldata import MATE_VALUE
f... | [
[
1,
0,
0.0035,
0.0035,
0,
0.66,
0,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.007,
0.0035,
0,
0.66,
0.0435,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0105,
0.0035,
0,
0... | [
"from time import time",
"from random import random",
"from heapq import heappush, heappop",
"from lmovegen import genAllMoves, genCheckEvasions, genCaptures",
"from pychess.Utils.const import *",
"from leval import evaluateComplete",
"from lsort import getCaptureValue, getMoveValue",
"from lmove impo... |
from bitboard import *
from ldata import *
from pychess.Utils.const import *
#
# Caveat: Many functions in this module has very similar code. If you fix a
# bug, or write a perforance enchace, please update all functions. Apologies
# for the inconvenience
#
def isAttacked (board, cord, color):
""" To determine if... | [
[
1,
0,
0.0032,
0.0032,
0,
0.66,
0,
866,
0,
1,
0,
0,
866,
0,
0
],
[
1,
0,
0.0063,
0.0032,
0,
0.66,
0.1,
17,
0,
1,
0,
0,
17,
0,
0
],
[
1,
0,
0.0095,
0.0032,
0,
0.66,... | [
"from bitboard import *",
"from ldata import *",
"from pychess.Utils.const import *",
"def isAttacked (board, cord, color):\n \"\"\" To determine if cord is attacked by any pieces from color. \"\"\"\n pboards = board.boards[color]\n \n # Knights\n if pboards[KNIGHT] & moveArray[KNIGHT][cord]:\n... |
################################################################################
# The purpose of this module, is to give a certain position a score. The #
# greater the score, the better the position #
############################################################################... | [
[
1,
0,
0.0117,
0.0017,
0,
0.66,
0,
297,
0,
1,
0,
0,
297,
0,
0
],
[
1,
0,
0.0133,
0.0017,
0,
0.66,
0.0435,
17,
0,
1,
0,
0,
17,
0,
0
],
[
1,
0,
0.015,
0.0017,
0,
0.6... | [
"from pychess.Utils.const import *",
"from ldata import *",
"from LBoard import LBoard",
"from lsort import staticExchangeEvaluate",
"from lmove import newMove",
"randomval = 0 #randint(8,12)/10.",
"def evaluateComplete (board, color, balanced=False):\n \"\"\" A detailed evaluation function, taking i... |
"""
This module differs from leval in that it is not optimized for speed.
It checks differences between last and current board, and returns not
scores, but strings describing the differences.
Can be used for commenting on board changes.
"""
from gettext import ngettext
from ldata import *
from pychess.... | [
[
8,
0,
0.0051,
0.0088,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0117,
0.0015,
0,
0.66,
0.037,
723,
0,
1,
0,
0,
723,
0,
0
],
[
1,
0,
0.0132,
0.0015,
0,
0.66,... | [
"\"\"\"\n This module differs from leval in that it is not optimized for speed.\n It checks differences between last and current board, and returns not\n scores, but strings describing the differences.\n Can be used for commenting on board changes.\n\"\"\"",
"from gettext import ngettext",
"from lda... |
from bitboard import bitLength
from ldata import BLACK_SQUARES
from pychess.Utils.const import *
def repetitionCount (board, drawThreshold=3):
rc = 1
for ply in xrange(4, 1+min(len(board.history), board.fifty), 2):
if board.history[-ply] is None:
break # Game started from a position; early ... | [
[
1,
0,
0.011,
0.011,
0,
0.66,
0,
866,
0,
1,
0,
0,
866,
0,
0
],
[
1,
0,
0.022,
0.011,
0,
0.66,
0.1111,
17,
0,
1,
0,
0,
17,
0,
0
],
[
1,
0,
0.033,
0.011,
0,
0.66,
... | [
"from bitboard import bitLength",
"from ldata import BLACK_SQUARES",
"from pychess.Utils.const import *",
"def repetitionCount (board, drawThreshold=3):\n rc = 1\n for ply in xrange(4, 1+min(len(board.history), board.fifty), 2):\n if board.history[-ply] is None:\n break # Game started ... |
try:
from gmpy import mpz
uselp = False
except ImportError:
uselp = True
from array import array
#===============================================================================
# createBoard returns a new bitboard in the format preferred by this module
#=====================================... | [
[
7,
0,
0.0262,
0.0349,
0,
0.66,
0,
0,
0,
1,
0,
0,
0,
0,
0
],
[
1,
1,
0.0174,
0.0058,
1,
0.63,
0,
216,
0,
1,
0,
0,
216,
0,
0
],
[
14,
1,
0.0233,
0.0058,
1,
0.63,
... | [
"try:\n from gmpy import mpz\n uselp = False\nexcept ImportError:\n uselp = True\n from array import array",
" from gmpy import mpz",
" uselp = False",
" uselp = True",
" from array import array",
"def createBoard (number):\n return mpz(number)",
" return mpz(number)",
"i... |
### DEPRECATED
### SHOULD ONLY BE USED AS A REFERENCE TO MAKE leval
pieceValues = [0, 900, 500, 350, 300, 100]
from array import array
from pychess.Utils.const import *
# these tables will be used for positional bonuses: #
whiteknight = array('b', [
-20, -35,-10, -10, -10,-10, -35, -20,
-1... | [
[
14,
0,
0.0084,
0.0017,
0,
0.66,
0,
106,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0117,
0.0017,
0,
0.66,
0.0303,
80,
0,
1,
0,
0,
80,
0,
0
],
[
1,
0,
0.0134,
0.0017,
0,
0.6... | [
"pieceValues = [0, 900, 500, 350, 300, 100]",
"from array import array",
"from pychess.Utils.const import *",
"whiteknight = array('b', [\n -20, -35,-10, -10, -10,-10, -35, -20,\n -10, 0, 0, 3, 3, 0, 0, -10,\n -10, 0, 15, 15, 15, 15, 0, -10,\n -10, ... |
from copy import copy
from lutils.LBoard import LBoard
from lutils.bitboard import iterBits
from lutils.lmove import RANK, FILE, FLAG, PROMOTE_PIECE, toAN
from Piece import Piece
from Cord import Cord
from const import *
class Board:
""" Board is a thin layer above LBoard, adding the Piece objects, which are
... | [
[
1,
0,
0.0041,
0.0041,
0,
0.66,
0,
739,
0,
1,
0,
0,
739,
0,
0
],
[
1,
0,
0.0122,
0.0041,
0,
0.66,
0.1429,
33,
0,
1,
0,
0,
33,
0,
0
],
[
1,
0,
0.0163,
0.0041,
0,
0.... | [
"from copy import copy",
"from lutils.LBoard import LBoard",
"from lutils.bitboard import iterBits",
"from lutils.lmove import RANK, FILE, FLAG, PROMOTE_PIECE, toAN",
"from Piece import Piece",
"from Cord import Cord",
"from const import *",
"class Board:\n \"\"\" Board is a thin layer above LBoard... |
# -*- coding: UTF-8 -*-
################################################################################
# PyChess information #
################################################################################
NAME = "PyChess"
ENGINES_XML_API_VERSION = "0.10.1"... | [
[
14,
0,
0.0311,
0.0044,
0,
0.66,
0,
181,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0356,
0.0044,
0,
0.66,
0.0152,
501,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0667,
0.0044,
0,
0... | [
"NAME = \"PyChess\"",
"ENGINES_XML_API_VERSION = \"0.10.1\"",
"LOCAL, ARTIFICIAL, REMOTE = range(3)",
"EASY, INTERMEDIATE, EXPERT = range(3)",
"WHITE, BLACK = range(2)",
"WAITING_TO_START, PAUSED, RUNNING, DRAW, WHITEWON, BLACKWON, KILLED, \\\n ADJOURNED, ABORTED, UNKNOWN_STATE = range(10)",
"reprRes... |
from pychess.Utils.const import KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN
from pychess.Utils.repr import reprSign, reprColor, reprPiece
class Piece:
def __init__ (self, color, piece):
self.color = color
self.piece = piece
self.opacity = 1.0
self.x = None
self.y = Non... | [
[
1,
0,
0.0303,
0.0303,
0,
0.66,
0,
297,
0,
6,
0,
0,
297,
0,
0
],
[
1,
0,
0.0606,
0.0303,
0,
0.66,
0.5,
985,
0,
3,
0,
0,
985,
0,
0
],
[
3,
0,
0.5758,
0.8788,
0,
0.6... | [
"from pychess.Utils.const import KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN",
"from pychess.Utils.repr import reprSign, reprColor, reprPiece",
"class Piece:\n def __init__ (self, color, piece):\n self.color = color\n self.piece = piece\n \n self.opacity = 1.0\n self.x = None\n... |
import heapq
from time import time
from gobject import SIGNAL_RUN_FIRST, TYPE_NONE, GObject
from pychess.Utils.const import WHITE, BLACK
from pychess.System import repeat
from pychess.System.Log import log
class TimeModel (GObject):
__gsignals__ = {
"player_changed": (SIGNAL_RUN_FIRST, TYPE_NONE, ()),... | [
[
1,
0,
0.0044,
0.0044,
0,
0.66,
0,
251,
0,
1,
0,
0,
251,
0,
0
],
[
1,
0,
0.0088,
0.0044,
0,
0.66,
0.1667,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0132,
0.0044,
0,
... | [
"import heapq",
"from time import time",
"from gobject import SIGNAL_RUN_FIRST, TYPE_NONE, GObject",
"from pychess.Utils.const import WHITE, BLACK",
"from pychess.System import repeat",
"from pychess.System.Log import log",
"class TimeModel (GObject):\n \n __gsignals__ = {\n \"player_change... |
import datetime
from pychess.Utils.const import RUNNING
class LoadingError (Exception): pass
class ChessFile:
""" This class descripes an opened chessfile.
It is lazy in the sense of not parsing any games,
that the user don't request.
It has no catching. """
def __init__ (self, ga... | [
[
1,
0,
0.0149,
0.0149,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0299,
0.0149,
0,
0.66,
0.3333,
297,
0,
1,
0,
0,
297,
0,
0
],
[
3,
0,
0.0597,
0.0149,
0,
... | [
"import datetime",
"from pychess.Utils.const import RUNNING",
"class LoadingError (Exception): pass",
"class ChessFile:\n \"\"\" This class descripes an opened chessfile.\n It is lazy in the sense of not parsing any games,\n that the user don't request.\n It has no catching. \"\"\"\n ... |
__all__ = ["fen", "epd", "pgn",'chessalpha2']
| [
[
14,
0,
1,
1,
0,
0.66,
0,
272,
0,
0,
0,
0,
0,
5,
0
]
] | [
"__all__ = [\"fen\", \"epd\", \"pgn\",'chessalpha2']"
] |
# -*- coding: utf-8 -*-
from ChessFile import ChessFile, LoadingError
from htmlentitydefs import entitydefs
from pychess.Utils import Cord
from pychess.Utils.GameModel import GameModel
from pychess.Utils.Move import toFAN
from pychess.Utils.Piece import Piece
from pychess.Utils.const import *
from pychess.Utils.logic ... | [
[
1,
0,
0.0204,
0.0068,
0,
0.66,
0,
326,
0,
2,
0,
0,
326,
0,
0
],
[
1,
0,
0.0272,
0.0068,
0,
0.66,
0.0345,
744,
0,
1,
0,
0,
744,
0,
0
],
[
1,
0,
0.034,
0.0068,
0,
0... | [
"from ChessFile import ChessFile, LoadingError",
"from htmlentitydefs import entitydefs",
"from pychess.Utils import Cord",
"from pychess.Utils.GameModel import GameModel",
"from pychess.Utils.Move import toFAN",
"from pychess.Utils.Piece import Piece",
"from pychess.Utils.const import *",
"from pyche... |
from pychess.Utils.GameModel import GameModel
from pychess.Utils.const import WAITING_TO_START
from pychess.Utils.logic import getStatus
__label__ = _("Simple Chess Position")
__endings__ = "fen",
__append__ = True
def save (file, model):
"""Saves game to file in fen format"""
print >> file, model.boards... | [
[
1,
0,
0.0278,
0.0278,
0,
0.66,
0,
182,
0,
1,
0,
0,
182,
0,
0
],
[
1,
0,
0.0556,
0.0278,
0,
0.66,
0.1111,
297,
0,
1,
0,
0,
297,
0,
0
],
[
1,
0,
0.0833,
0.0278,
0,
... | [
"from pychess.Utils.GameModel import GameModel",
"from pychess.Utils.const import WAITING_TO_START",
"from pychess.Utils.logic import getStatus",
"__label__ = _(\"Simple Chess Position\")",
"__endings__ = \"fen\",",
"__append__ = True",
"def save (file, model):\n \"\"\"Saves game to file in fen forma... |
VERSION = "0.10"
VERSION_NAME = "Staunton"
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
557,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
1,
0.5,
0,
0.66,
1,
916,
1,
0,
0,
0,
0,
3,
0
]
] | [
"VERSION = \"0.10\"",
"VERSION_NAME = \"Staunton\""
] |
import os
import webbrowser
import math
import atexit
import signal
import gobject, gtk
from gtk import DEST_DEFAULT_MOTION, DEST_DEFAULT_HIGHLIGHT, DEST_DEFAULT_DROP
from pychess.System import conf, glock, uistuff, prefix, SubProcess, Log
from pychess.System.uistuff import POSITION_NONE, POSITION_CENTER, POSITION_GO... | [
[
1,
0,
0.0031,
0.0031,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0063,
0.0031,
0,
0.66,
0.0333,
461,
0,
1,
0,
0,
461,
0,
0
],
[
1,
0,
0.0094,
0.0031,
0,
... | [
"import os",
"import webbrowser",
"import math",
"import atexit",
"import signal",
"import gobject, gtk",
"from gtk import DEST_DEFAULT_MOTION, DEST_DEFAULT_HIGHLIGHT, DEST_DEFAULT_DROP",
"from pychess.System import conf, glock, uistuff, prefix, SubProcess, Log",
"from pychess.System.uistuff import ... |
from gobject import GObject, SIGNAL_RUN_FIRST, TYPE_NONE
class PlayerIsDead (Exception):
""" Used instead of returning a move,
when an engine crashes, or a nonlocal player disconnects """
pass
class TurnInterrupt (Exception):
""" Used instead of returning a move, when a players turn is interrupted... | [
[
1,
0,
0.0068,
0.0068,
0,
0.66,
0,
90,
0,
3,
0,
0,
90,
0,
0
],
[
3,
0,
0.0308,
0.0274,
0,
0.66,
0.3333,
977,
0,
0,
0,
0,
645,
0,
0
],
[
8,
1,
0.0308,
0.0137,
1,
0.... | [
"from gobject import GObject, SIGNAL_RUN_FIRST, TYPE_NONE",
"class PlayerIsDead (Exception):\n \"\"\" Used instead of returning a move,\n when an engine crashes, or a nonlocal player disconnects \"\"\"\n pass",
" \"\"\" Used instead of returning a move,\n when an engine crashes, or a nonl... |
from gobject import SIGNAL_RUN_FIRST
from threading import Condition
from pychess.System.Log import log
from pychess.Players.Engine import Engine
from pychess.Utils.const import *
from pychess.Utils.repr import reprColor
class ProtocolEngine (Engine):
__gsignals__ = {
"readyForOptions": (SIGNAL_RUN_F... | [
[
1,
0,
0.0278,
0.0278,
0,
0.66,
0,
90,
0,
1,
0,
0,
90,
0,
0
],
[
1,
0,
0.0556,
0.0278,
0,
0.66,
0.1667,
83,
0,
1,
0,
0,
83,
0,
0
],
[
1,
0,
0.1111,
0.0278,
0,
0.66... | [
"from gobject import SIGNAL_RUN_FIRST",
"from threading import Condition",
"from pychess.System.Log import log",
"from pychess.Players.Engine import Engine",
"from pychess.Utils.const import *",
"from pychess.Utils.repr import reprColor",
"class ProtocolEngine (Engine):\n \n __gsignals__ = {\n ... |
from Queue import Queue
import gtk, gobject
from pychess.Utils.const import *
from pychess.Utils.Offer import Offer
from pychess.System.Log import log
from pychess.System import glock, conf
from Player import Player, PlayerIsDead, TurnInterrupt
OFFER_MESSAGES = {
DRAW_OFFER:
(_("Your opponent has offere... | [
[
1,
0,
0.0038,
0.0038,
0,
0.66,
0,
952,
0,
1,
0,
0,
952,
0,
0
],
[
1,
0,
0.0113,
0.0038,
0,
0.66,
0.0909,
166,
0,
2,
0,
0,
166,
0,
0
],
[
1,
0,
0.0189,
0.0038,
0,
... | [
"from Queue import Queue",
"import gtk, gobject",
"from pychess.Utils.const import *",
"from pychess.Utils.Offer import Offer",
"from pychess.System.Log import log",
"from pychess.System import glock, conf",
"from Player import Player, PlayerIsDead, TurnInterrupt",
"OFFER_MESSAGES = {\n DRAW_OFFER:... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0151,
0.0102,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0211,
0.0006,
0,
0.66,
0.0149,
312,
0,
1,
0,
0,
312,
0,
0
],
[
1,
0,
0.0217,
0.0006,
0,
0.66... | [
"\"\"\"Enforces schema and verifies course files for referential integrity.\n\nUse this script to verify referential integrity of your course definition files\nbefore you import them into the production instance of Google AppEngine.\n\nHere is how to use the script:\n - prepare your course files\n - edi... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0968,
0.0065,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1097,
0.0065,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1226,
0.0065,
0,
0.66,... | [
"\"\"\"Allows export of Lessons and Units to other systems.\"\"\"",
"__author__ = 'psimakov@google.com (Pavel Simakov)'",
"from datetime import datetime",
"import os",
"import verify",
"RELEASE_TAG = '1.0'",
"def echo(unused_x):\n pass",
"JS_GCB_REGEX = \"\"\"\nfunction gcb_regex(base, modifiers) {... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1104,
0.0429,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1472,
0.0184,
0,
0.66,
0.0909,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1656,
0.0061,
0,
0.66,... | [
"\"\"\"Examples of custom extract-transform-load jobs.\n\nCustom jobs are run via tools/etl/etl.py. You must do environment setup before\netl.py can be invoked; see its module docstring for details.\n\nSee tools/etl/etl_lib.py for documentation on writing Job subclasses.\n\"\"\"",
"__author__ = [\n 'johncox@go... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1034,
0.0069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1241,
0.0207,
0,
0.66,
0.0476,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1448,
0.0069,
0,
0.66,... | [
"\"\"\"Remote environment manager for extract-transform-load utilities.\"\"\"",
"__author__ = [\n 'johncox@google.com',\n]",
"import os",
"import sys",
"import appengine_config",
"SERVER_SOFTWARE = 'Production Emulation'",
"if appengine_config.PRODUCTION_MODE:\n sys.exit('Running etl/tools/remote.... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0297,
0.002,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0356,
0.0059,
0,
0.66,
0.0714,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0416,
0.002,
0,
0.66,
... | [
"\"\"\"Example of custom MapReduce jobs.\"\"\"",
"__author__ = [\n 'juliaoh@google.com (Julia Oh)',\n]",
"import sys",
"from models import transforms",
"import mapreduce",
"_POS_LIMIT_SECONDS = 60 * 8",
"_SUM = 'sum'",
"class CsvStudentEventAccumulationPipeline(mapreduce.CsvGenerator):\n \"\"\"E... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0336,
0.0022,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0414,
0.0089,
0,
0.66,
0.0435,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0492,
0.0022,
0,
0.66,... | [
"\"\"\"MapReduce extensions for ETL.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n 'juliaoh@google.com (Julia Oh)',\n]",
"import csv",
"import os",
"import sys",
"from xml.etree import ElementTree",
"from models import transforms",
"import mrs",
"from tools.etl import etl_lib",
... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1119,
0.0075,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1343,
0.0224,
0,
0.66,
0.2,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1567,
0.0075,
0,
0.66,
... | [
"\"\"\"Libraries for writing extract-transform-load scripts.\"\"\"",
"__author__ = [\n 'johncox@google.com',\n]",
"import argparse",
"from controllers import sites",
"def get_context(course_url_prefix):\n \"\"\"Gets requested application context from the given course URL prefix.\n\n Args:\n ... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.2,
0.0133,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2267,
0.0133,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2533,
0.0133,
0,
0.66,
0... | [
"\"\"\"Sample announcements.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import datetime",
"SAMPLE_ANNOUNCEMENT_1 = {\n 'edit_url': None,\n 'title': 'Example Announcement',\n 'date': datetime.date(2012, 10, 6),\n 'is_draft': False,\n 'html': \"\"\"\n <br>Certificates w... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0392,
0.0026,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0444,
0.0026,
0,
0.66,
0.0417,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0522,
0.0026,
0,
0.66,... | [
"\"\"\"Classes and methods to create and manage Announcements.\"\"\"",
"__author__ = 'Saifu Angto (saifu@google.com)'",
"import datetime",
"import urllib",
"from common import tags",
"from controllers.utils import BaseHandler",
"from controllers.utils import BaseRESTHandler",
"from controllers.utils i... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0195,
0.0013,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0221,
0.0013,
0,
0.66,
0.0227,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0247,
0.0013,
0,
0.66,... | [
"\"\"\"Resources to be indexed and searched over by the search module.\"\"\"",
"__author__ = 'Ellis Michael (emichael@google.com)'",
"import collections",
"import datetime",
"import gettext",
"import HTMLParser",
"import logging",
"import operator",
"import os",
"import Queue",
"import re",
"i... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0495,
0.0033,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0561,
0.0033,
0,
0.66,
0.0667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.066,
0.0033,
0,
0.66,
... | [
"\"\"\"Module for implementing question tags.\"\"\"",
"__author__ = 'sll@google.com (Sean Lip)'",
"import os",
"from common import jinja_utils",
"from common import schema_fields",
"from common import tags",
"import jinja2",
"from models import custom_modules",
"from models import models as m_models... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0568,
0.0038,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0644,
0.0038,
0,
0.66,
0.0526,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.072,
0.0038,
0,
0.66,
... | [
"\"\"\"Generic object editor view that uses REST services.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import os",
"import urllib",
"import appengine_config",
"from common import jinja_utils",
"from common import schema_fields",
"from common import tags",
"from controllers import ... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1744,
0.0116,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1977,
0.0116,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2209,
0.0116,
0,
0.66,... | [
"\"\"\"Course explorer module.\"\"\"",
"__author__ = 'Rahul Singal (rahulsingal@google.com)'",
"from common import safe_dom",
"from controllers import utils",
"from models import custom_modules",
"from models.config import ConfigProperty",
"from models.models import StudentProfileDAO",
"from modules.c... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.062,
0.0041,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0702,
0.0041,
0,
0.66,
0.0417,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0785,
0.0041,
0,
0.66,
... | [
"\"\"\"Classes supporting courses viewed by a student.\"\"\"",
"__author__ = 'Rahul Singal (rahulsingal@google.com)'",
"import mimetypes",
"import appengine_config",
"from common import jinja_utils",
"from controllers import sites",
"from controllers.utils import PageInitializerService",
"from control... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.3409,
0.0227,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3864,
0.0227,
0,
0.66,
0.1429,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4318,
0.0227,
0,
0.66,... | [
"\"\"\"Messages used in the admin panel.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"from common import safe_dom",
"def assemble_sanitized_message(text, link):\n node_list = safe_dom.NodeList()\n if text:\n node_list.append(safe_dom.Text(text))\n if link:\n node_list.append(sa... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0209,
0.0014,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0237,
0.0014,
0,
0.66,
0.0303,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0265,
0.0014,
0,
0.66,... | [
"\"\"\"Site administration functionality.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import cgi",
"import cStringIO",
"import datetime",
"import os",
"import sys",
"import time",
"import urllib",
"import appengine_config",
"from common import jinja_utils",
"from common impo... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0378,
0.0025,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0428,
0.0025,
0,
0.66,
0.05,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0479,
0.0025,
0,
0.66,
... | [
"\"\"\"Classes supporting configuration property editor and REST operations.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import cgi",
"import urllib",
"from controllers import sites",
"from controllers.utils import BaseRESTHandler",
"from controllers.utils import XsrfTokenManager",
... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.2015,
0.2587,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3433,
0.0149,
0,
0.66,
0.0556,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.3582,
0.005,
0,
0.66,
... | [
"\"\"\"Oauth2 module implementation.\n\nIn order to use this module with your app you must enable it in main.py by\nchanging\n\n modules.oauth2.oauth2.register_module()\n\nto",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"import os",
"import traceback",
"from apiclient import discovery",
... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.12,
0.008,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.136,
0.008,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.144,
0.008,
0,
0.66,
0.2,... | [
"\"\"\"Classes to provide a tag to embed activities into lesson bodies.\"\"\"",
"import os",
"from xml.etree import cElementTree",
"from common import schema_fields",
"from common import tags",
"from models import courses",
"from models import custom_modules",
"_RESOURCES_PATH = os.path.join(\n os.... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.1014,
0.0068,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1149,
0.0068,
0,
0.66,
0.0714,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1351,
0.0068,
0,
0.66,... | [
"\"\"\"Classes for displaying peer review analytics.\"\"\"",
"__author__ = 'Sean Lip (sll@google.com)'",
"import os",
"from common import safe_dom",
"from controllers.utils import ApplicationHandler",
"from controllers.utils import HUMAN_READABLE_TIME_FORMAT",
"import jinja2",
"from models import cour... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1389,
0.0093,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1667,
0.0278,
0,
0.66,
0.1,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1944,
0.0093,
0,
0.66,
... | [
"\"\"\"Cron job definitions for the review subsystem.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"import logging",
"from controllers import sites",
"from controllers import utils",
"from models import courses",
"from modules.review import review",
"from google.appengine.api imp... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0573,
0.0038,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0687,
0.0115,
0,
0.66,
0.0526,
777,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.084,
0.0038,
0,
0.66,... | [
"\"\"\"Domain objects and constants for use by internal and external clients.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"ASSIGNER_KIND_AUTO = 'AUTO'",
"ASSIGNER_KIND_HUMAN = 'HUMAN'",
"ASSIGNER_KINDS = (\n ASSIGNER_KIND_AUTO,\n ASSIGNER_KIND_HUMAN,\n)",
"MAX_UNREMOVED_REVIEW... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.07,
0.024,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.092,
0.012,
0,
0.66,
0.1111,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.104,
0.004,
0,
0.66,
0.... | [
"\"\"\"Internal implementation details of the peer review subsystem.\n\nPublic classes, including domain objects, can be found in domain.py and\nmodels/student_work.py. Entities declared here should not be used by external\nclients.\n\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"from mode... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.2586,
0.0172,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2931,
0.0172,
0,
0.66,
0.1111,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3276,
0.0172,
0,
0.66,... | [
"\"\"\"Courses module.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"from controllers import assessments",
"from controllers import lessons",
"from controllers import utils",
"from models import content",
"from models import custom_modules",
"from tools import verify",
"custom_modul... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.023,
0.0015,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0261,
0.0015,
0,
0.66,
0.0312,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0307,
0.0015,
0,
0.66,
... | [
"\"\"\"Classes supporting online file editing.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import base64",
"import cgi",
"import os",
"import urllib",
"import appengine_config",
"from common import schema_fields",
"from controllers.utils import ApplicationHandler",
"from control... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0239,
0.0016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0271,
0.0016,
0,
0.66,
0.0455,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0303,
0.0016,
0,
0.66,... | [
"\"\"\"Classes and methods to create and manage analytics dashboards.\"\"\"",
"__author__ = 'Sean Lip (sll@google.com)'",
"import logging",
"import os",
"import urlparse",
"from common import safe_dom",
"from controllers.utils import ApplicationHandler",
"from controllers.utils import HUMAN_READABLE_T... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0302,
0.002,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0343,
0.002,
0,
0.66,
0.05,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0403,
0.002,
0,
0.66,
... | [
"\"\"\"Classes supporting creation and editing of questions.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import cgi",
"import copy",
"import urllib",
"from common import schema_fields",
"from controllers.utils import ApplicationHandler",
"from controllers.utils import BaseRESTHandler",
"fr... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0456,
0.003,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0517,
0.003,
0,
0.66,
0.0625,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0608,
0.003,
0,
0.66,
... | [
"\"\"\"Classes for management of individual students' peer review assignments.\"\"\"",
"__author__ = 'Sean Lip (sll@google.com)'",
"import os",
"import urllib",
"from controllers.lessons import create_readonly_assessment_params",
"from controllers.utils import ApplicationHandler",
"import jinja2",
"fr... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0658,
0.0044,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0746,
0.0044,
0,
0.66,
0.0625,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0833,
0.0044,
0,
0.66,... | [
"\"\"\"Classes supporting updates to basic course settings.\"\"\"",
"__author__ = 'Abhinav Khandelwal (abhinavk@google.com)'",
"from controllers.utils import ApplicationHandler",
"from controllers.utils import BaseRESTHandler",
"from controllers.utils import XsrfTokenManager",
"from models import courses"... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0096,
0.0006,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0109,
0.0006,
0,
0.66,
0.0233,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0122,
0.0006,
0,
0.66,... | [
"\"\"\"Classes supporting unit and lesson editing.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import cgi",
"import logging",
"import random",
"import urllib",
"from common import safe_dom",
"from common import tags",
"from common.schema_fields import FieldRegistry",
"from common.schema_... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0183,
0.0012,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0207,
0.0012,
0,
0.66,
0.0192,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0231,
0.0012,
0,
0.66,... | [
"\"\"\"Classes and methods to create and manage Courses.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import datetime",
"import os",
"import urllib",
"import appengine_config",
"from common import jinja_utils",
"from common import safe_dom",
"from controllers import sites",
"from... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0781,
0.0052,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0885,
0.0052,
0,
0.66,
0.0244,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.099,
0.0052,
0,
0.66,
... | [
"\"\"\"Messages used in the dashboard.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"from common import safe_dom",
"def assemble_sanitized_message(text, link):\n node_list = safe_dom.NodeList()\n if text:\n node_list.append(safe_dom.Text(text))\n node_list.append(safe_dom.Entity('&... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0691,
0.0046,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0783,
0.0046,
0,
0.66,
0.0833,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0922,
0.0046,
0,
0.66,... | [
"\"\"\"Classes supporting creation and editing of question_groups.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"from common import schema_fields",
"from controllers.utils import BaseRESTHandler",
"from controllers.utils import XsrfTokenManager",
"from models import transforms",
"from models.mod... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0802,
0.0053,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0963,
0.016,
0,
0.66,
0.0526,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1123,
0.0053,
0,
0.66,
... | [
"\"\"\"Student HTML file submission upload module.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"import logging",
"import os",
"from common import jinja_utils",
"from common import schema_fields",
"from common import tags",
"from controllers import utils",
"import jinja2",
"f... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1648,
0.011,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1868,
0.011,
0,
0.66,
0.025,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2088,
0.011,
0,
0.66,
... | [
"\"\"\"Course Builder web application entry point.\"\"\"",
"__author__ = 'Pavel Simakov (psimakov@google.com)'",
"import os",
"import webapp2",
"import appengine_config # pylint: disable-msg=unused-import",
"from common import tags",
"from controllers import sites",
"from models import custom_modules... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.056,
0.0037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0634,
0.0037,
0,
0.66,
0.0667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0709,
0.0037,
0,
0.66,
... | [
"\"\"\"GCB-provided custom tags.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import urllib",
"import urlparse",
"from common import jinja_utils",
"from common import schema_fields",
"from common import tags",
"from controllers import utils",
"from xml.etree import cElementTree",
"def _es... |
# -*- coding: utf-8 -*-
# Copyright 2013 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 requi... | [
[
8,
0,
0.0588,
0.0035,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0657,
0.0035,
0,
0.66,
0.0333,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0727,
0.0035,
0,
0.66,... | [
"\"\"\"Unit tests for the Search module.\"\"\"",
"__author__ = 'Ellis Michael (emichael@google.com)'",
"import re",
"import robotparser",
"import urlparse",
"from functional import actions",
"from modules.search import resources",
"from google.appengine.api import urlfetch",
"VALID_PAGE_URL = 'http:... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0796,
0.005,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0896,
0.005,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0995,
0.005,
0,
0.66,
... | [
"\"\"\"Unit tests for the transforms functions.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import datetime",
"import unittest",
"from models import transforms",
"def wrap_properties(properties):\n return {'properties': properties}",
" return {'properties': properties}",
"class JsonToD... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0446,
0.003,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0506,
0.003,
0,
0.66,
0.1111,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0565,
0.003,
0,
0.66,
... | [
"\"\"\"Unit tests for common/schema_fields.py.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import json",
"import unittest",
"from common import schema_fields",
"def remove_whitespace(s):\n return ''.join(s.split())",
" return ''.join(s.split())",
"class BaseFieldTests(unittest.TestCase... |
"""Unit tests for the javascript code."""
__author__ = 'John Orr (jorr@google.com)'
import os
import subprocess
import unittest
class AllJavaScriptTests(unittest.TestCase):
def karma_test(self, test_folder):
karma_conf = os.path.join(
'experimental', 'coursebuilder', 'tests', 'unit',
... | [
[
8,
0,
0.0312,
0.0312,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0938,
0.0312,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1562,
0.0312,
0,
0.66,
... | [
"\"\"\"Unit tests for the javascript code.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import os",
"import subprocess",
"import unittest",
"class AllJavaScriptTests(unittest.TestCase):\n\n def karma_test(self, test_folder):\n karma_conf = os.path.join(\n 'experimental', 'cou... |
"""Unit tests for the common.sanitize module."""
__author__ = 'John Orr (jorr@google.com)'
import unittest
from common import safe_dom
class MockNode(safe_dom.Node):
def __init__(self, value):
self._value = value
@property
def sanitized(self):
return self._value
class NodeListTests(un... | [
[
8,
0,
0.0036,
0.0036,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0108,
0.0036,
0,
0.66,
0.1111,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0179,
0.0036,
0,
0.66,... | [
"\"\"\"Unit tests for the common.sanitize module.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import unittest",
"from common import safe_dom",
"class MockNode(safe_dom.Node):\n def __init__(self, value):\n self._value = value\n\n @property\n def sanitized(self):\n return sel... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0678,
0.0042,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0763,
0.0042,
0,
0.66,
0.1,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0847,
0.0042,
0,
0.66,
... | [
"\"\"\"Unit tests for the Workflow class in models.courses.\"\"\"",
"__author__ = 'Sean Lip (sll@google.com)'",
"import unittest",
"from models.courses import LEGACY_HUMAN_GRADER_WORKFLOW",
"from models.courses import Workflow",
"import yaml",
"DATE_FORMAT_ERROR = (\n 'dates should be formatted as YY... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1034,
0.0069,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1172,
0.0069,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.131,
0.0069,
0,
0.66,
... | [
"\"\"\"Unit tests for common.tags.\"\"\"",
"__author__ = 'John Orr (jorr@google.com)'",
"import unittest",
"from xml.etree import cElementTree",
"from common import tags",
"class CustomTagTests(unittest.TestCase):\n \"\"\"Unit tests for the custom tag functionality.\"\"\"\n\n def setUp(self):\n\n ... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1442,
0.0096,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1635,
0.0096,
0,
0.66,
0.1667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1827,
0.0096,
0,
0.66,... | [
"\"\"\"Unit tests for mapreduce jobs.\"\"\"",
"__author__ = 'juliaoh@google.com (Julia Oh)'",
"import unittest",
"from models import transforms",
"from tools.etl import mapreduce",
"class HistogramTests(unittest.TestCase):\n\n def test_get_bin_number(self):\n bucket_size = 30\n histogram ... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0226,
0.0015,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0271,
0.0045,
0,
0.66,
0.0303,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.0316,
0.0015,
0,
0.66,... | [
"\"\"\"Page objects used in functional tests for Course Builder.\"\"\"",
"__author__ = [\n 'John Orr (jorr@google.com)'\n]",
"from selenium.common import exceptions",
"from selenium.webdriver.common import action_chains",
"from selenium.webdriver.common import by",
"from selenium.webdriver.support impo... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0513,
0.0418,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0753,
0.0021,
0,
0.66,
0.0385,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0795,
0.0021,
0,
0.66,... | [
"\"\"\"Performance test for a peer review system.\n\nWARNING! Use this script to test load Course Builder. This is very dangerous\nfeature, be careful, because anyone can impersonate super user of your Course\nBuilder instance; use only if you have to perform specific load testing\n\nKeep in mind:\n - when repea... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0833,
0.07,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1233,
0.0033,
0,
0.66,
0.0312,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.13,
0.0033,
0,
0.66,
... | [
"\"\"\"Course Builder test suite.\n\nThis script runs all functional and units test in the Course Builder project.\n\nHere is how to use the script:\n - download WebTest Python package from a URL below and put\n the files in a folder of your choice, for example: tmp/webtest:\n http://pypi.python.or... |
# coding: utf-8
# Copyright 2013 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 by ap... | [
[
8,
0,
0.033,
0.0021,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0371,
0.0021,
0,
0.66,
0.0556,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0412,
0.0021,
0,
0.66,
... | [
"\"\"\"Tests for modules/dashboard/analytics.\"\"\"",
"__author__ = 'Julia Oh(juliaoh@google.com)'",
"import os",
"import appengine_config",
"from controllers import sites",
"from controllers import utils",
"from models import config",
"from models import courses",
"from models import models",
"fr... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0442,
0.0029,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0501,
0.0029,
0,
0.66,
0.0769,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.056,
0.0029,
0,
0.66,
... | [
"\"\"\"Tests for modules/search/.\"\"\"",
"__author__ = 'Ellis Michael (emichael@google.com)'",
"import datetime",
"import logging",
"import re",
"from controllers import sites",
"from models import courses",
"from models import custom_modules",
"from modules.announcements import announcements",
"... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0824,
0.0055,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0989,
0.0165,
0,
0.66,
0.1,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1154,
0.0055,
0,
0.66,
... | [
"\"\"\"Functional tests for models.models.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"import datetime",
"from models import models",
"from tests.functional import actions",
"class EventEntityTestCase(actions.ExportTestBase):\n\n def test_for_export_transforms_correctly(self):\n... |
# coding: utf-8
# Copyright 2013 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 by ap... | [
[
8,
0,
0.1455,
0.0091,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1636,
0.0091,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1818,
0.0091,
0,
0.66,
... | [
"\"\"\"Tests for modules/review/stats.py.\"\"\"",
"__author__ = 'Sean Lip'",
"import actions",
"from actions import assert_contains",
"from actions import assert_equals",
"from controllers_review import get_review_payload",
"from controllers_review import get_review_step_key",
"from controllers_review... |
# Copyright 2012 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 by applicable law or ... | [
[
8,
0,
0.0229,
0.0013,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0256,
0.0013,
0,
0.66,
0.0167,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0269,
0.0013,
0,
0.66... | [
"\"\"\"A collection of actions for testing Course Builder pages.\"\"\"",
"import cgi",
"import functools",
"import logging",
"import os",
"import re",
"import urllib",
"import appengine_config",
"from controllers import sites",
"from controllers import utils",
"import main",
"from models impor... |
# coding: utf-8
# Copyright 2013 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 by ap... | [
[
8,
0,
0.0249,
0.0016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.028,
0.0016,
0,
0.66,
0.0833,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0312,
0.0016,
0,
0.66,
... | [
"\"\"\"Tests for controllers pertaining to peer review assessments.\"\"\"",
"__author__ = 'Sean Lip'",
"from controllers import sites",
"from models import transforms",
"import actions",
"from actions import assert_contains",
"from actions import assert_does_not_contain",
"from actions import assert_e... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.1786,
0.0119,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2143,
0.0357,
0,
0.66,
0.1111,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.25,
0.0119,
0,
0.66,
... | [
"\"\"\"Functional tests for models/utils.py.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"from models import counters",
"from models import utils",
"from tests.functional import actions",
"from google.appengine.ext import db",
"class Model(db.Model):\n create_date = db.DateTime... |
# Copyright 2013 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 by applicable law or ... | [
[
8,
0,
0.0904,
0.006,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1084,
0.0181,
0,
0.66,
0.1111,
777,
0,
0,
0,
0,
0,
5,
0
],
[
1,
0,
0.1265,
0.006,
0,
0.66,
... | [
"\"\"\"Functional tests for modules/upload/upload.py.\"\"\"",
"__author__ = [\n 'johncox@google.com (John Cox)',\n]",
"import os",
"from controllers import utils",
"from models import models",
"from models import student_work",
"from modules.upload import upload",
"from tests.functional import acti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.