code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style commen... | [
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
14,
0,
0.1224,
0.0102,
0,
0.66,
0.0714,
792,
6,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1531,
0.0102,
0,
... | [
"import os, re, mimetypes, sys",
"SOURCE = sys.argv[1:]",
"COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)",
"COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)",
"COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)",
"EXCLUDE_TYPES = [\n \"application/xml\... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
#!/usr/bin/env python
from distutils.core import setup
from crawle import VERSION
setup(name='CRAWL-E',
version=VERSION,
description='Highly distributed web crawling framework',
author='Bryce Boe',
author_email='bboe (_at_) cs.ucsb.edu',
url='http://code.google.com/p/crawl-e',
py_mo... | [
[
1,
0,
0.1667,
0.0833,
0,
0.66,
0,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.25,
0.0833,
0,
0.66,
0.5,
441,
0,
1,
0,
0,
441,
0,
0
],
[
8,
0,
0.7083,
0.6667,
0,
0.66,... | [
"from distutils.core import setup",
"from crawle import VERSION",
"setup(name='CRAWL-E',\n version=VERSION,\n description='Highly distributed web crawling framework',\n author='Bryce Boe',\n author_email='bboe (_at_) cs.ucsb.edu',\n url='http://code.google.com/p/crawl-e',\n py_modu... |
print("输入:")
year=int(input())
print(year)
for i in range(1,100):
if (year%400==0 or (year%4==0 and year%100!=0)):
print('year')
else:
print("平年!")
| [
[
8,
0,
0.0909,
0.0909,
0,
0.66,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
14,
0,
0.1818,
0.0909,
0,
0.66,
0.3333,
34,
3,
1,
0,
0,
901,
10,
2
],
[
8,
0,
0.3636,
0.0909,
0,
0... | [
"print(\"输入:\")",
"year=int(input())",
"print(year)",
"for i in range(1,100):\n if (year%400==0 or (year%4==0 and year%100!=0)):\n print('year')\n else:\n print(\"平年!\")",
" if (year%400==0 or (year%4==0 and year%100!=0)):\n print('year')\n else:\n print(\"平年!\")",
... |
#!/usr/bin/python
# Filename: using_file.py
import re
i=1000
poem=""
f = open('poem.txt', 'w') # open for 'w'riting
while i>0:
poem=poem+"B"
i=i-1
f.write(poem) # write text to file
f.close() # close the file
| [
[
1,
0,
0.25,
0.0833,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
14,
0,
0.3333,
0.0833,
0,
0.66,
0.1667,
826,
1,
0,
0,
0,
0,
1,
0
],
[
14,
0,
0.4167,
0.0833,
0,
0.... | [
"import re",
"i=1000",
"poem=\"\"",
"f = open('poem.txt', 'w') # open for 'w'riting",
"while i>0:\n poem=poem+\"B\"\n i=i-1",
" poem=poem+\"B\"",
" i=i-1",
"f.write(poem) # write text to file",
"f.close() # close the file"
] |
bigFile= open("big.txt", 'w')
bigFile.seek(28132) #大小自己定,需要几个G, fileSize就是几,速度绝对快
bigFile.write('\x00')
bigFile.close()
| [
[
14,
0,
0.25,
0.25,
0,
0.66,
0,
846,
3,
2,
0,
0,
693,
10,
1
],
[
8,
0,
0.5,
0.25,
0,
0.66,
0.3333,
66,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
0.75,
0.25,
0,
0.66,
0.66... | [
"bigFile= open(\"big.txt\", 'w')",
"bigFile.seek(28132) #大小自己定,需要几个G, fileSize就是几,速度绝对快",
"bigFile.write('\\x00')",
"bigFile.close()"
] |
import os
def DirFile(rootDir):
list_dirs = os.walk(rootDir)
for root,dirs,files in list_dirs:
for d in dirs:
print (os.path.join(root,d))
for f in files:
print (os.path.join(root,f))
DirFile('c:')
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
2,
0,
0.5556,
0.7778,
0,
0.66,
0.5,
298,
0,
1,
0,
0,
0,
0,
5
],
[
14,
1,
0.3333,
0.1111,
1,
0.43... | [
"import os",
"def DirFile(rootDir):\n\tlist_dirs = os.walk(rootDir)\n\tfor root,dirs,files in list_dirs:\n\t\tfor d in dirs:\n\t\t\tprint (os.path.join(root,d))\n\t\tfor f in files:\n\t\t\tprint (os.path.join(root,f))",
"\tlist_dirs = os.walk(rootDir)",
"\tfor root,dirs,files in list_dirs:\n\t\tfor d in dirs:... |
from sys import stdin
a, b, c = map(int, stdin.readline().strip().split())
print "%.3lf" % ((a+b+c)/3.0)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
256,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"a, b, c = map(int, stdin.readline().strip().split())",
"print(\"%.3lf\" % ((a+b+c)/3.0))"
] |
from sys import stdin
from math import *
r, h = map(float, stdin.readline().strip().split())
print "Area = %.3lf" % (pi*r*r*2 + 2*pi*r*h)
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.... | [
"from sys import stdin",
"from math import *",
"r, h = map(float, stdin.readline().strip().split())",
"print(\"Area = %.3lf\" % (pi*r*r*2 + 2*pi*r*h))"
] |
from sys import stdin
from math import *
n, = map(int, stdin.readline().strip().split())
rad = radians(n)
print "%.3lf %.3lf" % (sin(rad), cos(rad))
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"from math import *",
"n, = map(int, stdin.readline().strip().split())",
"rad = radians(n)",
"print(\"%.3lf %.3lf\" % (sin(rad), cos(rad)))"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
print n*(n+1)/2
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"print(n*(n+1)/2)"
] |
from sys import stdin
a, b = map(int, stdin.readline().strip().split())
print b, a
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.5,
127,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"from sys import stdin",
"a, b = map(int, stdin.readline().strip().split())",
"print(b, a)"
] |
from sys import stdin
n, m = map(int, stdin.readline().strip().split())
a = (4*n-m)/2
b = n-a
if m % 2 == 1 or a < 0 or b < 0: print "No answer"
else: print a, b
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.3333,
51,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"n, m = map(int, stdin.readline().strip().split())",
"a = (4*n-m)/2",
"b = n-a"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
money = n * 95
if money >= 300: money *= 0.85
print "%.2lf" % money
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.25,
773,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"money = n * 95",
"if money >= 300: money *= 0.85",
"print(\"%.2lf\" % money)"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
print ["yes", "no"][n % 2]
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"print [\"yes\", \"no\"][n % 2]"
] |
from sys import stdin
from math import *
x1, y1, x2, y2 = map(float, stdin.readline().strip().split())
print "%.3lf" % hypot((x1-x2), (y1-y2))
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.... | [
"from sys import stdin",
"from math import *",
"x1, y1, x2, y2 = map(float, stdin.readline().strip().split())",
"print(\"%.3lf\" % hypot((x1-x2), (y1-y2)))"
] |
from sys import stdin
n = stdin.readline().strip().split()[0]
print '%c%c%c' % (n[2], n[1], n[0])
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.5,
773,
6,
0,
0,
0,
0,
0,
3
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"from sys import stdin",
"n = stdin.readline().strip().split()[0]",
"print('%c%c%c' % (n[2], n[1], n[0]))"
] |
from sys import stdin
x, = map(float, stdin.readline().strip().split())
print abs(x)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
190,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"x, = map(float, stdin.readline().strip().split())",
"print(abs(x))"
] |
from sys import stdin
from calendar import isleap
year, = map(int, stdin.readline().strip().split())
if isleap(year): print "yes"
else: print "no"
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
917,
0,
1,
0,
0,
917,
0,
0
],
[
14,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"from calendar import isleap",
"year, = map(int, stdin.readline().strip().split())"
] |
from sys import stdin
f, = map(float, stdin.readline().strip().split())
print "%.3lf" % (5*(f-32)/9)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
899,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"f, = map(float, stdin.readline().strip().split())",
"print(\"%.3lf\" % (5*(f-32)/9))"
] |
from sys import stdin
a, b, c = map(int, stdin.readline().strip().split())
if a*a + b*b == c*c or a*a + c*c == b*b or b*b + c*c == a*a: print "yes"
elif a + b <= c or a + c <= b or b + c <= a: print "not a triangle"
else: print "no"
| [
[
1,
0,
1,
1,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
]
] | [
"from sys import stdin"
] |
from sys import stdin
a = map(int, stdin.readline().strip().split())
a.sort()
print a[0], a[1], a[2]
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.3333,
475,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"a = map(int, stdin.readline().strip().split())",
"a.sort()",
"print(a[0], a[1], a[2])"
] |
s = i = 0
while True:
term = 1.0 / (i*2+1)
s += term * ((-1)**i)
if term < 1e-6: break
i += 1
print "%.6lf" % s
| [
[
14,
0,
0.1429,
0.1429,
0,
0.66,
0,
553,
1,
0,
0,
0,
0,
1,
0
],
[
5,
0,
0.5714,
0.7143,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.4286,
0.1429,
1,
0.77,
... | [
"s = i = 0",
"while True:\n term = 1.0 / (i*2+1)\n s += term * ((-1)**i)\n if term < 1e-6: break\n i += 1",
" term = 1.0 / (i*2+1)",
" if term < 1e-6: break",
"print(\"%.6lf\" % s)"
] |
from sys import stdin
from decimal import *
a, b, c = map(int, stdin.readline().strip().split())
getcontext().prec = c
print Decimal(a) / Decimal(b)
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.25,
349,
0,
1,
0,
0,
349,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"from decimal import *",
"a, b, c = map(int, stdin.readline().strip().split())",
"getcontext().prec = c",
"print(Decimal(a) / Decimal(b))"
] |
from sys import stdin
n = int(stdin.readline().strip())
print "%.3lf" % sum([1.0/x for x in range(1,n+1)])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
1,
0,
0,
901,
10,
3
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n = int(stdin.readline().strip())",
"print(\"%.3lf\" % sum([1.0/x for x in range(1,n+1)]))"
] |
from sys import stdin
print len(stdin.readline().strip())
| [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
4
]
] | [
"from sys import stdin",
"print(len(stdin.readline().strip()))"
] |
from itertools import product
from math import *
def issqrt(n):
s = int(floor(sqrt(n)))
return s*s == n
aabb = [a*1100+b*11 for a,b in product(range(1,10),range(10))]
print ' '.join(map(str, filter(issqrt, aabb)))
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.2222,
0.1111,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
2,
0,
0.5556,
0.3333,
0,
0.... | [
"from itertools import product",
"from math import *",
"def issqrt(n):\n s = int(floor(sqrt(n)))\n return s*s == n",
" s = int(floor(sqrt(n)))",
" return s*s == n",
"aabb = [a*1100+b*11 for a,b in product(range(1,10),range(10))]",
"print(' '.join(map(str, filter(issqrt, aabb))))"
] |
from sys import stdin
a = map(int, stdin.readline().strip().split())
print "%d %d %.3lf" % (min(a), max(a), float(sum(a)) / len(a))
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
475,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"a = map(int, stdin.readline().strip().split())",
"print(\"%d %d %.3lf\" % (min(a), max(a), float(sum(a)) / len(a)))"
] |
from sys import stdin
def cycle(n):
if n == 1: return 0
elif n % 2 == 1: return cycle(n*3+1) + 1
else: return cycle(n/2) + 1
n = int(stdin.readline().strip())
print cycle(n)
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5,
0.4444,
0,
0.66,
0.3333,
276,
0,
1,
1,
0,
0,
0,
2
],
[
4,
1,
0.5556,
0.3333,
1,
0.95,... | [
"from sys import stdin",
"def cycle(n):\n if n == 1: return 0\n elif n % 2 == 1: return cycle(n*3+1) + 1\n else: return cycle(n/2) + 1",
" if n == 1: return 0\n elif n % 2 == 1: return cycle(n*3+1) + 1\n else: return cycle(n/2) + 1",
" if n == 1: return 0",
" elif n % 2 == 1: return cycle(n*3+1) + 1... |
from sys import stdin
n = int(stdin.readline().strip())
count = n*2-1
for i in range(n):
print ' '*i + '#'*count
count -= 2
| [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.3333,
773,
3,
1,
0,
0,
901,
10,
3
],
[
14,
0,
0.5,
0.1667,
0,
... | [
"from sys import stdin",
"n = int(stdin.readline().strip())",
"count = n*2-1",
"for i in range(n):\n print(' '*i + '#'*count)\n count -= 2",
" print(' '*i + '#'*count)"
] |
for abc in range(123, 329):
big = str(abc) + str(abc*2) + str(abc*3)
if(''.join(sorted(big)) == '123456789'): print abc, abc*2, abc*3
| [
[
6,
0,
0.75,
1,
0,
0.66,
0,
38,
3,
0,
0,
0,
0,
0,
4
],
[
14,
1,
1,
0.5,
1,
0.89,
0,
235,
4,
0,
0,
0,
0,
0,
3
]
] | [
"for abc in range(123, 329):\n big = str(abc) + str(abc*2) + str(abc*3)",
" big = str(abc) + str(abc*2) + str(abc*3)"
] |
from sys import stdin
n, m = map(int, stdin.readline().strip().split())
print "%.5lf" % sum([1.0/i/i for i in range(n,m+1)])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
51,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, m = map(int, stdin.readline().strip().split())",
"print(\"%.5lf\" % sum([1.0/i/i for i in range(n,m+1)]))"
] |
from sys import stdin
data = map(int, stdin.readline().strip().split())
n, m = data[0], data[-1]
data = data[1:-1]
print len(filter(lambda x: x < m, data))
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.25,
929,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"data = map(int, stdin.readline().strip().split())",
"n, m = data[0], data[-1]",
"data = data[1:-1]",
"print(len(filter(lambda x: x < m, data)))"
] |
from sys import stdin
def solve(a, b, c):
for i in range(10, 101):
if i % 3 == a and i % 5 == b and i % 7 == c:
print i
return
print 'No answer'
a, b, c = map(int, stdin.readline().strip().split())
solve(a, b, c)
| [
[
1,
0,
0.0909,
0.0909,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5,
0.5455,
0,
0.66,
0.3333,
599,
0,
3,
0,
0,
0,
0,
3
],
[
6,
1,
0.5,
0.3636,
1,
0.3,
... | [
"from sys import stdin",
"def solve(a, b, c):\n for i in range(10, 101):\n if i % 3 == a and i % 5 == b and i % 7 == c:\n print(i)\n return\n print('No answer')",
" for i in range(10, 101):\n if i % 3 == a and i % 5 == b and i % 7 == c:\n print(i)\n return",
" if i % 3 == a and... |
from itertools import product
sol = [a*100+b*10+c for a,b,c in product(range(1,10), range(10), range(10)) if a**3+b**3+c**3 == a*100+b*10+c]
print '\n'.join(map(str, sol))
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
808,
0,
1,
0,
0,
808,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
723,
5,
0,
0,
0,
0,
0,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from itertools import product",
"sol = [a*100+b*10+c for a,b,c in product(range(1,10), range(10), range(10)) if a**3+b**3+c**3 == a*100+b*10+c]",
"print('\\n'.join(map(str, sol)))"
] |
from sys import stdin
from math import *
n = int(stdin.readline().strip())
print sum(map(factorial, range(1,n+1))) % (10**6)
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"from math import *",
"n = int(stdin.readline().strip())",
"print(sum(map(factorial, range(1,n+1))) % (10**6))"
] |
#!/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\... |
#print 'Content-Type: application/xml'
#print ''
#
#f = open( 'voter-info-gadget.xml', 'r' )
#xml = f.read()
#f.close()
#
#print xml
#import re
#from pprint import pformat, pprint
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
#def dumpRequest( req ):... | [
[
1,
0,
0.2549,
0.0196,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.2745,
0.0196,
0,
0.66,
0.2,
327,
0,
1,
0,
0,
327,
0,
0
],
[
3,
0,
0.7059,
0.2157,
0,
0.6... | [
"from google.appengine.ext import webapp",
"from google.appengine.ext.webapp.util import run_wsgi_app",
"class GadgetHandler( webapp.RequestHandler ):\n\tdef get( self, dump, debug ):\n\t\tself.response.headers['Content-Type'] = 'application/xml'\n\t\tif debug == None: debug = ''\n\t\tf = open( 'voter-info-gadg... |
#!/usr/bin/env python
import math
# z() and zz() are a quick and dirty hack to deal with the Aleutian Islands.
# We should use a more correct algorithm for extendBounds like the one
# in the Maps API, but this is good enough to fix the immediate problem.
def z( n ):
if n > 0.0:
return n - 360.0
return n
def zz( ... | [
[
1,
0,
0.0291,
0.0097,
0,
0.66,
0,
526,
0,
1,
0,
0,
526,
0,
0
],
[
2,
0,
0.0922,
0.0388,
0,
0.66,
0.1429,
859,
0,
1,
1,
0,
0,
0,
0
],
[
4,
1,
0.0922,
0.0194,
1,
0.... | [
"import math",
"def z( n ):\n\tif n > 0.0:\n\t\treturn n - 360.0\n\treturn n",
"\tif n > 0.0:\n\t\treturn n - 360.0",
"\t\treturn n - 360.0",
"\treturn n",
"def zz( n ):\n\tif n < -180.0:\n\t\treturn n + 360.0\n\treturn n",
"\tif n < -180.0:\n\t\treturn n + 360.0",
"\t\treturn n + 360.0",
"\treturn ... |
#!/usr/bin/env python
array = [
{
'abbr': 'AL',
'name': 'Alabama',
'parties': {
'dem': { 'date': '02-05' },
'gop': { 'date': '02-05' }
}
},
{
'abbr': 'AK',
'name': 'Alaska',
'parties': {
'dem': { 'date': '02-05', 'type': 'caucus' },
'gop': { 'date': '02-05', 'type': 'caucus' }
}
},
{
... | [
[
14,
0,
0.4943,
0.977,
0,
0.66,
0,
80,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.9862,
0.0023,
0,
0.66,
0.25,
489,
0,
0,
0,
0,
0,
6,
0
],
[
6,
0,
0.9897,
0.0046,
0,
0.66,
... | [
"array = [\n\t{\n\t\t'abbr': 'AL',\n\t\t'name': 'Alabama',\n\t\t'parties': {\n\t\t\t'dem': { 'date': '02-05' },\n\t\t\t'gop': { 'date': '02-05' }\n\t\t}",
"byAbbr = {}",
"for state in array:\n\tbyAbbr[ state['abbr'] ] = state",
"\tbyAbbr[ state['abbr'] ] = state",
"byName = {}",
"for state in array:\n\tby... |
#!/usr/bin/env python
# shpUtils.py
# Original version by Zachary Forest Johnson
# http://indiemaps.com/blog/index.php/code/pyShapefile.txt
# This version modified by Michael Geary
from struct import unpack
import dbfUtils
XY_POINT_RECORD_LENGTH = 16
db = []
def loadShapefile( filename ):
# open dbf file and get fe... | [
[
1,
0,
0.0421,
0.0053,
0,
0.66,
0,
399,
0,
1,
0,
0,
399,
0,
0
],
[
1,
0,
0.0474,
0.0053,
0,
0.66,
0.0526,
699,
0,
1,
0,
0,
699,
0,
0
],
[
14,
0,
0.0526,
0.0053,
0,
... | [
"from struct import unpack",
"import dbfUtils",
"XY_POINT_RECORD_LENGTH = 16",
"db = []",
"def loadShapefile( filename ):\n\t# open dbf file and get features as a list\n\tglobal db\n\tdbfile = open( filename[0:-4] + '.dbf', 'rb' )\n\tdb = list( dbfUtils.dbfreader(dbfile) )\n\tdbfile.close()\n\t\n\tfp = open... |
#!/usr/bin/env python
# makepolys.py
import codecs
import json
import math
import os
import random
import re
import shutil
import stat
import sys
import time
from geo import Geo
import shpUtils
import states
#states = json.load( open('states.json') )
jsonpath = 'json'
shapespath = 'shapefiles'
geo = Geo()
keysep ... | [
[
1,
0,
0.0201,
0.004,
0,
0.66,
0,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.0241,
0.004,
0,
0.66,
0.0323,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.0281,
0.004,
0,
0.6... | [
"import codecs",
"import json",
"import math",
"import os",
"import random",
"import re",
"import shutil",
"import stat",
"import sys",
"import time",
"from geo import Geo",
"import shpUtils",
"import states",
"jsonpath = 'json'",
"shapespath = 'shapefiles'",
"geo = Geo()",
"keysep =... |
#!/usr/bin/env python
# dbfUtils.py
# By Raymond Hettinger
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715
import struct, datetime, decimal, itertools
def dbfreader(f):
"""Returns an iterator over records in a Xbase DBF file.
The first row returned contains the field names.
The second row contai... | [
[
1,
0,
0.0588,
0.0084,
0,
0.66,
0,
399,
0,
4,
0,
0,
399,
0,
0
],
[
2,
0,
0.2983,
0.4538,
0,
0.66,
0.5,
887,
0,
1,
0,
0,
0,
0,
25
],
[
8,
1,
0.1218,
0.084,
1,
0.01,... | [
"import struct, datetime, decimal, itertools",
"def dbfreader(f):\n\t\"\"\"Returns an iterator over records in a Xbase DBF file.\n\n\tThe first row returned contains the field names.\n\tThe second row contains field specs: (type, size, decimal places).\n\tSubsequent rows contain the data records.\n\tIf a record i... |
#!/usr/bin/env python
# get-strings.py
# By Michael Geary - http://mg.to/
# See UNLICENSE or http://unlicense.org/ for public domain notice.
# Reads the JSON feed for a Google Docs spreadsheet containing the
# localized strings for the Google Election Center gadget, then writes
# the strings for each language into a ... | [
[
1,
0,
0.4878,
0.0244,
0,
0.66,
0,
463,
0,
3,
0,
0,
463,
0,
0
],
[
14,
0,
0.5366,
0.0244,
0,
0.66,
0.2,
789,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.5854,
0.0244,
0,
0.6... | [
"import json, re, urllib2",
"url = 'https://spreadsheets.google.com/feeds/list/0AuiC0EUz_p_xdHE3R2U5cTE0aFdHcWpTVVhPQVlzUmc/1/public/values?alt=json'",
"langs = {}",
"feed = json.load( urllib2.urlopen(url) )['feed']",
"for entry in feed['entry']:\n\tid = entry['gsx$id']['$t']\n\tfor col in entry:\n\t\tmatch... |
#!/usr/bin/env python
# coding: utf-8
# make-hi.py - special HI processing for 2010
# Copyright (c) 2010 Michael Geary - http://mg.to/
# Use under either the MIT or GPL license
# http://www.opensource.org/licenses/mit-license.php
# http://www.opensource.org/licenses/gpl-2.0.php
import re
def convert( input, output )... | [
[
1,
0,
0.2941,
0.0294,
0,
0.66,
0,
540,
0,
1,
0,
0,
540,
0,
0
],
[
2,
0,
0.5735,
0.4706,
0,
0.66,
0.3333,
438,
0,
2,
0,
0,
0,
0,
13
],
[
8,
1,
0.3824,
0.0294,
1,
0... | [
"import re",
"def convert( input, output ):\n\tprint('Converting %s to %s' %( input, output ))\n\tinput = open( input, 'r' )\n\toutput = open( output, 'wb' )\n\toutput.write( '{\\n' )\n\tfor line in input:\n\t\tline = line.rstrip('\\n').split('\\t')\n\t\tif len(line) > 12:",
"\tprint('Converting %s to %s' %( in... |
#!/usr/bin/env python
import codecs
import re
import jinja2
import markdown
def process_slides():
with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:
md = codecs.open('slides.md', encoding='utf8').read()
md_slides = md.split('\n---\n')
print 'Compiled %s slides.' % len(m... | [
[
1,
0,
0.0526,
0.0175,
0,
0.66,
0,
220,
0,
1,
0,
0,
220,
0,
0
],
[
1,
0,
0.0702,
0.0175,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0877,
0.0175,
0,
... | [
"import codecs",
"import re",
"import jinja2",
"import markdown",
"def process_slides():\n with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:\n md = codecs.open('slides.md', encoding='utf8').read()\n md_slides = md.split('\\n---\\n')\n print('Compiled %s slides.' ... |
#!/usr/bin/env python
## Copyright (c) 2012 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENT... | [
[
8,
0,
0.0787,
0.0079,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.0945,
0.0079,
0,
0.66,
0.2,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.1102,
0.0079,
0,
0.66,
... | [
"\"\"\"Classes for representing diff pieces.\"\"\"",
"__author__ = \"jkoleszar@google.com\"",
"import re",
"class DiffLines(object):\n \"\"\"A container for one half of a diff.\"\"\"\n\n def __init__(self, filename, offset, length):\n self.filename = filename\n self.offset = offset\n ... |
#!/usr/bin/env python
## Copyright (c) 2012 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENT... | [
[
8,
0,
0.2857,
0.3,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.4571,
0.0143,
0,
0.66,
0.1667,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.4714,
0.0143,
0,
0.66,
... | [
"\"\"\"Wraps paragraphs of text, preserving manual formatting\n\nThis is like fold(1), but has the special convention of not modifying lines\nthat start with whitespace. This allows you to intersperse blocks with\nspecial formatting, like code blocks, with written prose. The prose will\nbe wordwrapped, and the manu... |
#!/usr/bin/env python
## Copyright (c) 2012 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENT... | [
[
8,
0,
0.1645,
0.0789,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.2237,
0.0132,
0,
0.66,
0.1429,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.25,
0.0132,
0,
0.66,
... | [
"\"\"\"Calculates the \"intersection\" of two unified diffs.\n\nGiven two diffs, A and B, it finds all hunks in B that had non-context lines\nin A and prints them to stdout. This is useful to determine the hunks in B that\nare relevant to A. The resulting file can be applied with patch(1) on top of A.\n\"\"\"",
"... |
"""
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributi... | [
[
8,
0,
0.0472,
0.0849,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1038,
0.0094,
0,
0.66,
0.125,
509,
0,
6,
0,
0,
509,
0,
0
],
[
14,
0,
0.1132,
0.0094,
0,
0.66... | [
"\"\"\"\n * Copyright (c) 2012 The WebM project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree. An additional intellectual property rights grant can be found\n * in the file PATENTS. ... |
import csv, os, glob
import sys
import numpy
class affycel:
def _int_(self, filename, version, header, intensityCells, intensity, maskscells, masks, outlierCells, outliers, modifiedCells, modified):
self.filename = filename
self.version = version
self.header = {}
self.intensityCel... | [
[
1,
0,
0.014,
0.007,
0,
0.66,
0,
312,
0,
3,
0,
0,
312,
0,
0
],
[
1,
0,
0.021,
0.007,
0,
0.66,
0.25,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.028,
0.007,
0,
0.66,
... | [
"import csv, os, glob",
"import sys",
"import numpy",
"class affycel:\n\n def _int_(self, filename, version, header, intensityCells, intensity, maskscells, masks, outlierCells, outliers, modifiedCells, modified):\n self.filename = filename\n self.version = version\n self.header = {}\n ... |
import web
import json
from base import Base
class XTask(Base):
def GET(self):
results = self.db.query("SELECT * FROM Pet")
return self.query_serializer(results) | [
[
1,
0,
0.1,
0.1,
0,
0.66,
0,
183,
0,
1,
0,
0,
183,
0,
0
],
[
1,
0,
0.2,
0.1,
0,
0.66,
0.3333,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.4,
0.1,
0,
0.66,
0.6667,
... | [
"import web",
"import json",
"from base import Base",
"class XTask(Base):\n\t\n\tdef GET(self):\n\t\tresults = self.db.query(\"SELECT * FROM Pet\")\n\t\treturn self.query_serializer(results)",
"\tdef GET(self):\n\t\tresults = self.db.query(\"SELECT * FROM Pet\")\n\t\treturn self.query_serializer(results)",
... |
import web
import json
from datetime import datetime
#thanks: http://stackoverflow.com/questions/11875770/how-to-overcome-datetime-datetime-not-json-serializable-in-python
class DateTimeEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.isoformat()
return json.JSONEncod... | [
[
1,
0,
0.037,
0.037,
0,
0.66,
0,
183,
0,
1,
0,
0,
183,
0,
0
],
[
1,
0,
0.0741,
0.037,
0,
0.66,
0.25,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.1111,
0.037,
0,
0.66,
... | [
"import web",
"import json",
"from datetime import datetime",
"class DateTimeEncoder(json.JSONEncoder):\n\tdef default(self, obj):\n\t\tif isinstance(obj, datetime):\n\t\t\treturn obj.isoformat()\n\t\treturn json.JSONEncoder.default(self, obj)",
"\tdef default(self, obj):\n\t\tif isinstance(obj, datetime):\... |
import web
import time
from base import Base
class AddPet(Base):
def POST(self):
input = web.input()
input["age"] = int(input["age"])
print(input)
input = dict(input)
results = self.db.query("INSERT into Pet(Shelter_Name, Age, Gender, Pet_Name) values ($shelter_name, $age, $gender, $pet_name)",
vars=in... | [
[
1,
0,
0.0588,
0.0588,
0,
0.66,
0,
183,
0,
1,
0,
0,
183,
0,
0
],
[
1,
0,
0.1176,
0.0588,
0,
0.66,
0.3333,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.1765,
0.0588,
0,
... | [
"import web",
"import time",
"from base import Base",
"class AddPet(Base):\n\t\n\tdef POST(self):\n\t\tinput = web.input()\n\t\tinput[\"age\"] = int(input[\"age\"])\n\t\tprint(input)\n\t\tinput = dict(input)\n\t\tresults = self.db.query(\"INSERT into Pet(Shelter_Name, Age, Gender, Pet_Name) values ($shelter_n... |
import web
from addpet import AddPet
from xtask import XTask
urls = (
'/addpet', 'AddPet',
'/xtask', 'XTask' #sample task
)
app = web.application(urls, globals())
if __name__ == "__main__":
app.run() | [
[
1,
0,
0.0769,
0.0769,
0,
0.66,
0,
183,
0,
1,
0,
0,
183,
0,
0
],
[
1,
0,
0.1538,
0.0769,
0,
0.66,
0.2,
163,
0,
1,
0,
0,
163,
0,
0
],
[
1,
0,
0.2308,
0.0769,
0,
0.6... | [
"import web",
"from addpet import AddPet",
"from xtask import XTask",
"urls = (\n '/addpet', 'AddPet',\n '/xtask', 'XTask' #sample task\n)",
"app = web.application(urls, globals())",
"if __name__ == \"__main__\":\n app.run()",
" app.run()"
] |
from sys import stdin
a, b, c = map(int, stdin.readline().strip().split())
print "%.3lf" % ((a+b+c)/3.0)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
256,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"a, b, c = map(int, stdin.readline().strip().split())",
"print(\"%.3lf\" % ((a+b+c)/3.0))"
] |
from sys import stdin
from math import *
r, h = map(float, stdin.readline().strip().split())
print "Area = %.3lf" % (pi*r*r*2 + 2*pi*r*h)
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.... | [
"from sys import stdin",
"from math import *",
"r, h = map(float, stdin.readline().strip().split())",
"print(\"Area = %.3lf\" % (pi*r*r*2 + 2*pi*r*h))"
] |
from sys import stdin
from math import *
n, = map(int, stdin.readline().strip().split())
rad = radians(n)
print "%.3lf %.3lf" % (sin(rad), cos(rad))
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"from math import *",
"n, = map(int, stdin.readline().strip().split())",
"rad = radians(n)",
"print(\"%.3lf %.3lf\" % (sin(rad), cos(rad)))"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
print n*(n+1)/2
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"print(n*(n+1)/2)"
] |
from sys import stdin
a, b = map(int, stdin.readline().strip().split())
print b, a
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.5,
127,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"from sys import stdin",
"a, b = map(int, stdin.readline().strip().split())",
"print(b, a)"
] |
from sys import stdin
n, m = map(int, stdin.readline().strip().split())
a = (4*n-m)/2
b = n-a
if m % 2 == 1 or a < 0 or b < 0: print "No answer"
else: print a, b
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.3333,
51,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"n, m = map(int, stdin.readline().strip().split())",
"a = (4*n-m)/2",
"b = n-a"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
money = n * 95
if money >= 300: money *= 0.85
print "%.2lf" % money
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.25,
773,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"money = n * 95",
"if money >= 300: money *= 0.85",
"print(\"%.2lf\" % money)"
] |
from sys import stdin
n, = map(int, stdin.readline().strip().split())
print ["yes", "no"][n % 2]
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, = map(int, stdin.readline().strip().split())",
"print [\"yes\", \"no\"][n % 2]"
] |
from sys import stdin
from math import *
x1, y1, x2, y2 = map(float, stdin.readline().strip().split())
print "%.3lf" % hypot((x1-x2), (y1-y2))
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.75,
0.25,
0,
0.66,
0.... | [
"from sys import stdin",
"from math import *",
"x1, y1, x2, y2 = map(float, stdin.readline().strip().split())",
"print(\"%.3lf\" % hypot((x1-x2), (y1-y2)))"
] |
from sys import stdin
n = stdin.readline().strip().split()[0]
print '%c%c%c' % (n[2], n[1], n[0])
| [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.5,
0.25,
0,
0.66,
0.5,
773,
6,
0,
0,
0,
0,
0,
3
],
[
8,
0,
0.75,
0.25,
0,
0.66,
1,
... | [
"from sys import stdin",
"n = stdin.readline().strip().split()[0]",
"print('%c%c%c' % (n[2], n[1], n[0]))"
] |
from sys import stdin
x, = map(float, stdin.readline().strip().split())
print abs(x)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
190,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"x, = map(float, stdin.readline().strip().split())",
"print(abs(x))"
] |
from sys import stdin
from calendar import isleap
year, = map(int, stdin.readline().strip().split())
if isleap(year): print "yes"
else: print "no"
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
917,
0,
1,
0,
0,
917,
0,
0
],
[
14,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"from calendar import isleap",
"year, = map(int, stdin.readline().strip().split())"
] |
from sys import stdin
f, = map(float, stdin.readline().strip().split())
print "%.3lf" % (5*(f-32)/9)
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
899,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"f, = map(float, stdin.readline().strip().split())",
"print(\"%.3lf\" % (5*(f-32)/9))"
] |
from sys import stdin
a, b, c = map(int, stdin.readline().strip().split())
if a*a + b*b == c*c or a*a + c*c == b*b or b*b + c*c == a*a: print "yes"
elif a + b <= c or a + c <= b or b + c <= a: print "not a triangle"
else: print "no"
| [
[
1,
0,
1,
1,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
]
] | [
"from sys import stdin"
] |
from sys import stdin
a = map(int, stdin.readline().strip().split())
a.sort()
print a[0], a[1], a[2]
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.3333,
475,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"a = map(int, stdin.readline().strip().split())",
"a.sort()",
"print(a[0], a[1], a[2])"
] |
s = i = 0
while True:
term = 1.0 / (i*2+1)
s += term * ((-1)**i)
if term < 1e-6: break
i += 1
print "%.6lf" % s
| [
[
14,
0,
0.1429,
0.1429,
0,
0.66,
0,
553,
1,
0,
0,
0,
0,
1,
0
],
[
5,
0,
0.5714,
0.7143,
0,
0.66,
0.5,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
1,
0.4286,
0.1429,
1,
0.67,
... | [
"s = i = 0",
"while True:\n term = 1.0 / (i*2+1)\n s += term * ((-1)**i)\n if term < 1e-6: break\n i += 1",
" term = 1.0 / (i*2+1)",
" if term < 1e-6: break",
"print(\"%.6lf\" % s)"
] |
from sys import stdin
from decimal import *
a, b, c = map(int, stdin.readline().strip().split())
getcontext().prec = c
print Decimal(a) / Decimal(b)
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.25,
349,
0,
1,
0,
0,
349,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"from decimal import *",
"a, b, c = map(int, stdin.readline().strip().split())",
"getcontext().prec = c",
"print(Decimal(a) / Decimal(b))"
] |
from sys import stdin
n = int(stdin.readline().strip())
print "%.3lf" % sum([1.0/x for x in range(1,n+1)])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
773,
3,
1,
0,
0,
901,
10,
3
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n = int(stdin.readline().strip())",
"print(\"%.3lf\" % sum([1.0/x for x in range(1,n+1)]))"
] |
from sys import stdin
print len(stdin.readline().strip())
| [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
8,
0,
1,
0.5,
0,
0.66,
1,
535,
3,
1,
0,
0,
0,
0,
4
]
] | [
"from sys import stdin",
"print(len(stdin.readline().strip()))"
] |
from itertools import product
from math import *
def issqrt(n):
s = int(floor(sqrt(n)))
return s*s == n
aabb = [a*1100+b*11 for a,b in product(range(1,10),range(10))]
print ' '.join(map(str, filter(issqrt, aabb)))
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
808,
0,
1,
0,
0,
808,
0,
0
],
[
1,
0,
0.2222,
0.1111,
0,
0.66,
0.25,
526,
0,
1,
0,
0,
526,
0,
0
],
[
2,
0,
0.5556,
0.3333,
0,
0.... | [
"from itertools import product",
"from math import *",
"def issqrt(n):\n s = int(floor(sqrt(n)))\n return s*s == n",
" s = int(floor(sqrt(n)))",
" return s*s == n",
"aabb = [a*1100+b*11 for a,b in product(range(1,10),range(10))]",
"print(' '.join(map(str, filter(issqrt, aabb))))"
] |
from sys import stdin
a = map(int, stdin.readline().strip().split())
print "%d %d %.3lf" % (min(a), max(a), float(sum(a)) / len(a))
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
475,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"a = map(int, stdin.readline().strip().split())",
"print(\"%d %d %.3lf\" % (min(a), max(a), float(sum(a)) / len(a)))"
] |
from sys import stdin
def cycle(n):
if n == 1: return 0
elif n % 2 == 1: return cycle(n*3+1) + 1
else: return cycle(n/2) + 1
n = int(stdin.readline().strip())
print cycle(n)
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5,
0.4444,
0,
0.66,
0.3333,
276,
0,
1,
1,
0,
0,
0,
2
],
[
4,
1,
0.5556,
0.3333,
1,
0.52,... | [
"from sys import stdin",
"def cycle(n):\n if n == 1: return 0\n elif n % 2 == 1: return cycle(n*3+1) + 1\n else: return cycle(n/2) + 1",
" if n == 1: return 0\n elif n % 2 == 1: return cycle(n*3+1) + 1\n else: return cycle(n/2) + 1",
" if n == 1: return 0",
" elif n % 2 == 1: return cycle(n*3+1) + 1... |
from sys import stdin
n = int(stdin.readline().strip())
count = n*2-1
for i in range(n):
print ' '*i + '#'*count
count -= 2
| [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.3333,
0.1667,
0,
0.66,
0.3333,
773,
3,
1,
0,
0,
901,
10,
3
],
[
14,
0,
0.5,
0.1667,
0,
... | [
"from sys import stdin",
"n = int(stdin.readline().strip())",
"count = n*2-1",
"for i in range(n):\n print(' '*i + '#'*count)\n count -= 2",
" print(' '*i + '#'*count)"
] |
for abc in range(123, 329):
big = str(abc) + str(abc*2) + str(abc*3)
if(''.join(sorted(big)) == '123456789'): print abc, abc*2, abc*3
| [
[
6,
0,
0.75,
1,
0,
0.66,
0,
38,
3,
0,
0,
0,
0,
0,
4
],
[
14,
1,
1,
0.5,
1,
0.74,
0,
235,
4,
0,
0,
0,
0,
0,
3
]
] | [
"for abc in range(123, 329):\n big = str(abc) + str(abc*2) + str(abc*3)",
" big = str(abc) + str(abc*2) + str(abc*3)"
] |
from sys import stdin
n, m = map(int, stdin.readline().strip().split())
print "%.5lf" % sum([1.0/i/i for i in range(n,m+1)])
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
51,
3,
2,
0,
0,
53,
10,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from sys import stdin",
"n, m = map(int, stdin.readline().strip().split())",
"print(\"%.5lf\" % sum([1.0/i/i for i in range(n,m+1)]))"
] |
from sys import stdin
data = map(int, stdin.readline().strip().split())
n, m = data[0], data[-1]
data = data[1:-1]
print len(filter(lambda x: x < m, data))
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
14,
0,
0.4,
0.2,
0,
0.66,
0.25,
929,
3,
2,
0,
0,
53,
10,
4
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.5,
... | [
"from sys import stdin",
"data = map(int, stdin.readline().strip().split())",
"n, m = data[0], data[-1]",
"data = data[1:-1]",
"print(len(filter(lambda x: x < m, data)))"
] |
from sys import stdin
def solve(a, b, c):
for i in range(10, 101):
if i % 3 == a and i % 5 == b and i % 7 == c:
print i
return
print 'No answer'
a, b, c = map(int, stdin.readline().strip().split())
solve(a, b, c)
| [
[
1,
0,
0.0909,
0.0909,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
2,
0,
0.5,
0.5455,
0,
0.66,
0.3333,
599,
0,
3,
0,
0,
0,
0,
3
],
[
6,
1,
0.5,
0.3636,
1,
0.7,
... | [
"from sys import stdin",
"def solve(a, b, c):\n for i in range(10, 101):\n if i % 3 == a and i % 5 == b and i % 7 == c:\n print(i)\n return\n print('No answer')",
" for i in range(10, 101):\n if i % 3 == a and i % 5 == b and i % 7 == c:\n print(i)\n return",
" if i % 3 == a and... |
from itertools import product
sol = [a*100+b*10+c for a,b,c in product(range(1,10), range(10), range(10)) if a**3+b**3+c**3 == a*100+b*10+c]
print '\n'.join(map(str, sol))
| [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
808,
0,
1,
0,
0,
808,
0,
0
],
[
14,
0,
0.6667,
0.3333,
0,
0.66,
0.5,
723,
5,
0,
0,
0,
0,
0,
4
],
[
8,
0,
1,
0.3333,
0,
0.66,
... | [
"from itertools import product",
"sol = [a*100+b*10+c for a,b,c in product(range(1,10), range(10), range(10)) if a**3+b**3+c**3 == a*100+b*10+c]",
"print('\\n'.join(map(str, sol)))"
] |
from sys import stdin
from math import *
n = int(stdin.readline().strip())
print sum(map(factorial, range(1,n+1))) % (10**6)
| [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.3333,
526,
0,
1,
0,
0,
526,
0,
0
],
[
14,
0,
0.6,
0.2,
0,
0.66,
0.6667,... | [
"from sys import stdin",
"from math import *",
"n = int(stdin.readline().strip())",
"print(sum(map(factorial, range(1,n+1))) % (10**6))"
] |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | [
[
8,
0,
0.0319,
0.0532,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0745,
0.0106,
0,
0.66,
0.1429,
540,
0,
1,
0,
0,
540,
0,
0
],
[
1,
0,
0.0851,
0.0106,
0,
0.66... | [
"'''\nModule which brings history information about files from Mercurial.\n\n@author: Rodrigo Damazio\n'''",
"import re",
"import subprocess",
"REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')",
"def _GetOutputLines(args):\n '''\n Runs an external process and returns its output as a list of lines... |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | [
[
8,
0,
0.0417,
0.0521,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0104,
0,
0.66,
0.125,
640,
0,
1,
0,
0,
640,
0,
0
],
[
1,
0,
0.0938,
0.0104,
0,
0.66,... | [
"'''\nEntry point for My Tracks i18n tool.\n\n@author: Rodrigo Damazio\n'''",
"import mytracks.files",
"import mytracks.translate",
"import mytracks.validate",
"import sys",
"def Usage():\n print('Usage: %s <command> [<language> ...]\\n' % sys.argv[0])\n print('Commands are:')\n print(' cleanup')\n p... |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | [
[
8,
0,
0.1905,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.7143,
0.619,
0,
0.66,
1,
229,
0,
2,
0,
0,
186,
0,
1
],
[
8,
1,
0.5238,
0.1429,
1,
0.79,
... | [
"'''\nModule which prompts the user for translations and saves them.\n\nTODO: implement\n\n@author: Rodrigo Damazio\n'''",
"class Translator(object):\n '''\n classdocs\n '''\n\n def __init__(self, language):\n '''\n Constructor",
" '''\n classdocs\n '''",
" def __init__(self, language):\n '''... |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | [
[
8,
0,
0.0304,
0.0522,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.0783,
0.0087,
0,
0.66,
... | [
"'''\nModule which compares languague files to the master file and detects\nissues.\n\n@author: Rodrigo Damazio\n'''",
"import os",
"from mytracks.parser import StringsParser",
"import mytracks.history",
"class Validator(object):\n\n def __init__(self, languages):\n '''\n Builds a strings file valida... |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1333,
0.0222,
0,
0.66,
0.125,
79,
0,
1,
0,
0,
79,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
... | [
"'''\nModule for dealing with resource files (but not their contents).\n\n@author: Rodrigo Damazio\n'''",
"import os.path",
"from glob import glob",
"import re",
"MYTRACKS_RES_DIR = 'MyTracks/res'",
"ANDROID_MASTER_VALUES = 'values'",
"ANDROID_VALUES_MASK = 'values-*'",
"def GetMyTracksDir():\n '''\n... |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | [
[
8,
0,
0.0261,
0.0435,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0609,
0.0087,
0,
0.66,
0.3333,
573,
0,
1,
0,
0,
573,
0,
0
],
[
1,
0,
0.0696,
0.0087,
0,
0.66... | [
"'''\nModule which parses a string XML file.\n\n@author: Rodrigo Damazio\n'''",
"from xml.parsers.expat import ParserCreate",
"import re",
"class StringsParser(object):\n '''\n Parser for string XML files.\n\n This object is not thread-safe and should be used for parsing a single file at\n a time, only.\n... |
import os, re, sys, urllib
from time import sleep
from shutil import move
# Disable traceback
sys.tracebacklimit = 0
# Global for finding images
htmldl = '<a href="//images.4chan.org/'
htmlboardfind = '[<a href="res/[0-9]+" class="replylink">Reply</a>]'
# Dynamic Print Function
def dynamic_print(msg):
sys.stdou... | [
[
1,
0,
0.0054,
0.0054,
0,
0.66,
0,
688,
0,
4,
0,
0,
688,
0,
0
],
[
1,
0,
0.0109,
0.0054,
0,
0.66,
0.0526,
654,
0,
1,
0,
0,
654,
0,
0
],
[
1,
0,
0.0163,
0.0054,
0,
... | [
"import os, re, sys, urllib",
"from time import sleep",
"from shutil import move",
"sys.tracebacklimit = 0",
"htmldl = '<a href=\"//images.4chan.org/'",
"htmlboardfind = '[<a href=\"res/[0-9]+\" class=\"replylink\">Reply</a>]'",
"def dynamic_print(msg):\t\n sys.stdout.write(\"\\r\"+msg)\n sys.stdo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.