code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
"""
Django settings for final_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, .... | [
[
8,
0,
0.0521,
0.0938,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.125,
0.0104,
0,
0.66,
0.0526,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1354,
0.0104,
0,
0.66... | [
"\"\"\"\nDjango settings for final_project project.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.6/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.6/ref/settings/",
"import os",
"BASE_DIR = os.path.dirname(os.path.dir... |
__author__ = 'esraa'
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class MyRegistrationForm(UserCreationForm):
email = forms.EmailField(required=True)
class Meta:
model = User
fields = ('username','email','password1'... | [
[
14,
0,
0.05,
0.05,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1,
0.05,
0,
0.66,
0.25,
294,
0,
1,
0,
0,
294,
0,
0
],
[
1,
0,
0.15,
0.05,
0,
0.66,
0.5,
... | [
"__author__ = 'esraa'",
"from django import forms",
"from django.contrib.auth.models import User",
"from django.contrib.auth.forms import UserCreationForm",
"class MyRegistrationForm(UserCreationForm):\n email = forms.EmailField(required=True)\n\n class Meta:\n model = User\n fields = ('... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'final_project.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^sear... | [
[
1,
0,
0.0323,
0.0323,
0,
0.66,
0,
528,
0,
3,
0,
0,
528,
0,
0
],
[
1,
0,
0.0968,
0.0323,
0,
0.66,
0.3333,
302,
0,
1,
0,
0,
302,
0,
0
],
[
8,
0,
0.1935,
0.0323,
0,
... | [
"from django.conf.urls import patterns, include, url",
"from django.contrib import admin",
"admin.autodiscover()",
"urlpatterns = patterns('',\n # Examples:\n # url(r'^$', 'final_project.views.home', name='home'),\n # url(r'^blog/', include('blog.urls')),\n\n url(r'^admin/', include(admin.site.url... |
"""
WSGI config for final_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "final_project.settings")
from d... | [
[
8,
0,
0.3214,
0.5714,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.7143,
0.0714,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
8,
0,
0.7857,
0.0714,
0,
0.66,
... | [
"\"\"\"\nWSGI config for final_project project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/\n\"\"\"",
"import os",
"os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"fi... |
from django.shortcuts import render_to_response
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib import auth
from django.core.context_processors import csrf
#from forms import MyRegistrationForm
from django.contrib.auth.forms import UserCreationForm
def index(reque... | [
[
1,
0,
0.0122,
0.0122,
0,
0.66,
0,
852,
0,
1,
0,
0,
852,
0,
0
],
[
1,
0,
0.0244,
0.0122,
0,
0.66,
0.0769,
852,
0,
1,
0,
0,
852,
0,
0
],
[
1,
0,
0.0366,
0.0122,
0,
... | [
"from django.shortcuts import render_to_response",
"from django.shortcuts import render",
"from django.http import HttpResponseRedirect",
"from django.contrib import auth",
"from django.core.context_processors import csrf",
"from django.contrib.auth.forms import UserCreationForm",
"def index(request):\n... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "final_project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| [
[
1,
0,
0.2,
0.1,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3,
0.1,
0,
0.66,
0.5,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.75,
0.6,
0,
0.66,
1,
0,
... | [
"import os",
"import sys",
"if __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"final_project.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)",
" os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "final_project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| [
[
1,
0,
0.2,
0.1,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3,
0.1,
0,
0.66,
0.5,
509,
0,
1,
0,
0,
509,
0,
0
],
[
4,
0,
0.75,
0.6,
0,
0.66,
1,
0,
... | [
"import os",
"import sys",
"if __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"final_project.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)",
" os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"... |
#====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | [
[
1,
0,
0.3514,
0.0135,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3649,
0.0135,
0,
0.66,
0.1111,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.3784,
0.0135,
0,
... | [
"import os",
"import re",
"import tempfile",
"import shutil",
"ignore_pattern = re.compile('^(.svn|target|bin|classes)')",
"java_pattern = re.compile('^.*\\.java')",
"annot_pattern = re.compile('import org\\.apache\\.http\\.annotation\\.')",
"def process_dir(dir):\n files = os.listdir(dir)\n for... |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | [
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.1224,
0.0102,
0,
0.66,
0.0714,
792,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1531,
0.0102,
0,
... | [
"import os, re, mimetypes, sys",
"SOURCE = sys.argv[1:]",
"COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)",
"COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)",
"COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)",
"EXCLUDE_TYPES = [\n \"application/xml\... |
# San Angeles Observation
# Original C version Copyright 2004-2005 Jetro Lauha
# Web: http://iki.fi/jetro/
#
# BSD-license.
#
# Javascript version by Ken Waters
# Skulpt (Python) version by Scott Graham
import webgl
ShapeParams = [
# m a b n1 n2 n3 m a b n1 n2 n3 res1... | [
[
1,
0,
0.02,
0.002,
0,
0.66,
0,
201,
0,
1,
0,
0,
201,
0,
0
],
[
14,
0,
0.047,
0.048,
0,
0.66,
0.0294,
183,
0,
0,
0,
0,
0,
5,
0
],
[
3,
0,
0.081,
0.012,
0,
0.66,
... | [
"import webgl",
"ShapeParams = [\n # m a b n1 n2 n3 m a b n1 n2 n3 res1 res2 scale (org.res1,res2)\n [10, 1, 2, 90, 1, -45, 8, 1, 1, -1, 1, -0.4 , 20, 30, 2], # 40, 60\n [10, 1, 2, 90, 1, -45, 4, 1, 1, ... |
# JSLint doesn't allow/support disabling the requirement for braces around
# blocks, and that's one uglification I refuse to perform in the service of a
# lint.
#
# There are of course lots of other intelligent things JSLint has to say
# because it's just too easy in JS to do something that (e.g.) IE won't like.
# So, ... | [
[
1,
0,
0.1818,
0.013,
0,
0.66,
0,
394,
0,
2,
0,
0,
394,
0,
0
],
[
1,
0,
0.1948,
0.013,
0,
0.66,
0.2,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.2078,
0.013,
0,
0.66,
... | [
"from subprocess import Popen, PIPE",
"import sys",
"import re",
"def remapError(linestarts, line, col, err):\n if len(linestarts) == 0:\n # none supplied on command line\n return \"%s:%d:%d: %s\" % (sys.argv[1], line, col - 1, err)\n\n for i in range(len(linestarts)):\n if line > l... |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Pgen imports
import grammar, token, tokenize
class PgenGrammar(grammar.Grammar):
pass
class ParserGenerator(object):
def __init__(self, filename, stream=None):
close_stream = None
... | [
[
1,
0,
0.013,
0.0026,
0,
0.66,
0,
260,
0,
3,
0,
0,
260,
0,
0
],
[
3,
0,
0.0195,
0.0052,
0,
0.66,
0.2,
344,
0,
0,
0,
0,
407,
0,
0
],
[
3,
0,
0.4492,
0.849,
0,
0.66,... | [
"import grammar, token, tokenize",
"class PgenGrammar(grammar.Grammar):\n pass",
"class ParserGenerator(object):\n\n def __init__(self, filename, stream=None):\n close_stream = None\n if stream is None:\n stream = open(filename)\n close_stream = stream.close\n se... |
#! /usr/bin/env python
"""Token constants (from "token.h")."""
# Taken from Python (r53757) and modified to include some tokens
# originally monkeypatched in by pgen2.tokenize
#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
C... | [
[
8,
0,
0.0366,
0.0122,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1098,
0.0122,
0,
0.66,
0.0159,
977,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.122,
0.0122,
0,
0.66,... | [
"\"\"\"Token constants (from \"token.h\").\"\"\"",
"ENDMARKER = 0",
"NAME = 1",
"NUMBER = 2",
"STRING = 3",
"NEWLINE = 4",
"INDENT = 5",
"DEDENT = 6",
"LPAR = 7",
"RPAR = 8",
"LSQB = 9",
"RSQB = 10",
"COLON = 11",
"COMMA = 12",
"SEMI = 13",
"PLUS = 14",
"MINUS = 15",
"STAR = 16",
... |
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | [
[
8,
0,
0.0314,
0.0482,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0587,
0.0021,
0,
0.66,
0.0172,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.0618,
0.0042,
0,
0.66... | [
"\"\"\"Tokenization help for Python programs.\n\ngenerate_tokens(readline) is a generator that breaks a stream of\ntext into Python tokens. It accepts a readline-like method which is called\nrepeatedly to get the next line of input (or \"\" for EOF). It generates\n5-tuples with these members:\n\n the token typ... |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | [
[
8,
0,
0.0421,
0.0495,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0792,
0.005,
0,
0.66,
0.1667,
848,
0,
1,
0,
0,
848,
0,
0
],
[
1,
0,
0.0941,
0.005,
0,
0.66,
... | [
"\"\"\"This module defines the data structures used to represent a grammar.\n\nThese are a bit arcane because they are derived from the data\nstructures used by Python's 'pgen' parser generator.\n\nThere's also a table here mapping operators to their names in the\ntoken module; the Python tokenize module reports al... |
#! /usr/bin/env python
"""Generate JS code from an ASDL description."""
# TO DO
# handle fields that have a type but no name
import os, sys
import asdl
TABSIZE = 4
MAX_COL = 80
def get_c_type(name):
"""Return a string for the C name of the type.
This function special cases the default types provided by as... | [
[
8,
0,
0.0051,
0.0026,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0179,
0.0026,
0,
0.66,
0.0455,
688,
0,
2,
0,
0,
688,
0,
0
],
[
1,
0,
0.023,
0.0026,
0,
0.66,... | [
"\"\"\"Generate JS code from an ASDL description.\"\"\"",
"import os, sys",
"import asdl",
"TABSIZE = 4",
"MAX_COL = 80",
"def get_c_type(name):\n \"\"\"Return a string for the C name of the type.\n\n This function special cases the default types provided by asdl:\n identifier, string, int, bool.... |
s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpg... | [
[
14,
0,
0.3929,
0.75,
0,
0.66,
0,
553,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.8214,
0.0357,
0,
0.66,
0.3333,
355,
0,
0,
0,
0,
0,
6,
0
],
[
6,
0,
0.8929,
0.1071,
0,
0.66... | [
"s = \"\"\"Gur Mra bs Clguba, ol Gvz Crgref\n\nOrnhgvshy vf orggre guna htyl.\nRkcyvpvg vf orggre guna vzcyvpvg.\nFvzcyr vf orggre guna pbzcyrk.\nPbzcyrk vf orggre guna pbzcyvpngrq.\nSyng vf orggre guna arfgrq.\nFcnefr vf orggre guna qrafr.",
"d = {}",
"for c in (65, 97):\n for i in range(26):\n d[chr... |
__author__ = 'bmiller'
def testEqual(actual, expected):
if type(expected) == type(1):
if actual == expected:
print('Pass')
return True
elif type(expected) == type(1.11):
if abs(actual-expected) < 0.00001:
print('Pass')
return True
else:
... | [
[
14,
0,
0.0476,
0.0476,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
2,
0,
0.4762,
0.7143,
0,
0.66,
0.5,
214,
0,
2,
1,
0,
0,
0,
11
],
[
4,
1,
0.4524,
0.5714,
1,
0.99,... | [
"__author__ = 'bmiller'",
"def testEqual(actual, expected):\n if type(expected) == type(1):\n if actual == expected:\n print('Pass')\n return True\n elif type(expected) == type(1.11):\n if abs(actual-expected) < 0.00001:\n print('Pass')",
" if type(expecte... |
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import os
from django.utils import simplejson
from google.appengine.ext import db
class MainPage(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/html'
path = os.pat... | [
[
1,
0,
0.0164,
0.0164,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.0328,
0.0164,
0,
0.66,
0.0833,
327,
0,
1,
0,
0,
327,
0,
0
],
[
1,
0,
0.0492,
0.0164,
0,
... | [
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"import os",
"from django.utils import simplejson",
"from google.appengine.ext import db",
"class MainPage(webapp.RequestHandler):\n def get(self):\n self.response.headers['Content-Type'] = 't... |
import sys
import webgl
import webgl.primitives
import webgl.models
import webgl.matrix4 as m4
def main():
print "Starting up..."
gl = webgl.Context("canvas")
sh = webgl.Shader(gl, VertexShader, FragmentShader)
sh.use()
m = webgl.models.Model(sh, webgl.primitives.createCube(1), [])
eyePos... | [
[
1,
0,
0.0118,
0.0118,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0235,
0.0118,
0,
0.66,
0.125,
201,
0,
1,
0,
0,
201,
0,
0
],
[
1,
0,
0.0353,
0.0118,
0,
0... | [
"import sys",
"import webgl",
"import webgl.primitives",
"import webgl.models",
"import webgl.matrix4 as m4",
"def main():\n print(\"Starting up...\")\n gl = webgl.Context(\"canvas\")\n sh = webgl.Shader(gl, VertexShader, FragmentShader)\n sh.use()\n \n m = webgl.models.Model(sh, webgl.p... |
"""
quick hack script to convert from quake2 .bsp to simple format to draw. drops
most information. keeps only raw polys and lightmaps.
makes .blv and .llv file (big and little endian level)
file format is
'BLV1' or 'LLV1'
int texwidth
int texheight
int numtris
float startx, starty, s... | [
[
8,
0,
0.0724,
0.1402,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1495,
0.0047,
0,
0.66,
0.0909,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1542,
0.0047,
0,
0.66... | [
"\"\"\"\n\nquick hack script to convert from quake2 .bsp to simple format to draw. drops\nmost information. keeps only raw polys and lightmaps.\n\nmakes .blv and .llv file (big and little endian level)\n\nfile format is",
"import os",
"import sys",
"import struct",
"def strunpack(stream, format):\n retur... |
import goog.graphics as gfx
import goog.dom as dom
def main():
g = gfx.createSimpleGraphics(600, 200)
print g
fill = gfx.SolidFill('yellow')
stroke = gfx.Stroke(2, 'green')
g.drawRect(30, 10, 100, 80, stroke, fill)
stroke = gfx.Stroke(4, 'green')
g.drawImage(30, 110, 276, 110, 'http://www... | [
[
1,
0,
0.0256,
0.0256,
0,
0.66,
0,
78,
0,
1,
0,
0,
78,
0,
0
],
[
1,
0,
0.0513,
0.0256,
0,
0.66,
0.3333,
107,
0,
1,
0,
0,
107,
0,
0
],
[
2,
0,
0.5256,
0.8718,
0,
0.... | [
"import goog.graphics as gfx",
"import goog.dom as dom",
"def main():\n g = gfx.createSimpleGraphics(600, 200)\n print(g)\n fill = gfx.SolidFill('yellow')\n stroke = gfx.Stroke(2, 'green')\n\n g.drawRect(30, 10, 100, 80, stroke, fill)\n stroke = gfx.Stroke(4, 'green')",
" g = gfx.createSi... |
def f():
n = "OK"
print n
f()
| [
[
2,
0,
0.4167,
0.6667,
0,
0.66,
0,
899,
0,
0,
0,
0,
0,
0,
1
],
[
14,
1,
0.3333,
0.1667,
1,
0.63,
0,
773,
1,
0,
0,
0,
0,
3,
0
],
[
8,
1,
0.6667,
0.1667,
1,
0.63,
... | [
"def f():\n n = \"OK\"\n\n print(n)",
" n = \"OK\"",
" print(n)",
"f()"
] |
print '0"1'
print '2\'3'
print "4'5"
print "6\"7"
print '''8'9"0'''
| [
[
8,
0,
0.2,
0.2,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.4,
0.2,
0,
0.66,
0.25,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.5,
535,
... | [
"print('0\"1')",
"print('2\\'3')",
"print(\"4'5\")",
"print(\"6\\\"7\")",
"print('''8'9\"0''')"
] |
y = 1
| [
[
14,
0,
1,
1,
0,
0.66,
0,
304,
1,
0,
0,
0,
0,
1,
0
]
] | [
"y = 1"
] |
print x+2*3
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(x+2*3)"
] |
print 4-1
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(4-1)"
] |
class Stuff:
def __init__(self):
self.a = 0
self.b = 'b'
self.c = [1,2,3]
self.d = 100000000000000
s = Stuff()
s.a += 10
s.b += 'dog'
s.c += [9,10]
s.d += 10000
print s.a
print s.b
print s.c
print s.d
| [
[
3,
0,
0.2059,
0.3529,
0,
0.66,
0,
710,
0,
1,
0,
0,
0,
0,
0
],
[
2,
1,
0.2353,
0.2941,
1,
0.41,
0,
555,
0,
1,
0,
0,
0,
0,
0
],
[
14,
2,
0.1765,
0.0588,
2,
0.09,
... | [
"class Stuff:\n def __init__(self):\n self.a = 0\n self.b = 'b'\n self.c = [1,2,3]\n self.d = 100000000000000",
" def __init__(self):\n self.a = 0\n self.b = 'b'\n self.c = [1,2,3]\n self.d = 100000000000000",
" self.a = 0",
" self.b ... |
print [] or 5
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print([] or 5)"
] |
def f(n):
i = 0
while i < n:
yield i
i = 100
yield i
i += 1
for i in f(50):
print i
| [
[
2,
0,
0.4,
0.7,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
0
],
[
14,
1,
0.2,
0.1,
1,
0.4,
0,
826,
1,
0,
0,
0,
0,
1,
0
],
[
5,
1,
0.5,
0.5,
1,
0.4,
1,
0,
0,
... | [
"def f(n):\n i = 0\n while i < n:\n yield i\n i = 100\n yield i\n i += 1",
" i = 0",
" while i < n:\n yield i\n i = 100\n yield i\n i += 1",
" yield i",
" i = 100",
" yield i",
"for i in f(50):\n print(i)",
" ... |
def f(iter):
for v in iter:
print v
f(x*y for x in range(10) for y in range(x))
| [
[
2,
0,
0.5,
0.75,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
1
],
[
6,
1,
0.625,
0.5,
1,
0.46,
0,
553,
2,
0,
0,
0,
0,
0,
1
],
[
8,
2,
0.75,
0.25,
2,
0.23,
0,
535,
... | [
"def f(iter):\n for v in iter:\n print(v)",
" for v in iter:\n print(v)",
" print(v)",
"f(x*y for x in range(10) for y in range(x))"
] |
X = "OK"
def test():
X = 4
print(X)
test()
print X
| [
[
14,
0,
0.1667,
0.1667,
0,
0.66,
0,
783,
1,
0,
0,
0,
0,
3,
0
],
[
2,
0,
0.5,
0.5,
0,
0.66,
0.3333,
224,
0,
0,
0,
0,
0,
0,
1
],
[
14,
1,
0.5,
0.1667,
1,
0.94,
0... | [
"X = \"OK\"",
"def test():\n X = 4\n print(X)",
" X = 4",
" print(X)",
"test()",
"print(X)"
] |
def f():
y = 0
while y == 0:
y += 1
yield y
for i in f():
print i
| [
[
2,
0,
0.375,
0.625,
0,
0.66,
0,
899,
0,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.25,
0.125,
1,
0.53,
0,
304,
1,
0,
0,
0,
0,
1,
0
],
[
5,
1,
0.5,
0.375,
1,
0.53,
1,
... | [
"def f():\n y = 0\n while y == 0:\n y += 1\n yield y",
" y = 0",
" while y == 0:\n y += 1\n yield y",
" yield y",
"for i in f():\n print(i)",
" print(i)"
] |
class X: pass
x = X()
methodName = "wee"
try:
stuff = getattr(x, methodName)
except AttributeError:
raise ValueError, "no such method in %s: %s" % (x.__class__, methodName)
| [
[
3,
0,
1,
1,
0,
0.66,
0,
783,
0,
0,
0,
0,
0,
0,
0
]
] | [
"class X: pass"
] |
import pkga.pkgb.modc as c_me
print c_me.stuff
print c_me.things
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
812,
0,
1,
0,
0,
812,
0,
0
],
[
8,
0,
0.75,
0.25,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
535... | [
"import pkga.pkgb.modc as c_me",
"print(c_me.stuff)",
"print(c_me.things)"
] |
print(int)
print(str(int))
print(repr(int))
class X:
pass
x = X()
print(str(x))
print(repr(x))
print(str(x.__class__))
print(repr(x.__class__))
print(str(X))
print(repr(X))
| [
[
8,
0,
0.0833,
0.0833,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.1667,
0.0833,
0,
0.66,
0.1,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.25,
0.0833,
0,
0.66,
... | [
"print(int)",
"print(str(int))",
"print(repr(int))",
"class X:\n pass",
"x = X()",
"print(str(x))",
"print(repr(x))",
"print(str(x.__class__))",
"print(repr(x.__class__))",
"print(str(X))",
"print(repr(X))"
] |
def test():
def fnc():
print "OK"
print fnc()
test()
| [
[
2,
0,
0.5,
0.8,
0,
0.66,
0,
224,
0,
0,
0,
0,
0,
0,
3
],
[
2,
1,
0.5,
0.4,
1,
0.23,
0,
499,
0,
0,
0,
0,
0,
0,
1
],
[
8,
2,
0.6,
0.2,
2,
0.92,
0,
535,
3... | [
"def test():\n def fnc():\n print(\"OK\")\n print(fnc())",
" def fnc():\n print(\"OK\")",
" print(\"OK\")",
" print(fnc())",
"test()"
] |
z = 0
for x in [1,2,3]:
z += x
print z
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
859,
1,
0,
0,
0,
0,
1,
0
],
[
6,
0,
0.625,
0.5,
0,
0.66,
0.5,
190,
0,
0,
0,
0,
0,
0,
0
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
535,... | [
"z = 0",
"for x in [1,2,3]:\n z += x",
"print(z)"
] |
a = (1,2,3)
b = ('a', 'b', 'c')
for x in a+b:
print x
print "a:",a
print "b:",b
| [
[
14,
0,
0.1667,
0.1667,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
8,
0
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.25,
756,
0,
0,
0,
0,
0,
8,
0
],
[
6,
0,
0.5833,
0.3333,
0,
0.66... | [
"a = (1,2,3)",
"b = ('a', 'b', 'c')",
"for x in a+b:\n print(x)",
" print(x)",
"print(\"a:\",a)",
"print(\"b:\",b)"
] |
import this
| [
[
1,
0,
1,
1,
0,
0.66,
0,
324,
0,
1,
0,
0,
324,
0,
0
]
] | [
"import this"
] |
v = [3,2,1]
v.sort()
print v[0]
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
553,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
489,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1... | [
"v = [3,2,1]",
"v.sort()",
"print(v[0])"
] |
wee = lambda waa, woo=False, wii=True: ("OK", waa, woo, wii)
print wee("stuff")
print wee("stuff", "dog")
print wee("stuff", "dog", "cat")
print wee("stuff", wii="lamma")
print wee(wii="lamma", waa="pocky")
print wee(wii="lamma", waa="pocky", woo="blorp")
| [
[
14,
0,
0.125,
0.125,
0,
0.66,
0,
48,
9,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.375,
0.125,
0,
0.66,
0.1667,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.5,
0.125,
0,
0.66,
0.... | [
"wee = lambda waa, woo=False, wii=True: (\"OK\", waa, woo, wii)",
"print(wee(\"stuff\"))",
"print(wee(\"stuff\", \"dog\"))",
"print(wee(\"stuff\", \"dog\", \"cat\"))",
"print(wee(\"stuff\", wii=\"lamma\"))",
"print(wee(wii=\"lamma\", waa=\"pocky\"))",
"print(wee(wii=\"lamma\", waa=\"pocky\", woo=\"blorp... |
def f(n):
i = 0
while i < n:
yield i
yield i * 10
i += 1
for i in f(10):
print i
| [
[
2,
0,
0.3889,
0.6667,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
0
],
[
14,
1,
0.2222,
0.1111,
1,
0.72,
0,
826,
1,
0,
0,
0,
0,
1,
0
],
[
5,
1,
0.5,
0.4444,
1,
0.72,
1... | [
"def f(n):\n i = 0\n while i < n:\n yield i\n yield i * 10\n i += 1",
" i = 0",
" while i < n:\n yield i\n yield i * 10\n i += 1",
" yield i",
" yield i * 10",
"for i in f(10):\n print(i)",
" print(i)"
] |
def f(*a):
print a
def g(x, *a):
print x, a
def h(x, y, *a):
print x, y, a
def i(x, y=4, *a):
print x, y, a
f()
f(1)
f(1, 2, 3)
g(1)
g(1, 2, 3)
h(1, 2)
h(1, 2, 3)
h(1, 2, 3, 4)
i(1)
i(1, 2, 3)
i(1, 2, 3, 4)
| [
[
2,
0,
0.0652,
0.087,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
1
],
[
8,
1,
0.087,
0.0435,
1,
0.16,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
2,
0,
0.1957,
0.087,
0,
0.66,
0.... | [
"def f(*a):\n print(a)",
" print(a)",
"def g(x, *a):\n print(x, a)",
" print(x, a)",
"def h(x, y, *a):\n print(x, y, a)",
" print(x, y, a)",
"def i(x, y=4, *a):\n print(x, y, a)",
" print(x, y, a)",
"f()",
"f(1)",
"f(1, 2, 3)",
"g(1)",
"g(1, 2, 3)",
"h(1, 2)",
"h(... |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[1:5] = b
print a
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
756,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"a = [1,2,3,4,5,6]",
"b = [9,9,9]",
"a[1:5] = b",
"print(a)"
] |
def stuff(n):
print not n
for x in range(-5, 5):
stuff(x)
| [
[
2,
0,
0.3,
0.4,
0,
0.66,
0,
686,
0,
1,
0,
0,
0,
0,
1
],
[
8,
1,
0.4,
0.2,
1,
0.38,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
6,
0,
0.9,
0.4,
0,
0.66,
1,
190,
3... | [
"def stuff(n):\n print(not n)",
" print(not n)",
"for x in range(-5, 5):\n stuff(x)",
" stuff(x)"
] |
print False == 0
print True == 1
print True == 2
| [
[
8,
0,
0.3333,
0.3333,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,... | [
"print(False == 0)",
"print(True == 1)",
"print(True == 2)"
] |
a = (1 for x in range(3))
print a
for i in a:
print i
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
475,
5,
0,
0,
0,
0,
0,
1
],
[
8,
0,
0.5,
0.25,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
6,
0,
0.875,
0.5,
0,
0.66,
1,
82... | [
"a = (1 for x in range(3))",
"print(a)",
"for i in a:\n print(i)",
" print(i)"
] |
d = {}
d["__proto__"]="testing"
print d
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
355,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,... | [
"d = {}",
"d[\"__proto__\"]=\"testing\"",
"print(d)"
] |
# Test the creation of sets
l = [1,2,3,4,1,1]
print l
s = set(l)
print s
print len(s)
| [
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0,
810,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.5,
0.1667,
0,
0.66,
0.25,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.6667,
0.1667,
0,
0.66,
... | [
"l = [1,2,3,4,1,1]",
"print(l)",
"s = set(l)",
"print(s)",
"print(len(s))"
] |
print str(range(-4))[:5]
print len(range(-4))
| [
[
8,
0,
0.5,
0.5,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
3
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
3
]
] | [
"print(str(range(-4))[:5])",
"print(len(range(-4)))"
] |
var1 = "foo"
if isinstance(var1, str):
print "var1 is a string"
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
897,
1,
0,
0,
0,
0,
3,
0
],
[
4,
0,
0.8333,
0.6667,
0,
0.66,
1,
0,
3,
0,
0,
0,
0,
0,
2
],
[
8,
1,
1,
0.3333,
1,
0.14,
0,
... | [
"var1 = \"foo\"",
"if isinstance(var1, str):\n print(\"var1 is a string\")",
" print(\"var1 is a string\")"
] |
def test(a,b):
return a+b
print test(1,1)+test(1,1)
| [
[
2,
0,
0.5,
0.6667,
0,
0.66,
0,
224,
0,
2,
1,
0,
0,
0,
0
],
[
13,
1,
0.6667,
0.3333,
1,
0.25,
0,
0,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,
5... | [
"def test(a,b):\n return a+b",
" return a+b",
"print(test(1,1)+test(1,1))"
] |
a,b = 1,2
print a+b
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
127,
0,
0,
0,
0,
0,
8,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a,b = 1,2",
"print(a+b)"
] |
a = [100,101,102,103,104,105,106,107]
del a[2:6]
print a
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
2,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a = [100,101,102,103,104,105,106,107]",
"print(a)"
] |
x = [0]*10
for i in range(10):
x[i] += i
x[i] += i*2
print x
| [
[
14,
0,
0.1429,
0.1429,
0,
0.66,
0,
190,
4,
0,
0,
0,
0,
0,
0
],
[
6,
0,
0.5714,
0.4286,
0,
0.66,
0.5,
826,
3,
0,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.1429,
0,
0.66,
1... | [
"x = [0]*10",
"for i in range(10):\n x[i] += i\n x[i] += i*2",
"print(x)"
] |
s = set([2,3,4])
t = set([3,4,5])
u = set([1,3,5])
a = s.difference(t)
b = u.difference(s)
c = u.difference(t)
print a
print b
print c
print a == set([2])
print b == set([1,5])
print c == set([1])
d = s.difference(t, u)
print d
print d == set([2])
| [
[
14,
0,
0.05,
0.05,
0,
0.66,
0,
553,
3,
1,
0,
0,
21,
10,
1
],
[
14,
0,
0.1,
0.05,
0,
0.66,
0.0714,
15,
3,
1,
0,
0,
21,
10,
1
],
[
14,
0,
0.15,
0.05,
0,
0.66,
0... | [
"s = set([2,3,4])",
"t = set([3,4,5])",
"u = set([1,3,5])",
"a = s.difference(t)",
"b = u.difference(s)",
"c = u.difference(t)",
"print(a)",
"print(b)",
"print(c)",
"print(a == set([2]))",
"print(b == set([1,5]))",
"print(c == set([1]))",
"d = s.difference(t, u)",
"print(d)",
"print(d ==... |
print "%s:%r:%d:%x" % ("dog", "cat", 23456, 999999999999L)
| [] | [] |
x=1
if x == 1:
print "yes"
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
],
[
4,
0,
0.8333,
0.6667,
0,
0.66,
1,
0,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
1,
0.3333,
1,
0.09,
0,
... | [
"x=1",
"if x == 1:\n print(\"yes\")",
" print(\"yes\")"
] |
print 'Hello';
print "stuff"; print "things"
| [] | [] |
for i in (i*2 for i in range(3)):
print i
| [
[
6,
0,
0.75,
1,
0,
0.66,
0,
826,
5,
0,
0,
0,
0,
0,
2
],
[
8,
1,
1,
0.5,
1,
0.02,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"for i in (i*2 for i in range(3)):\n print(i)",
" print(i)"
] |
print len("\\0")
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(len(\"\\\\0\"))"
] |
x = []
x.append(x)
print x<x
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
243,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1... | [
"x = []",
"x.append(x)",
"print(x<x)"
] |
print str((1,2,3))
print str([1,2,3])
print str({1:'ok', 2:'stuff'})
print str("weewaa")
| [
[
8,
0,
0.25,
0.25,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.5,
0.25,
0,
0.66,
0.3333,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
0.75,
0.25,
0,
0.66,
0.6667,... | [
"print(str((1,2,3)))",
"print(str([1,2,3]))",
"print(str({1:'ok', 2:'stuff'}))",
"print(str(\"weewaa\"))"
] |
a = range(30)
print a[-10::5]
print a[-10::-6]
a = tuple(range(30))
print a[-10::5]
print a[-10::-6]
| [
[
14,
0,
0.1667,
0.1667,
0,
0.66,
0,
475,
3,
1,
0,
0,
816,
10,
1
],
[
8,
0,
0.3333,
0.1667,
0,
0.66,
0.2,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.5,
0.1667,
0,
0.66,
... | [
"a = range(30)",
"print(a[-10::5])",
"print(a[-10::-6])",
"a = tuple(range(30))",
"print(a[-10::5])",
"print(a[-10::-6])"
] |
print {1:'stuff', 'ok':4}
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print({1:'stuff', 'ok':4})"
] |
def f(a, b, **c):
sortc = [(x,y) for x,y in c.items()]
sortc.sort()
print a, b, sortc
f(1, 2, d=4, e=5)
f(1, b=4, e=5)
f(a=1, b=4, e=5, f=6, g=7)
| [
[
2,
0,
0.3125,
0.5,
0,
0.66,
0,
899,
0,
3,
0,
0,
0,
0,
3
],
[
14,
1,
0.25,
0.125,
1,
0.82,
0,
934,
5,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.375,
0.125,
1,
0.82,
0.5,
... | [
"def f(a, b, **c):\n sortc = [(x,y) for x,y in c.items()]\n sortc.sort()\n print(a, b, sortc)",
" sortc = [(x,y) for x,y in c.items()]",
" sortc.sort()",
" print(a, b, sortc)",
"f(1, 2, d=4, e=5)",
"f(1, b=4, e=5)",
"f(a=1, b=4, e=5, f=6, g=7)"
] |
a,b = "OK"
print a+b
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
127,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"a,b = \"OK\"",
"print(a+b)"
] |
print " hello ".partition("x")
print " hello ".rpartition("x")
| [
[
8,
0,
0.5,
0.5,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(\" hello \".partition(\"x\"))",
"print(\" hello \".rpartition(\"x\"))"
] |
print "".join(["O"]+["K"])
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(\"\".join([\"O\"]+[\"K\"]))"
] |
print slice(1)
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(slice(1))"
] |
print len([1,2,3])
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(len([1,2,3]))"
] |
x = [v*v for v in range(0,5)]
print x[3]
| [
[
14,
0,
0.5,
0.5,
0,
0.66,
0,
190,
5,
0,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"x = [v*v for v in range(0,5)]",
"print(x[3])"
] |
class X: pass
print type(X)
x = X()
print type(x)
print x
class Y(object): pass
print type(Y)
y = Y()
print type(y)
print y
| [
[
3,
0,
0.1,
0.1,
0,
0.66,
0,
783,
0,
0,
0,
0,
0,
0,
0
],
[
8,
0,
0.2,
0.1,
0,
0.66,
0.1111,
535,
3,
1,
0,
0,
0,
0,
2
],
[
14,
0,
0.3,
0.1,
0,
0.66,
0.2222,
... | [
"class X: pass",
"print(type(X))",
"x = X()",
"print(type(x))",
"print(x)",
"class Y(object): pass",
"print(type(Y))",
"y = Y()",
"print(type(y))",
"print(y)"
] |
print "a"*15
print "dog"*19
print 40*"weee"
| [
[
8,
0,
0.3333,
0.3333,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,... | [
"print(\"a\"*15)",
"print(\"dog\"*19)",
"print(40*\"weee\")"
] |
def wee(waa, woo=True, wii=False):
print waa, woo, wii
wee("OK")
| [
[
2,
0,
0.5,
0.6667,
0,
0.66,
0,
48,
0,
3,
0,
0,
0,
0,
1
],
[
8,
1,
0.6667,
0.3333,
1,
0.37,
0,
535,
3,
3,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,
4... | [
"def wee(waa, woo=True, wii=False):\n print(waa, woo, wii)",
" print(waa, woo, wii)",
"wee(\"OK\")"
] |
print "aa..bbb...ccc".replace("..", "X")
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print(\"aa..bbb...ccc\".replace(\"..\", \"X\"))"
] |
x = {}
x['y'] = "test"
print x['y']
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
6,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,... | [
"x = {}",
"x['y'] = \"test\"",
"print(x['y'])"
] |
def f(n):
yield 1
a, b = n, n + 1
yield 2
yield a
yield b
a = 9999
b = 9999
for i in f(20):
print i
| [
[
2,
0,
0.35,
0.6,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
0
],
[
8,
1,
0.2,
0.1,
1,
0.41,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.3,
0.1,
1,
0.41,
0.25,
127,
... | [
"def f(n):\n yield 1\n a, b = n, n + 1\n yield 2\n yield a\n yield b",
" yield 1",
" a, b = n, n + 1",
" yield 2",
" yield a",
" yield b",
"a = 9999",
"b = 9999",
"for i in f(20):\n print(i)",
" print(i)"
] |
x = 1
n = 0
while x < 10:
x = x + 1
if n == 2:
continue
n = n + 1
print n
| [
[
14,
0,
0.125,
0.125,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.25,
0.125,
0,
0.66,
0.3333,
773,
1,
0,
0,
0,
0,
1,
0
],
[
5,
0,
0.625,
0.625,
0,
0.66,
... | [
"x = 1",
"n = 0",
"while x < 10:\n x = x + 1\n if n == 2:\n continue\n n = n + 1",
" x = x + 1",
" if n == 2:\n continue",
" n = n + 1",
"print(n)"
] |
def f(n):
for i in range(n):
yield i
g = f(5)
print g.next()
print g.next()
print g.next()
print g.next()
| [
[
2,
0,
0.25,
0.375,
0,
0.66,
0,
899,
0,
1,
0,
0,
0,
0,
1
],
[
6,
1,
0.3125,
0.25,
1,
0.45,
0,
826,
3,
0,
0,
0,
0,
0,
1
],
[
8,
2,
0.375,
0.125,
2,
0.13,
0,
... | [
"def f(n):\n for i in range(n):\n yield i",
" for i in range(n):\n yield i",
" yield i",
"g = f(5)",
"print(g.next())",
"print(g.next())",
"print(g.next())",
"print(g.next())"
] |
print "Yes" if True else "No"
print "Yes" if False else "No"
| [
[
8,
0,
0.5,
0.5,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(\"Yes\" if True else \"No\")",
"print(\"Yes\" if False else \"No\")"
] |
print True and True
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(True and True)"
] |
xyzy = [100,101,102,103,104,105,106,107]
del xyzy
print xyzy
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
100,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
2,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"xyzy = [100,101,102,103,104,105,106,107]",
"print(xyzy)"
] |
def x():
y = lambda x,y,z: x*y+z
print y(5, 10, 15)
x()
| [
[
2,
0,
0.5,
0.75,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
0,
2
],
[
14,
1,
0.5,
0.25,
1,
0.4,
0,
304,
9,
0,
0,
0,
0,
0,
0
],
[
8,
1,
0.75,
0.25,
1,
0.4,
1,
535,
... | [
"def x():\n y = lambda x,y,z: x*y+z\n print(y(5, 10, 15))",
" y = lambda x,y,z: x*y+z",
" print(y(5, 10, 15))",
"x()"
] |
x = []
x.append(x)
print({x:'OK'}[x])
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
243,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1... | [
"x = []",
"x.append(x)",
"print({x:'OK'}[x])"
] |
# Tests the list functions.
l = [1,1,2,3,5,8,13,21]
print l
print l.count(1)
print l.reverse()
print l
print l.count(1)
print l.count(0)
print l.count(3)
print l.index(5)
print l.remove(5)
print l.remove(1)
print l.count(1)
print l
| [
[
14,
0,
0.1429,
0.0714,
0,
0.66,
0,
810,
0,
0,
0,
0,
0,
5,
0
],
[
8,
0,
0.2143,
0.0714,
0,
0.66,
0.0833,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.2857,
0.0714,
0,
0.6... | [
"l = [1,1,2,3,5,8,13,21]",
"print(l)",
"print(l.count(1))",
"print(l.reverse())",
"print(l)",
"print(l.count(1))",
"print(l.count(0))",
"print(l.count(3))",
"print(l.index(5))",
"print(l.remove(5))",
"print(l.remove(1))",
"print(l.count(1))",
"print(l)"
] |
class X:
pass
y = X()
print "OK"
| [
[
3,
0,
0.375,
0.5,
0,
0.66,
0,
783,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.5,
304,
3,
0,
0,
0,
783,
10,
1
],
[
8,
0,
1,
0.25,
0,
0.66,
1,
5... | [
"class X:\n pass",
"y = X()",
"print(\"OK\")"
] |
# using obj[token] in JS doesn't work as a generic string dict
# make sure to use *both* hasOwnProperty and then get it, otherwise object
# builtins will return existence.
def toString():
print "wee"
class stuff:
def toString(self):
return "waa"
def valueOf(self):
return "stuff"
toString()... | [
[
2,
0,
0.2812,
0.125,
0,
0.66,
0,
661,
0,
0,
0,
0,
0,
0,
1
],
[
8,
1,
0.3125,
0.0625,
1,
0.58,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
3,
0,
0.5625,
0.3125,
0,
0.66,
... | [
"def toString():\n print(\"wee\")",
" print(\"wee\")",
"class stuff:\n def toString(self):\n return \"waa\"\n def valueOf(self):\n return \"stuff\"",
" def toString(self):\n return \"waa\"",
" return \"waa\"",
" def valueOf(self):\n return \"stuff\"",
... |
print 1 in {1:2}
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(1 in {1:2})"
] |
for k in {'OK':0}: print k
| [] | [] |
print str(range(-4,-8,-1))[:5]
print len(range(-4,-8,-1))
print range(-4,-8,-1)[0]
print range(-4,-8,-1)[1]
print range(-4,-8,-1)[-1]
| [
[
8,
0,
0.2,
0.2,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
3
],
[
8,
0,
0.4,
0.2,
0,
0.66,
0.25,
535,
3,
1,
0,
0,
0,
0,
3
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.5,
535,
... | [
"print(str(range(-4,-8,-1))[:5])",
"print(len(range(-4,-8,-1)))",
"print(range(-4,-8,-1)[0])",
"print(range(-4,-8,-1)[1])",
"print(range(-4,-8,-1)[-1])"
] |
def test(): pass
x = 1
print test()
| [
[
2,
0,
0.3333,
0.3333,
0,
0.66,
0,
224,
0,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
190,
1,
0,
0,
0,
0,
1,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
1... | [
"def test(): pass",
"x = 1",
"print(test())"
] |
x = 444
def f(arg):
return "OK: " + arg + ", " + str(x)
| [
[
14,
0,
0.3333,
0.3333,
0,
0.66,
0,
190,
1,
0,
0,
0,
0,
1,
0
],
[
2,
0,
0.8333,
0.6667,
0,
0.66,
1,
899,
0,
1,
1,
0,
0,
0,
1
],
[
13,
1,
1,
0.3333,
1,
0.31,
0,... | [
"x = 444",
"def f(arg):\n return \"OK: \" + arg + \", \" + str(x)",
" return \"OK: \" + arg + \", \" + str(x)"
] |
x = [10] * 5
x[:3] += 100,100
print x
| [
[
14,
0,
0.2,
0.2,
0,
0.66,
0,
190,
4,
0,
0,
0,
0,
0,
0
],
[
8,
0,
1,
0.2,
0,
0.66,
2,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"x = [10] * 5",
"print(x)"
] |
print [x*x for x in range(20) if x > 10 if x % 2 == 0]
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
2
]
] | [
"print([x*x for x in range(20) if x > 10 if x % 2 == 0])"
] |
a = [1,2,3,4,5,6]
b = [9,9,9]
a[2] = b
print a
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
475,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.3333,
756,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"a = [1,2,3,4,5,6]",
"b = [9,9,9]",
"a[2] = b",
"print(a)"
] |
class C:
def __init__(self, data):
self.data = data
def pr(self):
print self.data
C("OK").pr()
| [
[
3,
0,
0.5,
0.8333,
0,
0.66,
0,
619,
0,
2,
0,
0,
0,
0,
1
],
[
2,
1,
0.4167,
0.3333,
1,
0.36,
0,
555,
0,
2,
0,
0,
0,
0,
0
],
[
14,
2,
0.5,
0.1667,
2,
0.02,
0,
... | [
"class C:\n def __init__(self, data):\n self.data = data\n def pr(self):\n print(self.data)",
" def __init__(self, data):\n self.data = data",
" self.data = data",
" def pr(self):\n print(self.data)",
" print(self.data)",
"C(\"OK\").pr()"
] |
big = 012345670123456701234567012345670L # 32 octal digits
print "'%o'" % big
print "'%o'" % -big
print "'%5o'" % -big
print "'%33o'" % -big
print "'%34o'" % -big
print "'%-34o'" % -big
print "'%034o'" % -big
print "'%-034o'" % -big
print "'%036o'" % -big
print "'%036o'" % big
print "'%0+36o'" % big
print "'%+36o'" % ... | [
[
8,
0,
0.0256,
0.0256,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.0513,
0.0256,
0,
0.66,
0.0312,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.0769,
0.0256,
0,
0.66... | [
"print(\"'%o'\" % big)",
"print(\"'%o'\" % -big)",
"print(\"'%5o'\" % -big)",
"print(\"'%33o'\" % -big)",
"print(\"'%34o'\" % -big)",
"print(\"'%-34o'\" % -big)",
"print(\"'%034o'\" % -big)",
"print(\"'%-034o'\" % -big)",
"print(\"'%036o'\" % -big)",
"print(\"'%036o'\" % big)",
"print(\"'%0+36o'... |
print "OKx"[:-1]
| [
[
8,
0,
1,
1,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
]
] | [
"print(\"OKx\"[:-1])"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.