rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
"""Scan through string looking for a match to the pattern, returning a MatchObject instance, or None if no match was found.""" | """search(string[, pos][, endpos]) -> MatchObject or None Scan through string looking for a location where this regular expression produces a match, and return a corresponding MatchObject instance. Return None if no position in the string matches the pattern; note that this is different from finding a zero-length match at some point in the string. The optional pos and endpos parameters have the same meaning as for the match() method. """ | def search(self, string, pos=0, endpos=None): """Scan through string looking for a match to the pattern, returning a MatchObject instance, or None if no match was found.""" | e6c8af476c85446f800a2bcad96d979cbf3dcfc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/e6c8af476c85446f800a2bcad96d979cbf3dcfc0/re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
533,
16,
949,
33,
20,
16,
679,
917,
33,
7036,
4672,
3536,
7972,
3059,
533,
7849,
364,
279,
845,
358,
326,
1936,
16,
5785,
279,
4639,
921,
791,
16,
578,
599,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
533,
16,
949,
33,
20,
16,
679,
917,
33,
7036,
4672,
3536,
7972,
3059,
533,
7849,
364,
279,
845,
358,
326,
1936,
16,
5785,
279,
4639,
921,
791,
16,
578,
599,
309,
... |
found_table = True | def reflecttable(self, connection, table): #TODO: map these better column_func = { 14 : lambda r: sqltypes.String(r['FLEN']), # TEXT 7 : lambda r: sqltypes.Integer(), # SHORT 8 : lambda r: sqltypes.Integer(), # LONG 9 : lambda r: sqltypes.Float(), # QUAD 10 : lambda r: sqltypes.Float(), # FLOAT 27 : lambda r: sqltypes.Double(), # DOUBLE 35 : lambda r: sqltypes.DateTime(), # TIMESTAMP 37 : lambda r: sqltypes.String(r['FLEN']), # VARYING 261: lambda r: sqltypes.TEXT(), # BLOB 40 : lambda r: sqltypes.Char(r['FLEN']), # CSTRING 12 : lambda r: sqltypes.Date(), # DATE 13 : lambda r: sqltypes.Time(), # TIME 16 : lambda r: sqltypes.Numeric(precision=r['FPREC'], length=r['FSCALE'] * -1) #INT64 } tblqry = """\ SELECT DISTINCT R.RDB$FIELD_NAME AS FNAME, R.RDB$NULL_FLAG AS NULL_FLAG, R.RDB$FIELD_POSITION, F.RDB$FIELD_TYPE AS FTYPE, F.RDB$FIELD_SUB_TYPE AS STYPE, F.RDB$FIELD_LENGTH AS FLEN, F.RDB$FIELD_PRECISION AS FPREC, F.RDB$FIELD_SCALE AS FSCALE FROM RDB$RELATION_FIELDS R JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME WHERE F.RDB$SYSTEM_FLAG=0 and R.RDB$RELATION_NAME=? ORDER BY R.RDB$FIELD_POSITION;""" keyqry = """ SELECT RC.RDB$CONSTRAINT_TYPE KEYTYPE, RC.RDB$CONSTRAINT_NAME CNAME, RC.RDB$INDEX_NAME INAME, SE.RDB$FIELD_NAME SENAME, FROM RDB$RELATION_CONSTRAINTS RC LEFT JOIN RDB$INDEX_SEGMENTS SE ON RC.RDB$INDEX_NAME=SE.RDB$INDEX_NAME WHERE RC.RDB$RELATION_NAME=? AND SE.RDB$FIELD_NAME=? """ #import pdb;pdb.set_trace() # get all of the fields for this table c = connection.execute(tblqry, [table.name.upper()]) found_table = False while True: row = c.fetchone() if not row: break found_table = True args = [row['FNAME']] kw = {} # get the data types and lengths args.append(column_func[row['FTYPE']](row)) | 5c0e32bf33a5db32c1beabc0fadb4ddd1fbd24be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1074/5c0e32bf33a5db32c1beabc0fadb4ddd1fbd24be/firebird.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3037,
2121,
12,
2890,
16,
1459,
16,
1014,
4672,
468,
6241,
30,
852,
4259,
7844,
1057,
67,
644,
273,
288,
5045,
294,
3195,
436,
30,
21899,
18,
780,
12,
86,
3292,
42,
13017,
3546,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3037,
2121,
12,
2890,
16,
1459,
16,
1014,
4672,
468,
6241,
30,
852,
4259,
7844,
1057,
67,
644,
273,
288,
5045,
294,
3195,
436,
30,
21899,
18,
780,
12,
86,
3292,
42,
13017,
3546,
3631,
... | |
elif lower(filename[-4:]) == '.pyc': | elif lower(filename[-4:]) in ['.pyc', '.pyd', '.pyo']: | def modulename(path): """Return the Python module name for a given path, or None.""" filename = os.path.basename(path) if lower(filename[-3:]) == '.py': return filename[:-3] elif lower(filename[-4:]) == '.pyc': return filename[:-4] elif lower(filename[-11:]) == 'module.so': return filename[:-11] elif lower(filename[-13:]) == 'module.so.1': return filename[:-13] | bb384e153d6614fce08e58bada5e06402dc8b3e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/bb384e153d6614fce08e58bada5e06402dc8b3e4/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31961,
12,
803,
4672,
3536,
990,
326,
6600,
1605,
508,
364,
279,
864,
589,
16,
578,
599,
12123,
1544,
273,
1140,
18,
803,
18,
13909,
12,
803,
13,
309,
2612,
12,
3459,
18919,
23,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31961,
12,
803,
4672,
3536,
990,
326,
6600,
1605,
508,
364,
279,
864,
589,
16,
578,
599,
12123,
1544,
273,
1140,
18,
803,
18,
13909,
12,
803,
13,
309,
2612,
12,
3459,
18919,
23,
30,
... |
def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): | def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): | def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just output a list of (filename, modulename, funcname,) for functions that were called at least once; This overrides `count' and `trace' @param ignoremods a list of the names of modules to ignore @param ignoredirs a list of the names of directories to ignore all of the (recursive) contents of @param infile file from which to read stored counts to be added into the results @param outfile file in which to write the results """ self.infile = infile self.outfile = outfile self.ignore = Ignore(ignoremods, ignoredirs) self.counts = {} # keys are (filename, linenumber) self.blabbed = {} # for debugging self.pathtobasename = {} # for memoizing os.path.basename self.donothing = 0 self.trace = trace self._calledfuncs = {} if countfuncs: self.globaltrace = self.globaltrace_countfuncs elif trace and count: self.globaltrace = self.globaltrace_lt self.localtrace = self.localtrace_trace_and_count elif trace: self.globaltrace = self.globaltrace_lt self.localtrace = self.localtrace_trace elif count: self.globaltrace = self.globaltrace_lt self.localtrace = self.localtrace_count else: # Ahem -- do nothing? Okay. self.donothing = 1 | 9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1056,
33,
21,
16,
2606,
33,
21,
16,
1056,
17728,
33,
20,
16,
2305,
22760,
33,
9334,
2305,
8291,
33,
9334,
14568,
33,
7036,
16,
8756,
33,
7036,
4672,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1056,
33,
21,
16,
2606,
33,
21,
16,
1056,
17728,
33,
20,
16,
2305,
22760,
33,
9334,
2305,
8291,
33,
9334,
14568,
33,
7036,
16,
8756,
33,
7036,
4672,
35... |
xapian.Query(db._field_mappings.get_prefix("mission") + "a13"), | xapian.Query(db._field_mappings.get_prefix("mission") + self.request.mission.name), | def get_context_data(self): # Get the query text q = self.request.GET.get('q', '') # Get the offset value try: offset = int( self.request.GET.get('offset', '0') ) if offset < 0: offset = 0 except ValueError: offset = 0 # Get the results from Xapian db = xappy.SearchConnection( os.path.join( settings.SITE_ROOT, '..', "xappydb", ), ) query = db.query_parse( q, default_op=db.OP_OR, ) query=db.query_filter( query, # FIXME: mission-specific filter! xapian.Query(db._field_mappings.get_prefix("mission") + "a13"), ) results = db.search( query=query, startrank=offset, endrank=offset+PAGESIZE, checkatleast=offset+PAGESIZE+1, ) # Go through the results, building a list of LogLine objects redis_conn = redis.Redis() log_lines = [] for result in results: transcript_name, timestamp = result.id.split(":", 1) log_line = LogLine(redis_conn, transcript_name, int(timestamp)) log_line.speaker = Character(redis_conn, transcript_name.split('/')[0], result.data['speaker'][0]) log_line.title = mark_safe(result.summarise("text", maxlen=50, ellipsis='…', strict_length=True, hl=None)) log_line.summary = mark_safe(result.summarise("text", maxlen=600, ellipsis='…', hl=('<mark>', '</mark>'))) log_lines.append(log_line) | 4058a738b5d7431c062760983ae2181e082d8868 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13780/4058a738b5d7431c062760983ae2181e082d8868/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2472,
67,
892,
12,
2890,
4672,
468,
968,
326,
843,
977,
1043,
273,
365,
18,
2293,
18,
3264,
18,
588,
2668,
85,
2187,
28707,
468,
968,
326,
1384,
460,
775,
30,
1384,
273,
509... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2472,
67,
892,
12,
2890,
4672,
468,
968,
326,
843,
977,
1043,
273,
365,
18,
2293,
18,
3264,
18,
588,
2668,
85,
2187,
28707,
468,
968,
326,
1384,
460,
775,
30,
1384,
273,
509... |
_cfunc_refs[tmpval1] = c_drawit | def fl_add_symbol(name, pydrawit, scalable): """ fl_add_symbol(name, pydrawit, scalable) -> num. """ c_drawit = FL_DRAWPTR(pydrawit) retval = _fl_add_symbol(name, c_drawit, scalable) _cfunc_refs[tmpval1] = c_drawit return retval | 8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
67,
7175,
12,
529,
16,
2395,
9446,
305,
16,
8292,
429,
4672,
3536,
1183,
67,
1289,
67,
7175,
12,
529,
16,
2395,
9446,
305,
16,
8292,
429,
13,
317,
818,
18,
3536,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
67,
7175,
12,
529,
16,
2395,
9446,
305,
16,
8292,
429,
4672,
3536,
1183,
67,
1289,
67,
7175,
12,
529,
16,
2395,
9446,
305,
16,
8292,
429,
13,
317,
818,
18,
3536,
225,... | |
assert long(v.scaledDoubleValue(e)) == v | sdv = self.sdv assert long(sdv(v, e)) == v | def test_scale_3_v(self): e = self.e v = self.v8 assert long(v.scaledDoubleValue(e)) == v assert e[0] == 0 assert long((v+1).scaledDoubleValue(e)) - v == 0 assert e[0] == 0 | 26c8ed171c9c50296861dbc6d44f6ae539fb07e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6753/26c8ed171c9c50296861dbc6d44f6ae539fb07e6/test_jy_internals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5864,
67,
23,
67,
90,
12,
2890,
4672,
425,
273,
365,
18,
73,
331,
273,
365,
18,
90,
28,
8349,
90,
273,
365,
18,
6427,
90,
1815,
1525,
12,
6427,
90,
12,
90,
16,
425,
371... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5864,
67,
23,
67,
90,
12,
2890,
4672,
425,
273,
365,
18,
73,
331,
273,
365,
18,
90,
28,
8349,
90,
273,
365,
18,
6427,
90,
1815,
1525,
12,
6427,
90,
12,
90,
16,
425,
371... |
class MusicHistoryRepositoryFixture(Fixture): | class MusicHistoryRepositoryFixture(AspyFixture): | def run(self): t = os.listdir("E:\\Music\\Bloc Party - Silent Alarm\\") fss = FileSystemServices() files = fss.find_all_files("E:\\Music\\Bloc Party - Silent Alarm\\", ".mp3") self.assertEquals(16, len(files), "Num of files loaded") files = fss.find_all_files("E:\\Music\\Muse - Absolution", ".mp3") self.assertEquals(14, len(files), "Num of files loaded") | 43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5169/43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd/aspyplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
268,
273,
1140,
18,
1098,
1214,
2932,
41,
31027,
49,
14894,
1695,
38,
1829,
6393,
93,
300,
348,
8125,
2262,
4610,
1695,
7923,
225,
284,
1049,
273,
10931,
5676,
1435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
268,
273,
1140,
18,
1098,
1214,
2932,
41,
31027,
49,
14894,
1695,
38,
1829,
6393,
93,
300,
348,
8125,
2262,
4610,
1695,
7923,
225,
284,
1049,
273,
10931,
5676,
1435... |
sage: R = RealField() sage: list(xsrange(1, 5, R(0.5))) | sage: list(xsrange(1, 5, 0.5)) | def xsrange(start, end=None, step=1, universe=None, check=True, include_endpoint=False): """ Return an iterator over numbers \code{a, a+step, ..., a+k*step}, where \code{a+k*step < b} and \code{a+(k+1)*step > b}. INPUT: a -- number b -- number step -- number (default: 1) OUTPUT: iterator Unlike range, a and b can be any type of numbers, and the resulting iterator involves numbers of that type. SEE ALSO: srange. NOTE: This function is called \code{xsrange} to distinguish it from the builtin Python \code{xrange} command. EXAMPLES: sage: list(xsrange(1,10)) [1, 2, 3, 4, 5, 6, 7, 8, 9] sage: Q = RationalField() sage: list(xsrange(1, 10, Q('1/2'))) [1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5, 11/2, 6, 13/2, 7, 15/2, 8, 17/2, 9, 19/2] sage: R = RealField() sage: list(xsrange(1, 5, R(0.5))) [1.00000000000000, 1.50000000000000, 2.00000000000000, 2.50000000000000, 3.00000000000000, 3.50000000000000, 4.00000000000000, 4.50000000000000] sage: list(xsrange(0, 1, R('0.4'))) [0.000000000000000, 0.400000000000000, 0.800000000000000] Negative ranges are also allowed: sage: list(xrange(4,1,-1)) [4, 3, 2] sage: list(sxrange(4,1,-1)) [4, 3, 2] sage: list(sxrange(4,1,-1/2)) [4, 7/2, 3, 5/2, 2, 3/2] """ if end is None: end = start start = 0 if step == 0: raise ValueError, "step must not be 0" from sage.structure.sequence import Sequence from sage.rings.all import ZZ if check: if universe is None: universe = Sequence([start, end, step]).universe() start, end, step = universe(start), universe(end), universe(step) if include_endpoint: if universe in [int, long, ZZ]: if (start-end) % step == 0: end += step else: count = (start-end)/step if count == int(float(count)): end += step count += 1 if universe is int: return xrange(start, end, step) | 285dc9c60fd59b5e65432747859dd76b728bb3b8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/285dc9c60fd59b5e65432747859dd76b728bb3b8/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9280,
3676,
12,
1937,
16,
679,
33,
7036,
16,
2235,
33,
21,
16,
29235,
33,
7036,
16,
866,
33,
5510,
16,
2341,
67,
8003,
33,
8381,
4672,
3536,
2000,
392,
2775,
1879,
5600,
521,
710,
95... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9280,
3676,
12,
1937,
16,
679,
33,
7036,
16,
2235,
33,
21,
16,
29235,
33,
7036,
16,
866,
33,
5510,
16,
2341,
67,
8003,
33,
8381,
4672,
3536,
2000,
392,
2775,
1879,
5600,
521,
710,
95... |
% (page_put_queue.qsize(), remaining)) page_put_queue.put((None, None, None, None, None, None, None)) | % remaining()) | def _flush(): """Wait for the page-putter to flush its queue. Called automatically upon exiting from Python. """ if page_put_queue.qsize() > 0: import datetime remaining = datetime.timedelta( seconds = page_put_queue.qsize() * config.put_throttle) output(u'Waiting for %i pages to be put. Estimated time remaining: %s' % (page_put_queue.qsize(), remaining)) page_put_queue.put((None, None, None, None, None, None, None)) while(_putthread.isAlive()): try: _putthread.join(1) except KeyboardInterrupt: remainingPages = page_put_queue.qsize() - 1 # -1 because we added a None element to stop the queue remainingSeconds = datetime.timedelta(seconds=(page_put_queue.qsize()) * config.put_throttle) answer = inputChoice(u'There are %i pages remaining in the queue. Estimated time remaining: %s\nReally exit?' % (remainingPages, remainingSeconds), ['yes', 'no'], ['y', 'N'], 'N') if answer == 'y': return try: get_throttle.drop() except NameError: pass | ce3cb1d9de6559e55f6d0804a899bd3b5a143aac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/ce3cb1d9de6559e55f6d0804a899bd3b5a143aac/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11330,
13332,
3536,
5480,
364,
326,
1363,
17,
458,
387,
358,
3663,
2097,
2389,
18,
225,
11782,
6635,
12318,
15702,
628,
6600,
18,
225,
3536,
309,
1363,
67,
458,
67,
4000,
18,
85,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11330,
13332,
3536,
5480,
364,
326,
1363,
17,
458,
387,
358,
3663,
2097,
2389,
18,
225,
11782,
6635,
12318,
15702,
628,
6600,
18,
225,
3536,
309,
1363,
67,
458,
67,
4000,
18,
85,
... |
if __name__ == "draw": layout(1) wireframe() reset() D = 10. L = 80. d = 0.2 n = 12 b = 30. res = askItems([['Diameter',D],['Length',L],['WireDiam',d],['NWires',n], ['Pitch',b]]) D = float(res['Diameter']) L = float(res['Length']) d = float(res['WireDiam']) n = int(res['NWires']) if (n % 2) != 0: warning('Number of wires must be even!') exit() b = float(res['Pitch']) H = DoubleHelixStent(D,L,d,n,b).all() clear() draw(H,view='iso') if ack("Do you want to save this image (in lots of formats) ?"): for ext in [ 'bmp', 'jpg', 'pbm', 'png', 'ppm', 'xbm', 'xpm', 'eps', 'ps', 'pdf', 'tex' ]: saveImage('WireStent.'+ext) | def all(self): """Return the Formex with all bar elements.""" return self.F | d3a15cd51357fc2545b2ef4fbf394e7c165ba0c4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2499/d3a15cd51357fc2545b2ef4fbf394e7c165ba0c4/WireStent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
12,
2890,
4672,
3536,
990,
326,
2748,
338,
598,
777,
4653,
2186,
12123,
327,
365,
18,
42,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
12,
2890,
4672,
3536,
990,
326,
2748,
338,
598,
777,
4653,
2186,
12123,
327,
365,
18,
42,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
def extractSrpm(pkg, pkgdir, filecache, repodir, oldpkg): | def extractSrpm(reponame, pkg, pkgdir, filecache, repodir, oldpkg): | def extractSrpm(pkg, pkgdir, filecache, repodir, oldpkg): files = pkg.getFilenames() i = pkg.getSpecfile(files) specfile = files[i] if os.path.exists("%s/%s" % (pkgdir, specfile)): checksum = getChecksum("%s/%s" % (pkgdir, specfile)) # same spec file in repo and in rpm: nothing to do if checksum == pkg["filemd5s"][i]: return os.system('rm -rf "%s"' % pkgdir) makeDirs(pkgdir) extractRpm(pkg, pkgdir + "/") for f in os.listdir(pkgdir): if f not in files and f not in ("Makefile", "sources"): fsrc = pkgdir + "/" + f os.unlink(fsrc) os.system("cd %s && git-update-index --remove %s" % (pkgdir, f)) if "sources" in files or "Makefile" in files: raise ValueError, \ "src.rpm contains sources/Makefile: %s" % pkg.filename EXTRACT_SOURCE_FOR = ["MAKEDEV", "anaconda", "anaconda-help", "anaconda-product", "basesystem", "booty", "chkconfig", "device-mapper", "dmraid", "firstboot", "glibc-kernheaders", "hwdata", "initscripts", "iscsi-initiator-utils", "kudzu", "mkinitrd", "pam_krb5", "passwd", "redhat-config-kickstart", "redhat-config-netboot", "redhat-config-network", "redhat-config-securitylevel", "rhn-applet", "rhnlib", "rhpl", "sysklogd", "system-config-printer", "system-config-securitylevel", "tux", "udev"] sources = [] if filecache: for i in xrange(len(files)): f = files[i] if not S_ISREG(pkg["filemodes"][i]) or not isBinary(f): continue fsrc = pkgdir + "/" + f # should we use sha instead of md5: #md5data = getChecksum(fsrc, "sha") md5data = pkg["filemd5s"][i] fdir = "%s/%s" % (filecache, md5data[0:2]) fname = "%s/%s.bin" % (fdir, md5data) # XXX disable this until my machine has more disk space if None and not os.path.isfile(fname): makeDirs(fdir) doLnOrCopy(fsrc, fname) if pkg["name"] in EXTRACT_SOURCE_FOR: if fsrc.find(".tar") >= 0: tempdir = "%s/e.tar" % pkgdir os.mkdir(tempdir) dirname = explodeFile(fsrc, tempdir, "0") os.rename(dirname, "%s/tar" % pkgdir) os.rmdir(tempdir) os.unlink(fsrc) sources.append("%s %s\n" % (md5data, f)) sources.sort(cmpNoMD5) writeFile(pkgdir + "/sources", sources) writeFile(pkgdir + "/Makefile", [ "include ../pyrpm/Makefile.srpm\n", "NAME:=%s\nSPECFILE:=%s\n" % (pkg["name"], specfile)]) # XXX: also checkin the data into a per-package repo os.system("cd %s && { find . -path ./.git -prune -o -type f -print | sed -e 's|^./||' | xargs git-update-index --add --refresh; }" % pkgdir) os.system('cd %s && { for file in $(git-ls-files); do [ ! -f "$file" ] && git-update-index --remove "$file"; done; }' % pkgdir) if oldpkg: (fd, tmpfile) = mkstemp_file("/tmp", special=1) fd.write("update %s from %s-%s to %s-%s\n\nchangelog:\n\n" % \ (pkg["name"], oldpkg["version"], oldpkg["release"], pkg["version"], pkg["release"]) + \ getChangeLogDiff(oldpkg, pkg)) fd.close() del fd changelog = "-F " + tmpfile user = "cvs@devel.redhat.com" email = user if pkg["changelogname"]: user = pkg["changelogname"][0] if user.rfind("> ") != -1: user = user[:user.rfind("> ") + 1] email = user if email.find("<") != -1: email = email[email.find("<") + 1:email.rfind(">") + 1] if user.rfind(" <") != -1: user = user[:user.rfind(" <")] # XXX if we monitor trees, we could change the checkin time to # first day of release of the rpm package instead of rpm buildtime # XXX git knows about an "order" file which gives information on # how to order files for a diff: "*.spec" (.spec first) buildtime = str(pkg.hdr.getOne("buildtime")) os.system("cd " + repodir + " && GIT_AUTHOR_NAME=\"" + user + \ "\" GIT_AUTHOR_EMAIL=\"" + email + "\" GIT_AUTHOR_DATE=" + \ buildtime + " GIT_COMMITTER_NAME=\"" + user + \ "\" GIT_COMMITTER_EMAIL=\"" + email + "\" GIT_COMMITTER_DATE=" + \ buildtime + " git commit " + changelog) if tmpfile != None: os.unlink(tmpfile) | d4a3970fa3f1947aabfdd4eca421bbf58568d6ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/d4a3970fa3f1947aabfdd4eca421bbf58568d6ba/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
55,
86,
7755,
12,
266,
500,
339,
16,
3475,
16,
3475,
1214,
16,
585,
2493,
16,
2071,
369,
481,
16,
1592,
10657,
4672,
1390,
273,
3475,
18,
588,
25579,
6809,
1435,
277,
273,
3475,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
55,
86,
7755,
12,
266,
500,
339,
16,
3475,
16,
3475,
1214,
16,
585,
2493,
16,
2071,
369,
481,
16,
1592,
10657,
4672,
1390,
273,
3475,
18,
588,
25579,
6809,
1435,
277,
273,
3475,
... |
def apply_rule(added_clause, added_params, added_tables): | def apply_rule(added_clause, added_params, added_tables, parent_model=None, child_object=None): | def apply_rule(added_clause, added_params, added_tables): if added_clause: query.where_clause += added_clause query.where_clause_params += added_params for table in added_tables: if table not in query.tables: query.tables.append(table) return True return False | 17412755b91a9fe74a02c1e25cf89d2ac1f23b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/17412755b91a9fe74a02c1e25cf89d2ac1f23b52/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
5345,
12,
9665,
67,
18128,
16,
3096,
67,
2010,
16,
3096,
67,
9373,
16,
982,
67,
2284,
33,
7036,
16,
1151,
67,
1612,
33,
7036,
4672,
309,
3096,
67,
18128,
30,
843,
18,
6051,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
5345,
12,
9665,
67,
18128,
16,
3096,
67,
2010,
16,
3096,
67,
9373,
16,
982,
67,
2284,
33,
7036,
16,
1151,
67,
1612,
33,
7036,
4672,
309,
3096,
67,
18128,
30,
843,
18,
6051,... |
def test_Df_denom(self): | def test_df_denom(self): | def test_Df_denom(self): assert_equal(self.Ttest.df_denom, self.res1.model.df_resid) | c944eab8d84c6cac2fb5de055fceb6bc5953418f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12658/c944eab8d84c6cac2fb5de055fceb6bc5953418f/test_regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2180,
67,
13002,
362,
12,
2890,
4672,
1815,
67,
9729,
12,
2890,
18,
56,
3813,
18,
2180,
67,
13002,
362,
16,
365,
18,
455,
21,
18,
2284,
18,
2180,
67,
15567,
13,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2180,
67,
13002,
362,
12,
2890,
4672,
1815,
67,
9729,
12,
2890,
18,
56,
3813,
18,
2180,
67,
13002,
362,
16,
365,
18,
455,
21,
18,
2284,
18,
2180,
67,
15567,
13,
2,
-100,
... |
def _cmp(a, b, sh): | def _cmp(a, b, sh, abs=abs, cmp=cmp): | def _cmp(a, b, sh): try: return not abs(cmp(a, b, sh)) except os.error: return 2 | 96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9625,
12,
69,
16,
324,
16,
699,
16,
2417,
33,
5113,
16,
9411,
33,
9625,
4672,
775,
30,
327,
486,
2417,
12,
9625,
12,
69,
16,
324,
16,
699,
3719,
1335,
1140,
18,
1636,
30,
327,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9625,
12,
69,
16,
324,
16,
699,
16,
2417,
33,
5113,
16,
9411,
33,
9625,
4672,
775,
30,
327,
486,
2417,
12,
9625,
12,
69,
16,
324,
16,
699,
3719,
1335,
1140,
18,
1636,
30,
327,... |
(child, cookie2) = self._treeCtrl.GetNextChild(project, cookie) | (child, cookie2) = self._treeCtrl.GetNextChild(project, cookie2) | def _GetFileItem(self, shortFileName = None, longFileName = None): """ Returns the tree item for a file given the short (display) or long (fullpath) file name. """ rootItem = self._treeCtrl.GetRootItem() (project, cookie) = self._treeCtrl.GetFirstChild(rootItem) while project.IsOk(): (child, cookie2) = self._treeCtrl.GetFirstChild(project) while child.IsOk(): if shortFileName: if self._treeCtrl.GetItemText(child) == shortFileName: return child else: if self._treeCtrl.GetLongFilename(child) == longFileName: return child (child, cookie2) = self._treeCtrl.GetNextChild(project, cookie) (project, cookie) = self._treeCtrl.GetNextChild(rootItem, cookie) return None | bbb2889740248dad3f6405367f6382e7cb6cb839 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/bbb2889740248dad3f6405367f6382e7cb6cb839/ProjectEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
812,
1180,
12,
2890,
16,
3025,
4771,
273,
599,
16,
1525,
4771,
273,
599,
4672,
3536,
2860,
326,
2151,
761,
364,
279,
585,
864,
326,
3025,
261,
5417,
13,
578,
1525,
261,
2854,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
812,
1180,
12,
2890,
16,
3025,
4771,
273,
599,
16,
1525,
4771,
273,
599,
4672,
3536,
2860,
326,
2151,
761,
364,
279,
585,
864,
326,
3025,
261,
5417,
13,
578,
1525,
261,
2854,... |
else | else: | def size(self): if hasattr(os, 'fstat'): return os.fstat(self.fileno()).st_size else return os.stat(self.name).st_size | f4f0fa72df9cf1504a67e88b0970739d121d4a92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12534/f4f0fa72df9cf1504a67e88b0970739d121d4a92/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
963,
12,
2890,
4672,
309,
3859,
12,
538,
16,
296,
74,
5642,
11,
4672,
327,
1140,
18,
74,
5642,
12,
2890,
18,
7540,
5764,
1435,
2934,
334,
67,
1467,
469,
30,
327,
1140,
18,
5642,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
963,
12,
2890,
4672,
309,
3859,
12,
538,
16,
296,
74,
5642,
11,
4672,
327,
1140,
18,
74,
5642,
12,
2890,
18,
7540,
5764,
1435,
2934,
334,
67,
1467,
469,
30,
327,
1140,
18,
5642,
12,
... |
demoBuildStatus["svnRevision"] = self.getSvnRevision() except: pass if not self.hasDemoDir: msg = "Library %s version %s has no demo folder!" %(self.library.dir, self.dir) console.error(msg) demoBuildStatus["buildError"] = msg return demoBuildStatus console.info("Generating %s version of demo variant %s for library %s version %s..." %(demoVersion,demoVariant, self.libraryName, self.versionName) ) subPath = os.path.join("demo", demoVariant) try: rcode, output, errout = self.runGenerator(demoVersion, subPath) | rcode, output, errout = runGenerator(self.path, target, macro) | def buildDemo(self, demoVariant = "default", demoVersion = "build"): demoBuildStatus = {} try: demoBuildStatus["svnRevision"] = self.getSvnRevision() except: pass if not self.hasDemoDir: msg = "Library %s version %s has no demo folder!" %(self.library.dir, self.dir) console.error(msg) demoBuildStatus["buildError"] = msg return demoBuildStatus console.info("Generating %s version of demo variant %s for library %s version %s..." %(demoVersion,demoVariant, self.libraryName, self.versionName) ) subPath = os.path.join("demo", demoVariant) try: rcode, output, errout = self.runGenerator(demoVersion, subPath) except Exception, e: msg = "Error running generator: " + str(e) console.wite("") console.error(e) demoBuildStatus["buildError"] = msg return demoBuildStatus #some demos don't produce a qooxdoo application, so they're ignored #for the demobrowser demoScriptPath = os.path.join(self.path, "demo", demoVariant, demoVersion, "script") hasScriptDir = os.path.isdir(demoScriptPath) if rcode > 0: console.error(errout) console.info(output) if not errout: errout = "Unknown error" demoBuildStatus["buildError"] = errout elif not hasScriptDir: console.write("") console.warn("No script directory created!") demoBuildStatus["buildError"] = "No script directory created" else: console.write("Done.", "info") demoBuildStatus["buildError"] = None self.demoBuildStatus = demoBuildStatus return demoBuildStatus | 610bd392cd356830d4652a775532be95d83a132a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/610bd392cd356830d4652a775532be95d83a132a/repository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
27126,
12,
2890,
16,
21477,
9356,
273,
315,
1886,
3113,
21477,
1444,
273,
315,
3510,
6,
4672,
21477,
3116,
1482,
273,
2618,
775,
30,
436,
710,
16,
876,
16,
6445,
7028,
273,
1086,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
27126,
12,
2890,
16,
21477,
9356,
273,
315,
1886,
3113,
21477,
1444,
273,
315,
3510,
6,
4672,
21477,
3116,
1482,
273,
2618,
775,
30,
436,
710,
16,
876,
16,
6445,
7028,
273,
1086,
... |
if sys.platform == 'Darwin1.2': | if platform == 'Darwin1.2': | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 1cfa0e8295f3d8749eba860c3e99f12d18bfbee3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1cfa0e8295f3d8749eba860c3e99f12d18bfbee3/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
309,
1173,
13640,
19,
3729,
19,
2941,
11,
486,
316,
365,
18,
9576,
18,
12083,
67,
8291,
30,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
309,
1173,
13640,
19,
3729,
19,
2941,
11,
486,
316,
365,
18,
9576,
18,
12083,
67,
8291,
30,
365,
... |
methodTreeView.append_column(gtk.TreeViewColumn("tree", gtk.CellRendererText(), markup=0)) objectTreeView.append_column(gtk.TreeViewColumn("tree", gtk.CellRendererText(), markup=0)) | def _params(self): return A(Ps(), 'This method returns a class nearly implementing a Gnome Grimoire client application.') | d15b9c725ea67add01a06509ffd56a9e5e38264b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9377/d15b9c725ea67add01a06509ffd56a9e5e38264b/ggui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2010,
12,
2890,
4672,
327,
432,
12,
18124,
9334,
296,
2503,
707,
1135,
279,
667,
13378,
715,
19981,
279,
611,
82,
1742,
611,
86,
381,
19847,
1004,
2521,
1093,
13,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2010,
12,
2890,
4672,
327,
432,
12,
18124,
9334,
296,
2503,
707,
1135,
279,
667,
13378,
715,
19981,
279,
611,
82,
1742,
611,
86,
381,
19847,
1004,
2521,
1093,
13,
2,
-100,
-100,
-... | |
listbox = Tkinter.Listbox( self.tkref, yscrollcommand=scrollbar.set, font=listbox_font, bg="light yellow", selectmode=Tkinter.SINGLE, height=30, width=40, relief=Tkinter.FLAT, ) listbox.config(selectbackground=listbox["bg"], selectforeground=listbox["fg"]) listbox.bind("<Double-Button-1>", open_char_page) | listbox = Tkinter.Listbox( self.tkref, yscrollcommand=scrollbar.set, font=listbox_font, bg="light yellow", selectmode=Tkinter.SINGLE, height=30, width=40, relief=Tkinter.FLAT, ) listbox.config(selectbackground=listbox["bg"], selectforeground=listbox["fg"]) listbox.bind("<Double-Button-1>", open_char_page) | def __init__(self, root): self.tkref = root self.tkref.title("Prolepsis 0.2.0") | a297d3735c8e07d10e9f1f8937e0131696e57ce3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4811/a297d3735c8e07d10e9f1f8937e0131696e57ce3/prolepsis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
4672,
365,
18,
16099,
1734,
273,
1365,
365,
18,
16099,
1734,
18,
2649,
2932,
626,
298,
1121,
291,
374,
18,
22,
18,
20,
7923,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
4672,
365,
18,
16099,
1734,
273,
1365,
365,
18,
16099,
1734,
18,
2649,
2932,
626,
298,
1121,
291,
374,
18,
22,
18,
20,
7923,
2,
-100,
-100,
-100,
... |
def createLogFile(self, test, stdout): | def createLogFile(self, test, stdout, leakLogs): | def createLogFile(self, test, stdout): """ For a given test and stdout buffer, create a log file. also log any found leaks. On a remote system we have to fix the test name since it can contain directories. """ try: f = open(test + ".log", "w") f.write(stdout) | d03cbb5b473702276b62e302f308e75a52db6d14 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/d03cbb5b473702276b62e302f308e75a52db6d14/runxpcshelltests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
19103,
12,
2890,
16,
1842,
16,
3909,
16,
20891,
7777,
4672,
3536,
2457,
279,
864,
1842,
471,
3909,
1613,
16,
752,
279,
613,
585,
18,
225,
2546,
613,
1281,
1392,
20891,
87,
18,
275... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
19103,
12,
2890,
16,
1842,
16,
3909,
16,
20891,
7777,
4672,
3536,
2457,
279,
864,
1842,
471,
3909,
1613,
16,
752,
279,
613,
585,
18,
225,
2546,
613,
1281,
1392,
20891,
87,
18,
275... |
print vid | def get_video_description(vid): print vid j = json.load(urllib2.urlopen(url % vid)) if j.get('error'): return j = j['data'] out = '\x02%s\x02' % j['title'] out += ' - length \x02' length = j['duration'] if length / 3600: # > 1 hour out += '%dh ' % (length / 3600) if length / 60: out += '%dm ' % (length / 60 % 60) out += "%ds\x02" % (length % 60) if 'rating' in j: out += ' - rated \x02%.2f/5.0\x02 (%d)' % (j['rating'], j['ratingCount']) if 'viewCount' in j: out += ' - \x02%s\x02 views' % locale.format('%d', j['viewCount'], 1) upload_time = time.strptime(j['uploaded'], "%Y-%m-%dT%H:%M:%S.000Z") out += ' - \x02%s\x02 on \x02%s\x02' % (j['uploader'], time.strftime("%Y.%m.%d", upload_time)) if 'contentRating' in j: out += ' - \x034NSFW\x02' return out | a4ada7893ca725b4894819279d6b890ffd40d155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9775/a4ada7893ca725b4894819279d6b890ffd40d155/youtube.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9115,
67,
3384,
12,
1246,
4672,
525,
273,
1163,
18,
945,
12,
718,
2941,
22,
18,
295,
18589,
12,
718,
738,
18339,
3719,
225,
309,
525,
18,
588,
2668,
1636,
11,
4672,
327,
225... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9115,
67,
3384,
12,
1246,
4672,
525,
273,
1163,
18,
945,
12,
718,
2941,
22,
18,
295,
18589,
12,
718,
738,
18339,
3719,
225,
309,
525,
18,
588,
2668,
1636,
11,
4672,
327,
225... | |
return [path_utils.ChromiumBaselinePath('chromium-win'), path_utils.WebKitBaselinePath('win'), path_utils.WebKitBaselinePath('mac')] | dirs = [] if PlatformVersion() == "-xp": dirs.append(path_utils.ChromiumBaselinePath('chromium-win-xp')) dirs.append(path_utils.ChromiumBaselinePath('chromium-win')) dirs.append(path_utils.WebKitBaselinePath('win')) dirs.append(path_utils.WebKitBaselinePath('mac')) return dirs | def BaselineSearchPath(): """Returns the list of directories to search for baselines/results, in order of preference. Paths are relative to the top of the source tree.""" return [path_utils.ChromiumBaselinePath('chromium-win'), path_utils.WebKitBaselinePath('win'), path_utils.WebKitBaselinePath('mac')] | cf37da383867e81a5998fb06f5bca52dc92552c7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/cf37da383867e81a5998fb06f5bca52dc92552c7/platform_utils_win.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
345,
3027,
2979,
743,
13332,
3536,
1356,
326,
666,
434,
6402,
358,
1623,
364,
2580,
14567,
19,
4717,
16,
316,
1353,
434,
11555,
18,
16643,
854,
3632,
358,
326,
1760,
434,
326,
1084,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
345,
3027,
2979,
743,
13332,
3536,
1356,
326,
666,
434,
6402,
358,
1623,
364,
2580,
14567,
19,
4717,
16,
316,
1353,
434,
11555,
18,
16643,
854,
3632,
358,
326,
1760,
434,
326,
1084,... |
print format3c(month_name[q], month_name[q+1], month_name[q+2]) format3c(header, header, header) | s = (s + '\n' * l + format3cstring(month_name[q], month_name[q+1], month_name[q+2], colwidth, c).rstrip() + '\n' * l + header + '\n' * l) | def prcal(year): """Print a year's calendar.""" header = weekheader(2) format3c('', `year`, '') for q in range(January, January+12, 3): print format3c(month_name[q], month_name[q+1], month_name[q+2]) format3c(header, header, header) data = [] height = 0 for month in range(q, q+3): cal = monthcalendar(year, month) if len(cal) > height: height = len(cal) data.append(cal) for i in range(height): for cal in data: if i >= len(cal): print ' '*_colwidth, else: prweek(cal[i], 2) print _spacing, print | 338398f1cb7106ce99627d71e1839a1616596a76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/338398f1cb7106ce99627d71e1839a1616596a76/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
846,
771,
12,
6874,
4672,
3536,
5108,
279,
3286,
1807,
5686,
12123,
1446,
273,
4860,
3374,
12,
22,
13,
740,
23,
71,
2668,
2187,
1375,
6874,
9191,
28707,
364,
1043,
316,
1048,
12,
46,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
846,
771,
12,
6874,
4672,
3536,
5108,
279,
3286,
1807,
5686,
12123,
1446,
273,
4860,
3374,
12,
22,
13,
740,
23,
71,
2668,
2187,
1375,
6874,
9191,
28707,
364,
1043,
316,
1048,
12,
46,
3... |
sage: K = NumberField(x^3 - 2, 'a'); K | sage: K = NumberField(x^3 - 2); K | def is_CyclotomicField(x): return isinstance(x, NumberField_cyclotomic) | 43f8843c72a7b540aa8c8372f583216476d11299 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/43f8843c72a7b540aa8c8372f583216476d11299/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
17992,
830,
352,
24721,
974,
12,
92,
4672,
327,
1549,
12,
92,
16,
3588,
974,
67,
2431,
830,
352,
24721,
13,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
17992,
830,
352,
24721,
974,
12,
92,
4672,
327,
1549,
12,
92,
16,
3588,
974,
67,
2431,
830,
352,
24721,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
oldImagePage = wikipedia.Page(mysite, ns + ':' + oldImage) | oldImagePage = wikipedia.ImagePage(mysite, ns + ':' + oldImage) | def main(): oldImage = None newImage = None summary = '' always = False loose = False # read command line parameters for arg in wikipedia.handleArgs(): if arg == '-always': always = True elif arg == '-loose': loose = True elif arg.startswith('-summary'): if len(arg) == len('-summary'): summary = wikipedia.input(u'Choose an edit summary: ') else: summary = arg[len('-summary:'):] else: if oldImage: newImage = arg else: oldImage = arg if not oldImage: wikipedia.showHelp('image') else: mysite = wikipedia.getSite() ns = mysite.image_namespace() oldImagePage = wikipedia.Page(mysite, ns + ':' + oldImage) gen = pagegenerators.FileLinksGenerator(oldImagePage) preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = ImageRobot(preloadingGen, oldImage, newImage, summary, always, loose) bot.run() | 1c1122c0c04ca623ee142c83f739db1434c8c7f9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/1c1122c0c04ca623ee142c83f739db1434c8c7f9/image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1592,
2040,
273,
599,
394,
2040,
273,
599,
4916,
273,
875,
3712,
273,
1083,
28393,
273,
1083,
468,
855,
1296,
980,
1472,
364,
1501,
316,
21137,
18,
4110,
2615,
13332,
309,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1592,
2040,
273,
599,
394,
2040,
273,
599,
4916,
273,
875,
3712,
273,
1083,
28393,
273,
1083,
468,
855,
1296,
980,
1472,
364,
1501,
316,
21137,
18,
4110,
2615,
13332,
309,
1... |
return self.articles[title]['text'] | return self.articles[norm(title)]['text'] | def getRawArticle(self, title, revision=None): try: return self.articles[title]['text'] except KeyError: return None | f043320e646c4f2d323c7b9284ef98b6ee76ecda /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/f043320e646c4f2d323c7b9284ef98b6ee76ecda/test_zipcreator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10547,
7880,
12,
2890,
16,
2077,
16,
6350,
33,
7036,
4672,
775,
30,
327,
365,
18,
16462,
63,
7959,
12,
2649,
13,
23962,
955,
3546,
1335,
4999,
30,
327,
599,
225,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10547,
7880,
12,
2890,
16,
2077,
16,
6350,
33,
7036,
4672,
775,
30,
327,
365,
18,
16462,
63,
7959,
12,
2649,
13,
23962,
955,
3546,
1335,
4999,
30,
327,
599,
225,
2,
-100,
-100,
-100,
... |
return _('[hidden]') | return self._('[hidden]') | def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | b8b5dcad40d558bb420083124fa7c9603708cbf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b8b5dcad40d558bb420083124fa7c9603708cbf4/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7351,
12,
2890,
4672,
9163,
6987,
279,
315,
7446,
6,
4335,
434,
326,
1272,
9163,
309,
486,
365,
18,
291,
67,
1945,
67,
601,
13332,
327,
389,
2668,
63,
6345,
3864,
13,
2,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7351,
12,
2890,
4672,
9163,
6987,
279,
315,
7446,
6,
4335,
434,
326,
1272,
9163,
309,
486,
365,
18,
291,
67,
1945,
67,
601,
13332,
327,
389,
2668,
63,
6345,
3864,
13,
2,
-100,
-100,
... |
sage: [1,2,3] in T False | def Tableaux(n=None): """ Returns the combinatorial class of tableaux. If n is specified, then it returns the combinatorial class of all tableaux of size n. EXAMPLES:: sage: T = Tableaux(); T Tableaux sage: [[1,2],[3,4]] in T True sage: [[1,2],[3]] in T True sage: [1,2,3] in T False :: sage: T = Tableaux(4); T Tableaux of size 4 sage: [[1,2],[3,4]] in T True sage: [[1,2],[3]] in T False sage: [1,2,3] in T False """ if n == None: return Tableaux_all() else: return Tableaux_n(n) | 37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3555,
18196,
12,
82,
33,
7036,
4672,
3536,
2860,
326,
3894,
4240,
649,
667,
434,
1014,
18196,
18,
971,
290,
353,
1269,
16,
1508,
518,
1135,
326,
3894,
4240,
649,
667,
434,
777,
1014,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3555,
18196,
12,
82,
33,
7036,
4672,
3536,
2860,
326,
3894,
4240,
649,
667,
434,
1014,
18196,
18,
971,
290,
353,
1269,
16,
1508,
518,
1135,
326,
3894,
4240,
649,
667,
434,
777,
1014,
1... | |
has strides (3, 12, 1) and is compatible with NumpyArray<2, RGBValue<UInt8>, UnstridedArrayTag>. | has strides (3, 12, 1) and is compatible with NumpyArray<2, RGBValue<UInt8>, UnstridedArrayTag>. | def _array_docstring_(name, shape, compat): return ''' Constructor: .. method:: %(name)s(obj, dtype=numpy.float32, order='V', init = True, value = None) :param obj: a data or shape object (see below) :param dtype: desired element type :param order: desired memory layout (see below) :param init: True: initialize the image with zeros; False: do not initialize the image :type init: boolean :param value: initialize the image with this value (overrides init) :type value: convertible to dtype **obj** may be one of the following * If obj is a vigra.%(name)s or a subclass, a copy of obj with the given dtype and order is created, and obj's class is transferred. * If obj is a numpy.ndarray with compatible shape, a copy of obj with the given dtype, order and class vigra.%(name)s is created. * If obj is a sequence, it is interpreted as a shape. When the shape is compatible, a new vigra.%(name)s with the given dtype and order is created. * Otherwise, or if the shape is not compatible, an exception is raised. | 7142b8e8a5aa0e21c28f74980abb0be6e15b7601 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12582/7142b8e8a5aa0e21c28f74980abb0be6e15b7601/arraytypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1126,
67,
24675,
67,
12,
529,
16,
2179,
16,
4796,
4672,
327,
9163,
11417,
30,
225,
6116,
707,
2866,
8975,
529,
13,
87,
12,
2603,
16,
3182,
33,
15974,
18,
5659,
1578,
16,
1353,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1126,
67,
24675,
67,
12,
529,
16,
2179,
16,
4796,
4672,
327,
9163,
11417,
30,
225,
6116,
707,
2866,
8975,
529,
13,
87,
12,
2603,
16,
3182,
33,
15974,
18,
5659,
1578,
16,
1353,
2... |
if not char.canreach( target.char, 4 ): char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 ) return False | if target.char: if not char.canreach( target.char, 4 ): char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 ) return False | def response( char, args, target ): if skills.skilltable[ ARMSLORE ][ skills.UNHIDE ] and char.hidden: char.removefromview() char.hidden = False char.update() backpack = char.getbackpack() item = target.item if item: if not item.getoutmostchar() == char: top = item.getoutmostitem() if top.container and top.container.ischar(): top = top.container if not char.canreach(top, 4): char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 ) return False if isweapon( item ) or isarmor( item ) or isshield( item ): char.socket.settag( 'skill_delay', int( wolfpack.time.currenttime() + ARMSLORE_DELAY ) ) if not char.checkskill( ARMSLORE, 0, 1000 ): char.socket.clilocmessage( 0x7A281, "", 0x3b2, 3 ) return False char.socket.clilocmessage( 0x103319, "", 0x3b2, 3 ) condi = ( 10 * ( item.health / item.maxhealth ) ) if condi < 0: condi = 0 elif condi > 9: condi = 9 char.socket.clilocmessage( 1038285 + condi ) if isweapon( item ): layer_id = 0 if item.twohanded: layer_id = 1 mindamage = fromitem( item, MINDAMAGE ) maxdamage = fromitem( item, MAXDAMAGE ) avdamage = ( mindamage + maxdamage ) / 2 dmg_id = 9 * max( 0, min( int( avdamage / 5 ), 6 ) ) if itemcheck( item, ITEM_PIERCING ): char.socket.clilocmessage( 1038218 + layer_id + dmg_id ) elif itemcheck( item, ITEM_SLASHING ): char.socket.clilocmessage( 1038220 + layer_id + dmg_id ) elif itemcheck( item, ITEM_BASHING ): char.socket.clilocmessage( 1038222 + layer_id + dmg_id ) elif itemcheck( item, ITEM_RANGED ): char.socket.clilocmessage( 1038224 + dmg_id ) else: char.socket.clilocmessage( 1038216 + layer_id + dmg_id ) # check if poisoned if item.hastag( 'poisoning_uses' ): char.socket.clilocmessage( 1038284 ) else: armor = fromitem( item, RESISTANCE_PHYSICAL ) armor = armor + fromitem( item, RESISTANCE_FIRE ) armor = armor + fromitem( item, RESISTANCE_COLD ) armor = armor + fromitem( item, RESISTANCE_POISON ) armor = armor + fromitem( item, RESISTANCE_ENERGY ) arm_id = max( 0, min( int( armor / 5 ), 7 ) ) char.socket.clilocmessage( 1038295 + arm_id ) return True else: char.socket.clilocmessage( 0x7A280, "", 0x3b2, 3 ) return False else: if not char.canreach( target.char, 4 ): char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 ) return False if not char.distanceto ( target.char ) < 5: char.socket.clilocmessage( 0x7A27E, "", 0x3b2, 3 ) return False char.socket.clilocmessage( 0x7A280, "", 0x3b2, 3 ) return False | 51fa6f3f8b84ef0dc152b87275f04a0f0c4c7a78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/51fa6f3f8b84ef0dc152b87275f04a0f0c4c7a78/armslore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
766,
12,
1149,
16,
833,
16,
1018,
262,
30,
225,
309,
15667,
87,
18,
7771,
737,
2121,
63,
6052,
3537,
1502,
862,
308,
63,
15667,
87,
18,
2124,
44,
10385,
308,
471,
1149,
18,
6345,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
766,
12,
1149,
16,
833,
16,
1018,
262,
30,
225,
309,
15667,
87,
18,
7771,
737,
2121,
63,
6052,
3537,
1502,
862,
308,
63,
15667,
87,
18,
2124,
44,
10385,
308,
471,
1149,
18,
6345,
30,... |
self._imacopy = _imacopy | for attr in ('center','quat'): self._saw[attr] = 1 | def __init__(self, mols, _imacopy = False): print "warning: this extrude non-merging thing doesn't yet work, in fact it eats some of your mols" #### self._saw = {} # for initial debug only; see __getattr__ (dict of attrs we've delegated) self._imacopy = _imacopy # so far, just for debug msgs; might turn out to be useful for extrude to know, we'll see self._mols = [] try: mols = list(mols) except: mols = [mols] # kluge(?) -- let mols be a single mol or a list of them for mol in mols: self.merge(mol) | 87507b5d72c4f9e44bf4b021301509d805c1bf11 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/87507b5d72c4f9e44bf4b021301509d805c1bf11/extrudeMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
312,
3528,
16,
389,
381,
1077,
1101,
273,
1083,
4672,
1172,
315,
8551,
30,
333,
7582,
1317,
1661,
17,
6592,
1998,
7757,
3302,
1404,
4671,
1440,
16,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
312,
3528,
16,
389,
381,
1077,
1101,
273,
1083,
4672,
1172,
315,
8551,
30,
333,
7582,
1317,
1661,
17,
6592,
1998,
7757,
3302,
1404,
4671,
1440,
16,
316,
... |
self.assertEquals(len(self.GetActiveNotifications()), 0) | self.assertFalse(self.GetActiveNotifications()) | def testAllowOnPermissionInfobar(self): """Tries to create a notification and clicks allow on the infobar.""" self.NavigateToURL(self.TEST_PAGE_URL) # This notification should not be shown because we don't have permission. self._CreateHTMLNotification(self.NO_SUCH_URL) self.assertEquals(len(self.GetActiveNotifications()), 0) | 1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce/notifications.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
7009,
1398,
5041,
966,
3215,
12,
2890,
4672,
3536,
13652,
358,
752,
279,
3851,
471,
27659,
1699,
603,
326,
1123,
3215,
12123,
365,
18,
50,
20698,
774,
1785,
12,
2890,
18,
16961,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
7009,
1398,
5041,
966,
3215,
12,
2890,
4672,
3536,
13652,
358,
752,
279,
3851,
471,
27659,
1699,
603,
326,
1123,
3215,
12123,
365,
18,
50,
20698,
774,
1785,
12,
2890,
18,
16961,
67... |
if popup: popup.destroy() | def get_guide(popup=None, verbose=True, XMLTV_FILE=None): """ Get a TV guide from memory cache, file cache or raw XMLTV file. Tries to return at least the channels from the config file if there is no other data """ global cached_guide if not XMLTV_FILE: XMLTV_FILE = config.XMLTV_FILE # Can we use the cached version (if same as the file)? if (cached_guide == None or (os.path.isfile(XMLTV_FILE) and cached_guide.timestamp != os.path.getmtime(XMLTV_FILE))): # No, is there a pickled version ("file cache") in a file? pname = '%s/TV.xml.pickled' % config.FREEVO_CACHEDIR got_cached_guide = False if (os.path.isfile(XMLTV_FILE) and os.path.isfile(pname) and (os.path.getmtime(pname) > os.path.getmtime(XMLTV_FILE))): if verbose: _debug_('XMLTV, reading cached file (%s)' % pname) if popup: popup.show() cached_guide = util.read_pickle(pname) if popup: popup.destroy() epg_ver = None try: epg_ver = cached_guide.EPG_VERSION except AttributeError: if verbose: _debug_('EPG does not have a version number, must be reloaded') print dir(cached_guide) if epg_ver != epg_types.EPG_VERSION: if verbose: _debug_('EPG version missmatch, must be reloaded') elif cached_guide.timestamp != os.path.getmtime(XMLTV_FILE): # Hmmm, weird, there is a pickled file newer than the TV.xml # file, but the timestamp in it does not match the TV.xml # timestamp. We need to reload! if verbose: _debug_('EPG: Pickled file timestamp mismatch, reloading!') else: if verbose: _debug_('XMLTV, got cached guide (version %s).' % epg_ver) got_cached_guide = True if not got_cached_guide: # Need to reload the guide if popup: popup.show() if verbose: _debug_('XMLTV, trying to read raw file (%s)' % XMLTV_FILE) try: cached_guide = load_guide(verbose, XMLTV_FILE) except: # Don't violently crash on a incomplete or empty TV.xml please. cached_guide = None print print String(_("Couldn't load the TV Guide, got an exception!")) print traceback.print_exc() else: # Replace config.XMLTV_FILE before we save the pickle in order # to avoid timestamp confision. if XMLTV_FILE != config.XMLTV_FILE: shutil.copyfile(XMLTV_FILE, config.XMLTV_FILE) os.unlink(XMLTV_FILE) cached_guide.timestamp = os.path.getmtime(config.XMLTV_FILE) # Dump a pickled version for later reads util.save_pickle(cached_guide, pname) if not cached_guide: # An error occurred, return an empty guide cached_guide = epg_types.TvGuide() if popup: popup.destroy() return cached_guide | 0e05f1648449945068552ffa5a800db813a8fe15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/0e05f1648449945068552ffa5a800db813a8fe15/epg_xmltv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12118,
12,
16086,
33,
7036,
16,
3988,
33,
5510,
16,
3167,
15579,
67,
3776,
33,
7036,
4672,
3536,
968,
279,
399,
58,
7343,
628,
3778,
1247,
16,
585,
1247,
578,
1831,
3167,
1557... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
12118,
12,
16086,
33,
7036,
16,
3988,
33,
5510,
16,
3167,
15579,
67,
3776,
33,
7036,
4672,
3536,
968,
279,
399,
58,
7343,
628,
3778,
1247,
16,
585,
1247,
578,
1831,
3167,
1557... | |
if e.args[0] == 2013: | if e.args[0] in (2006, 2013): if c == 2: raise OperationalError(ErrorMessage(e)) | def _executeRetry(self, conn, cursor, query): while 1: try: if self.need_unicode: # For MysqlDB 1.2.1 and later, we go # encoding->unicode->charset (in the mysql db) myquery = unicode(query, self.encoding) return cursor.execute(myquery) else: return cursor.execute(query) except MySQLdb.OperationalError, e: if e.args[0] == 2013: # SERVER_LOST error if self.debug: self.printDebug(conn, str(e), 'ERROR') else: raise OperationalError(ErrorMessage(e)) except MySQLdb.IntegrityError, e: msg = ErrorMessage(e) if e.args[0] == 1062: raise DuplicateEntryError(msg) else: raise IntegrityError(msg) except MySQLdb.InternalError, e: raise InternalError(ErrorMessage(e)) except MySQLdb.ProgrammingError, e: raise ProgrammingError(ErrorMessage(e)) except MySQLdb.DataError, e: raise DataError(ErrorMessage(e)) except MySQLdb.NotSupportedError, e: raise NotSupportedError(ErrorMessage(e)) except MySQLdb.DatabaseError, e: raise DatabaseError(ErrorMessage(e)) except MySQLdb.InterfaceError, e: raise InterfaceError(ErrorMessage(e)) except MySQLdb.Warning, e: raise Warning(ErrorMessage(e)) except MySQLdb.Error, e: raise Error(ErrorMessage(e)) | bb9e0aa3ab22e008901a43fc137e06c593f329ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8798/bb9e0aa3ab22e008901a43fc137e06c593f329ea/mysqlconnection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
7539,
12,
2890,
16,
1487,
16,
3347,
16,
843,
4672,
1323,
404,
30,
775,
30,
309,
365,
18,
14891,
67,
9124,
30,
468,
2457,
26252,
2290,
404,
18,
22,
18,
21,
471,
5137,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
7539,
12,
2890,
16,
1487,
16,
3347,
16,
843,
4672,
1323,
404,
30,
775,
30,
309,
365,
18,
14891,
67,
9124,
30,
468,
2457,
26252,
2290,
404,
18,
22,
18,
21,
471,
5137,
16,
... |
@button.buttonAndHandler(_('Edit'), name='edit') def handle_edit(self, action): self.status = _(u"No changes made.") for subform in self.subforms: data, errors = subform.extractData() if errors: self.status = subform.formErrorsMessage return del data['delete'] self.context.before_update(subform.content, data) changes = subform.applyChanges(data) if changes: self.status = _(u"Successfully updated.") | def handle_delete(self, action): self.status = _(u"Please select items to delete.") | 46a969ae19c36c33e965f161a873fa4c481b4ced /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9844/46a969ae19c36c33e965f161a873fa4c481b4ced/crud.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3733,
12,
2890,
16,
1301,
4672,
365,
18,
2327,
273,
389,
12,
89,
6,
8496,
2027,
1516,
358,
1430,
1199,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3733,
12,
2890,
16,
1301,
4672,
365,
18,
2327,
273,
389,
12,
89,
6,
8496,
2027,
1516,
358,
1430,
1199,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
The comparision is based on the nummerical name of the device, which is the bus address for the device. """ if (long(self.data[0]["name"])) < other: | The comparision is based on the name of the device, which is the bus address for the device. """ if self.data[0]["name"] < other: | def __cmp__(self, other): """Compare device data widgets to other widgets (or anything). | 7097a4488bf2024658027b2a1b488d8cb08b4e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3093/7097a4488bf2024658027b2a1b488d8cb08b4e1c/amswidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
3536,
8583,
2346,
501,
10965,
358,
1308,
10965,
261,
280,
6967,
2934,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
3536,
8583,
2346,
501,
10965,
358,
1308,
10965,
261,
280,
6967,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"Distrito Federal": "America/Sao_Paulo", | def sortcountry(locs): return sorted(locs, cmp=lambda x,y: cmp(x.country, y.country)) | 1bbc56baf780450d24ff014e413b2bd01f8b602b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7981/1bbc56baf780450d24ff014e413b2bd01f8b602b/genlocationlist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
9082,
12,
24323,
4672,
327,
3115,
12,
24323,
16,
9411,
33,
14661,
619,
16,
93,
30,
9411,
12,
92,
18,
9082,
16,
677,
18,
9082,
3719,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1524,
9082,
12,
24323,
4672,
327,
3115,
12,
24323,
16,
9411,
33,
14661,
619,
16,
93,
30,
9411,
12,
92,
18,
9082,
16,
677,
18,
9082,
3719,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
manager.call(*options.args) | manager.cmd_call(*options.args) | def start(options, console): account = options.account settings = SIPSimpleSettings() engine = GreenEngine() engine.start_cfg(enable_sound=not options.disable_sound, log_level=settings.logging.pjsip_level if (settings.logging.trace_pjsip or options.trace_pjsip) else 0, trace_sip=settings.logging.trace_sip or options.trace_sip) try: if hasattr(options.account, "stun_servers") and len(options.account.stun_servers) > 0: engine.detect_nat_type(*options.account.stun_servers[0]) logstate.start_loggers(trace_engine=options.trace_engine) if isinstance(account, BonjourAccount): if engine.local_udp_port: print 'Local contact: %s:%s;transport=udp' % (account.contact, engine.local_udp_port) if engine.local_tcp_port: print 'Local contact: %s:%s;transport=tcp' % (account.contact, engine.local_tcp_port) if engine.local_tls_port: print 'Local contact: %s:%s;transport=tls' % (account.contact, engine.local_tls_port) MessageRenderer().start() session_manager = SessionManager() manager = ChatManager(engine, account, console) manager.update_prompt() try: print "Type :help to get information about commands and shortcuts" if not options.args: print 'Waiting for incoming SIP session requests...' else: try: manager.call(*options.args) except (UserCommandError, SessionStateError), ex: print str(ex) while True: try: readloop(console, manager, manager.get_shortcuts()) except EOF: if manager.current_session: manager.close_current_session() else: raise except BaseException, ex: # will print the exception myself, because finally section takes # time and maybe interrupted thus hiding the original exception if type(ex) is not EOF: import traceback traceback.print_exc() finally: console.copy_input_line() with calming_message(1, "Disconnecting the session(s)..."): manager.close() finally: with calming_message(1, "Disconnecting the session(s)..."): proc.waitall([proc.spawn(session.end) for session in SessionManager().sessions]) with calming_message(2, "Stopping the engine..."): engine.stop() api.sleep(0.1) | 70dafcbe86a3b853916ca8377c1ad04a98e54771 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/70dafcbe86a3b853916ca8377c1ad04a98e54771/sip_session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2116,
16,
2983,
4672,
2236,
273,
702,
18,
4631,
1947,
273,
348,
2579,
5784,
2628,
1435,
4073,
273,
17766,
4410,
1435,
4073,
18,
1937,
67,
7066,
12,
7589,
67,
29671,
33,
902,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2116,
16,
2983,
4672,
2236,
273,
702,
18,
4631,
1947,
273,
348,
2579,
5784,
2628,
1435,
4073,
273,
17766,
4410,
1435,
4073,
18,
1937,
67,
7066,
12,
7589,
67,
29671,
33,
902,
7... |
if 'lastSeconds' in reportRequest: try: lastSeconds = long( reportRequest[ 'lastSeconds' ] ) | if 'lastSeconds' in reportRequestExtra: try: lastSeconds = long( reportRequestExtra[ 'lastSeconds' ] ) | def __checkPlotRequest( self, reportRequest ): #Check sliding plots if 'lastSeconds' in reportRequest: try: lastSeconds = long( reportRequest[ 'lastSeconds' ] ) except: return S_ERROR( "lastSeconds key must be a number" ) if lastSeconds < 3600: return S_ERROR( "lastSeconds must be more than 3600" ) now = Time.toEpoch() reportRequest[ 'endTime' ] = now reportRequest[ 'startTime' ] = now - lastSeconds del( reportRequest[ 'lastSeconds' ] ) #Check keys for key in self.__reportRequestDict: if key == 'extraArgs' and key not in reportRequest: reportRequest[ key ] = {} if not key in reportRequest: return S_ERROR( 'Missing mandatory field %s in plot reques' % key ) requestKeyType = type( reportRequest[ key ] ) if key in ( 'startTime', 'endTime' ): if requestKeyType not in self.__reportRequestDict[ key ]: return S_ERROR( "Type mismatch for field %s (%s), required one of %s" % ( key, str(requestKeyType), str( self.__reportRequestDict[ key ] ) ) ) reportRequest[ key ] = int( Time.toEpoch( reportRequest[ key ] ) ) else: if requestKeyType != self.__reportRequestDict[ key ]: return S_ERROR( "Type mismatch for field %s (%s), required %s" % ( key, str(requestKeyType), str( self.__reportRequestDict[ key ] ) ) ) return S_OK( reportRequest ) | 5fd58af393cd30bf99a9e697e749344a229ad99b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/5fd58af393cd30bf99a9e697e749344a229ad99b/ReportGeneratorHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
11532,
691,
12,
365,
16,
2605,
691,
262,
30,
468,
1564,
2020,
10415,
17931,
309,
296,
2722,
6762,
11,
316,
2605,
691,
7800,
30,
775,
30,
1142,
6762,
273,
1525,
12,
2605,
69... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
11532,
691,
12,
365,
16,
2605,
691,
262,
30,
468,
1564,
2020,
10415,
17931,
309,
296,
2722,
6762,
11,
316,
2605,
691,
7800,
30,
775,
30,
1142,
6762,
273,
1525,
12,
2605,
69... |
header.append(mapping[2*i]+256*mapping[2*i+1]) | if sys.byteorder == 'big': header.append(256*mapping[2*i]+mapping[2*i+1]) else: header.append(mapping[2*i]+256*mapping[2*i+1]) | def _optimize_unicode(charset, fixup): charmap = [0]*65536 negate = 0 for op, av in charset: if op is NEGATE: negate = 1 elif op is LITERAL: charmap[fixup(av)] = 1 elif op is RANGE: for i in range(fixup(av[0]), fixup(av[1])+1): charmap[i] = 1 elif op is CATEGORY: # XXX: could expand category return charset # cannot compress if negate: for i in range(65536): charmap[i] = not charmap[i] comps = {} mapping = [0]*256 block = 0 data = [] for i in range(256): chunk = tuple(charmap[i*256:(i+1)*256]) new = comps.setdefault(chunk, block) mapping[i] = new if new == block: block += 1 data += _mk_bitmap(chunk) header = [block] assert MAXCODE == 65535 for i in range(128): header.append(mapping[2*i]+256*mapping[2*i+1]) data[0:0] = header return [(BIGCHARSET, data)] | 3550dd30bb8cb880840a4f1f492a7f3e9207cab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3550dd30bb8cb880840a4f1f492a7f3e9207cab9/sre_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
29155,
67,
9124,
12,
9999,
16,
2917,
416,
4672,
1149,
1458,
273,
306,
20,
5772,
26,
2539,
5718,
15626,
273,
374,
364,
1061,
16,
1712,
316,
4856,
30,
309,
1061,
353,
12901,
26316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
29155,
67,
9124,
12,
9999,
16,
2917,
416,
4672,
1149,
1458,
273,
306,
20,
5772,
26,
2539,
5718,
15626,
273,
374,
364,
1061,
16,
1712,
316,
4856,
30,
309,
1061,
353,
12901,
26316,
... |
if(order == None): | if order == None: | def process_header(data): """Processes the header.""" | a6feb1e5c52929a2b7bcc20a424e929b737f2517 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9355/a6feb1e5c52929a2b7bcc20a424e929b737f2517/wiki_grabber.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
3374,
12,
892,
4672,
3536,
10599,
326,
1446,
12123,
2,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
3374,
12,
892,
4672,
3536,
10599,
326,
1446,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
assert w_obj is not None if space.is_w(w_obj, space.w_None): | if w_obj is None: | def force(space, proxy): if not isinstance(proxy, W_Proxy): return proxy w_obj = proxy.dereference() assert w_obj is not None if space.is_w(w_obj, space.w_None): raise OperationError( space.w_ReferenceError, space.wrap("weakly referenced object no longer exists")) return w_obj | 8664d78738e75c047334f91a1106f2a6d30386d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/8664d78738e75c047334f91a1106f2a6d30386d0/interp__weakref.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2944,
12,
2981,
16,
2889,
4672,
309,
486,
1549,
12,
5656,
16,
678,
67,
3886,
4672,
327,
2889,
341,
67,
2603,
273,
2889,
18,
765,
73,
1134,
1435,
309,
341,
67,
2603,
353,
599,
30,
100... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2944,
12,
2981,
16,
2889,
4672,
309,
486,
1549,
12,
5656,
16,
678,
67,
3886,
4672,
327,
2889,
341,
67,
2603,
273,
2889,
18,
765,
73,
1134,
1435,
309,
341,
67,
2603,
353,
599,
30,
100... |
html = "<label for='%s'>%s</label>\n" % (self.name , super(BaseWidget,self).label) | html = "<label for='%s'>%s</label>\n" % (self.name , translate(super(BaseWidget,self).label, context=self.request)) | def __call__( self ): """Render the widget to HTML.""" value = self._getFormValue() html = "<label for='%s'>%s</label>\n" % (self.name , super(BaseWidget,self).label) if self.__required: html += "<span class='fieldRequired' title='%s' > %s </span>" % ( translate(_(u'title_required'),context=self.request), translate(_(u'title_required'),context=self.request)) if super(BaseWidget, self).hint: html += "<div class='formHelp'>%s</div>" % super(BaseWidget, self).hint if super(BaseWidget, self).error() != '': html += "<div>%s</div>" % super(BaseWidget, self).error() if value == 'on': kw = {'checked': 'checked'} else: kw = {} return "%s %s %s" % ( renderElement(self.tag, type='hidden', name=self.name+".used", id=self.name+".used", value="" ), renderElement(self.tag, type=self.type, name=self.name, id=self.name, cssClass=self.cssClass, extra=self.extra, value="on", **kw), html | f815367044b4876066e9603ab78072a7e423eea8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12236/f815367044b4876066e9603ab78072a7e423eea8/checkboxwidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
365,
262,
30,
3536,
3420,
326,
3604,
358,
3982,
12123,
460,
273,
365,
6315,
588,
1204,
620,
1435,
1729,
273,
3532,
1925,
364,
28713,
87,
11,
9822,
87,
1757,
1925,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
365,
262,
30,
3536,
3420,
326,
3604,
358,
3982,
12123,
460,
273,
365,
6315,
588,
1204,
620,
1435,
1729,
273,
3532,
1925,
364,
28713,
87,
11,
9822,
87,
1757,
1925,
... |
detail = ' var bounds = [%f,%f];\n' % (t0, tMax) detail += ' var d = [];\n' dfmt = ' d["%s"] = { n:"%s", p:"%s", c:[%s] };\n'; for p in data.dmesg: list = data.dmesg[p]['list'] for d in list: parent = data.deviceParentID(d, p) idlist = data.deviceChildrenIDs(d, p) idstr = "" for i in idlist: if(idstr == ""): idstr += '"'+i+'"' else: idstr += ', '+'"'+i+'"' detail += dfmt % (list[d]['id'], d, parent, idstr) | detail = ' var devtable = [];\n' for data in testruns: topo = data.deviceTopology() detail += ' devtable[%d] = "%s";\n' % (data.testnumber, topo) detail += ' var bounds = [%f,%f];\n' % (t0, tMax) | def addScriptCode(hf): global data t0 = (data.start - data.tSuspended) * 1000 tMax = (data.end - data.tSuspended) * 1000 # create an array in javascript memory with the device details detail = ' var bounds = [%f,%f];\n' % (t0, tMax) detail += ' var d = [];\n' dfmt = ' d["%s"] = { n:"%s", p:"%s", c:[%s] };\n'; for p in data.dmesg: list = data.dmesg[p]['list'] for d in list: parent = data.deviceParentID(d, p) idlist = data.deviceChildrenIDs(d, p) idstr = "" for i in idlist: if(idstr == ""): idstr += '"'+i+'"' else: idstr += ', '+'"'+i+'"' detail += dfmt % (list[d]['id'], d, parent, idstr) # add the code which will manipulate the data in the browser script_code = \ '<script type="text/javascript">\n'+detail+\ ' var filter = [];\n'\ ' var table = [];\n'\ ' function deviceParent(devid) {\n'\ ' var devlist = [];\n'\ ' if(filter.indexOf(devid) < 0) filter[filter.length] = devid;\n'\ ' if(d[devid].p in d)\n'\ ' devlist = deviceParent(d[devid].p);\n'\ ' else if(d[devid].p != "")\n'\ ' devlist = [d[devid].p];\n'\ ' devlist[devlist.length] = d[devid].n;\n'\ ' return devlist;\n'\ ' }\n'\ ' function deviceChildren(devid, column, row) {\n'\ ' if(!(devid in d)) return;\n'\ ' if(filter.indexOf(devid) < 0) filter[filter.length] = devid;\n'\ ' var cell = {name: d[devid].n, span: 1};\n'\ ' var span = 0;\n'\ ' if(column >= table.length) table[column] = [];\n'\ ' table[column][row] = cell;\n'\ ' for(var i = 0; i < d[devid].c.length; i++) {\n'\ ' var cid = d[devid].c[i];\n'\ ' span += deviceChildren(cid, column+1, row+span);\n'\ ' }\n'\ ' if(span == 0) span = 1;\n'\ ' table[column][row].span = span;\n'\ ' return span;\n'\ ' }\n'\ ' function deviceTree(devid, resume) {\n'\ ' var html = "<table border=1>";\n'\ ' filter = [];\n'\ ' table = [];\n'\ ' plist = deviceParent(devid);\n'\ ' var devidx = plist.length - 1;\n'\ ' for(var i = 0; i < devidx; i++)\n'\ ' table[i] = [{name: plist[i], span: 1}];\n'\ ' deviceChildren(devid, devidx, 0);\n'\ ' for(var i = 0; i < devidx; i++)\n'\ ' table[i][0].span = table[devidx][0].span;\n'\ ' for(var row = 0; row < table[0][0].span; row++) {\n'\ ' html += "<tr>";\n'\ ' for(var col = 0; col < table.length; col++)\n'\ ' if(row in table[col]) {\n'\ ' var cell = table[col][row];\n'\ ' var args = "";\n'\ ' if(cell.span > 1)\n'\ ' args += " rowspan="+cell.span;\n'\ ' if((col == devidx) && (row == 0))\n'\ ' args += " class=tdhl";\n'\ ' if(resume)\n'\ ' html += "<td"+args+">"+cell.name+" →</td>";\n'\ ' else\n'\ ' html += "<td"+args+">← "+cell.name+"</td>";\n'\ ' }\n'\ ' html += "</tr>";\n'\ ' }\n'\ ' html += "</table>";\n'\ ' return html;\n'\ ' }\n'\ ' function zoomTimeline() {\n'\ ' var timescale = document.getElementById("timescale");\n'\ ' var dmesg = document.getElementById("dmesg");\n'\ ' var zoombox = document.getElementById("dmesgzoombox");\n'\ ' var val = parseFloat(dmesg.style.width);\n'\ ' var newval = 100;\n'\ ' var sh = window.outerWidth / 2;\n'\ ' if(this.id == "zoomin") {\n'\ ' newval = val * 1.2;\n'\ ' if(newval > 40000) newval = 40000;\n'\ ' dmesg.style.width = newval+"%";\n'\ ' zoombox.scrollLeft = ((zoombox.scrollLeft + sh) * newval / val) - sh;\n'\ ' } else if (this.id == "zoomout") {\n'\ ' newval = val / 1.2;\n'\ ' if(newval < 100) newval = 100;\n'\ ' dmesg.style.width = newval+"%";\n'\ ' zoombox.scrollLeft = ((zoombox.scrollLeft + sh) * newval / val) - sh;\n'\ ' } else {\n'\ ' zoombox.scrollLeft = 0;\n'\ ' dmesg.style.width = "100%";\n'\ ' }\n'\ ' var html = "";\n'\ ' var t0 = bounds[0];\n'\ ' var tMax = bounds[1];\n'\ ' var tTotal = tMax - t0;\n'\ ' var wTotal = tTotal * 100.0 / newval;\n'\ ' for(var tS = 1000; (wTotal / tS) < 3; tS /= 10);\n'\ ' if(tS < 1) tS = 1;\n'\ ' for(var s = ((t0 / tS)|0) * tS; s < tMax; s += tS) {\n'\ ' var pos = (tMax - s) * 100.0 / tTotal;\n'\ ' var name = (s == 0)?"S/R":(s+"ms");\n'\ ' html += \"<div class=\\\"t\\\" style=\\\"right:\"+pos+\"%\\\">\"+name+\"</div>\";\n'\ ' }\n'\ ' timescale.innerHTML = html;\n'\ ' }\n'\ ' function deviceDetail() {\n'\ ' var devtitle = document.getElementById("devicedetail");\n'\ ' devtitle.innerHTML = "<h1>"+this.title+"</h1>";\n'\ ' var devtree = document.getElementById("devicetree");\n'\ ' devtree.innerHTML = deviceTree(this.id, (this.title.indexOf("resume") >= 0));\n'\ ' var cglist = document.getElementById("callgraphs");\n'\ ' if(!cglist) return;\n'\ ' var cg = cglist.getElementsByClassName("atop");\n'\ ' for (var i = 0; i < cg.length; i++) {\n'\ ' if(filter.indexOf(cg[i].id) >= 0) {\n'\ ' cg[i].style.display = "block";\n'\ ' } else {\n'\ ' cg[i].style.display = "none";\n'\ ' }\n'\ ' }\n'\ ' }\n'\ ' window.addEventListener("load", function () {\n'\ ' var dmesg = document.getElementById("dmesg");\n'\ ' dmesg.style.width = "100%"\n'\ ' document.getElementById("zoomin").onclick = zoomTimeline;\n'\ ' document.getElementById("zoomout").onclick = zoomTimeline;\n'\ ' document.getElementById("zoomdef").onclick = zoomTimeline;\n'\ ' var dev = dmesg.getElementsByClassName("thread");\n'\ ' for (var i = 0; i < dev.length; i++) {\n'\ ' dev[i].onclick = deviceDetail;\n'\ ' }\n'\ ' zoomTimeline();\n'\ ' });\n'\ '</script>\n' hf.write(script_code); | 0c52bda8f6c5785b5982bc3636b627b4ccd59c3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/0c52bda8f6c5785b5982bc3636b627b4ccd59c3f/analyze_suspend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3651,
1085,
12,
76,
74,
4672,
2552,
501,
225,
268,
20,
273,
261,
892,
18,
1937,
300,
501,
18,
88,
55,
22942,
13,
380,
4336,
268,
2747,
273,
261,
892,
18,
409,
300,
501,
18,
88... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3651,
1085,
12,
76,
74,
4672,
2552,
501,
225,
268,
20,
273,
261,
892,
18,
1937,
300,
501,
18,
88,
55,
22942,
13,
380,
4336,
268,
2747,
273,
261,
892,
18,
409,
300,
501,
18,
88... |
if not os.path.exists(dirname): | if dirname and not os.path.exists(dirname): print "Creating Folders: '%s'" % dirname | def new_decoded_pad(self, decoder, pad, is_last): if self.added_pad_already: return if "audio" not in pad.get_caps()[0].get_name(): return | fb263caf044aa99ff978564e088e8ab6a2b54428 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2369/fb263caf044aa99ff978564e088e8ab6a2b54428/soundconverter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
26646,
67,
6982,
12,
2890,
16,
8320,
16,
4627,
16,
353,
67,
2722,
4672,
309,
365,
18,
9665,
67,
6982,
67,
17583,
30,
327,
309,
315,
11509,
6,
486,
316,
4627,
18,
588,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
26646,
67,
6982,
12,
2890,
16,
8320,
16,
4627,
16,
353,
67,
2722,
4672,
309,
365,
18,
9665,
67,
6982,
67,
17583,
30,
327,
309,
315,
11509,
6,
486,
316,
4627,
18,
588,
67,
... |
del names["__builtins__"] | if names.has_key("__builtins__"): del names["__builtins__"] | def check_all(modname): names = {} try: exec "import %s" % modname in names except ImportError: # silent fail here seems the best route since some modules # may not be available in all environments return verify(hasattr(sys.modules[modname], "__all__"), "%s has no __all__ attribute" % modname) names = {} exec "from %s import *" % modname in names del names["__builtins__"] keys = names.keys() keys.sort() all = list(sys.modules[modname].__all__) # in case it's a tuple all.sort() verify(keys==all, "%s != %s" % (keys, all)) | f4e0faab048eef5b6838e9f7d76f90c7d144edd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f4e0faab048eef5b6838e9f7d76f90c7d144edd3/test___all__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
454,
12,
1711,
529,
4672,
1257,
273,
2618,
775,
30,
1196,
315,
5666,
738,
87,
6,
738,
16037,
316,
1257,
1335,
11308,
30,
468,
10404,
2321,
2674,
12001,
326,
3796,
1946,
3241,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
454,
12,
1711,
529,
4672,
1257,
273,
2618,
775,
30,
1196,
315,
5666,
738,
87,
6,
738,
16037,
316,
1257,
1335,
11308,
30,
468,
10404,
2321,
2674,
12001,
326,
3796,
1946,
3241,
... |
elif SCons.Util.is_Sequence(d): | elif is_Sequence(d): | def _action(target, source, env): # prepare the line separator linesep = env['LINESEPARATOR'] if linesep is None: linesep = os.linesep elif is_String(linesep): pass elif isinstance(linesep, Value): linesep = linesep.get_text_contents() else: raise SCons.Errors.UserError( 'unexpected type/class for LINESEPARATOR: %s' % repr(linesep), None) # create a dictionary to use for the substitutions if not env.has_key('SUBST_DICT'): subs = None # no substitutions else: d = env['SUBST_DICT'] if SCons.Util.is_Dict(d): d = d.items() elif SCons.Util.is_Sequence(d): pass else: raise SCons.Errors.UserError('SUBST_DICT must be dict or sequence') subs = [] for (k,v) in d: if callable(v): v = v() if SCons.Util.is_String(v): v = env.subst(v) else: v = str(v) subs.append((k,v)) # write the file try: fd = open(target[0].get_path(), "w") except (OSError,IOError), e: raise SCons.Errors.UserError("Can't write target file %s" % target[0]) # separate lines by 'linesep' only if linesep is not empty lsep = None for s in source: if lsep: fd.write(lsep) fd.write(_do_subst(s, subs)) lsep = linesep fd.close() | bdbff6e7b39938e660b9afad2cb330055c8cb93a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12817/bdbff6e7b39938e660b9afad2cb330055c8cb93a/textfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1128,
12,
3299,
16,
1084,
16,
1550,
4672,
468,
2911,
326,
980,
4182,
24223,
273,
1550,
3292,
5997,
4550,
3546,
309,
24223,
353,
599,
30,
24223,
273,
1140,
18,
3548,
881,
1327,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1128,
12,
3299,
16,
1084,
16,
1550,
4672,
468,
2911,
326,
980,
4182,
24223,
273,
1550,
3292,
5997,
4550,
3546,
309,
24223,
353,
599,
30,
24223,
273,
1140,
18,
3548,
881,
1327,
353,
... |
if is_accepter_started(): | if not node_reset_config['reset_accepter'] and is_accepter_started(): | def start_accepter(): shimstack = ShimStackInterface('(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're done, return the name! return myname else: for possibleport in configuration['ports']: try: servicelogger.log("[INFO]: Trying to wait") shimstack.waitforconn(unique_id, possibleport, nmconnectionmanager.connection_handler) except Exception, e: servicelogger.log("[ERROR]: when calling waitforconn for the connection_handler: " + str(e)) servicelogger.log_last_exception() else: # the waitforconn was completed so the acceptor is started acceptor_state['lock'].acquire() acceptor_state['started']= True acceptor_state['lock'].release() # assign the nodemanager name myname = unique_id + ":" + str(possibleport) servicelogger.log("[INFO]: Now listening as " + myname) break else: servicelogger.log("[ERROR]: cannot find a port for waitforconn.") # check infrequently time.sleep(configuration['pollfrequency']) | 234c1f93c0c2f1d6cd3d0edf3d746b9359bf1110 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/234c1f93c0c2f1d6cd3d0edf3d746b9359bf1110/nmmain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
9436,
264,
13332,
225,
17555,
3772,
273,
2638,
381,
2624,
1358,
2668,
12,
23779,
1799,
3585,
1555,
381,
2506,
13,
225,
3089,
67,
350,
273,
14771,
67,
482,
856,
67,
869,
67,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
9436,
264,
13332,
225,
17555,
3772,
273,
2638,
381,
2624,
1358,
2668,
12,
23779,
1799,
3585,
1555,
381,
2506,
13,
225,
3089,
67,
350,
273,
14771,
67,
482,
856,
67,
869,
67,
10... |
self.errorOut("error, value is not 8bit: %s" %val) | self.errorExit("error, value is not 8bit: %s" %val) | def val2percent(self, val): if len(val) != 2: self.errorOut("error, value is not 8bit: %s" %val) | ed330f6b89df5e36da27e444855e0b166dc9eda1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10061/ed330f6b89df5e36da27e444855e0b166dc9eda1/knxmonitor_decoder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1244,
22,
8849,
12,
2890,
16,
1244,
4672,
225,
309,
562,
12,
1125,
13,
480,
576,
30,
365,
18,
1636,
1182,
2932,
1636,
16,
460,
353,
486,
1725,
3682,
30,
738,
87,
6,
738,
1125,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1244,
22,
8849,
12,
2890,
16,
1244,
4672,
225,
309,
562,
12,
1125,
13,
480,
576,
30,
365,
18,
1636,
1182,
2932,
1636,
16,
460,
353,
486,
1725,
3682,
30,
738,
87,
6,
738,
1125,
13,
... |
Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)).start() | self._addThread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)) self._waitThreads() self.assertEqual(self.done.get_nowait(), 'DONE') self.GL.acquire(locking.LEVEL_INSTANCE, ['i3']) self._addThread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)) self._waitThreads() self.assertEqual(self.done.get_nowait(), 'DONE') self._addThread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i3', 1)) self.assertRaises(Queue.Empty, self.done.get_nowait) self.GL.release(locking.LEVEL_INSTANCE) self._waitThreads() self.assertEqual(self.done.get_nowait(), 'DONE') self.GL.acquire(locking.LEVEL_INSTANCE, ['i2'], shared=1) self._addThread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 1)) self._waitThreads() self.assertEqual(self.done.get_nowait(), 'DONE') self._addThread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 0)) self.assertRaises(Queue.Empty, self.done.get_nowait) self.GL.release(locking.LEVEL_INSTANCE) self._waitThreads() | def testConcurrency(self): self.GL.acquire(locking.LEVEL_CLUSTER, ['BGL'], shared=1) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') self.GL.acquire(locking.LEVEL_INSTANCE, ['i3']) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i1', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i3', 1)).start() self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.GL.release(locking.LEVEL_INSTANCE) self.assertEqual(self.done.get(True, 1), 'DONE') self.GL.acquire(locking.LEVEL_INSTANCE, ['i2'], shared=1) Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 1)).start() self.assertEqual(self.done.get(True, 1), 'DONE') Thread(target=self._doLock, args=(locking.LEVEL_INSTANCE, 'i2', 0)).start() self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.GL.release(locking.LEVEL_INSTANCE) self.assertEqual(self.done.get(True, 1), 'DONE') | 4607c978b8f973b63c49547f1b8d6061fdbd78d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/4607c978b8f973b63c49547f1b8d6061fdbd78d3/ganeti.locking_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18273,
12,
2890,
4672,
365,
18,
11261,
18,
1077,
1039,
12,
739,
310,
18,
10398,
67,
5017,
23069,
16,
10228,
38,
11261,
17337,
5116,
33,
21,
13,
365,
6315,
1289,
3830,
12,
3299,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18273,
12,
2890,
4672,
365,
18,
11261,
18,
1077,
1039,
12,
739,
310,
18,
10398,
67,
5017,
23069,
16,
10228,
38,
11261,
17337,
5116,
33,
21,
13,
365,
6315,
1289,
3830,
12,
3299,
3... |
asm.setid("animal", 1000) asm.setid("adoption", 1000) | def tocurrency(s): if s.strip() == "": return 0.0 s = s.replace("$", "") try: return float(s) except: return 0.0 | c3b4bf95871b6d378043eb65202d9eee1d553772 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/194/c3b4bf95871b6d378043eb65202d9eee1d553772/org_dc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
7095,
12,
87,
4672,
309,
272,
18,
6406,
1435,
422,
1408,
30,
327,
374,
18,
20,
272,
273,
272,
18,
2079,
2932,
8,
3113,
1408,
13,
775,
30,
327,
1431,
12,
87,
13,
1335,
30,
327,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
7095,
12,
87,
4672,
309,
272,
18,
6406,
1435,
422,
1408,
30,
327,
374,
18,
20,
272,
273,
272,
18,
2079,
2932,
8,
3113,
1408,
13,
775,
30,
327,
1431,
12,
87,
13,
1335,
30,
327,... | |
import re _userprog = re.compile('^([^@]*)@(.*)$') | import re _userprog = re.compile('^([^@]*)@(.*)$') | def splituser(host): global _userprog if _userprog is None: import re _userprog = re.compile('^([^@]*)@(.*)$') match = _userprog.match(host) if match: return match.group(1, 2) return None, host | 7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
1355,
12,
2564,
4672,
2552,
389,
1355,
14654,
309,
389,
1355,
14654,
353,
599,
30,
1930,
283,
389,
1355,
14654,
273,
283,
18,
11100,
2668,
66,
8178,
36,
15471,
36,
14361,
8,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
1355,
12,
2564,
4672,
2552,
389,
1355,
14654,
309,
389,
1355,
14654,
353,
599,
30,
1930,
283,
389,
1355,
14654,
273,
283,
18,
11100,
2668,
66,
8178,
36,
15471,
36,
14361,
8,
6134,
... |
def runPerfSuite(options): | def runPerfTests(options, testlist=None): | def runPerfSuite(options): """ Run the Performance Test Suite """ # XXX need to log the full output to intermediate file so that we can # XXX first show the condensed form, sleep for 5 seconds, and cat the # XXX full log (like do_tests.sh does). failed = False savePWD = os.getcwd() try: if 'release' in options.modes: testlist = [] testlistLarge = [] if not options.dryrun: os.chdir(options.chandlerHome) for item in glob.glob(os.path.join(options.profileDir, '__repository__.0*')): if os.path.isdir(item): build_lib.rmdirs(item) else: os.remove(item) for item in glob.glob(os.path.join(options.chandlerHome, 'tools', 'QATestScripts', 'Performance', 'Perf*.py')): if 'PerfLargeData' in item: testlistLarge.append(item) else: testlist.append(item) # small repo tests failed = runScriptPerfTests(options, testlist) # large repo tests if not failed or options.noStop: if runScriptPerfTests(options, testlistLarge, largeData=True): failed = True # startup tests if not failed or options.noStop: if os.name == 'nt' or sys.platform == 'cygwin': t = 'time.exe' elif sys.platform == 'darwin': t = 'gtime' if not build_lib.getCommand(['which', t]): log('%s not found, skipping startup performance tests' % t) log('NOTE: %s is not part of OS X, you need to compile one' + \ 'yourself (get source from http://directory.fsf.org/time.html)' + \ 'or get it from darwinports project.' % t) else: t = '/usr/bin/time' if runStartupPerfTests(options, t): failed = True if not failed: # Don't continue even if noStop, almost certain these won't work if runStartupPerfTests(options, t, largeData=True): failed = True else: log('Skipping Performance Tests - release mode not specified') finally: os.chdir(savePWD) return failed | 4272128dba31ee83ec0437dd8cb2441e28a3495b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/4272128dba31ee83ec0437dd8cb2441e28a3495b/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
22016,
14650,
12,
2116,
16,
1842,
1098,
33,
7036,
4672,
3536,
1939,
326,
11217,
1359,
7766,
348,
9519,
3536,
468,
11329,
1608,
358,
613,
326,
1983,
876,
358,
12110,
585,
1427,
716,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
22016,
14650,
12,
2116,
16,
1842,
1098,
33,
7036,
4672,
3536,
1939,
326,
11217,
1359,
7766,
348,
9519,
3536,
468,
11329,
1608,
358,
613,
326,
1983,
876,
358,
12110,
585,
1427,
716,
... |
(list) a list of lists of length 3, each holding the | (list) A list of lists of length 3, each holding the | def points(self): """ Return a list of the generating points in this Mordell-Weil group. | 1cc4edc9aafb88d044d853b60331d1432546cf60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1cc4edc9aafb88d044d853b60331d1432546cf60/interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3143,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
326,
12516,
3143,
316,
333,
490,
517,
1165,
17,
3218,
330,
1041,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3143,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
326,
12516,
3143,
316,
333,
490,
517,
1165,
17,
3218,
330,
1041,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if package: display_pkg_data(herd, handler) else: display_dev_data(herd, handler) return 0 def herdstat(herds): """display statistics about given herd(s)/dev(s)""" if os.environ.has_key('HERDS'): herds_xml = get_herds_xml(os.environ['HERDS']) else: print "HERDS environment variable is not set." print "Attempting to retrieve herds.xml from http://www.gentoo.org/." herds_xml = get_herds_xml(herds_url) if herds_xml == None: return 1 handler = parse_xml(Herds_XML(), herds_xml) if handler == None: return 1 herds_xml.close() for herd in herds: if display_herd_data(herd, handler) != 0: return 1 if herd != herds[-1]: print '\n' return 0 if __name__ == '__main__': from getopt import gnu_getopt,GetoptError if len(sys.argv) == 1: print_usage() sys.exit(1) try: opts,args = gnu_getopt(sys.argv[1:], "hvp", ["help","verbose","package"]) except GetoptError: print_usage() sys.exit(1) verbose = False package = False for o, a in opts: if o in ("-v", "--verbose"): verbose = True if o in ("-h", "--help"): print_usage() sys.exit(0) if o in ("-p", "--package"): package = True sys.exit(herdstat(args)) | def endElement(self, tag): if tag == "herd": self._inside_herd="No" if tag == "name" and self._inside_maintainer == "No": self._inside_herd_name="No" if tag == "email" and self._inside_maintainer == "No": self._inside_herd_email="No" if tag == "description" and self._inside_maintainer == "No": self._inside_herd_desc="No" if tag == "maintainer": self._inside_maintainer="No" if tag == "email" and self._inside_maintainer == "Yes": self._inside_maintainer_email="No" if tag == "name" and self._inside_maintainer == "Yes": self._inside_maintainer_name="No" if tag == "role": self._inside_maintainer_role="No" def characters(self, contents): if self._inside_herd_name == "Yes": self._current_herd = contents self._herds[contents] = {} if self._inside_herd_desc == "Yes": self._descs[self._current_herd] = contents if self._inside_maintainer_email == "Yes": self._current_dev = contents self._herds[self._current_herd][contents]=[] if self._inside_maintainer_name == "Yes": self._herds[self._current_herd][self._current_dev].append(contents) if self._inside_maintainer_role == "Yes": self._herds[self._current_herd][self._current_dev].append(contents) | def display_herd_data(herd, handler): """Display herd statistics for the specified herd""" # does herd exist? if not handler._herds.has_key(herd): print "Herd '%s' was not found in herds.xml." % herd return 1 print format("Herd", herd) print format("Description", handler._descs[herd]) if package: display_pkg_data(herd, handler) else: display_dev_data(herd, handler) return 0 | 9192ad127a74c44eb6c32ae70ef1cead0367aa1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2297/9192ad127a74c44eb6c32ae70ef1cead0367aa1d/portage_herds.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
1614,
72,
67,
892,
12,
1614,
72,
16,
1838,
4672,
3536,
4236,
22336,
72,
7691,
364,
326,
1269,
22336,
72,
8395,
225,
468,
1552,
22336,
72,
1005,
35,
309,
486,
1838,
6315,
1614... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
1614,
72,
67,
892,
12,
1614,
72,
16,
1838,
4672,
3536,
4236,
22336,
72,
7691,
364,
326,
1269,
22336,
72,
8395,
225,
468,
1552,
22336,
72,
1005,
35,
309,
486,
1838,
6315,
1614... |
def lock(tmp_dir, timeout = 60, min_wait = 5, max_wait = 10, verbosity = 0): | def lock(tmp_dir, timeout=60, min_wait=5, max_wait=10, verbosity=0): | def lock(tmp_dir, timeout = 60, min_wait = 5, max_wait = 10, verbosity = 0): """ Obtain lock access by creating a given temporary directory (whose base will be created if needed, but will not be deleted after the lock is removed). If access is refused by the same lock owner during more than 'timeout' seconds, then the current lock is overridden. If timeout is None, then no timeout is performed. The lock is performed by creating a 'lock' file in 'tmp_dir' that contains a unique id identifying the owner of the lock (the process id, followed by a random string). When there is already a lock, the process sleeps for a random amount of time between min_wait and max_wait seconds before trying again. If 'verbosity' is >= 1, then a message will be displayed when we need to wait for the lock. If it is set to a value >1, then this message will be displayed each time we re-check for the presence of the lock. Otherwise it is displayed only when we notice the lock's owner has changed. @param tmp_dir: lock directory that will be created when acquiring the lock @type tmp_dir: string @param timeout: time (in seconds) to wait before replacing an existing lock @type timeout: int @param min_wait: minimum time (in seconds) to wait before trying again to get the lock @type min_wait: int @param max_wait: maximum time (in seconds) to wait before trying again to get the lock @type max_wait: int @param verbosity: amount of feedback displayed to screen @type verbosity: int """ # Create base of lock directory if required. base_lock = os.path.basename(tmp_dir) if not os.path.isdir(base_lock): try: os.makedirs(base_lock) except: # Someone else was probably trying to create it at the same time. # We wait two seconds just to make sure the following assert does # not fail on some NFS systems. os.sleep(2) assert os.path.isdir(base_lock) # Variable initialization. lock_file = os.path.join(tmp_dir, 'lock') random.seed() unique_id = '%s_%s' % (os.getpid(), ''.join([str(random.randint(0,9)) for i in range(10)])) no_display = (verbosity == 0) # Acquire lock. while True: try: last_owner = 'no_owner' time_start = time.time() while os.path.isdir(tmp_dir): try: read_owner = open(lock_file).readlines()[0].strip() except: read_owner = 'failure' if last_owner == read_owner: if timeout is not None and time.time() - time_start >= timeout: # Timeout exceeded. break else: last_owner = read_owner time_start = time.time() no_display = (verbosity == 0) if not no_display: print 'Waiting for existing lock by %s (I am %s)' % ( read_owner, unique_id) if verbosity <= 1: no_display = True time.sleep(random.uniform(min_wait, max_wait)) try: os.mkdir(tmp_dir) except: # Error while creating the directory: someone else must have tried # at the exact same time. continue # Safety check: the directory should be here. assert os.path.isdir(tmp_dir) # Write own id into lock file. lock_write = open(lock_file, 'w') lock_write.write(unique_id + '\n') lock_write.close() # Verify we are really the lock owner (this should not be needed, # but better be safe than sorry). owner = open(lock_file).readlines()[0].strip() if owner != unique_id: # Too bad, try again. continue else: # We got the lock, hoorray! return except: # If something wrong happened, we try again. raise continue | 2be4d824287329a2fa216c5b1c5463b33950738c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/2be4d824287329a2fa216c5b1c5463b33950738c/compilelock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2176,
12,
5645,
67,
1214,
16,
2021,
33,
4848,
16,
1131,
67,
7048,
33,
25,
16,
943,
67,
7048,
33,
2163,
16,
11561,
33,
20,
4672,
3536,
24850,
2176,
2006,
635,
4979,
279,
864,
6269,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2176,
12,
5645,
67,
1214,
16,
2021,
33,
4848,
16,
1131,
67,
7048,
33,
25,
16,
943,
67,
7048,
33,
2163,
16,
11561,
33,
20,
4672,
3536,
24850,
2176,
2006,
635,
4979,
279,
864,
6269,
18... |
self._close_callback(id) def _close_callback(self, id): | def _no_longer_opened(self, id): try: del self._channels[id] except KeyError: pass self._close_callback(id) | a5bfb8e501203c8e51497d9683602631bf98cb56 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7009/a5bfb8e501203c8e51497d9683602631bf98cb56/gateway_base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2135,
67,
9379,
693,
67,
25304,
12,
2890,
16,
612,
4672,
775,
30,
1464,
365,
6315,
9114,
63,
350,
65,
1335,
4999,
30,
1342,
365,
6315,
4412,
67,
3394,
12,
350,
13,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2135,
67,
9379,
693,
67,
25304,
12,
2890,
16,
612,
4672,
775,
30,
1464,
365,
6315,
9114,
63,
350,
65,
1335,
4999,
30,
1342,
365,
6315,
4412,
67,
3394,
12,
350,
13,
2,
-100,
-100... | |
"""Calculate RMSD from a given MSD.""" | """Calculate RMSD from a given MSD. """ | def calc_rmsd(msd): """Calculate RMSD from a given MSD.""" if msd < 0.0: return 0.0 return math.sqrt(msd) | 0af2bbd2f823c142ced4a1951f7ce02d646d6905 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10674/0af2bbd2f823c142ced4a1951f7ce02d646d6905/TLS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
29716,
72,
12,
959,
72,
4672,
3536,
8695,
534,
3537,
40,
628,
279,
864,
9238,
40,
18,
3536,
309,
4086,
72,
411,
374,
18,
20,
30,
327,
374,
18,
20,
327,
4233,
18,
24492,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
29716,
72,
12,
959,
72,
4672,
3536,
8695,
534,
3537,
40,
628,
279,
864,
9238,
40,
18,
3536,
309,
4086,
72,
411,
374,
18,
20,
30,
327,
374,
18,
20,
327,
4233,
18,
24492,
1... |
if not requestObject: | self.request = requestObject if not self.request: | def __init__(self,requestObject=False): """ Constructor function, must specify request object to instantiate FailoverTransfer. """ self.log = gLogger.getSubLogger( "FailoverTransfer" ) self.rm = ReplicaManager() if not requestObject: self.request = RequestContainer() self.request.setRequestName('default_request.xml') self.request.setSourceComponent('FailoverTransfer') self.request = requestObject | f3b16a5bf91decd4625c0cf4f9b7d4e2523d66fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/f3b16a5bf91decd4625c0cf4f9b7d4e2523d66fa/FailoverTransfer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2293,
921,
33,
8381,
4672,
3536,
11417,
445,
16,
1297,
4800,
590,
733,
358,
10275,
8911,
1643,
5912,
18,
3536,
365,
18,
1330,
273,
314,
3328,
18,
588,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2293,
921,
33,
8381,
4672,
3536,
11417,
445,
16,
1297,
4800,
590,
733,
358,
10275,
8911,
1643,
5912,
18,
3536,
365,
18,
1330,
273,
314,
3328,
18,
588,
16... |
class reference: | class Reference: | def isresource(filename): "Is the specifired name a resource?" (root, ext) = os.path.splitext(filename) return ext and ext[1:] in resource_extensions | 62fd356284c4417edfc1b352313444f738cf4666 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9355/62fd356284c4417edfc1b352313444f738cf4666/wmltools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
3146,
12,
3459,
4672,
315,
2520,
326,
857,
430,
2921,
508,
279,
1058,
7225,
261,
3085,
16,
1110,
13,
273,
1140,
18,
803,
18,
4939,
408,
12,
3459,
13,
327,
1110,
471,
1110,
63,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
3146,
12,
3459,
4672,
315,
2520,
326,
857,
430,
2921,
508,
279,
1058,
7225,
261,
3085,
16,
1110,
13,
273,
1140,
18,
803,
18,
4939,
408,
12,
3459,
13,
327,
1110,
471,
1110,
63,
2... |
x, y, resolution2, resolution1 = bb.x, bb.y, bb.height, bb.width | x, y, height, width = bb.x, bb.y, bb.height, bb.width | def imagecapture(self, window_name = None, x = 0, y = 0, width = None, height = None): ''' Captures screenshot of the whole desktop or given window @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param x: x co-ordinate value @type x: int @param y: y co-ordinate value @type y: int @param width: width co-ordinate value @type width: int @param height: height co-ordinate value @type height: int | ff746be08b5d982d2599f56ebe1f94cbebc66c8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/ff746be08b5d982d2599f56ebe1f94cbebc66c8f/generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1316,
19250,
12,
2890,
16,
2742,
67,
529,
273,
599,
16,
619,
273,
374,
16,
677,
273,
374,
16,
1835,
273,
599,
16,
2072,
273,
599,
4672,
9163,
385,
1657,
1823,
17179,
434,
326,
7339,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1316,
19250,
12,
2890,
16,
2742,
67,
529,
273,
599,
16,
619,
273,
374,
16,
677,
273,
374,
16,
1835,
273,
599,
16,
2072,
273,
599,
4672,
9163,
385,
1657,
1823,
17179,
434,
326,
7339,
... |
if currency.company_id.id != company_id: | if currency.company_id and currency.company_id.id != company_id: | def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id): val = {} dom = {} obj_journal = self.pool.get('account.journal') if company_id and part_id and type: acc_id = False partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) if partner_obj.property_account_payable and partner_obj.property_account_receivable: if partner_obj.property_account_payable.company_id.id != company_id and partner_obj.property_account_receivable.company_id.id != company_id: property_obj = self.pool.get('ir.property') rec_pro_id = property_obj.search(cr, uid, [('name','=','property_account_receivable'),('res_id','=','res.partner,'+str(part_id)+''),('company_id','=',company_id)]) pay_pro_id = property_obj.search(cr, uid, [('name','=','property_account_payable'),('res_id','=','res.partner,'+str(part_id)+''),('company_id','=',company_id)]) if not rec_pro_id: rec_pro_id = property_obj.search(cr, uid, [('name','=','property_account_receivable'),('company_id','=',company_id)]) if not pay_pro_id: pay_pro_id = property_obj.search(cr, uid, [('name','=','property_account_payable'),('company_id','=',company_id)]) rec_line_data = property_obj.read(cr, uid, rec_pro_id, ['name','value','res_id']) pay_line_data = property_obj.read(cr, uid, pay_pro_id, ['name','value','res_id']) rec_res_id = rec_line_data and int(rec_line_data[0]['value'].split(',')[1]) or False pay_res_id = pay_line_data and int(pay_line_data[0]['value'].split(',')[1]) or False if not rec_res_id and not pay_res_id: raise osv.except_osv(_('Configuration Error !'), _('Can not find account chart for this company, Please Create account.')) if type in ('out_invoice', 'out_refund'): acc_id = rec_res_id else: acc_id = pay_res_id val= {'account_id': acc_id} account_obj = self.pool.get('account.account') if ids: if company_id: inv_obj = self.browse(cr,uid,ids) for line in inv_obj[0].invoice_line: if line.account_id: if line.account_id.company_id.id != company_id: result_id = account_obj.search(cr, uid, [('name','=',line.account_id.name),('company_id','=',company_id)]) if not result_id: raise osv.except_osv(_('Configuration Error !'), _('Can not find account chart for this company in invoice line account, Please Create account.')) r_id = self.pool.get('account.invoice.line').write(cr, uid, [line.id], {'account_id': result_id[0]}) else: if invoice_line: for inv_line in invoice_line: obj_l = account_obj.browse(cr, uid, inv_line[2]['account_id']) if obj_l.company_id.id != company_id: raise osv.except_osv(_('Configuration Error !'), _('invoice line account company is not match with invoice company.')) else: continue if company_id and type: if type in ('out_invoice', 'out_refund'): journal_type = 'sale' else: journal_type = 'purchase' journal_ids = obj_journal.search(cr, uid, [('company_id','=',company_id), ('type', '=', journal_type)]) if journal_ids: val['journal_id'] = journal_ids[0] else: raise osv.except_osv(_('Configuration Error !'), _('Can not find account journal for this company in invoice, Please Create journal.')) dom = {'journal_id': [('id', 'in', journal_ids)]} else: journal_ids = obj_journal.search(cr, uid, []) | 195ac98256e35e49c13c668ec5ff8378f65a0527 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/195ac98256e35e49c13c668ec5ff8378f65a0527/invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
16840,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
9395,
67,
350,
16,
1087,
67,
350,
16,
618,
16,
9179,
67,
1369,
16,
5462,
67,
350,
4672,
1244,
273,
2618,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
16840,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
9395,
67,
350,
16,
1087,
67,
350,
16,
618,
16,
9179,
67,
1369,
16,
5462,
67,
350,
4672,
1244,
273,
2618,
... |
_actions = {} _objects_and_text_that_need_fixing_later = [] def fix_whatsthis_text_and_links(parent, refix_later = (), debug_cutoff = 0): | _actions = {} _objects_and_text_that_need_fixing_later = [] def fix_whatsthis_text_and_links(parent, refix_later = (), debug_cutoff = 0): | def create_whats_this_descriptions_for_NanoHive_dialog(w): "Create What's This descriptions for the Nano-Hive dialog widgets." # MPQC Electrostatics Potential Plane MPQCESPText = "<u><b>MPQC Electrostatics Potential Plane</b></u><br>"\ "Enables the <i>MPQC Electrostatics Potential Plane</i> plugin. "\ "</p>" w.MPQC_ESP_checkbox.setWhatsThis(MPQCESPText ) MPQCESPTipText = "Enables/disables MPQC Electrostatics Potential Plane Plugin" w.MPQC_ESP_checkbox.setToolTip(MPQCESPTipText) | 596540c24ceb3b478e904a42e26d7d5dd8809d95 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/596540c24ceb3b478e904a42e26d7d5dd8809d95/whatsthis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3350,
2323,
67,
2211,
67,
30288,
67,
1884,
67,
16112,
44,
688,
67,
12730,
12,
91,
4672,
315,
1684,
18734,
1807,
1220,
15550,
364,
326,
23294,
83,
17,
44,
688,
6176,
10965,
119... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3350,
2323,
67,
2211,
67,
30288,
67,
1884,
67,
16112,
44,
688,
67,
12730,
12,
91,
4672,
315,
1684,
18734,
1807,
1220,
15550,
364,
326,
23294,
83,
17,
44,
688,
6176,
10965,
119... |
EXAMPLES: Plot the vector fields involving sin and cos | EXAMPLES: Plot some vector fields involving sin and cos:: | def plot_vector_field((f, g), xrange, yrange, **options): r""" \code{plot_vector_field} takes two functions of two variables xvar and yvar (for instance, if the variables are $x$ and $y$, take $(f(x,y), g(x,y))$) and plots vector arrows of the function over the specified ranges, with xrange being of xvar between xmin and xmax and yrange similarly (see below). plot_vector_field((f, g), (xvar, xmin, xmax), (yvar, ymin, ymax)) EXAMPLES: Plot the vector fields involving sin and cos sage: x,y = var('x y') sage: plot_vector_field((sin(x), cos(y)), (x,-3,3), (y,-3,3)) sage: plot_vector_field(( y, (cos(x)-2)*sin(x)), (x,-pi,pi), (y,-pi,pi)) Plot a gradient field sage: u,v = var('u v') sage: f = exp(-(u^2+v^2)) sage: plot_vector_field(f.gradient(), (u,-2,2), (v,-2,2)) We ignore function values that are infinite or NaN. sage: x,y = var('x,y') sage: plot_vector_field( (-x/sqrt(x^2+y^2), -y/sqrt(x^2+y^2)), (x, -10, 10), (y, -10, 10)) sage: plot_vector_field( (-x/sqrt(x+y), -y/sqrt(x+y)), (x, -10, 10), (y, -10, 10)) """ from sage.plot.plot import setup_for_eval_on_grid, Graphics z, xstep, ystep, xrange, yrange = setup_for_eval_on_grid([f,g], xrange, yrange, options['plot_points']) f,g = z xpos_array, ypos_array, xvec_array, yvec_array = [],[],[],[] for x in xsrange(xrange[0], xrange[1], xstep, include_endpoint=True): for y in xsrange(yrange[0], yrange[1], ystep, include_endpoint=True): xpos_array.append(x) ypos_array.append(y) xvec_array.append(f(x,y)) yvec_array.append(g(x,y)) import numpy xvec_array = numpy.ma.masked_invalid(numpy.array(xvec_array, dtype=float)) yvec_array = numpy.ma.masked_invalid(numpy.array(yvec_array, dtype=float)) g = Graphics() g.add_primitive(PlotField(xpos_array, ypos_array, xvec_array, yvec_array, options)) return g | b39a838c560927994d5f1cd0239aaf60298ce479 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/b39a838c560927994d5f1cd0239aaf60298ce479/plot_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
67,
7737,
67,
1518,
12443,
74,
16,
314,
3631,
12314,
16,
677,
3676,
16,
2826,
2116,
4672,
436,
8395,
225,
521,
710,
95,
4032,
67,
7737,
67,
1518,
97,
5530,
2795,
4186,
434,
2795,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
67,
7737,
67,
1518,
12443,
74,
16,
314,
3631,
12314,
16,
677,
3676,
16,
2826,
2116,
4672,
436,
8395,
225,
521,
710,
95,
4032,
67,
7737,
67,
1518,
97,
5530,
2795,
4186,
434,
2795,... |
text = render_to_string("result_email_debug.html", {'item': item}) | text = render_to_string("result_email_default.html", {'item': item}) | def checkResults(self): ''' Refer GmailResultsFramework.checkResults for documentation''' tags = self.grestags + " IANA" gmail_user = setting.get("username") gmail_pwd = setting.get("password") smtpserver = smtplib.SMTP("smtp.gmail.com",587) smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo() smtpserver.login(gmail_user, gmail_pwd) self.log.info("Checking Results... {0}".format(str(setting.get("poll_interval"))), extra=tags) for item in SuryaIANAResult.objects(isEmailed=False): try: misc = item.item.misc misc_dict = json.loads(misc) except ValueError as ve: self.log.error('[ Sanity ] The misc input is not a json syntax string. Store it as { "rawstring": (...input...)} . The orignial Input:' + str(misc)+ "Reason:" + str(ve), extra=tags) misc = '{ "rawString":"' + str(misc) + '"}' if misc_dict.has_key("fromemail"): | 0aa4807e39e33d001ef9ecfe4816f98924605ba0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13935/0aa4807e39e33d001ef9ecfe4816f98924605ba0/IANAGmailResults.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
3447,
12,
2890,
4672,
9163,
868,
586,
611,
4408,
3447,
13701,
18,
1893,
3447,
364,
7323,
26418,
2342,
273,
365,
18,
75,
8792,
1341,
397,
315,
467,
1258,
37,
6,
225,
314,
4408,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
3447,
12,
2890,
4672,
9163,
868,
586,
611,
4408,
3447,
13701,
18,
1893,
3447,
364,
7323,
26418,
2342,
273,
365,
18,
75,
8792,
1341,
397,
315,
467,
1258,
37,
6,
225,
314,
4408,
67,... |
self.call_command('editormanager', 'start') except: self.log.warn('editor failed to start') raise try: | def start(self): """Start Pida.""" self.__services = services.service_manager() self.__services.load_all() self.__editor = self.get_service('editormanager') self.__window = self.get_service('window') self.__services.bind() self.__services.reset() try: self.call_command('editormanager', 'start') except: self.log.warn('editor failed to start') raise try: self.call_command('terminal', 'execute_shell') except: self.log.warn('terminal emulator not configured correctly') self.__window.call('show_window') | ad6ce673e6d322368c81038d63ae00645c0dbbd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/ad6ce673e6d322368c81038d63ae00645c0dbbd3/boss.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
3536,
1685,
27041,
69,
12123,
365,
16186,
8387,
273,
4028,
18,
3278,
67,
4181,
1435,
365,
16186,
8387,
18,
945,
67,
454,
1435,
365,
16186,
9177,
273,
365,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
3536,
1685,
27041,
69,
12123,
365,
16186,
8387,
273,
4028,
18,
3278,
67,
4181,
1435,
365,
16186,
8387,
18,
945,
67,
454,
1435,
365,
16186,
9177,
273,
365,
18,
588,
... | |
Manufacture a PackageDb for an RPM system. We hide this inside a factory method so that we only import the RPM Python bindings if we're on a platform likely to have them | Manufacture a PackageDb for an RPM system. We hide this inside a factory method so that we only import the RPM Python bindings if we're on a platform likely to have them | def __makeRpmPackageDb(): """ Manufacture a PackageDb for an RPM system. We hide this inside a factory method so that we only import the RPM Python bindings if we're on a platform likely to have them """ class RpmPackageDb(PackageDb): def getVersion(self, packageName): import rpm ts = rpm.TransactionSet() for header in ts.dbMatch("name", packageName): return Version.fromString(header["version"]) raise "Package not found: %s"%packageName return RpmPackageDb() | 2f3ee57faf7a591d83f5269c04bac4d4c273ebc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10139/2f3ee57faf7a591d83f5269c04bac4d4c273ebc9/distro.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6540,
54,
7755,
2261,
4331,
13332,
3536,
8660,
11853,
594,
279,
7508,
4331,
364,
392,
534,
12728,
2619,
18,
225,
1660,
6853,
333,
4832,
279,
3272,
707,
1427,
716,
732,
1338,
1930,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6540,
54,
7755,
2261,
4331,
13332,
3536,
8660,
11853,
594,
279,
7508,
4331,
364,
392,
534,
12728,
2619,
18,
225,
1660,
6853,
333,
4832,
279,
3272,
707,
1427,
716,
732,
1338,
1930,
... |
this = apply(_quickfix.new_MassCancelRequestType, args) | this = _quickfix.new_MassCancelRequestType(*args) | def __init__(self, *args): this = apply(_quickfix.new_MassCancelRequestType, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
18060,
6691,
691,
559,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
18060,
6691,
691,
559,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
doc1 = PDFDocument() doc2 = PDFDocument() font = TTFont("Vera", "Vera.ttf") self.assertEquals(font.splitString(u'hello ', doc1), [(0, 'hello ')]) self.assertEquals(font.splitString(u'hello ', doc2), [(0, 'hello ')]) self.assertEquals(font.splitString(u'\u0410\u0411'.encode('UTF-8'), doc1), [(0, '\x80\x81')]) self.assertEquals(font.splitString(u'\u0412'.encode('UTF-8'), doc2), [(0, '\x80')]) font.addObjects(doc1) self.assertEquals(font.splitString(u'\u0413'.encode('UTF-8'), doc2), [(0, '\x81')]) font.addObjects(doc2) | ttfAsciiReadable = rl_config.ttfAsciiReadable try: rl_config.ttfAsciiReadable = 1 doc1 = PDFDocument() doc2 = PDFDocument() font = TTFont("Vera", "Vera.ttf") self.assertEquals(font.splitString(u'hello ', doc1), [(0, 'hello ')]) self.assertEquals(font.splitString(u'hello ', doc2), [(0, 'hello ')]) self.assertEquals(font.splitString(u'\u0410\u0411'.encode('UTF-8'), doc1), [(0, '\x80\x81')]) self.assertEquals(font.splitString(u'\u0412'.encode('UTF-8'), doc2), [(0, '\x80')]) font.addObjects(doc1) self.assertEquals(font.splitString(u'\u0413'.encode('UTF-8'), doc2), [(0, '\x81')]) font.addObjects(doc2) finally: rl_config.ttfAsciiReadable = ttfAsciiReadable | def testParallelConstruction(self): "Test that TTFont can be used for different documents at the same time" doc1 = PDFDocument() doc2 = PDFDocument() font = TTFont("Vera", "Vera.ttf") self.assertEquals(font.splitString(u'hello ', doc1), [(0, 'hello ')]) self.assertEquals(font.splitString(u'hello ', doc2), [(0, 'hello ')]) self.assertEquals(font.splitString(u'\u0410\u0411'.encode('UTF-8'), doc1), [(0, '\x80\x81')]) self.assertEquals(font.splitString(u'\u0412'.encode('UTF-8'), doc2), [(0, '\x80')]) font.addObjects(doc1) self.assertEquals(font.splitString(u'\u0413'.encode('UTF-8'), doc2), [(0, '\x81')]) font.addObjects(doc2) | 9b00011f0c2f6693e4cfbfc1b4cff7b7c0a7bdb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3878/9b00011f0c2f6693e4cfbfc1b4cff7b7c0a7bdb8/test_pdfbase_ttfonts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13056,
25485,
12,
2890,
4672,
315,
4709,
716,
19912,
5711,
848,
506,
1399,
364,
3775,
7429,
622,
326,
1967,
813,
6,
997,
21,
273,
12667,
2519,
1435,
997,
22,
273,
12667,
2519,
1435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13056,
25485,
12,
2890,
4672,
315,
4709,
716,
19912,
5711,
848,
506,
1399,
364,
3775,
7429,
622,
326,
1967,
813,
6,
997,
21,
273,
12667,
2519,
1435,
997,
22,
273,
12667,
2519,
1435... |
@param file: The filename from which to load pnm image data @type file: string """ if _debug: print "\t%s: Called PnmImage.load()" % rendererName | @param fname: The filename from which to load pnm image data @type fname: string """ debugMsg("Called PnmImage.load()") fileCheck(fname) | def load(self, file): """ Loads pnm (ppm, pgm, pbm) image data from file. | c44140bd3d918f82e3b4fb0f16f6949f4d7b003e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/c44140bd3d918f82e3b4fb0f16f6949f4d7b003e/image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
16,
585,
4672,
3536,
4444,
87,
11059,
81,
261,
84,
7755,
16,
7184,
81,
16,
6386,
81,
13,
1316,
501,
628,
585,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
16,
585,
4672,
3536,
4444,
87,
11059,
81,
261,
84,
7755,
16,
7184,
81,
16,
6386,
81,
13,
1316,
501,
628,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
raise TypeError,'trying to assign %s to %s and is not a date, being of type %s ' % (val, aname, type(val)) | raise TypeError,( 'trying to assign %s to %s and is not a date, '\ 'being of type %s ' ) % (val, aname, type(val)) | def typeCheckAndConvert(self, val, aname, attr): if val == None: val = "NULL" elif _isDateKind(attr): if (not isDateTime(val)) and not val == PyDBI.SYSDATE: raise TypeError,'trying to assign %s to %s and is not a date, being of type %s ' % (val, aname, type(val)) val = _dateConvertToDB(val) elif _isNumber(attr): if attr in ('FLOAT4', 'FLOAT8'): f = float else: f = lambda x: int(float(x)) try: return f(val) except: raise TypeError, ('trying to assign %s to %s and is not' ' a number') % (val, aname) elif _isString(attr) and not isinstance(val, types.StringType): raise TypeError, 'trying to assign %s to %s and is not a string'% ( val, aname) elif attr.upper() == 'BOOL': if val: return '1=1' else: return '0=1' return val | 119236e30f6300c964069b6c46f74b6d8a592c68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/119236e30f6300c964069b6c46f74b6d8a592c68/postconn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
618,
1564,
1876,
2723,
12,
2890,
16,
1244,
16,
392,
339,
16,
1604,
4672,
309,
1244,
422,
599,
30,
1244,
273,
315,
8560,
6,
1327,
389,
291,
1626,
5677,
12,
1747,
4672,
309,
261,
902,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
618,
1564,
1876,
2723,
12,
2890,
16,
1244,
16,
392,
339,
16,
1604,
4672,
309,
1244,
422,
599,
30,
1244,
273,
315,
8560,
6,
1327,
389,
291,
1626,
5677,
12,
1747,
4672,
309,
261,
902,
... |
def _get_sig(args): | def _gen_sig(args): | def _get_sig(args): sig = [] for i, arg in enumerate(args): if arg.startswith('['): arg = arg.strip('[]') arg = '%s%d=""' % (arg, i) else: arg = '%s%d' % (arg, i) sig.append(arg) sig = ', '.join(sig) params = sig.replace('=""', '') return sig, params | 55807175eb7f31fdf1571e39ca97782d9f45b1a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12327/55807175eb7f31fdf1571e39ca97782d9f45b1a8/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4507,
67,
7340,
12,
1968,
4672,
3553,
273,
5378,
364,
277,
16,
1501,
316,
4241,
12,
1968,
4672,
309,
1501,
18,
17514,
1918,
2668,
3292,
4672,
1501,
273,
1501,
18,
6406,
2668,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4507,
67,
7340,
12,
1968,
4672,
3553,
273,
5378,
364,
277,
16,
1501,
316,
4241,
12,
1968,
4672,
309,
1501,
18,
17514,
1918,
2668,
3292,
4672,
1501,
273,
1501,
18,
6406,
2668,
63,
... |
return http.Response(stream='fail') return http.Response(stream='success') | return HTMLResponse(stream='fail') return HTMLResponse(stream='success') | def render(self, ctx): try: self.worksheet.delete_all_output(self.username) except ValueError: return http.Response(stream='fail') return http.Response(stream='success') | 2c1a5997a8830efcfb475993e5f1efb45ed121ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2c1a5997a8830efcfb475993e5f1efb45ed121ea/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
775,
30,
365,
18,
1252,
8118,
18,
3733,
67,
454,
67,
2844,
12,
2890,
18,
5053,
13,
1335,
2068,
30,
327,
1062,
18,
1064,
12,
3256,
2218,
6870,
6134,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
775,
30,
365,
18,
1252,
8118,
18,
3733,
67,
454,
67,
2844,
12,
2890,
18,
5053,
13,
1335,
2068,
30,
327,
1062,
18,
1064,
12,
3256,
2218,
6870,
6134,
32... |
start = int(self.cfg['start']) | start = int(cfg['start']) | def configure(self): try: self.cfg = self.ud.getSection('noip') except EC2DataRetrievalError: return | 9318eb56e356ed43d46dfcb46c8a883c30dd2aa5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7645/9318eb56e356ed43d46dfcb46c8a883c30dd2aa5/noip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
2890,
4672,
775,
30,
365,
18,
7066,
273,
365,
18,
1100,
18,
588,
5285,
2668,
2135,
625,
6134,
1335,
7773,
22,
751,
27356,
668,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
2890,
4672,
775,
30,
365,
18,
7066,
273,
365,
18,
1100,
18,
588,
5285,
2668,
2135,
625,
6134,
1335,
7773,
22,
751,
27356,
668,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
return len(rows) > 0 | return result | def has_file(conn, path, mirror_id): """check if file 'path' exists on mirror 'mirror_id' by looking at the database. path can contain wildcards, which will result in a LIKE match. """ if path.find('*') >= 0 or path.find('%') >= 0: pattern = True oprtr = 'like' path = path.replace('*', '%') else: pattern = False oprtr = '=' query = "SELECT mirr_hasfile_byname(%s, '%s')" \ % (mirror_id, path) rows = conn.Server._connection.queryAll(query) return len(rows) > 0 | 0bfde61ede9a4f12d97f7111864cf39319b65b14 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3890/0bfde61ede9a4f12d97f7111864cf39319b65b14/files.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
768,
12,
4646,
16,
589,
16,
15593,
67,
350,
4672,
3536,
1893,
309,
585,
296,
803,
11,
1704,
603,
15593,
296,
27197,
67,
350,
11,
635,
7849,
622,
326,
2063,
18,
225,
589,
848... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
768,
12,
4646,
16,
589,
16,
15593,
67,
350,
4672,
3536,
1893,
309,
585,
296,
803,
11,
1704,
603,
15593,
296,
27197,
67,
350,
11,
635,
7849,
622,
326,
2063,
18,
225,
589,
848... |
if status == 1: print "INFO: CPUs utilized is not in same package or core" | if status == 1: print "INFO: CPUs utilized is not in same package or core" | def validate_cpu_consolidation(sched_mc_level, sched_smt_level): ''' Verify if cpu's on which threads executed belong to same package ''' cpus_utilized = list() try: for l in sorted(stats_percentage.keys()): #modify threshold if stats_percentage[l][1] > 50: cpu_id = stats_percentage[l][0].split("cpu") if cpu_id[1] != '': cpus_utilized.append(int(cpu_id[1])) cpus_utilized.sort() print "INFO: CPU's utilized ", cpus_utilized status = validate_cpugrp_map(cpus_utilized, sched_mc_level, sched_smt_level) if status == 1: print "INFO: CPUs utilized is not in same package or core" return(status) except Exception, details: print "Exception in validate_cpu_consolidation: ", details sys.exit(1) | 94fd025f45e2da008712ef6b037eba0ec614ddc0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11457/94fd025f45e2da008712ef6b037eba0ec614ddc0/sched_mc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
11447,
67,
8559,
7953,
367,
12,
87,
2049,
67,
13952,
67,
2815,
16,
23964,
67,
87,
1010,
67,
2815,
4672,
9163,
8553,
309,
8326,
1807,
603,
1492,
7403,
7120,
10957,
358,
1967,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
11447,
67,
8559,
7953,
367,
12,
87,
2049,
67,
13952,
67,
2815,
16,
23964,
67,
87,
1010,
67,
2815,
4672,
9163,
8553,
309,
8326,
1807,
603,
1492,
7403,
7120,
10957,
358,
1967,
... |
raise ValueError('No induced copy of the graph exists') return self.subgraph(H) def subgraph_search(self, G): r""" Returns an of `G` included in self. INPUT: - ``G`` -- the graph whose copy we are looking for in ``self`` ALGORITHM: Brute-force EXAMPLES: A Petersen Graph contains a `P_5` :: sage: g = graphs.PetersenGraph() sage: h1 = g.subgraph_search(graphs.PathGraph(5)) sage: h1 Subgraph of (Petersen graph): Graph on 5 vertices sage: h1.vertices() [0, 1, 2, 3, 4] It also contains a Claw (`K_{1,3}`):: sage: h2 = g.subgraph_search(graphs.ClawGraph()) sage: h2 Subgraph of (Petersen graph): Graph on 4 vertices sage: h2.vertices() [0, 1, 4, 5] However, as it contains no subgraph isomorphic to `K_3`, an exception is raised in this case :: sage: g.subgraph_search(graphs.CompleteGraph(3)) Traceback (most recent call last): ... ValueError: No copy of the graph exists """ from sage.graphs.generic_graph_pyx import subgraph_search H = subgraph_search(self, G) if H == []: raise ValueError('No copy of the graph exists') | return None | def induced_subgraph_search(self, G): r""" Returns an induced copy of `G` in self. | 84286d4be578725f91d534440b316bce27cdde2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/84286d4be578725f91d534440b316bce27cdde2f/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1547,
26372,
67,
1717,
4660,
67,
3072,
12,
2890,
16,
611,
4672,
436,
8395,
2860,
392,
1547,
26372,
1610,
434,
1375,
43,
68,
316,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1547,
26372,
67,
1717,
4660,
67,
3072,
12,
2890,
16,
611,
4672,
436,
8395,
2860,
392,
1547,
26372,
1610,
434,
1375,
43,
68,
316,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if len(message) > 2048: logging.error("Message to large to be handled on J2ME side. Please report bug!") raise MessageToLargeException() else: try: self.client_sock.sendall(message) except bluetooth.BluetoothError: logging.debug("Trying to send while remote side was disconnected") | try: self.client_sock.sendall(message) except bluetooth.BluetoothError: logging.debug("Trying to send while remote side was disconnected") | def send_query(self, package): # TODO: Handle larger packages on client side (what is needed?!) logging.debug("Sending package:\n" + str(package)) message = (json.write(package) + u"\u0000").encode('utf-8') logging.debug(repr(message)) if len(message) > 2048: logging.error("Message to large to be handled on J2ME side. Please report bug!") raise MessageToLargeException() else: try: self.client_sock.sendall(message) except bluetooth.BluetoothError: logging.debug("Trying to send while remote side was disconnected") | 8208c72b763cb3dd626c146d6562879050670e37 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2456/8208c72b763cb3dd626c146d6562879050670e37/BTServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2271,
12,
2890,
16,
2181,
4672,
468,
2660,
30,
5004,
10974,
5907,
603,
1004,
4889,
261,
23770,
353,
3577,
35,
24949,
2907,
18,
4148,
2932,
16322,
2181,
5581,
82,
6,
397,
609,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
2271,
12,
2890,
16,
2181,
4672,
468,
2660,
30,
5004,
10974,
5907,
603,
1004,
4889,
261,
23770,
353,
3577,
35,
24949,
2907,
18,
4148,
2932,
16322,
2181,
5581,
82,
6,
397,
609,
... |
input_cache = lal.Cache().fromfile(fp) input_cache = input_cache - input_cache.sieve( description = 'SLIDE' ) | input_cache = lal.Cache().fromfile(fp).sieve( description = 'THINCA_SECOND' ) | def get_output_from_cache(self): """ Returns a list of files that this node will generate using the input_cache. The output file names are the same as the input urls, but with the zero_lag 'THINCA' file replaced with 'THINCA_TO_COINC', and with the filepaths pointing to the current directory in which the thinca_to_coinc node is being run. """ if not self.__input_cache: raise ValueError, "no input-cache specified" # open the input cache file fp = open(self.__input_cache, 'r') input_cache = lal.Cache().fromfile(fp) # remove any slide files input_cache = input_cache - input_cache.sieve( description = 'SLIDE' ) output_files = [ \ '/'.join([ os.getcwd(), re.sub('THINCA', 'THINCA_TO_COINC', os.path.basename(entry.url)) ]) for entry in input_cache \ ] return output_files | 43f81a5e2a29a5509dbd4c404ef8a76838864a84 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/43f81a5e2a29a5509dbd4c404ef8a76838864a84/inspiral.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2844,
67,
2080,
67,
2493,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
1390,
716,
333,
756,
903,
2103,
1450,
326,
810,
67,
2493,
18,
1021,
876,
585,
1257,
854,
326,
1967,
487,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2844,
67,
2080,
67,
2493,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
1390,
716,
333,
756,
903,
2103,
1450,
326,
810,
67,
2493,
18,
1021,
876,
585,
1257,
854,
326,
1967,
487,
... |
exts.append( Extension('errno', ['errnomodule.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 14eb1f6ecd9a9b76c82d1be0510a6778d47886d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/14eb1f6ecd9a9b76c82d1be0510a6778d47886d2/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | |
search_title = re.compile(r'\\title{([^}]*)}').search skipping = re.compile(r'(\\end{document}|\\tableofcontents)').search src = file(src) dest = file(dest, "w") iter_lines = iter(src.readlines()) | search_title = re.compile(r'\\title{([^{}]*(?:{[^}]*})*)}').search skipping = re.compile(r'(\\end{document}|\\tableofcontents|^%)').search src = file(src_path) dest = file(dest_path, "w") src_text = src.read() src.close() title = search_title(src_text) if title: title = re.sub(r'\\\w+({[^}]*})?', '', title.group(1)) iter_lines = iter(src_text.splitlines()) | def tex_postprocess(src, dest, want_header = False, process_line=noop): """ Postprocessing of the LaTeX file generated from ReST. Reads file src and saves to dest only the true content (without the document header and final) - so it is suitable to be used as part of the longer document. Returns the title of document If want_header is set, returns also the document header (as the list of lines). """ title = '' header = [] add_header_line = header.append global counter_no counter_no = counter_no + 1 counter_text = "listcnt%d" % counter_no search_title = re.compile(r'\\title{([^}]*)}').search skipping = re.compile(r'(\\end{document}|\\tableofcontents)').search src = file(src) dest = file(dest, "w") iter_lines = iter(src.readlines()) for l in iter_lines: l = process_line(l) if not l: continue if want_header: add_header_line(replace_rst_macros('', l)) m = search_title(l) if m: title = m.group(0) if l.startswith("\\maketitle"): break for l in iter_lines: l = process_line(l) if skipping(l): # To-Do minitoc instead of tableofcontents continue elif "\hypertarget{old-versions}" in l: break elif "listcnt0" in l: l = l.replace("listcnt0", counter_text) dest.write(l) if not title: raise Exception("Bueee, no title") return title, header | 6d2a084d7d87c7db6ac34a2a97ebcf661ae34075 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13107/6d2a084d7d87c7db6ac34a2a97ebcf661ae34075/mklatex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16573,
67,
2767,
2567,
12,
4816,
16,
1570,
16,
2545,
67,
3374,
273,
1083,
16,
1207,
67,
1369,
33,
2135,
556,
4672,
3536,
5616,
10632,
434,
326,
21072,
21575,
60,
585,
4374,
628,
868,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16573,
67,
2767,
2567,
12,
4816,
16,
1570,
16,
2545,
67,
3374,
273,
1083,
16,
1207,
67,
1369,
33,
2135,
556,
4672,
3536,
5616,
10632,
434,
326,
21072,
21575,
60,
585,
4374,
628,
868,
8... |
('CopyChannelURL', None, _(menubar.getLabel('CopyChannelURL')), menubar.getShortcut('CopyChannelURL').GTKString(), None, self.on_copy_channel_link_activate), ('MailChannel', None, _(menubar.getLabel('MailChannel')), menubar.getShortcut('MailChannel').GTKString(), None, self.on_mail_channel_link_activate), | ('CopyChannelURL', None, menubar.getLabel('CopyChannelURL'), menubar.getShortcut('CopyChannelURL').GTKString(), None, self.on_copy_channel_link_activate), ('MailChannel', None, menubar.getLabel('MailChannel'), menubar.getShortcut('MailChannel').GTKString(), None, self.on_mail_channel_link_activate), | def actionGroups (self): confirmMainThread() actionGroups = {} actionGroups["VideoSelected"] = gtk.ActionGroup("VideoSelected") actionGroups["VideosSelected"] = gtk.ActionGroup("VideosSelected") actionGroups["VideoPlaying"] = gtk.ActionGroup("VideoPlaying") actionGroups["VideoPlayable"] = gtk.ActionGroup("VideoPlayable") actionGroups["ChannelSelected"] = gtk.ActionGroup("ChannelSelected") actionGroups["ChannelsSelected"] = gtk.ActionGroup("ChannelsSelected") actionGroups["ChannelFolderSelected"] = gtk.ActionGroup("ChannelFolderSelected") actionGroups["ChannelLikeSelected"] = gtk.ActionGroup("ChannelLikeSelected") actionGroups["ChannelLikesSelected"] = gtk.ActionGroup("ChannelLikesSelected") actionGroups["PlaylistLikeSelected"] = gtk.ActionGroup("PlaylistLikeSelected") actionGroups["PlaylistLikesSelected"] = gtk.ActionGroup("PlaylistLikesSelected") actionGroups["Ubiquitous"] = gtk.ActionGroup("Ubiquitous") | ec8ebd404e647fa07d54e7cbddd5b1001a7d3243 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/ec8ebd404e647fa07d54e7cbddd5b1001a7d3243/callbackhandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
3621,
261,
2890,
4672,
6932,
6376,
3830,
1435,
1301,
3621,
273,
2618,
1301,
3621,
9614,
10083,
7416,
11929,
273,
22718,
18,
1803,
1114,
2932,
10083,
7416,
7923,
1301,
3621,
9614,
58,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
3621,
261,
2890,
4672,
6932,
6376,
3830,
1435,
1301,
3621,
273,
2618,
1301,
3621,
9614,
10083,
7416,
11929,
273,
22718,
18,
1803,
1114,
2932,
10083,
7416,
7923,
1301,
3621,
9614,
58,
... |
self.valid_values = [ "netboot2/extra_files", ] | def __init__(self,spec,addlargs): self.valid_values = [ "netboot2/extra_files", ] self.required_values=[ "boot/kernel", "netboot2/builddate", "netboot2/busybox_config", "netboot2/packages" ] try: if addlargs.has_key("netboot2/packages"): if type(addlargs["netboot2/packages"]) == types.StringType: loopy=[addlargs["netboot2/packages"]] else: loopy=addlargs["netboot2/packages"] except: raise CatalystError,"configuration error in netboot2/packages." | 89642d36b36d08719a7e8ed319f03cd44f6cb86d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/89642d36b36d08719a7e8ed319f03cd44f6cb86d/netboot2_target.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2793,
16,
1289,
80,
1968,
4672,
365,
18,
4718,
67,
2372,
22850,
315,
7137,
19,
8111,
3113,
315,
2758,
7137,
22,
19,
70,
89,
330,
449,
340,
3113,
315,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2793,
16,
1289,
80,
1968,
4672,
365,
18,
4718,
67,
2372,
22850,
315,
7137,
19,
8111,
3113,
315,
2758,
7137,
22,
19,
70,
89,
330,
449,
340,
3113,
315,
2... | |
cty.c_int, [cty.c_int, cty.POINTER(FL_PUP_ENTRY)], | cty.c_int, [cty.c_int, cty.POINTER(FL_PUP_ENTRY)], | def fl_resume_timer(ob): """ fl_resume_timer(ob) """ _fl_resume_timer(ob) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
25158,
67,
12542,
12,
947,
4672,
3536,
1183,
67,
25158,
67,
12542,
12,
947,
13,
3536,
225,
389,
2242,
67,
25158,
67,
12542,
12,
947,
13,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
25158,
67,
12542,
12,
947,
4672,
3536,
1183,
67,
25158,
67,
12542,
12,
947,
13,
3536,
225,
389,
2242,
67,
25158,
67,
12542,
12,
947,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,... |
""" Manage a table while traversing. Maybe change to a mixin defining the visit/departs, but then class Table internal variables are in the Translator. Table style might be * standard: horizontal and vertical lines * booktabs (requires booktabs latex package): only horizontal lines * nolines, borderless : no lines | """Manage a table while traversing. Maybe change to a mixin defining the visit/departs, but then class Table internal variables are in the Translator. Table style might be :standard: horizontal and vertical lines :booktabs: only horizontal lines (requires "booktabs" LaTeX package) :nolines: (or borderless) no lines | def section(self, level): """ Return the section name at the given level for the specific document class. | c864668986577697fde0269ca08cae63c3e4ea04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8194/c864668986577697fde0269ca08cae63c3e4ea04/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
12,
2890,
16,
1801,
4672,
3536,
2000,
326,
2442,
508,
622,
326,
864,
1801,
364,
326,
2923,
1668,
667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
12,
2890,
16,
1801,
4672,
3536,
2000,
326,
2442,
508,
622,
326,
864,
1801,
364,
326,
2923,
1668,
667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
print "Done building global RRT" | print "Done building global RRT", len(self.globalnodes) def init(self, view): """Builds the static obstacle map, global roadmap""" self.globaltree(view) | def init(self, view): """Builds the static obstacle map, global roadmap""" #RRT from goal nodes = [self.Node(self.goal, None, None)] for i in xrange(self.GLOBALNODES): newpos = Vec2d(random.randrange(640), random.randrange(480)) #TODO: remove hardcoded world size besttime = None bestnode = None for tonode in nodes: topos = tonode.position connectable = True for o in view.obstacles: if line_distance2(topos, newpos, o.p1, o.p2) <= self.radius: connectable = False break if connectable: dist = topos.distance_to(newpos) if tonode.parent is None: turndist = 0 #goal node else: turndist = abs(angle_diff((topos - newpos).angle(), tonode.angle)) time = dist/self.speed + turndist/self.turningspeed if bestnode is None or time < besttime: besttime = time bestnode = tonode if bestnode: topos = bestnode.position diff = topos - newpos angle = diff.angle() vdir = diff.norm() difflen = diff.length() div = 1 while difflen/div > self.GLOBALMINEDGE: div += 1 #subdivide the new edge for d in xrange(div): nodes.append(self.Node(newpos + vdir*d*difflen/div, angle, bestnode)) self.globalnodes = nodes print "Done building global RRT" | 0484f9f3f562dab318bf38b4cbce4815517c3c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9407/0484f9f3f562dab318bf38b4cbce4815517c3c34/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
1476,
4672,
3536,
7746,
326,
760,
3768,
334,
16066,
852,
16,
2552,
721,
361,
1458,
8395,
468,
54,
12185,
628,
17683,
2199,
273,
306,
2890,
18,
907,
12,
2890,
18,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
1476,
4672,
3536,
7746,
326,
760,
3768,
334,
16066,
852,
16,
2552,
721,
361,
1458,
8395,
468,
54,
12185,
628,
17683,
2199,
273,
306,
2890,
18,
907,
12,
2890,
18,
27... |
req.hdf[key] = val | def send_project_index(environ, start_response, parent_dir=None, env_paths=None): req = Request(environ, start_response) loadpaths = [pkg_resources.resource_filename('trac', 'templates')] if req.environ.get('trac.env_index_template'): tmpl_path, template = os.path.split(req.environ['trac.env_index_template']) loadpaths.insert(0, tmpl_path) if template.endswith('.cs'): req.hdf = HDFWrapper(loadpaths) # keep that for custom .cs templates else: template = 'index.html' data = {} if req.environ.get('trac.template_vars'): for pair in req.environ['trac.template_vars'].split(','): key, val = pair.split('=') req.hdf[key] = val data[key] = val if parent_dir and not env_paths: env_paths = dict([(filename, os.path.join(parent_dir, filename)) for filename in os.listdir(parent_dir)]) try: href = Href(req.base_path) projects = [] for env_name, env_path in get_environments(environ).items(): try: env = _open_environment(env_path, run_once=environ['wsgi.run_once']) proj = { 'name': env.project_name, 'description': env.project_description, 'href': href(env_name) } except Exception, e: proj = {'name': env_name, 'description': to_unicode(e)} projects.append(proj) projects.sort(lambda x, y: cmp(x['name'].lower(), y['name'].lower())) req.hdf['projects'] = projects data['projects'] = projects if template.endswith('.cs'): # assume Clearsilver req.display(template) markuptemplate = TemplateLoader(loadpaths).load(template) stream = markuptemplate.generate(**data) output = stream.render('xhtml', doctype=DocType.XHTML_STRICT) req.send(output, 'text/html') except RequestDone: pass | 6f3e923127813ae725586b9f66c6f9dde3543cb6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/6f3e923127813ae725586b9f66c6f9dde3543cb6/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
4406,
67,
1615,
12,
28684,
16,
787,
67,
2740,
16,
982,
67,
1214,
33,
7036,
16,
1550,
67,
4481,
33,
7036,
4672,
1111,
273,
1567,
12,
28684,
16,
787,
67,
2740,
13,
225,
1262,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
4406,
67,
1615,
12,
28684,
16,
787,
67,
2740,
16,
982,
67,
1214,
33,
7036,
16,
1550,
67,
4481,
33,
7036,
4672,
1111,
273,
1567,
12,
28684,
16,
787,
67,
2740,
13,
225,
1262,... | |
(r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace, ' | ('(' + cs_ident + r'|\.)+', Name.Namespace, ' | def _escape(st): return st.replace(u'\\', ur'\\').replace(u'-', ur'\-').\ replace(u'[', ur'\[').replace(u']', ur'\]') | 2d51ba32a8d1a3aa53b0d1357926a4121af20db4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6148/2d51ba32a8d1a3aa53b0d1357926a4121af20db4/dotnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6939,
12,
334,
4672,
327,
384,
18,
2079,
12,
89,
11,
1695,
2187,
8896,
11,
10471,
2934,
2079,
12,
89,
11,
17,
2187,
8896,
8314,
6627,
2934,
64,
1453,
12,
89,
11,
63,
2187,
8896,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6939,
12,
334,
4672,
327,
384,
18,
2079,
12,
89,
11,
1695,
2187,
8896,
11,
10471,
2934,
2079,
12,
89,
11,
17,
2187,
8896,
8314,
6627,
2934,
64,
1453,
12,
89,
11,
63,
2187,
8896,... |
wxDefaultPosition, [400,-1]) | wx.DefaultPosition, [400,-1]) | def __init__(self, parent, ID, title, item, attrList, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE): | 274c70bb600f7f1c7386160a60fb689f2a35f11d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/274c70bb600f7f1c7386160a60fb689f2a35f11d/Util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1599,
16,
2077,
16,
761,
16,
1604,
682,
16,
963,
33,
27226,
18,
1868,
1225,
16,
949,
33,
27226,
18,
1868,
2555,
16,
2154,
33,
27226,
18,
5280,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
1599,
16,
2077,
16,
761,
16,
1604,
682,
16,
963,
33,
27226,
18,
1868,
1225,
16,
949,
33,
27226,
18,
1868,
2555,
16,
2154,
33,
27226,
18,
5280,... |
return cPickle.loads(string.join(strlist, '')) | return cPickle.loads(''.join(strlist)) | def _toobj(self, str): intlist = map(int, string.split(str, ',')) intlist = array.array('b', intlist) strlist = map(chr, intlist) return cPickle.loads(string.join(strlist, '')) | f2ee7819d5222cd29b59546baa9d57b085052f29 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/f2ee7819d5222cd29b59546baa9d57b085052f29/Index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
2603,
12,
2890,
16,
609,
4672,
509,
1098,
273,
852,
12,
474,
16,
533,
18,
4939,
12,
701,
16,
3316,
3719,
509,
1098,
273,
526,
18,
1126,
2668,
70,
2187,
509,
1098,
13,
609,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
2603,
12,
2890,
16,
609,
4672,
509,
1098,
273,
852,
12,
474,
16,
533,
18,
4939,
12,
701,
16,
3316,
3719,
509,
1098,
273,
526,
18,
1126,
2668,
70,
2187,
509,
1098,
13,
609,
... |
def create_index(self, builder): | def create_index(self, builder, _fixre=re.compile(r'(.*) ([(][^()]*[)])')): | def create_index(self, builder): """Create the real index from the collected index entries.""" new = {} | eb6bc55cf6a2f60dae70f2c9c0dff83addc51cae /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5620/eb6bc55cf6a2f60dae70f2c9c0dff83addc51cae/environment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1615,
12,
2890,
16,
2089,
16,
389,
904,
266,
33,
266,
18,
11100,
12,
86,
11,
14361,
23265,
12,
65,
5969,
1435,
5772,
63,
25887,
2506,
3719,
30,
3536,
1684,
326,
2863,
770,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1615,
12,
2890,
16,
2089,
16,
389,
904,
266,
33,
266,
18,
11100,
12,
86,
11,
14361,
23265,
12,
65,
5969,
1435,
5772,
63,
25887,
2506,
3719,
30,
3536,
1684,
326,
2863,
770,
6... |
TABLE_REX = re.compile("</h3>\s*(<table>.*?</table>)", re.I) | TABLE_REX = re.compile("</h3>\s*(<table>.*?</table>)", re.I | re.S) | def fetch_url(inner, opener, url): fileobj = yield inner.thread(opener.open, url) list(inner) try: data = yield inner.thread(fileobj.read) finally: fileobj.close() list(inner) inner.finish(data) | 10d85217bc4f3922bace7c803641d586249b5bd1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14361/10d85217bc4f3922bace7c803641d586249b5bd1/xmlfeed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
718,
12,
7872,
16,
20532,
16,
880,
4672,
17041,
273,
2824,
3443,
18,
5930,
12,
25098,
18,
3190,
16,
880,
13,
666,
12,
7872,
13,
775,
30,
501,
273,
2824,
3443,
18,
5930,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
718,
12,
7872,
16,
20532,
16,
880,
4672,
17041,
273,
2824,
3443,
18,
5930,
12,
25098,
18,
3190,
16,
880,
13,
666,
12,
7872,
13,
775,
30,
501,
273,
2824,
3443,
18,
5930,
12,... |
if (fileutil.exists(enclosedFile)): | if fileutil.exists(enclosedFile): | def fix_incorrect_torrent_subdir(self): """Up to revision 6257, torrent downloads were incorrectly being created in an extra subdirectory. This method "migrates" those torrent downloads to the correct layout. | a28536b6501d5fda71e4176d25a5e36e9bb1ea11 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/a28536b6501d5fda71e4176d25a5e36e9bb1ea11/item.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
267,
6746,
67,
13039,
547,
67,
1717,
1214,
12,
2890,
4672,
3536,
1211,
358,
6350,
1666,
2947,
27,
16,
17351,
23011,
4591,
25621,
3832,
2522,
316,
392,
2870,
29869,
18,
225,
122... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
67,
267,
6746,
67,
13039,
547,
67,
1717,
1214,
12,
2890,
4672,
3536,
1211,
358,
6350,
1666,
2947,
27,
16,
17351,
23011,
4591,
25621,
3832,
2522,
316,
392,
2870,
29869,
18,
225,
122... |
getattr(self, self.__testMethodName)() | getattr(self, self._testMethodName)() | def debug(self): """Run the test without collecting errors in a TestResult""" self.setUp() getattr(self, self.__testMethodName)() self.tearDown() | b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
2890,
4672,
3536,
1997,
326,
1842,
2887,
30160,
1334,
316,
279,
7766,
1253,
8395,
365,
18,
542,
1211,
1435,
3869,
12,
2890,
16,
365,
6315,
3813,
11666,
13,
1435,
365,
18,
736,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
2890,
4672,
3536,
1997,
326,
1842,
2887,
30160,
1334,
316,
279,
7766,
1253,
8395,
365,
18,
542,
1211,
1435,
3869,
12,
2890,
16,
365,
6315,
3813,
11666,
13,
1435,
365,
18,
736,
... |
self.clear_cb() | def render_cb(self, event=None): # Grab data. s = self.editbox.get("0.0", "end") lines = s.split('\n') control_points, knotvec, self.degree, self.dt = parse_data(lines) | 387d445524458665cb6c1b7ef0090619a9cb64b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13663/387d445524458665cb6c1b7ef0090619a9cb64b8/uitk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
7358,
12,
2890,
16,
871,
33,
7036,
4672,
468,
17150,
501,
18,
272,
273,
365,
18,
4619,
2147,
18,
588,
2932,
20,
18,
20,
3113,
315,
409,
7923,
2362,
273,
272,
18,
4939,
2668... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
7358,
12,
2890,
16,
871,
33,
7036,
4672,
468,
17150,
501,
18,
272,
273,
365,
18,
4619,
2147,
18,
588,
2932,
20,
18,
20,
3113,
315,
409,
7923,
2362,
273,
272,
18,
4939,
2668... | |
backtrack.append((prvpkg, OPER_INSTALL, REASON_REQUIRES, pkg, prvpkg, self.getState())) | bt.append((prvpkg, OPER_INSTALL, REASON_REQUIRES, pkg, prvpkg, self.getState())) | def run(self): loopctrl = {} | e9831a12235fcae7ab1b6189a4d00b2b6f1634cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/e9831a12235fcae7ab1b6189a4d00b2b6f1634cf/transaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2798,
16277,
273,
2618,
2,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2798,
16277,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if window in self.nextlist: | if self.nextlist and window in self.nextlist: | def del_window(self,window): if window.is_minimized(): self.minimized_windows_count -= 1 if window in self.nextlist: self.nextlist.remove(window) self.windows[window].del_button() self.update_state_request() if self.needs_attention: self.needs_attention_changed() if not self.windows and not self.launcher: self.hide_list() self.popup.destroy() self.button.destroy() self.winlist.destroy() self.dockbar.groups.remove(self.res_class) elif not self.windows and self.launcher and self.popup_showing: self.popup.resize(10,10) gobject.idle_add(self.show_list_request) | 7ad42b4c4c46ea962d2e02ddbf72fbe46513c574 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7075/7ad42b4c4c46ea962d2e02ddbf72fbe46513c574/dockbarx.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
67,
5668,
12,
2890,
16,
5668,
4672,
309,
2742,
18,
291,
67,
1154,
381,
1235,
13332,
365,
18,
1154,
381,
1235,
67,
13226,
67,
1883,
3947,
404,
309,
365,
18,
4285,
1098,
471,
2742,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
67,
5668,
12,
2890,
16,
5668,
4672,
309,
2742,
18,
291,
67,
1154,
381,
1235,
13332,
365,
18,
1154,
381,
1235,
67,
13226,
67,
1883,
3947,
404,
309,
365,
18,
4285,
1098,
471,
2742,... |
self.startChannel([[profile.uri, None, None]]) | self.startChannel([[profile.uri, encoding, chardata]]) | def newChannel(self, profile): log.debug('trying to start channel with %s' % profile.uri) self.startChannel([[profile.uri, None, None]]) | 8394f1cef9a64658cae76898a2b0b10fe4ca14ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11576/8394f1cef9a64658cae76898a2b0b10fe4ca14ba/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2909,
12,
2890,
16,
3042,
4672,
613,
18,
4148,
2668,
698,
310,
358,
787,
1904,
598,
738,
87,
11,
738,
3042,
18,
1650,
13,
365,
18,
1937,
2909,
3816,
63,
5040,
18,
1650,
16,
599,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2909,
12,
2890,
16,
3042,
4672,
613,
18,
4148,
2668,
698,
310,
358,
787,
1904,
598,
738,
87,
11,
738,
3042,
18,
1650,
13,
365,
18,
1937,
2909,
3816,
63,
5040,
18,
1650,
16,
599,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.