code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
# Given a Data Structure having first n integers and next n chars. A = i1 i2 i3 ... iN c1 c2 c3 ... cN. Write an in-place algorithm to rearrange the elements of the array ass A = i1 c1 i2 c2 ... iN cN
inputs = []
inputs += [[ 1, 'A' ]]
inputs += [[ 1, 2, 'A', 'B' ]]
inputs += [[ 1, 2, 3, 'A', 'B', 'C' ]]
inputs ... | [
[
14,
0,
0.0286,
0.0095,
0,
0.66,
0,
226,
0,
0,
0,
0,
0,
5,
0
],
[
2,
0,
0.1667,
0.0381,
0,
0.66,
1.5,
910,
0,
3,
0,
0,
0,
0,
0
],
[
14,
1,
0.1619,
0.0095,
1,
0.38,... | [
"inputs = []",
"def swap_element(table, i, j):\n\ttmp = table[i]\n\ttable[i] = table[j]\n\ttable[j] = tmp",
"\ttmp = table[i]",
"\ttable[i] = table[j]",
"\ttable[j] = tmp",
"def swap_range(table, first, last):\n\tsize = last - first + 1\n\tpremiddle = first + size/2 - 1\n\n\tif size > 3:\n\t\tif 2 == size... |
# Shift table by x elements
inputs = []
inputs += [[1]]
inputs += [[1, 2]]
inputs += [[1, 2, 3]]
inputs += [[1, 2, 3, 4]]
inputs += [[1, 2, 3, 4, 5]]
inputs += [[1, 2, 3, 4, 5, 6]]
inputs += [[1, 2, 3, 4, 5, 6, 7]]
inputs += [[1, 2, 3, 4, 5, 6, 7, 8]]
inputs += [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
inputs += [[1, ... | [
[
14,
0,
0.0769,
0.0256,
0,
0.66,
0,
226,
0,
0,
0,
0,
0,
5,
0
],
[
2,
0,
0.4231,
0.1026,
0,
0.66,
2.75,
910,
0,
3,
0,
0,
0,
0,
0
],
[
14,
1,
0.4103,
0.0256,
1,
0.23... | [
"inputs = []",
"def swap_element(table, i, j):\n\ttmp = table[i]\n\ttable[i] = table[j]\n\ttable[j] = tmp",
"\ttmp = table[i]",
"\ttable[i] = table[j]",
"\ttable[j] = tmp",
"def shift_recursive(table, x, size):\n\tif size <= 1 or x % size == 0:\n\t\t# Table's size is less than 2, or we shift by 0 elements... |
# -*- coding: utf-8 -*-
# Django settings for abeona project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
# ('Patricio Molina', 'patriciomolina@gmail.com'),
# ('Nicolás Giorgetti', 'niko.kane@gmail.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'postgresql_psyc... | [
[
14,
0,
0.0488,
0.0122,
0,
0.66,
0,
309,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.061,
0.0122,
0,
0.66,
0.0455,
7,
2,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1098,
0.061,
0,
0.66,... | [
"DEBUG = True",
"TEMPLATE_DEBUG = DEBUG",
"ADMINS = (\n # ('Your Name', 'your_email@domain.com'),\n # ('Patricio Molina', 'patriciomolina@gmail.com'),\n # ('Nicolás Giorgetti', 'niko.kane@gmail.com'),\n)",
"MANAGERS = ADMINS",
"DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postg... |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^abeona/', include('abeona.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs' ... | [
[
1,
0,
0.0588,
0.0588,
0,
0.66,
0,
341,
0,
1,
0,
0,
341,
0,
0
],
[
14,
0,
0.7059,
0.6471,
0,
0.66,
1,
990,
3,
1,
0,
0,
75,
10,
1
]
] | [
"from django.conf.urls.defaults import *",
"urlpatterns = patterns('',\n # Example:\n # (r'^abeona/', include('abeona.foo.urls')),\n\n # Uncomment the admin/doc line below and add 'django.contrib.admindocs' \n # to INSTALLED_APPS to enable admin documentation:\n # (r'^admin/doc/', include('django.c... |
#!/usr/bin/python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run ... | [
[
1,
0,
0.1818,
0.0909,
0,
0.66,
0,
879,
0,
1,
0,
0,
879,
0,
0
],
[
7,
0,
0.5,
0.5455,
0,
0.66,
0.5,
0,
0,
1,
0,
0,
0,
0,
2
],
[
1,
1,
0.3636,
0.0909,
1,
0.46,
... | [
"from django.core.management import execute_manager",
"try:\n import settings # Assumed to be in the same directory.\nexcept ImportError:\n import sys\n sys.stderr.write(\"Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\\nYou'll have to run dj... |
# -*- python -*-
# vi: ft=python
# Copyright 2008 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
# or its licensors, as applicable.
#
# You may not use this file except under the terms of the accompanying license.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this f... | [
[
1,
0,
0.1139,
0.0042,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.1224,
0.0042,
0,
0.66,
0.0143,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1308,
0.0042,
0,
0.... | [
"import os",
"print(\"Currently supported OS version: Ubuntu 10.04\")",
"EnsureSConsVersion(0,97)",
"from SCons.Script import *",
"import os,sys,string,re",
"from glob import glob",
"os.system(\"./generate_version_cc.sh ./version.cc\")",
"sources = glob(\"ocr-*/*.cc\") + [\"version.cc\"]",
"exclude ... |
#!/usr/bin/python
import sys,os,re,string,os.path,glob
if not os.path.isdir("ocroscript") and os.path.isdir("ocr-layout"):
sys.stderr.write("must run this script from the top directory of ocropus")
sys.exit(1)
dirs = {}
edges = []
files = glob.glob("*/*.h") + glob.glob("*/*.cc")
for file in files:
dir =... | [
[
1,
0,
0.0556,
0.0185,
0,
0.66,
0,
509,
0,
6,
0,
0,
509,
0,
0
],
[
4,
0,
0.1111,
0.0556,
0,
0.66,
0.0625,
0,
0,
0,
0,
0,
0,
0,
4
],
[
8,
1,
0.1111,
0.0185,
1,
0.76... | [
"import sys,os,re,string,os.path,glob",
"if not os.path.isdir(\"ocroscript\") and os.path.isdir(\"ocr-layout\"):\n sys.stderr.write(\"must run this script from the top directory of ocropus\")\n sys.exit(1)",
" sys.stderr.write(\"must run this script from the top directory of ocropus\")",
" sys.exi... |
#!/usr/bin/python
import os,sys,re,string,glob
if len(glob.glob("*/*.a"))<10:
sys.stderr.write("not enough libraries; you probably need to build ocropus first")
sys.exit(255)
sources = {}
nsymbols = 0
for line in os.popen("nm -o -C */*.a","r").readlines():
line = line[:-1]
fields = line.split(None,3... | [
[
1,
0,
0.1071,
0.0357,
0,
0.66,
0,
688,
0,
5,
0,
0,
688,
0,
0
],
[
4,
0,
0.2143,
0.1071,
0,
0.66,
0.1667,
0,
0,
0,
0,
0,
0,
0,
4
],
[
8,
1,
0.2143,
0.0357,
1,
0.39... | [
"import os,sys,re,string,glob",
"if len(glob.glob(\"*/*.a\"))<10:\n sys.stderr.write(\"not enough libraries; you probably need to build ocropus first\")\n sys.exit(255)",
" sys.stderr.write(\"not enough libraries; you probably need to build ocropus first\")",
" sys.exit(255)",
"sources = {}",
... |
#!/usr/bin/python
import os,sys,re,string
def die(s):
sys.stderr.write(s)
sys.exit(1)
def run(s):
sys.stderr.write("# "+s+"\n")
return os.system(s)
def tick(s):
return os.popen(s,"r").read()
file = sys.argv[-1]
rest = sys.argv[1:-1]
temp = "___temp___.cc"
tempo = "___temp___.o"
def clean():
... | [
[
1,
0,
0.0429,
0.0143,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
2,
0,
0.0857,
0.0429,
0,
0.66,
0.0526,
952,
0,
1,
0,
0,
0,
0,
2
],
[
8,
1,
0.0857,
0.0143,
1,
0.... | [
"import os,sys,re,string",
"def die(s):\n sys.stderr.write(s)\n sys.exit(1)",
" sys.stderr.write(s)",
" sys.exit(1)",
"def run(s):\n sys.stderr.write(\"# \"+s+\"\\n\")\n return os.system(s)",
" sys.stderr.write(\"# \"+s+\"\\n\")",
" return os.system(s)",
"def tick(s):\n retu... |
#!/usr/bin/python
# Copyright 2007 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
# or its licensors, as applicable.
#
# You may not use this file except under the terms of the accompanying license.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in c... | [
[
1,
0,
0.3824,
0.0147,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
1,
0,
0.3971,
0.0147,
0,
0.66,
0.2,
79,
0,
2,
0,
0,
79,
0,
0
],
[
2,
0,
0.4485,
0.0588,
0,
0.66,... | [
"import os,re,getopt,sys",
"from os.path import join, getsize",
"def search(r,s):\n global groups\n groups = re.search(r,s)\n return groups",
" groups = re.search(r,s)",
" return groups",
"def warn(s):\n global jamfile,nr,line\n print(\"%s:%d:%s\"%(jamfile,nr,s))\n print(\" \",li... |
#!/usr/bin/python
import sys,os,re,string,os.path,glob
if not os.path.exists("ocr-utils"):
sys.stderr.write("must be run from top level of ocropus installation")
sys.exit(1)
sources = glob.glob("*/*.h") + glob.glob("*/*.cc")
class UnionFind:
def __init__(self):
self.num_weights = {}
self... | [
[
1,
0,
0.0226,
0.0075,
0,
0.66,
0,
509,
0,
6,
0,
0,
509,
0,
0
],
[
4,
0,
0.0451,
0.0226,
0,
0.66,
0.0556,
0,
0,
0,
0,
0,
0,
0,
3
],
[
8,
1,
0.0451,
0.0075,
1,
0.56... | [
"import sys,os,re,string,os.path,glob",
"if not os.path.exists(\"ocr-utils\"):\n sys.stderr.write(\"must be run from top level of ocropus installation\")\n sys.exit(1)",
" sys.stderr.write(\"must be run from top level of ocropus installation\")",
" sys.exit(1)",
"sources = glob.glob(\"*/*.h\") +... |
#!/usr/bin/python
import os,string,glob,sys,getopt,re
script = sys.argv[0]
assert os.path.exists(script)
def uptodate(source=None,target=None):
if not os.path.exists(target): return 0
return os.path.getmtime(source)<os.path.getmtime(target)
def keywords(**keywords): return keywords
extraction_params = keyw... | [
[
1,
0,
0.0423,
0.0141,
0,
0.66,
0,
688,
0,
6,
0,
0,
688,
0,
0
],
[
14,
0,
0.0704,
0.0141,
0,
0.66,
0.125,
254,
6,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.1268,
0.0423,
0,
0.... | [
"import os,string,glob,sys,getopt,re",
"script = sys.argv[0]",
"def uptodate(source=None,target=None):\n if not os.path.exists(target): return 0\n return os.path.getmtime(source)<os.path.getmtime(target)",
" if not os.path.exists(target): return 0",
" if not os.path.exists(target): return 0",
... |
#!/usr/bin/python
# these are possible justifications; please stick to one of them
STANDARD = "it's a textbook algorithm"
APIDOCS = "it's based on a sample from the API documentation of the corresponding library"
PERFORMANCE = "strict inlining is demonstrably necessary for performance"
STABLE = "we don't expect to be... | [
[
14,
0,
0.0556,
0.0111,
0,
0.66,
0,
131,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0667,
0.0111,
0,
0.66,
0.0588,
145,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0778,
0.0111,
0,
0... | [
"STANDARD = \"it's a textbook algorithm\"",
"APIDOCS = \"it's based on a sample from the API documentation of the corresponding library\"",
"PERFORMANCE = \"strict inlining is demonstrably necessary for performance\"",
"STABLE = \"we don't expect to be making any changes to this code\"",
"DEBUGGING = \"code... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import string,re,sys,os,shutil,glob
import xml.sax as sax
from PIL import Image
usage = """
... hocr image_pattern output_prefix
Arguments:
xml_pattern: either a glob pattern that results in a list
of xml files, or @filename for a file containing
... | [
[
1,
0,
0.0205,
0.0051,
0,
0.66,
0,
890,
0,
6,
0,
0,
890,
0,
0
],
[
1,
0,
0.0256,
0.0051,
0,
0.66,
0.0323,
587,
0,
1,
0,
0,
587,
0,
0
],
[
1,
0,
0.0308,
0.0051,
0,
... | [
"import string,re,sys,os,shutil,glob",
"import xml.sax as sax",
"from PIL import Image",
"usage = \"\"\"\n... hocr image_pattern output_prefix\n\n\n\nArguments:\n\n xml_pattern: either a glob pattern that results in a list",
"if len(sys.argv)!=4:\n sys.stderr.write(usage)\n print(\"args:\",sys.argv... |
#!/usr/bin/python
import os,sys,os.path,glob,re,string,random
from pylab import *
# FIXME
# -- fix boxplot to use list-of-list representation (currently broken)
stream = sys.stdin
if len(sys.argv)>1: stream = open(sys.argv[1],"r")
data = []
for line in stream.xreadlines():
f = line.split()
if len(f)>0 and f[... | [
[
1,
0,
0.0571,
0.0286,
0,
0.66,
0,
688,
0,
7,
0,
0,
688,
0,
0
],
[
1,
0,
0.0857,
0.0286,
0,
0.66,
0.0769,
735,
0,
1,
0,
0,
735,
0,
0
],
[
14,
0,
0.2286,
0.0286,
0,
... | [
"import os,sys,os.path,glob,re,string,random",
"from pylab import *",
"stream = sys.stdin",
"if len(sys.argv)>1: stream = open(sys.argv[1],\"r\")",
"if len(sys.argv)>1: stream = open(sys.argv[1],\"r\")",
"data = []",
"for line in stream.xreadlines():\n f = line.split()\n if len(f)>0 and f[0]==\"co... |
#!/usr/bin/python
import os,sys,os.path,glob,re,string,random
ocropus = "../ocropus-cmd/ocropus"
simp_re = re.compile(r'[^a-zA-Z0-9,.+=/*?!-]+')
def die(s):
sys.stderr.write("FATAL: %s\n"%s)
sys.exit(1)
def ensure(s):
if not os.path.exists(s):
die("%s: file not found" % s)
ensure(ocropus)
direct... | [
[
1,
0,
0.0541,
0.027,
0,
0.66,
0,
688,
0,
7,
0,
0,
688,
0,
0
],
[
14,
0,
0.1081,
0.027,
0,
0.66,
0.0833,
618,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1351,
0.027,
0,
0.6... | [
"import os,sys,os.path,glob,re,string,random",
"ocropus = \"../ocropus-cmd/ocropus\"",
"simp_re = re.compile(r'[^a-zA-Z0-9,.+=/*?!-]+')",
"def die(s):\n sys.stderr.write(\"FATAL: %s\\n\"%s)\n sys.exit(1)",
" sys.stderr.write(\"FATAL: %s\\n\"%s)",
" sys.exit(1)",
"def ensure(s):\n if not o... |
#!/usr/bin/python
import os,sys,os.path,glob,re,string,random
# FIXME
# -- better documentation
# -- better command line error checking
# -- use temporary file names instead of _truth, _ocr
# -- more informative error messages
# -- record machine, processing times
# -- get rid of ./distance
# -- output data into sqlit... | [
[
1,
0,
0.0286,
0.0143,
0,
0.66,
0,
688,
0,
7,
0,
0,
688,
0,
0
],
[
14,
0,
0.2,
0.0143,
0,
0.66,
0.0588,
618,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.2143,
0.0143,
0,
0.6... | [
"import os,sys,os.path,glob,re,string,random",
"ocropus = \"../ocropus-cmd/ocropus\"",
"distance = \"../ocropus-cmd/ocr-distance\"",
"simp_re = re.compile(r'[^a-zA-Z0-9,.+=/*?! \\n-]+')",
"def simplify(s):\n s = simp_re.sub('',s)\n s = re.sub(r'^\\s+','',s)\n s = re.sub(r'\\s+','\\n',s)\n return... |
#!/usr/bin/python
import sys,os
vars = {}
results = []
for file in sys.argv[1:]:
current = {}
for line in open(file).readlines():
f = line.split()
if len(f)>1 and f[0]=="pick":
key,value = f[1].split("=")
if len(value.split(":"))==2:
m,s = value.split("... | [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
]
] | [
"import sys,os"
] |
#!/usr/bin/python
#
# 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 required by applicable law ... | [
[
14,
0,
0.0557,
0.0033,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0689,
0.0033,
0,
0.66,
0.0333,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0721,
0.0033,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import db",
"from google.appengine.ext.webapp import template",
"from apiclient.discovery import build_from_document",
"from apiclient.http import MediaUpload",
"from oauth2... |
#!/usr/bin/python
#
# 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 required by applicable law ... | [
[
14,
0,
0.0281,
0.0017,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0347,
0.0017,
0,
0.66,
0.0303,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
0.0364,
0.0017,
0,
0... | [
"__author__ = 'afshar@google.com (Ali Afshar)'",
"import sys",
"sys.path.insert(0, 'lib')",
"import os",
"import httplib2",
"import sessions",
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"from google.appengine.ext import db",
"from google... |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | [
[
8,
0,
0.1818,
0.0267,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2032,
0.0053,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
3,
0,
0.2219,
0.0107,
0,
0.66,
... | [
"\"\"\"Module to enforce different constraints on flags.\n\nA validator represents an invariant, enforced over a one or more flags.\nSee 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual.\n\"\"\"",
"__author__ = 'olexiy@google.com (Olexiy Oryeshko)'",
"class Error(Exception):\n \"\"\"Thrown If val... |
#!/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.0738,
0.0041,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.0779,
0.0041,
0,
0.66,
0.0625,
154,
0,
1,
0,
0,
154,
0,
0
],
[
1,
0,
0.082,
0.0041,
0,
0... | [
"import base64",
"import hashlib",
"import logging",
"import time",
"from OpenSSL import crypto",
"from anyjson import simplejson",
"CLOCK_SKEW_SECS = 300 # 5 minutes in seconds",
"AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds",
"MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds",
"cla... |
# 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.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: #... |
# 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.0145,
0.0035,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0176,
0.0009,
0,
0.66,
0.0244,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0193,
0.0009,
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) 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.1619,
0.0476,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2,
0.0095,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2286,
0.0095,
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... |
# 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... |
__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.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... |
# 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... |
# 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.1205,
0.1452,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2046,
0.0033,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.2112,
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)'",
... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.5312,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6562,
0.0312,
0,
0.66,
0.5,
777,
1,
0,
0,
0,
0,
3,
0
],
[
7,
0,
0.875,
0.2812,
0,
0.66,
... | [
"\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"try: # pragma: no cover\n import simplejson\nexcept ImportError: # pragma: no cover\n try:\n # Try to import from... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.0342,
0.0083,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0414,
0.0021,
0,
0.66,
0.0476,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0476,
0.0021,
0,
0.66,... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import copy",
"import httplib2",
"import logging",
"import oauth2 as oauth",
"import urllib",
"import urlparse",
"from anyjson import simplejson",
"tr... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.1259,
0.037,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1556,
0.0074,
0,
0.66,
0.125,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1704,
0.0074,
0,
0.66,
... | [
"\"\"\"Utilities for Google App Engine\n\nUtilities for making it easier to use the\nGoogle API Client for Python on Google App Engine.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import pickle",
"from google.appengine.ext import db",
"from apiclient.oauth import OAuthCredentials",
"... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
8,
0,
0.2619,
0.0635,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.3175,
0.0159,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.3492,
0.0159,
0,
0.66,
... | [
"\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 1.0 credentials.\n\"\"\"",
"__author__ = 'jcgregorio@google.com (Joe Gregorio)'",
"import pickle",
"import threading",
"from apiclient.oauth import Storage as BaseStorage",
"class Storage(BaseStorage):\n \"\"\"Store and retr... |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | [
[
1,
0,
0.2679,
0.0179,
0,
0.66,
0,
629,
0,
1,
0,
0,
629,
0,
0
],
[
1,
0,
0.2857,
0.0179,
0,
0.66,
0.2,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.3036,
0.0179,
0,
0.6... | [
"import apiclient",
"import base64",
"import pickle",
"from django.db import models",
"class OAuthCredentialsField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def db_type(self):\n return 'VARCHAR'\n\n def to_python(self, value):",
" __metaclass__ = models.SubfieldBase",
" def db_t... |
__version__ = "1.0c2"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
162,
1,
0,
0,
0,
0,
3,
0
]
] | [
"__version__ = \"1.0c2\""
] |
#!/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... |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | [
[
8,
0,
0.0318,
0.0545,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0636,
0.0091,
0,
0.66,
0.0909,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0727,
0.0091,
0,
0.66... | [
"\"\"\"\niri2uri\n\nConverts an IRI to a URI.\n\n\"\"\"",
"__author__ = \"Joe Gregorio (joe@bitworking.org)\"",
"__copyright__ = \"Copyright 2006, Joe Gregorio\"",
"__contributors__ = []",
"__version__ = \"1.0.0\"",
"__license__ = \"MIT\"",
"__history__ = \"\"\"\n\"\"\"",
"import urlparse",
"escape_... |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | [
[
8,
0,
0.0365,
0.0708,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.0845,
0.0205,
0,
0.66,
0.04,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0982,
0.0023,
0,
0.66,
... | [
"\"\"\"SocksiPy - Python SOCKS module.\nVersion 1.00\n\nCopyright 2006 Dan-Haim. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright ... |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | [
[
1,
0,
0.006,
0.006,
0,
0.66,
0,
32,
0,
1,
0,
0,
32,
0,
0
],
[
1,
0,
0.0119,
0.006,
0,
0.66,
0.1,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0179,
0.006,
0,
0.66,
... | [
"import Cookie",
"import datetime",
"import time",
"import email.utils",
"import calendar",
"import base64",
"import hashlib",
"import hmac",
"import re",
"import logging",
"class LilCookies:\n\n @staticmethod\n def _utf8(s):\n if isinstance(s, unicode):\n return s.encode(\"utf-8\")\n ... |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | [
[
14,
0,
0.1667,
0.0556,
0,
0.66,
0,
189,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3889,
0.0556,
0,
0.66,
0.3333,
295,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.6111,
0.0556,
0,
0... | [
"manual_verstr = \"1.5\"",
"auto_build_num = \"211\"",
"verstr = manual_verstr + \".\" + auto_build_num",
"try:\n from pyutil.version_class import Version as pyutil_Version\n __version__ = pyutil_Version(verstr)\nexcept (ImportError, ValueError):\n # Maybe there is no pyutil installed.\n from dist... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | [
[
8,
0,
0.2927,
0.561,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6098,
0.0244,
0,
0.66,
0.25,
311,
0,
1,
0,
0,
311,
0,
0
],
[
1,
0,
0.6341,
0.0244,
0,
0.66,
... | [
"\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including withou... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | [
[
8,
0,
0.3,
0.575,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.625,
0.025,
0,
0.66,
0.3333,
311,
0,
1,
0,
0,
311,
0,
0
],
[
1,
0,
0.65,
0.025,
0,
0.66,
0.6... | [
"\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including withou... |
# 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>[\\+\\*])... |
def foobar():
print 'yes'
foobar()
| [
[
2,
0,
0.375,
0.5,
0,
0.66,
0,
139,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.5,
0.25,
1,
0.87,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
139,
... | [
"def foobar():\n print('yes')",
" print('yes')",
"foobar()"
] |
print 4
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(4)"
] |
for i in range(10):
print i
| [
[
6,
0,
0.5,
0.6667,
0,
0.66,
0,
826,
3,
0,
0,
0,
0,
0,
2
],
[
8,
1,
0.6667,
0.3333,
1,
0.36,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"for i in range(10):\n print(i)",
" print(i)"
] |
class X: pass
| [
[
3,
0,
0.3333,
0.3333,
0,
0.66,
0,
783,
0,
0,
0,
0,
0,
0,
0
]
] | [
"class X: pass"
] |
import goog.math as gm
v0 = gm.Vec2(10, 12)
print "ctor", v0
v1 = gm.Vec2.randomUnit()
print "randomunit", gm.nearlyEquals(v1.magnitude(), 1.0);
v2 = gm.Vec2.random()
# todo; attr access
#print v2.x >= -1 and v2.x <= 1, v2.y >= -1 and v2.y <= 1
v3 = gm.Vec2.fromCoordinate(gm.Coordinate(4, 5))
print "fromcoord", v3
... | [
[
1,
0,
0.0204,
0.0204,
0,
0.66,
0,
190,
0,
1,
0,
0,
190,
0,
0
],
[
14,
0,
0.0612,
0.0204,
0,
0.66,
0.0303,
745,
3,
2,
0,
0,
198,
10,
1
],
[
8,
0,
0.0816,
0.0204,
0,
... | [
"import goog.math as gm",
"v0 = gm.Vec2(10, 12)",
"print(\"ctor\", v0)",
"v1 = gm.Vec2.randomUnit()",
"v2 = gm.Vec2.random()",
"v3 = gm.Vec2.fromCoordinate(gm.Coordinate(4, 5))",
"print(\"fromcoord\", v3)",
"v4 = v3.clone()",
"print(\"clone\", v4)",
"print(\"mag\", v4.magnitude())",
"print(\"mag... |
import goog.json
print goog.json.parse
# random sample from json.org
obj = goog.json.parse("""
{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortA... | [
[
1,
0,
0.0345,
0.0345,
0,
0.66,
0,
575,
0,
1,
0,
0,
575,
0,
0
],
[
8,
0,
0.1034,
0.0345,
0,
0.66,
0.3333,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.569,
0.8276,
0,
0.... | [
"import goog.json",
"print(goog.json.parse)",
"obj = goog.json.parse(\"\"\"\n{\n \"glossary\": {\n \"title\": \"example glossary\",\n \"GlossDiv\": {\n \"title\": \"S\",\n \"GlossList\": {\n \"GlossEntry\": {",
"print(obj)"
] |
from goog.json import parse as jparse
print jparse('''
{"x":5, "y":6, "z":[3.1, 4.7, 5.6]}
''')
| [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
575,
0,
1,
0,
0,
575,
0,
0
]
] | [
"from goog.json import parse as jparse"
] |
import goog.math as gm
c1 = gm.Coordinate()
c2 = gm.Coordinate(1)
c3 = gm.Coordinate(1, 2)
print c1.toString()
print c2.toString()
print c3.toString()
c4 = gm.Coordinate(1, 2)
c5 = gm.Coordinate(3, 4)
print gm.Coordinate.equals(c3, c4)
print gm.Coordinate.equals(c3, c5)
c6 = c4.clone()
c7 = c6.clone()
print gm.Coordi... | [
[
1,
0,
0.0455,
0.0455,
0,
0.66,
0,
190,
0,
1,
0,
0,
190,
0,
0
],
[
14,
0,
0.1364,
0.0455,
0,
0.66,
0.0556,
452,
3,
0,
0,
0,
782,
10,
1
],
[
14,
0,
0.1818,
0.0455,
0,
... | [
"import goog.math as gm",
"c1 = gm.Coordinate()",
"c2 = gm.Coordinate(1)",
"c3 = gm.Coordinate(1, 2)",
"print(c1.toString())",
"print(c2.toString())",
"print(c3.toString())",
"c4 = gm.Coordinate(1, 2)",
"c5 = gm.Coordinate(3, 4)",
"print(gm.Coordinate.equals(c3, c4))",
"print(gm.Coordinate.equal... |
import goog.json
strd = goog.json.serialize({
'a': 45,
'b': [
1, 2, 3, 4, {
'c': "stuff",
'd': "things",
}],
'xyzzy': False,
'blorp': True
})
print strd
print goog.json.unsafeParse(strd)
print goog.json.serialize(goog.json.unsafeParse(strd)) == strd
| [
[
1,
0,
0.0667,
0.0667,
0,
0.66,
0,
575,
0,
1,
0,
0,
575,
0,
0
],
[
14,
0,
0.5,
0.6667,
0,
0.66,
0.25,
75,
3,
1,
0,
0,
50,
10,
1
],
[
8,
0,
0.8667,
0.0667,
0,
0.66,... | [
"import goog.json",
"strd = goog.json.serialize({\n 'a': 45,\n 'b': [\n 1, 2, 3, 4, {\n 'c': \"stuff\",\n 'd': \"things\",\n }],\n 'xyzzy': False,",
"print(strd)",
"print(goog.json.unsafeParse(strd))",
"print(goog.json.serialize(goog.json.unsafeParse(strd)) == st... |
import goog.math as gm
K = 10000
def main():
print gm.clamp(408, 10, 100)
print gm.modulo(-10, 3)
print gm.lerp(0, 14, 0.25)
a = 14
b = 14.0001
print gm.nearlyEquals(a, b)
print gm.nearlyEquals(a, b, 0.01)
print gm.standardAngle(480)
print gm.toRadians(170)
print gm.toDegrees(2... | [
[
1,
0,
0.02,
0.02,
0,
0.66,
0,
190,
0,
1,
0,
0,
190,
0,
0
],
[
14,
0,
0.06,
0.02,
0,
0.66,
0.3333,
126,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.5,
0.82,
0,
0.66,
0.66... | [
"import goog.math as gm",
"K = 10000",
"def main():\n print(gm.clamp(408, 10, 100))\n print(gm.modulo(-10, 3))\n print(gm.lerp(0, 14, 0.25))\n a = 14\n b = 14.0001\n print(gm.nearlyEquals(a, b))\n print(gm.nearlyEquals(a, b, 0.01))",
" print(gm.clamp(408, 10, 100))",
" print(gm.mo... |
x = 3.14e159
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
]
] | [
"x = 3.14e159"
] |
x = -15921590215012591L
| [] | [] |
(-124561-1) & 0200000000
| [] | [] |
x = 314159.
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
]
] | [
"x = 314159."
] |
x = "doesn't "shrink", does it"
| [] | [] |
0xdeadc0de & 012345
| [] | [] |
-1*1/1+1*1//1 - ---1**1
| [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
4,
0,
0,
0,
0,
0,
0
]
] | [
"-1*1/1+1*1//1 - ---1**1"
] |
x = 3E123
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
]
] | [
"x = 3E123"
] |
x = 3e14159
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
]
] | [
"x = 3e14159"
] |
0xff <= 255
| [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
] | [
"0xff <= 255"
] |
import sys, time
x = sys.modules['time'].time()
| [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
509,
0,
2,
0,
0,
509,
0,
0
],
[
14,
0,
1,
0.5,
0,
0.66,
1,
190,
3,
0,
0,
0,
654,
10,
1
]
] | [
"import sys, time",
"x = sys.modules['time'].time()"
] |
x+y = 3e-1230
| [] | [] |
def d01v_(a=1, *k, **w): pass
| [
[
2,
0,
1,
1,
0,
0.66,
0,
498,
0,
3,
0,
0,
0,
0,
0
]
] | [
"def d01v_(a=1, *k, **w): pass"
] |
0b01 <= 255
| [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
] | [
"0b01 <= 255"
] |
y = ur"abc" + Ur"ABC" + uR"ABC" + UR"ABC"
| [] | [] |
x = .314159
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
]
] | [
"x = .314159"
] |
def k(x):
x += 2
x += 5
| [
[
2,
0,
0.75,
1,
0,
0.66,
0,
954,
0,
1,
0,
0,
0,
0,
0
]
] | [
"def k(x):\n x += 2"
] |
@staticmethod
def foo(x,y): pass
| [
[
2,
0,
1,
0.5,
0,
0.66,
0,
528,
0,
2,
0,
0,
0,
0,
0
]
] | [
"def foo(x,y): pass"
] |
if 1 < 1 > 1 == 1 >= 5 <= 0x15 <= 0x12 != 1 and 5 in 1 not in 1 is 1 or 5 is not 1: pass
| [
[
4,
0,
1,
1,
0,
0.66,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
] | [
"if 1 < 1 > 1 == 1 >= 5 <= 0x15 <= 0x12 != 1 and 5 in 1 not in 1 is 1 or 5 is not 1: pass"
] |
x = 1//1*1/5*12%0x12
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
4,
0,
0,
0,
0,
0,
0
]
] | [
"x = 1//1*1/5*12%0x12"
] |
0xFF & 0x15 | 1234
| [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
4,
0,
0,
0,
0,
0,
0
]
] | [
"0xFF & 0x15 | 1234"
] |
x = 1 << 1 >> 5
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
4,
0,
0,
0,
0,
0,
0
]
] | [
"x = 1 << 1 >> 5"
] |
a = r'''this is some
more stuff
| [] | [] |
x = u'abc' + U'ABC'
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
4,
0,
0,
0,
0,
0,
0
]
] | [
"x = u'abc' + U'ABC'"
] |
x = 0xfffffffffff
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
]
] | [
"x = 0xfffffffffff"
] |
0xdeadbeef != -1
| [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
] | [
"0xdeadbeef != -1"
] |
2134568 != 01231515
| [] | [] |
wee = """this is some
stuff and
| [] | [] |
def d22(a, b, c=2, d=2, *k): pass
| [
[
2,
0,
1,
1,
0,
0.66,
0,
755,
0,
5,
0,
0,
0,
0,
0
]
] | [
"def d22(a, b, c=2, d=2, *k): pass"
] |
~1 ^ 1 & 1 |1 ^ -1
| [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
4,
0,
0,
0,
0,
0,
0
]
] | [
"~1 ^ 1 & 1 |1 ^ -1"
] |
0o123 <= 0123
| [] | [] |
x = ur'abc' + Ur'ABC' + uR'ABC' + UR'ABC'
| [] | [] |
x = '"'; y = "'"
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
1,
1,
0,
0.66,
1,
304,
1,
0,
0,
0,
0,
3,
0
]
] | [
"x = '\"'; y = \"'\"",
"x = '\"'; y = \"'\""
] |
1 + 1
| [
[
8,
0,
1,
1,
0,
0.66,
0,
0,
4,
0,
0,
0,
0,
0,
0
]
] | [
"1 + 1"
] |
x = 123141242151251616110l
| [] | [] |
x = ''; y = ""
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
1,
1,
0,
0.66,
1,
304,
1,
0,
0,
0,
0,
3,
0
]
] | [
"x = ''; y = \"\"",
"x = ''; y = \"\""
] |
x = 1 - y + 15 - 01 + 0x124 + z + a[5]
| [] | [] |
01234567 > ~0x15
| [] | [] |
x = 3.14159
| [
[
14,
0,
1,
1,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
2,
0
]
] | [
"x = 3.14159"
] |
def f():
if True:
if False:
x =3
y = 4
return
return 19
| [
[
2,
0,
0.5714,
1,
0,
0.66,
0,
899,
0,
0,
1,
0,
0,
0,
0
],
[
4,
1,
0.6429,
0.8571,
1,
0.41,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
4,
2,
0.5714,
0.4286,
2,
0.84,
0,
... | [
"def f():\n if True:\n if False:\n x =3\n y = 4\n return\n return 19",
" if True:\n if False:\n x =3\n y = 4\n return\n return 19",
" if False:\n x =3\n y = 4",
" x =3",
" ... |
x = 0L
| [] | [] |
def make_tree(item, depth):
if not depth: return item, None, None
item2 = item + item
depth -= 1
return item, make_tree(item2 - 1, depth), make_tree(item2, depth)
def check_tree(node):
item, left, right = node
if not left: return item
return item + check_tree(left) - check_tree(right)
def ... | [
[
2,
0,
0.0938,
0.1562,
0,
0.66,
0,
92,
0,
2,
1,
0,
0,
0,
2
],
[
4,
1,
0.0625,
0.0312,
1,
0.42,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
[
13,
2,
0.0625,
0.0312,
2,
0.03,
0... | [
"def make_tree(item, depth):\n if not depth: return item, None, None\n item2 = item + item\n depth -= 1\n return item, make_tree(item2 - 1, depth), make_tree(item2, depth)",
" if not depth: return item, None, None",
" if not depth: return item, None, None",
" item2 = item + item",
" ... |
import sys
def main():
cout = sys.stdout.write
size = 4000
xr_size = range(size)
xr_iter = range(50)
bit = 128
byte_acc = 0
cout("P4\n%d %d\n" % (size, size))
size = float(size)
for y in xr_size:
fy = 2j * y / size - 1j
for x in xr_size:
z = 0j
... | [
[
1,
0,
0.0256,
0.0256,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5128,
0.8974,
0,
0.66,
0.5,
624,
0,
0,
0,
0,
0,
0,
9
],
[
14,
1,
0.1026,
0.0256,
1,
0.35... | [
"import sys",
"def main():\n cout = sys.stdout.write\n size = 4000\n xr_size = range(size)\n xr_iter = range(50)\n bit = 128\n byte_acc = 0",
" cout = sys.stdout.write",
" size = 4000",
" xr_size = range(size)",
" xr_iter = range(50)",
" bit = 128",
" byte_acc = 0",... |
def do(fmt, val):
print fmt % val
do("%d", 42)
do("%x", 42)
do("%o", 42)
do("%d", 42L)
do("%x", 42L)
do("%o", 42L)
do("%d", 4200000000000L)
do("%x", 4200000000000L)
do("%o", 4200000000000L)
do("%d", 0x4200000000000L)
do("%x", 0x4200000000000L)
do("%o", 0x4200000000000L)
do("%d", 0o4200000000000L)
do("%x", 0o4200000... | [
[
2,
0,
0.75,
1,
0,
0.66,
0,
245,
0,
2,
0,
0,
0,
0,
1
],
[
8,
1,
1,
0.5,
1,
0.19,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"def do(fmt, val):\n print(fmt % val)",
" print(fmt % val)"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.