org_text stringlengths 830 329k | texts sequence | scores sequence | num_lines int64 1 8.05k | avg_score float64 0 0.27 | check bool 1
class |
|---|---|---|---|---|---|
from django.http import HttpResponse
from django.core.servers.basehttp import FileWrapper
import csv, codecs, cStringIO
from feedback2013.models import Subject, Student, Score, Feedback
class UnicodeWriter:
"""
A CSV writer which will write rows to CSV file "f",
which is encoded in the given encoding.
"""
def... | [
"from django.http import HttpResponse\n",
"from django.core.servers.basehttp import FileWrapper\n",
"import csv, codecs, cStringIO\n",
"\n",
"from feedback2013.models import Subject, Student, Score, Feedback\n",
"\n",
"\n",
"class UnicodeWriter:\n",
"\t\"\"\"\n",
"\tA CSV writer which will write r... | [
0,
0,
0.03333333333333333,
0,
0,
0,
0,
0,
0.2,
0.018867924528301886,
0.024390243902439025,
0.2,
0,
0.014492753623188406,
0.03225806451612903,
0.027777777777777776,
0.015625,
0.05555555555555555,
0.017241379310344827,
0,
0.038461538461538464,
0.017543859649122806,
0.023809... | 90 | 0.063146 | false |
#FLM: Component Dump
# Version 2.0
#
# Will look through a font and write out a text file that lists any glyph with a
# component(s), one glyph per line of the file. On each line, the script writes
# the glyph name, the width of the glyph, and then each component name and x, y
# offset for that compnent. These values ... | [
"#FLM: Component Dump\n",
"# Version 2.0\n",
"#\n",
"# Will look through a font and write out a text file that lists any glyph with a\n",
"# component(s), one glyph per line of the file. On each line, the script writes\n",
"# the glyph name, the width of the glyph, and then each component name and x, y\n"... | [
0.047619047619047616,
0,
0,
0.012345679012345678,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.3333333333333333,
0,
0.3333333333333333,
0,
0,
0,
0,
0,
0,
0.3333333333333333,
0.012345679012345678,
0,
0.3333333333333333,
0,
0,
0,
0,
0,
0,
0... | 76 | 0.027366 | false |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem109.py
#
# Darts
# =====
# Published on Friday, 18th November 2005, 06:00 pm
#
# In the game of darts a player throws three darts at a target board which is
# split into twenty equal sized sections numbered one to twenty. The score
# of a dart is determined b... | [
"# -*- coding: utf-8 -*-\n",
"# ProjectEuler/src/python/problem109.py\n",
"#\n",
"# Darts\n",
"# =====\n",
"# Published on Friday, 18th November 2005, 06:00 pm\n",
"#\n",
"# In the game of darts a player throws three darts at a target board which is\n",
"# split into twenty equal sized sections numb... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.08333333333333333,
0,
0,
0.037037037037037035,
0
] | 41 | 0.002936 | false |
import cv2
from PyQt5.QtWidgets import QErrorMessage
#from socket import socket
#from pickle import loads
from Socket import Socket
class CannotReadFrame(BaseException) :
pass
class StreamReader :
def __init__(self) :
self._server = None
self._capturedDevice = None
pass
def conne... | [
"import cv2\n",
"from PyQt5.QtWidgets import QErrorMessage\n",
"#from socket import socket\n",
"#from pickle import loads\n",
"from Socket import Socket\n",
"\n",
"class CannotReadFrame(BaseException) :\n",
" pass\n",
"\n",
"class StreamReader :\n",
" def __init__(self) :\n",
" se... | [
0,
0,
0.037037037037037035,
0.038461538461538464,
0,
0,
0.05128205128205128,
0,
0,
0.09523809523809523,
0.04,
0,
0,
0,
0,
0.08771929824561403,
0,
0,
0,
0.030303030303030304,
0,
0.11764705882352941,
0,
0,
0.02857142857142857,
0,
0,
0.009900990099009901,
0,
0.... | 93 | 0.027124 | false |
#!/usr/bin/env python
# coding: UTF-8
print('Hello World!')
#如果try中有异常发生时,将执行异常的归属,执行except。
#异常层层比较,看是否是exception1, exception2...,直到找到其归属,执行相应的except中的语句。
#如果except后面没有任何参数,那么表示所有的exception都交给这段程序处理。
re1 = iter(range(5))
try:
#当循环进行到第6次的时候,re.next()不会再返回元素,而是抛出(raise)StopIteration的异常。
for i in range(100):
... | [
"#!/usr/bin/env python\n",
"# coding: UTF-8\n",
"\n",
"print('Hello World!')\n",
"\n",
"#如果try中有异常发生时,将执行异常的归属,执行except。\n",
"#异常层层比较,看是否是exception1, exception2...,直到找到其归属,执行相应的except中的语句。\n",
"#如果except后面没有任何参数,那么表示所有的exception都交给这段程序处理。\n",
"re1 = iter(range(5))\n",
"try:\n",
" #当循环进行到第6次的时... | [
0,
0,
0,
0,
0,
0.030303030303030304,
0.015873015873015872,
0.022222222222222223,
0,
0,
0.015625,
0,
0.03225806451612903,
0,
0.06896551724137931,
0,
0,
0.125,
0.03125,
0.024390243902439025,
0,
0,
0,
0,
0,
0,
0.029411764705882353,
0,
0.05555555555555555,
0.023... | 114 | 0.068821 | false |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OrgFileExporter, a python module exporter for exporting WikidPad files to
# orgfiles.
# Copyright (c) 2012 Josep Mones Teixidor
# All rights reserved.
#
#
# Redistribution and use in sour... | [
"# -*- encoding: utf-8 -*-\n",
"##############################################################################\n",
"#\n",
"# OrgFileExporter, a python module exporter for exporting WikidPad files to\n",
"# orgfiles.\n",
"# Copyright (c) 2012 Josep Mones Teixidor\n",
"# All rights reserved.\n... | [
0,
0,
0,
0,
0,
0,
0,
0.16666666666666666,
0.16666666666666666,
0.011627906976744186,
0,
0.16666666666666666,
0.012195121951219513,
0,
0.011764705882352941,
0.011764705882352941,
0,
0.011904761904761904,
0.012345679012345678,
0,
0.16666666666666666,
0.16666666666666666,
0.... | 496 | 0.013093 | false |
# Copyright (C) 2009 Tim Gaggstatter <Tim.Gaggstatter AT gmx DOT net>
# Copyright (C) 2010 Eduardo Robles Elvira <edulix AT gmail DOT com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundatio... | [
"# Copyright (C) 2009 Tim Gaggstatter <Tim.Gaggstatter AT gmx DOT net>\n",
"# Copyright (C) 2010 Eduardo Robles Elvira <edulix AT gmail DOT com>\n",
"#\n",
"# This program is free software: you can redistribute it and/or modify\n",
"# it under the terms of the GNU Affero General Public License as published ... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.038461538461538464,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.034482758620689655,
... | 200 | 0.00296 | false |
RowNum = int(input("Row: "))
ColumnNum = int(input("Column: "))
MatrixRow = []
MatrixColumn = []
for i in range(0, RowNum):
for j in range(0, ColumnNum):
MatrixColumn.append(j)
MatrixRow.append(MatrixColumn)
MatrixColumn = []
LineIndex = 0
j = 1
Max = ColumnNum * RowNum
while 1:
for i in range... | [
"RowNum = int(input(\"Row: \"))\n",
"ColumnNum = int(input(\"Column: \"))\n",
"MatrixRow = []\n",
"MatrixColumn = []\n",
"for i in range(0, RowNum):\n",
" for j in range(0, ColumnNum):\n",
" MatrixColumn.append(j)\n",
" MatrixRow.append(MatrixColumn)\n",
" MatrixColumn = []\n",
"Li... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.038461538461538464,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
] | 38 | 0.001012 | false |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem428.py
#
# Necklace of circles
# ===================
# Published on Sunday, 19th May 2013, 01:00 am
#
# Let a, b and c be positive numbers. Let W, X, Y, Z be four collinear points
# where |WX| = a, |XY| = b, |YZ| = c and |WZ| = a + b + c. Let Cin be the
# circ... | [
"# -*- coding: utf-8 -*-\n",
"# ProjectEuler/src/python/problem428.py\n",
"#\n",
"# Necklace of circles\n",
"# ===================\n",
"# Published on Sunday, 19th May 2013, 01:00 am\n",
"#\n",
"# Let a, b and c be positive numbers. Let W, X, Y, Z be four collinear points\n",
"# where |WX| = a, |XY... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.08333333333333333,
0,
0,
0.037037037037037035,
0
] | 27 | 0.004458 | false |
# This file is part of Plex:CS.
#
# Plex:CS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Plex:CS is distributed in the ho... | [
"# This file is part of Plex:CS.\n",
"#\n",
"# Plex:CS is free software: you can redistribute it and/or modify\n",
"# it under the terms of the GNU General Public License as published by\n",
"# the Free Software Foundation, either version 3 of the License, or\n",
"# (at your option) any later version... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.007692307692307693,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | 438 | 0.002839 | false |
"""
Represents the Depend settings
"""
# Always try to import cElementTree since it's faster if it exists
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
import platform
from os.path import join, abspath, exists
from pylib.logwrapper import LogWrapper
from pyli... | [
"\"\"\"\n",
"Represents the Depend settings\n",
"\"\"\"\n",
"\n",
"# Always try to import cElementTree since it's faster if it exists\n",
"try:\n",
" import xml.etree.cElementTree as ET\n",
"except ImportError:\n",
" import xml.etree.ElementTree as ET\n",
"\n",
"import platform\n",
"from... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.03333333333333333,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.04,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | 114 | 0.001588 | false |
# coding: UTF-8
# Name: 配置信息
# Author: LYC
# Created: 2014-04-08
import re
class Configuration(object):
"""
配置
"""
UserDeclarator = ":"
VarPrefix = "$"
FuncPrefix = "#"
ConstantPrefix = "$$"
VarRealPrefix = "_"
FuncRealPrefix = "func_"
UnknownNumber = "$$"
AnswerConstant... | [
"# coding: UTF-8\n",
"# Name: 配置信息\n",
"# Author: LYC\n",
"# Created: 2014-04-08\n",
"\n",
"import re\n",
"\n",
"class Configuration(object):\n",
" \"\"\"\n",
" 配置\n",
" \"\"\"\n",
" UserDeclarator = \":\"\n",
" VarPrefix = \"$\"\n",
" FuncPrefix = \"#\"\n",
" Consta... | [
0,
0,
0,
0,
0,
0,
0,
0.034482758620689655,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.07272727272727272,
0.05454545454545454,
0,
0,
0,
0.043478260869565216,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | 56 | 0.004223 | false |
# -*- coding: utf-8 -*-
"""
Region - descendant class of BaseRegion.
"""
import datetime
import os
import time
from common_exceptions import FailExit, FindFailed
from Location import Location
from BaseRegion import BaseRegion, logger, DELAY_BETWEEN_CV_ATTEMPT
from Match import Match
from Pattern im... | [
"# -*- coding: utf-8 -*-\r\n",
"\r\n",
"\"\"\"\r\n",
" Region - descendant class of BaseRegion.\r\n",
"\"\"\"\r\n",
"\r\n",
"import datetime\r\n",
"import os\r\n",
"import time\r\n",
"\r\n",
"from common_exceptions import FailExit, FindFailed\r\n",
"from Location import Location\r\n",
"fro... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.011904761904761904,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.011235955056179775,
0,
0,
0,
0,
0,
0,
0,
0,
... | 343 | 0.001366 | false |
# Used for perf measurements. Defines a simple function and makes 100 calls in a row.
# I ran 10K calls, total 1 million invocations, total time is around 250ms on my laptop (64bit 2.7GHz, Release mode, running .exe directly, no debugger);
# 0.4 microseconds per call.
m = 5
def addm(x, y):
x + y + m
x = addm(1... | [
"# Used for perf measurements. Defines a simple function and makes 100 calls in a row.\n",
"# I ran 10K calls, total 1 million invocations, total time is around 250ms on my laptop (64bit 2.7GHz, Release mode, running .exe directly, no debugger);\n",
"# 0.4 microseconds per call. \n",
"\n",
"m = 5\n",
"\n"... | [
0.011627906976744186,
0.006493506493506494,
0.03333333333333333,
0,
0,
0,
0.0625,
0.08333333333333333,
0.3333333333333333,
0.06666666666666667,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | 119 | 0.013423 | false |
from django import template
register = template.Library()
"""
Will be included in 1.4
"""
@register.filter()
def truncatechars(value, length):
"""
truncate after a certain number of characters,
if the last character is not space truncate at the next space
Edit by Taco: Now a... | [
"from django import template\n",
"\n",
"register = template.Library()\n",
"\n",
"\"\"\"\n",
" Will be included in 1.4\n",
"\"\"\"\n",
"\n",
"@register.filter()\n",
"def truncatechars(value, length):\n",
" \"\"\"\n",
" truncate after a certain number of characters,\n",
" i... | [
0,
0,
0,
0,
0,
0,
0,
0,
0.05263157894736842,
0,
0,
0,
0,
0.1111111111111111,
0,
0,
0,
0,
0.045454545454545456,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.029411764705882353,
0,
0,
0,
0.1111111111111111,
0,
0,
0,
0.027027027... | 61 | 0.010695 | false |
#!/usr/bin/env python
#coding:utf-8
# Author: mozman
# Purpose: a hack to generate XML containing CDATA by ElementTree
# Created: 26.05.2012
# Copyright (C) 2012, Manfred Moitzi
# License: GPLv3
# usage:
#
# from svgwrite.etree import etree, CDATA
#
# element = etree.Element('myTag')
# element.append(CD... | [
"#!/usr/bin/env python\r\n",
"#coding:utf-8\r\n",
"# Author: mozman\r\n",
"# Purpose: a hack to generate XML containing CDATA by ElementTree\r\n",
"# Created: 26.05.2012\r\n",
"# Copyright (C) 2012, Manfred Moitzi\r\n",
"# License: GPLv3\r\n",
"\r\n",
"# usage:\r\n",
"#\r\n",
"# from svgwrite.e... | [
0,
0.06666666666666667,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.02564102564102564,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.16666666666666666,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0.011494252873563218,
0,
0,
0,
0,
... | 56 | 0.007806 | false |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 4