rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
sage: Tab(rows = [[1,2],[3,4]]).list == [C(3),C(1),C(4),C(2)] True sage: Tab(columns = [[3,1],[4,2]]).list == [C(3),C(1),C(4),C(2)] | sage: Tab(rows = [[1,2],[3,4]])._list == [C(3),C(1),C(4),C(2)] True sage: Tab(columns = [[3,1],[4,2]])._list == [C(3),C(1),C(4),C(2)] | def positionsOfUnmatchedPlus(self, i): | 3cfa1b764cc6179c31a1090018aa7bfd52997657 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/3cfa1b764cc6179c31a1090018aa7bfd52997657/tensor_product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
13207,
12,
2890,
16,
277,
4672,
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,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
13207,
12,
2890,
16,
277,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sage: V.M | sage: V.M | def get_magma_attribute(self, attrname): """ Return value of a given Magma attribute. This is like self`attrname in Magma. | 04917fdfb19c54d3ca3aa421b8fa4cc30257acef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/04917fdfb19c54d3ca3aa421b8fa4cc30257acef/magma.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4527,
2540,
67,
4589,
12,
2890,
16,
1604,
529,
4672,
3536,
2000,
460,
434,
279,
864,
490,
9454,
1566,
18,
225,
1220,
353,
3007,
365,
68,
1747,
529,
316,
490,
9454,
18,
2,
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,
336,
67,
4527,
2540,
67,
4589,
12,
2890,
16,
1604,
529,
4672,
3536,
2000,
460,
434,
279,
864,
490,
9454,
1566,
18,
225,
1220,
353,
3007,
365,
68,
1747,
529,
316,
490,
9454,
18,
2,
-1... |
from ipdb import set_trace; set_trace() debug(title) | def main_upload(arguments): """Upload video to Youtube.""" usage = """Usage: %prog [OPTIONS] EMAIL PASSWORD FILE TITLE DESCRIPTION CATEGORY KEYWORDS Upload a video to youtube spliting it if necessary (uses ffmpeg).""" parser = optparse.OptionParser(usage, version=VERSION) parser.add_option('-c', '--get-categories', dest='get_categories', action="store_true", default=False, help='Show video categories') parser.add_option('-s', '--split-only', dest='split_only', action="store_true", default=False, help='Split videos without uploading') parser.add_option('-n', '--no-split', dest='no_split', action="store_true", default=False, help='Skip video split') parser.add_option('-u', '--get-upload-form-info', dest='get_upload_form_data', action="store_true", default=False, help="Don't upload, just get the form info") parser.add_option('', '--private', dest='private', action="store_true", default=False, help='Set uploaded video as private') parser.add_option('', '--location', dest='location', type="string", default=None, metavar="COORDINATES", help='Video location (lat, lon). example: "37.0,-122.0"') options, args = parser.parse_args(arguments) if options.get_categories: print " ".join(Youtube.get_categories().keys()) return elif options.split_only: video_path, = args for path in split_youtube_video(video_path): print path return elif len(args) != 7: parser.print_usage() return 1 encoding = get_encoding() email, password0, video_path, title, description, category, skeywords = \ [unicode(s, encoding) for s in args] from ipdb import set_trace; set_trace() debug(title) password = (sys.stdin.readline().strip() if password0 == "-" else password0) videos = ([video_path] if options.no_split else list(split_youtube_video(video_path))) debug("connecting to Youtube API") yt = Youtube(DEVELOPER_KEY, email, password) keywords = filter(bool, [s.strip() for s in re.split('[,;\s]+', skeywords)]) for index, splitted_video_path in enumerate(videos): complete_title = ("%s [%d/%d]" % (title, index+1, len(videos)) if len(videos) > 1 else title) args = [splitted_video_path, complete_title, description, category, keywords] kwargs = dict(private=options.private, location=parse_location(options.location)) if options.get_upload_form_data: data = yt.get_upload_form_data(*args, **kwargs) print "|".join([splitted_video_path, data["token"], data["post_url"]]) else: debug("start upload: %s (%s)" % (splitted_video_path, complete_title)) entry = yt.upload_video(*args, **kwargs) print entry.GetHtmlLink().href.replace("&feature=youtube_gdata", "") | 9a1ca1cfb5fe15c213d33feb4a0065af9208d38d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9246/9a1ca1cfb5fe15c213d33feb4a0065af9208d38d/youtube_upload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
67,
6327,
12,
7099,
4672,
3536,
4777,
6191,
358,
1624,
21105,
12123,
4084,
273,
3536,
5357,
30,
738,
14654,
306,
12422,
65,
25229,
23446,
7527,
29406,
21736,
31524,
19281,
5311,
23287,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
6327,
12,
7099,
4672,
3536,
4777,
6191,
358,
1624,
21105,
12123,
4084,
273,
3536,
5357,
30,
738,
14654,
306,
12422,
65,
25229,
23446,
7527,
29406,
21736,
31524,
19281,
5311,
23287,... | |
self._schema = reader.readFromUrl(url) | self._schema = reader.loadFromURL(url) | def getSchema(self): """if schema is not defined, first look for a Schema class instance in parent Schema. Else if not defined resolve schemaLocation and create a new Schema class instance. """ if not self._schema: schema = self._parent()._parent() self._schema = schema.getIncludeSchemas(\ self.attributes['schemaLocation']) if not self._schema: url = BaseUriResolver().normalize(\ self.attributes['schemaLocation'], schema.getBaseUrl()) reader = SchemaReader() reader._imports = schema.getImportSchemas() reader._includes = schema.getIncludeSchemas() self._schema = reader.readFromUrl(url) self._schema.setBaseUrl(url) return self._schema | 1cd5c28cd8be85c8bc8e60e9d61f5b98f1008955 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/1cd5c28cd8be85c8bc8e60e9d61f5b98f1008955/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11088,
12,
2890,
4672,
3536,
430,
1963,
353,
486,
2553,
16,
1122,
2324,
364,
279,
4611,
667,
791,
316,
982,
4611,
18,
225,
16289,
309,
486,
2553,
2245,
1963,
2735,
471,
752,
279,
394,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11088,
12,
2890,
4672,
3536,
430,
1963,
353,
486,
2553,
16,
1122,
2324,
364,
279,
4611,
667,
791,
316,
982,
4611,
18,
225,
16289,
309,
486,
2553,
2245,
1963,
2735,
471,
752,
279,
394,
... |
wikipedia.output(u"Request %s:%s" % (lang, path)) | wikipedia.output(u"Request %s:%s" % (site.lang, path)) | def GetData(params, site = None, verbose = False, useAPI = False, retryCount = 5, encodeTitle = True): """Get data from the query api, and convert it into a data object """ if site == None: site = wikipedia.getSite() for k,v in params.iteritems(): if not IsString(v): params[k] = unicode(v) params['format'] = 'json' if not useAPI: params['noprofile'] = '' for k,v in params.iteritems(): if type(v) == type(u''): params[k] = ToUtf8(v) # Titles param might be long, case convert it to post request data = None titlecount = 0 if 'titles' in params: titlecount = params['titles'].count('|') if encodeTitle: data = urllib.urlencode({'titles' : params['titles']}) del params['titles'] if useAPI: path = site.api_address() + urllib.urlencode(params.items()) else: path = site.query_address() + urllib.urlencode(params.items()) if verbose: if titlecount > 0: wikipedia.output(u"Requesting %d titles from %s:%s" % (titlecount, lang, path)) else: wikipedia.output(u"Request %s:%s" % (lang, path)) lastError = None retry_idle_time = 5 while retryCount >= 0: try: jsontext = "Nothing received" jsontext = site.getUrl( path, retry=True, data=data ) # This will also work, but all unicode strings will need to be converted from \u notation # decodedObj = eval( jsontext ) return simplejson.loads( jsontext ) except ValueError, error: retryCount -= 1 wikipedia.output(u"Error downloading data: %s" % error) wikipedia.output(u"Request %s:%s" % (lang, path)) wikipedia.debugDump('ApiGetDataParse', site, str(error) + '\n%s' % path, jsontext) lastError = error if retryCount >= 0: wikipedia.output(u"Retrying in %i seconds..." % retry_idle_time) time.sleep(retry_idle_time) # Next time wait longer, but not longer than half an hour retry_idle_time *= 2 if retry_idle_time > 300: retry_idle_time = 300 raise lastError | 3524e338086618d1dabcda0ee7578a46a28e59e3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/3524e338086618d1dabcda0ee7578a46a28e59e3/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30837,
12,
2010,
16,
2834,
273,
599,
16,
3988,
273,
1083,
16,
999,
2557,
273,
1083,
16,
30084,
273,
1381,
16,
2017,
4247,
273,
1053,
4672,
3536,
967,
501,
628,
326,
843,
1536,
16,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
30837,
12,
2010,
16,
2834,
273,
599,
16,
3988,
273,
1083,
16,
999,
2557,
273,
1083,
16,
30084,
273,
1381,
16,
2017,
4247,
273,
1053,
4672,
3536,
967,
501,
628,
326,
843,
1536,
16,
471,... |
''' Item properties and their values are edited with html FORM | """ Item properties and their values are edited with html FORM | def parsePropsFromForm(self, num_re=re.compile('^\d+$')): ''' Item properties and their values are edited with html FORM variables and their values. You can: | f11907437836b035b89a935141d5777def9d1278 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f11907437836b035b89a935141d5777def9d1278/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
5047,
1265,
1204,
12,
2890,
16,
818,
67,
266,
33,
266,
18,
11100,
2668,
17134,
72,
15,
9227,
3719,
30,
3536,
4342,
1790,
471,
3675,
924,
854,
18532,
598,
1729,
8979,
3152,
471,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
5047,
1265,
1204,
12,
2890,
16,
818,
67,
266,
33,
266,
18,
11100,
2668,
17134,
72,
15,
9227,
3719,
30,
3536,
4342,
1790,
471,
3675,
924,
854,
18532,
598,
1729,
8979,
3152,
471,
3... |
self.add_link('first', self.env.href.changeset(1), 'Changeset 1') self.add_link('prev', self.env.href.changeset(self.rev - 1), | self.add_link(req, 'first', self.env.href.changeset(1), 'Changeset 1') self.add_link(req, 'prev', self.env.href.changeset(self.rev - 1), | def render(self, req): self.perm.assert_permission (perm.CHANGESET_VIEW) | 5304b982a6c96671fea398b5c0665537d7d0f9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/5304b982a6c96671fea398b5c0665537d7d0f9ec/Changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1111,
4672,
365,
18,
12160,
18,
11231,
67,
9827,
261,
12160,
18,
14473,
4043,
67,
12145,
13,
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,
1743,
12,
2890,
16,
1111,
4672,
365,
18,
12160,
18,
11231,
67,
9827,
261,
12160,
18,
14473,
4043,
67,
12145,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"%s not in sys.path" % pth_file.imported) self.assertTrue(site.makepath(pth_file.good_dir_path)[0] in sys.path) self.assertTrue(not os.path.exists(pth_file.bad_dir_path)) | "%s not in sys.modules" % pth_file.imported) self.assertIn(site.makepath(pth_file.good_dir_path)[0], sys.path) self.assertFalse(os.path.exists(pth_file.bad_dir_path)) | def pth_file_tests(self, pth_file): """Contain common code for testing results of reading a .pth file""" self.assertTrue(pth_file.imported in sys.modules, "%s not in sys.path" % pth_file.imported) self.assertTrue(site.makepath(pth_file.good_dir_path)[0] in sys.path) self.assertTrue(not os.path.exists(pth_file.bad_dir_path)) | 92775272378851dfe1e295db9a292073fcc21e33 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/92775272378851dfe1e295db9a292073fcc21e33/test_site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18540,
67,
768,
67,
16341,
12,
2890,
16,
18540,
67,
768,
4672,
3536,
22928,
2975,
981,
364,
7769,
1686,
434,
6453,
279,
263,
2397,
585,
8395,
365,
18,
11231,
5510,
12,
2397,
67,
768,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18540,
67,
768,
67,
16341,
12,
2890,
16,
18540,
67,
768,
4672,
3536,
22928,
2975,
981,
364,
7769,
1686,
434,
6453,
279,
263,
2397,
585,
8395,
365,
18,
11231,
5510,
12,
2397,
67,
768,
1... |
assert isinstance(api_doc, APIDoc) if (isinstance(api_doc, VariableDoc) and api_doc.type_descr in (None, UNKNOWN)): if api_doc.value in (None, UNKNOWN): return '' api_doc = api_doc.value if api_doc.type_descr in (None, UNKNOWN): return '' return self.docstring_to_html(api_doc.type_descr, api_doc, indent) def rtype(self, api_doc, indent=0): if isinstance(api_doc, VariableDoc): if api_doc.value in (None, UNKNOWN): return '' api_doc = api_doc.value assert isinstance(api_doc, RoutineDoc) if api_doc.return_type in (None, UNKNOWN): return '' return self.docstring_to_html(api_doc.return_type, api_doc, indent) | return self._attr_to_html('type_descr', api_doc, indent) def return_type(self, api_doc, indent=0): return self._attr_to_html('return_type', api_doc, indent) | def type_descr(self, api_doc, indent=0): assert isinstance(api_doc, APIDoc) if (isinstance(api_doc, VariableDoc) and api_doc.type_descr in (None, UNKNOWN)): if api_doc.value in (None, UNKNOWN): return '' api_doc = api_doc.value if api_doc.type_descr in (None, UNKNOWN): return '' return self.docstring_to_html(api_doc.type_descr, api_doc, indent) | 5c410b5b6e25df3bdbc6da266f7773518165cb02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5c410b5b6e25df3bdbc6da266f7773518165cb02/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
618,
67,
28313,
12,
2890,
16,
1536,
67,
2434,
16,
3504,
33,
20,
4672,
1815,
1549,
12,
2425,
67,
2434,
16,
14410,
734,
504,
13,
309,
261,
291,
1336,
12,
2425,
67,
2434,
16,
7110,
1759... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
28313,
12,
2890,
16,
1536,
67,
2434,
16,
3504,
33,
20,
4672,
1815,
1549,
12,
2425,
67,
2434,
16,
14410,
734,
504,
13,
309,
261,
291,
1336,
12,
2425,
67,
2434,
16,
7110,
1759... |
res = run_sql_cached("SELECT code,name FROM field ORDER BY name ASC") | res = run_sql_cached("SELECT code,name FROM field ORDER BY name ASC", affected_tables=['field',]) | def get_searchwithin_fields(ln='en', colID=None): """Retrieves the fields name used in the 'search within' selection box for the collection ID colID.""" res = None if colID: res = run_sql_cached("""SELECT f.code,f.name FROM field AS f, collection_field_fieldvalue AS cff WHERE cff.type='sew' AND cff.id_collection=%s AND cff.id_field=f.id ORDER BY cff.score DESC, f.name ASC""", (colID,)) if not res: res = run_sql_cached("SELECT code,name FROM field ORDER BY name ASC") fields = [{ 'value' : '', 'text' : get_field_i18nname("any field", ln) }] for field_code, field_name in res: if field_code and field_code != "anyfield": fields.append({ 'value' : field_code, 'text' : get_field_i18nname(field_name, ln) }) return fields | ada6a289685f15e3d788079e52b7aa862a79a8e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/ada6a289685f15e3d788079e52b7aa862a79a8e1/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3072,
25850,
67,
2821,
12,
2370,
2218,
275,
2187,
645,
734,
33,
7036,
4672,
3536,
6960,
326,
1466,
508,
1399,
316,
326,
296,
3072,
3470,
11,
4421,
3919,
364,
326,
1849,
1599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3072,
25850,
67,
2821,
12,
2370,
2218,
275,
2187,
645,
734,
33,
7036,
4672,
3536,
6960,
326,
1466,
508,
1399,
316,
326,
296,
3072,
3470,
11,
4421,
3919,
364,
326,
1849,
1599,
... |
server = "%s:%s" % (account[server_key][0], account[port_key][0]) | def configure_outlook_express(unused): """Configure OE to use the SpamBayes POP3 and SMTP proxies, and configure SpamBayes to proxy the servers that OE was connecting to.""" # Requires win32all to be available (or for someone to write a # Mac version <wink>) if win32api is None: raise ImportError("win32 extensions required") accounts = oe_mailbox.OEAccountKeys() translate = {("POP3 Server", "POP3 Port") : "pop3proxy", ("SMTP Server", "SMTP Port") : "smtpproxy", } pop_proxy = pop_proxy_port smtp_proxy = smtp_proxy_port results = [] for proto, subkey, account in accounts: if proto == "POP3": for (server_key, port_key), sect in translate.items(): server = "%s:%s" % (account[server_key][0], account[port_key][0]) if sect[:4] == "pop3": pop_proxy = move_to_next_free_port(pop_proxy) proxy = pop_proxy else: smtp_proxy = move_to_next_free_port(smtp_proxy) proxy = smtp_proxy options[sect, "remote_servers"] += (server,) options[sect, "listen_ports"] += (proxy,) win32api.RegSetValueEx(subkey, server_key, 0, win32con.REG_SZ, "127.0.0.1") win32api.RegSetValueEx(subkey, port_key, 0, win32con.REG_SZ, str(proxy)) results.append("[%s] Proxy %s on localhost:%s" % \ (account["Account Name"][0], server, proxy)) elif proto == "IMAP4": # Setup imapfilter instead. pass options.update_file(optionsPathname) # Outlook Express rules are done in much the same way. Should one # be set up to work with notate_to or notate_subject? (and set that # option, obviously) return results | 30f1d6854fee0d525078ec8c7c26a93e7cef1e3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/30f1d6854fee0d525078ec8c7c26a93e7cef1e3b/autoconfigure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
67,
659,
7330,
67,
338,
1028,
12,
14375,
4672,
3536,
11207,
531,
41,
358,
999,
326,
5878,
301,
38,
528,
281,
26839,
23,
471,
18102,
13263,
16,
471,
5068,
5878,
301,
38,
528,
281,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5068,
67,
659,
7330,
67,
338,
1028,
12,
14375,
4672,
3536,
11207,
531,
41,
358,
999,
326,
5878,
301,
38,
528,
281,
26839,
23,
471,
18102,
13263,
16,
471,
5068,
5878,
301,
38,
528,
281,... | |
print `cf.get("Foo", "getname")` print `cf.get("Foo", "bar")` print `cf.get("Foo", "bar9")` print `cf.get("Foo", "bar10")` | verify(cf.get("Foo", "getname") == "Foo") verify(cf.get("Foo", "bar") == "something with interpolation (1 step)") verify(cf.get("Foo", "bar9") == "something with lots of interpolation (9 steps)") verify(cf.get("Foo", "bar10") == "something with lots of interpolation (10 steps)") | def interpolation(src): print print "Testing value interpolation..." cf = ConfigParser.ConfigParser({"getname": "%(__name__)s"}) sio = StringIO.StringIO(src) cf.readfp(sio) print `cf.get("Foo", "getname")` print `cf.get("Foo", "bar")` print `cf.get("Foo", "bar9")` print `cf.get("Foo", "bar10")` expect_get_error(cf, ConfigParser.InterpolationDepthError, "Foo", "bar11") | 3b4eacb6f09a74b34c9b912c4a532ce3c0bf8daa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3b4eacb6f09a74b34c9b912c4a532ce3c0bf8daa/test_cfgparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12851,
12,
4816,
4672,
1172,
1172,
315,
22218,
460,
12851,
7070,
6080,
273,
25076,
18,
809,
2678,
12590,
6,
588,
529,
6877,
22061,
972,
529,
972,
13,
87,
6,
6792,
272,
1594,
273,
15777,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12851,
12,
4816,
4672,
1172,
1172,
315,
22218,
460,
12851,
7070,
6080,
273,
25076,
18,
809,
2678,
12590,
6,
588,
529,
6877,
22061,
972,
529,
972,
13,
87,
6,
6792,
272,
1594,
273,
15777,
... |
shutil.rmtree(self.tmp_swapdir) | shutil.rmtree(path.join(self.tmp_swapdir, conf.SWAPFILE)) | def run(self): if not path.isabs(conf.HOME): conf.HOME = path.join(conf.SCRIPT_DIR, conf.HOME) if not path.isabs(conf.BIN): conf.BIN = path.join(conf.SCRIPT_DIR, conf.BIN) | 072d1dc9ea49cb7544909f9532c60827dd9d1e0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1208/072d1dc9ea49cb7544909f9532c60827dd9d1e0d/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
309,
486,
589,
18,
291,
5113,
12,
3923,
18,
14209,
4672,
2195,
18,
14209,
273,
589,
18,
5701,
12,
3923,
18,
10885,
67,
4537,
16,
2195,
18,
14209,
13,
225,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
309,
486,
589,
18,
291,
5113,
12,
3923,
18,
14209,
4672,
2195,
18,
14209,
273,
589,
18,
5701,
12,
3923,
18,
10885,
67,
4537,
16,
2195,
18,
14209,
13,
225,
309,
... |
new = re.pcre_expand(m, repl) | new = self._expand(m, repl) | def replace_all(self, event=None): prog = self.engine.getprog() if not prog: return repl = self.replvar.get() text = self.text res = self.engine.search_text(text, prog) if not res: text.bell() return text.tag_remove("sel", "1.0", "end") text.tag_remove("hit", "1.0", "end") line = res[0] col = res[1].start() if self.engine.iswrap(): line = 1 col = 0 ok = 1 first = last = None # XXX ought to replace circular instead of top-to-bottom when wrapping text.undo_block_start() while 1: res = self.engine.search_forward(text, prog, line, col, 0, ok) if not res: break line, m = res chars = text.get("%d.0" % line, "%d.0" % (line+1)) orig = m.group() new = re.pcre_expand(m, repl) i, j = m.span() first = "%d.%d" % (line, i) last = "%d.%d" % (line, j) if new == orig: text.mark_set("insert", last) else: text.mark_set("insert", first) if first != last: text.delete(first, last) if new: text.insert(first, new) col = i + len(new) ok = 0 text.undo_block_stop() if first and last: self.show_hit(first, last) self.close() | f8d071332a485ede280675a55e3319e136826dd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f8d071332a485ede280675a55e3319e136826dd0/ReplaceDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
67,
454,
12,
2890,
16,
871,
33,
7036,
4672,
11243,
273,
365,
18,
8944,
18,
588,
14654,
1435,
309,
486,
11243,
30,
327,
6831,
273,
365,
18,
26745,
1401,
18,
588,
1435,
977,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1453,
67,
454,
12,
2890,
16,
871,
33,
7036,
4672,
11243,
273,
365,
18,
8944,
18,
588,
14654,
1435,
309,
486,
11243,
30,
327,
6831,
273,
365,
18,
26745,
1401,
18,
588,
1435,
977,
273,
... |
def colorPickerCB(self, rr, gg, bb, aa): | def colorPickerExitCB(self, evt=None): self.lastColorPickerPos = self.colorPicker.GetPosition() self.colorPicker.Destroy() self.colorPicker = None def colorPickerUpdateCB(self, rr, gg, bb, aa): | def colorPickerCB(self, rr, gg, bb, aa): r = rr / 255.0 g = gg / 255.0 b = bb / 255.0 a = aa / 255.0 self.propCR.setValue(r) self.propCG.setValue(g) self.propCB.setValue(b) self.propCA.setValue(a) | b3be2000e903b2aacc1d0848361129170a021280 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7242/b3be2000e903b2aacc1d0848361129170a021280/ObjectPropertyUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2036,
13194,
6767,
8876,
12,
2890,
16,
6324,
33,
7036,
4672,
365,
18,
2722,
2957,
13194,
1616,
273,
365,
18,
3266,
13194,
18,
967,
2555,
1435,
365,
18,
3266,
13194,
18,
10740,
1435,
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,
2036,
13194,
6767,
8876,
12,
2890,
16,
6324,
33,
7036,
4672,
365,
18,
2722,
2957,
13194,
1616,
273,
365,
18,
3266,
13194,
18,
967,
2555,
1435,
365,
18,
3266,
13194,
18,
10740,
1435,
365,... |
def DoTreeRightDown(self, event): """Select the group under mouse cursor. Called when the right mouse buton is pressed on the group tree control. """ item, flags = self.groupTreeCtrl.HitTest(event.GetPosition()) if item.IsOk(): self.groupTreeCtrl.SelectItem(item) event.Skip() def DoPersonRightDown(self, event): """Select the person under mouse cursor. Called when the right mouse buton is pressed on the person list control. """ item, flags = self.personListCtrl.HitTest(event.GetPosition()) if flags & wxLIST_HITTEST_ONITEM: self.personListCtrl.Select(item) event.Skip() def DoRelationshipRightDown(self, event): """Select the relationship under mouse cursor. Called when the right mouse buton is pressed on the relationship list control. """ item, flags = self.relationshipListCtrl.HitTest(event.GetPosition()) if flags & wxLIST_HITTEST_ONITEM: self.relationshipListCtrl.Select(item) event.Skip() | def DoSelectGroup(self, event): """Update member and relationship lists for the selected group. | eb02f18240a2bb41de6b1ba2b0cb1fa07964bff8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/eb02f18240a2bb41de6b1ba2b0cb1fa07964bff8/wxclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
3391,
1114,
12,
2890,
16,
871,
4672,
3536,
1891,
3140,
471,
5232,
6035,
364,
326,
3170,
1041,
18,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
3391,
1114,
12,
2890,
16,
871,
4672,
3536,
1891,
3140,
471,
5232,
6035,
364,
326,
3170,
1041,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
res = self.__unlinkPath(lfn) if not res['OK']: gLogger.error("LcgFileCatalogClient.__addFile: Failed to remove file after failure to add checksum and size." % res['Message']) return S_ERROR("LcgFileCatalogClient.__addFile: Failed to set file size: %s" % errStr) | res = self.__unlinkPath( lfn ) if not res['OK']: gLogger.error( "LcgFileCatalogClient.__addFile: Failed to remove file after failure to add checksum and size." % res['Message'] ) return S_ERROR( "LcgFileCatalogClient.__addFile: Failed to set file size: %s" % errStr ) | def __addFile(self,lfn,pfn,size,se,guid,checksum): lfc.lfc_umask(0000) bdir = os.path.dirname(lfn) res = self.__executeOperation(bdir,'exists') # If we failed to find out whether the directory exists if not res['OK']: return S_ERROR(res['Message']) # If the directory doesn't exist if not res['Value']: #Make the directories recursively if needed res = self.__makeDirs(bdir) # If we failed to make the directory for the file if not res['OK']: return S_ERROR(res['Message']) #Create a new file fullLfn = '%s%s' % (self.prefix,lfn) value = lfc.lfc_creatg(fullLfn,guid,0664) if value != 0: errStr = lfc.sstrerror(lfc.cvar.serrno) gLogger.error("LcgFileCatalogClient__addFile: Failed to create GUID.", errStr) # Remove the file we just attempted to add res = self.__unlinkPath(lfn) if not res['OK']: gLogger.error("LcgFileCatalogClient.__addFile: Failed to remove file after failure.", res['Message']) return S_ERROR("LcgFileCatalogClient__addFile: Failed to create GUID: %s" % errStr) #Set the checksum and size of the file if not checksum: checksum = '' value = lfc.lfc_setfsizeg(guid,size,'AD',checksum) if value != 0: errStr = lfc.sstrerror(lfc.cvar.serrno) # Remove the file we just attempted to add res = self.__unlinkPath(lfn) if not res['OK']: gLogger.error("LcgFileCatalogClient.__addFile: Failed to remove file after failure to add checksum and size." % res['Message']) return S_ERROR("LcgFileCatalogClient.__addFile: Failed to set file size: %s" % errStr) return S_OK() | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
812,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
16,
15149,
4672,
328,
7142,
18,
80,
7142,
67,
379,
835,
12,
2787,
13,
324,
1214,
273,
1140,
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,
1001,
1289,
812,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
16,
15149,
4672,
328,
7142,
18,
80,
7142,
67,
379,
835,
12,
2787,
13,
324,
1214,
273,
1140,
18,
... |
cl.connect(PROXY) | cl.connect(proxy=PROXY) | def messageCB(sess,mess): nick=mess.getFrom().getResource() text=mess.getBody() ts=mess.getTimestamp() if not ts: ts=mess.setTimestamp() ts=mess.getTimestamp() tp=time.mktime(time.strptime(ts,'%Y%m%dT%H:%M:%S %Z'))+3600*3 if time.localtime()[-1]: tp+=3600 tp=time.localtime(tp) fold=time.strftime("%Y.%m",tp) day=time.strftime("%d",tp) tm=time.strftime("%H:%M:%S",tp) line="<tr><td>%s</td><td>%s<td>"%(tm,text) LOG(fold,day,tm,nick,text) | c130a725281ff9caf028d1ba1fb1eb12d7d17a79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/c130a725281ff9caf028d1ba1fb1eb12d7d17a79/logger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
883,
8876,
12,
23828,
16,
81,
403,
4672,
10909,
33,
81,
403,
18,
588,
1265,
7675,
588,
1420,
1435,
977,
33,
81,
403,
18,
588,
2250,
1435,
3742,
33,
81,
403,
18,
588,
4921,
1435,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
883,
8876,
12,
23828,
16,
81,
403,
4672,
10909,
33,
81,
403,
18,
588,
1265,
7675,
588,
1420,
1435,
977,
33,
81,
403,
18,
588,
2250,
1435,
3742,
33,
81,
403,
18,
588,
4921,
1435,
309,... |
self._requires = [] self._warnings = [] self._notes = [] | def __init__(self, obj, verbosity=0): """ Create the documentation for the given object. @param obj: The object to document. @type obj: any @param verbosity: The verbosity of output produced when creating documentation for the object. More positive numbers produce more verbose output; negative numbers supress warnings and errors. @type verbosity: C{int} """ self._uid = make_uid(obj) | 2ea766fa637b1324e25724545303f11e624a5247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/2ea766fa637b1324e25724545303f11e624a5247/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1081,
16,
11561,
33,
20,
4672,
3536,
1788,
326,
7323,
364,
326,
864,
733,
18,
225,
632,
891,
1081,
30,
1021,
733,
358,
1668,
18,
632,
723,
1081,
30,
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,
1001,
2738,
972,
12,
2890,
16,
1081,
16,
11561,
33,
20,
4672,
3536,
1788,
326,
7323,
364,
326,
864,
733,
18,
225,
632,
891,
1081,
30,
1021,
733,
358,
1668,
18,
632,
723,
1081,
30,
12... | |
msg['Subject'] = self.subject | msg['Subject'] = Header(self.subject, 'utf-8') | def send(self, rcpt, mime_headers={}): | 3f02f2ac732d18b63be45396663354e0178a2fb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/3f02f2ac732d18b63be45396663354e0178a2fb6/Notify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
12,
2890,
16,
4519,
337,
16,
4892,
67,
2485,
12938,
4672,
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,
... | [
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
12,
2890,
16,
4519,
337,
16,
4892,
67,
2485,
12938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return get_color(element, "stroke", "stroke-opacity"), False | color = get_color(element, "stroke", "stroke-opacity") if color: return color, False else: return color, True | def get_special_attribute(element, attribute): """ Try to get a special attribute from an element """ if attribute == "color": return get_color(element, "stop-color", "stop-opacity"), False elif attribute == "stops": return element.get_children("stop", Stop), False elif attribute == "xlink": return element.get_attribute("xlink:href", False), False elif attribute == "fill": return get_color(element, "fill", "fill-opacity"), False elif attribute == "stroke": return get_color(element, "stroke", "stroke-opacity"), False elif element.tag in ["svg", "defs", "g"]: # container objects search = [] if attribute[:4] == "all_": recursive = True attribute = attribute[4:] else: recursive = False if attribute in ["linear_gradients", "gradients", "fills"]: search.append(("linearGradient", Gradient)) if attribute in ["radial_gradients", "gradients", "fills"]: search.append(("radialGradient", Gradient)) if attribute in ["patterns", "fills"]: search.append(("pattern", TransformableContainer)) if attribute in ["rects", "basic_shapes", "shapes"]: search.append(("rect", Shape)) if attribute in ["circles", "basic_shapes", "shapes"]: search.append(("rect", Shape)) if attribute in ["ellipses", "basic_shapes", "shapes"]: search.append(("ellipse", Shape)) if attribute in ["lines", "basic_shapes", "shapes"]: search.append(("line", Line)) if attribute in ["polylines", "basic_shapes", "shapes"]: search.append(("polyline", Shape)) if attribute in ["paths", "basic_shapes", "shapes"]: search.append(("path", Shape)) if attribute in ["texts", "text_shapes", "shapes"]: search.append(("text", Shape)) if attribute in ["tspans", "text_shapes", "shapes"]: search.append(("tspan", Shape)) if attribute in ["trefs", "text_shapes", "shapes"]: search.append(("tref", Shape)) if attribute in ["groups", "containers"]: search.append(("g", TransformableColorableContainer)) if attribute in ["defs", "containers"]: search.append(("defs", Container)) if search: objs = [] for obj, stype in search: objs += element.get_children(obj, stype, recursive) return objs, False return None, True | 887863ca7f038dbe4ac239486c9c41d552f4d776 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2399/887863ca7f038dbe4ac239486c9c41d552f4d776/svgfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9371,
67,
4589,
12,
2956,
16,
1566,
4672,
3536,
6161,
358,
336,
279,
4582,
1566,
628,
392,
930,
3536,
309,
1566,
422,
315,
3266,
6877,
327,
336,
67,
3266,
12,
2956,
16,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9371,
67,
4589,
12,
2956,
16,
1566,
4672,
3536,
6161,
358,
336,
279,
4582,
1566,
628,
392,
930,
3536,
309,
1566,
422,
315,
3266,
6877,
327,
336,
67,
3266,
12,
2956,
16,
315,
... |
if time.time() - self.lastping > (self.timeout * 2): self.pingSelf = 1 log.msg("Dropping due to pingout") self.shutdown() | if time.time() - self.lastping > (self.timeout * 2): self.pingSelf = 1 log.msg("Dropping due to pingout") self.shutdown() | def checkPing(self): | c8dc6496fcdea91de7fd32e1a604f8130e3c8357 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5901/c8dc6496fcdea91de7fd32e1a604f8130e3c8357/words.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
17223,
12,
2890,
4672,
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,
0,
0,
0,
0,
0,
... | [
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
17223,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
'echo copy %s' % path | 'echo copy "%s"' % path | def on_compare(self, path, kind, result): from os.path import join | b45eed493c16cbe98b7f918a48ebaf8000111e9f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/692/b45eed493c16cbe98b7f918a48ebaf8000111e9f/cmpdirs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
9877,
12,
2890,
16,
589,
16,
3846,
16,
563,
4672,
628,
1140,
18,
803,
1930,
1233,
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,
603,
67,
9877,
12,
2890,
16,
589,
16,
3846,
16,
563,
4672,
628,
1140,
18,
803,
1930,
1233,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.browser = None | def __init__(self, hits): global _resultscounter hits = map(lambda (path, hits): (sucktitle(path), path, hits), hits) hits.sort() self.hits = hits nicehits = map( lambda (title, path, hits): title + '\r' + string.join( map(lambda (c, p): "%s (%d)" % (p, c), hits), ', '), hits) nicehits.sort() self.w = W.Window((440, 300), "Search results %d" % _resultscounter, minsize = (200, 100)) self.w.results = TwoLineList((-1, -1, 1, -14), nicehits, self.listhit) self.w.open() self.w.bind('return', self.listhit) self.w.bind('enter', self.listhit) _resultscounter = _resultscounter + 1 self.browser = None | cee949f945eacf13b3d780624620f295c351886f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cee949f945eacf13b3d780624620f295c351886f/PyDocSearch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11076,
4672,
2552,
389,
2088,
1017,
2096,
11076,
273,
852,
12,
14661,
261,
803,
16,
11076,
4672,
261,
87,
9031,
2649,
12,
803,
3631,
589,
16,
11076,
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,
1001,
2738,
972,
12,
2890,
16,
11076,
4672,
2552,
389,
2088,
1017,
2096,
11076,
273,
852,
12,
14661,
261,
803,
16,
11076,
4672,
261,
87,
9031,
2649,
12,
803,
3631,
589,
16,
11076,
3631,
... | |
'iban': fields.char('Account number', size=64), | 'iban': fields.char('Account Number', size=64), | def gen_next_ref(self, cr, uid, ids): if len(ids) != 1: return True # compute the next number ref cr.execute("select ref from res_partner where ref is not null order by char_length(ref) desc, ref desc limit 1") res = cr.dictfetchall() ref = res and res[0]['ref'] or '0' try: nextref = int(ref)+1 except e: raise osv.except_osv('Warning', "Couldn't generate the next id because some partners have an alphabetic id !") | 1bc0af85611d3b038312053316810e8a7343474e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7397/1bc0af85611d3b038312053316810e8a7343474e/partner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
4285,
67,
1734,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
4672,
309,
562,
12,
2232,
13,
480,
404,
30,
327,
1053,
225,
468,
3671,
326,
1024,
1300,
1278,
4422,
18,
8837,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3157,
67,
4285,
67,
1734,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
4672,
309,
562,
12,
2232,
13,
480,
404,
30,
327,
1053,
225,
468,
3671,
326,
1024,
1300,
1278,
4422,
18,
8837,
2932,
... |
return string.join(res, "") | return "".join(res) | def unquote(s): """unquote('abc%20def') -> 'abc def'.""" mychr = chr myatoi = string.atoi list = string.split(s, '%') res = [list[0]] myappend = res.append del list[0] for item in list: if item[1:2]: try: myappend(mychr(myatoi(item[:2], 16)) + item[2:]) except: myappend('%' + item) else: myappend('%' + item) return string.join(res, "") | 2aa671823938e593ea9dedd33b3cc4194fde8a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/2aa671823938e593ea9dedd33b3cc4194fde8a0a/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25611,
12,
87,
4672,
3536,
318,
6889,
2668,
18947,
9,
3462,
536,
6134,
317,
296,
18947,
1652,
11,
12123,
3399,
15182,
273,
4513,
3399,
270,
11359,
273,
533,
18,
270,
11359,
666,
273,
533... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
25611,
12,
87,
4672,
3536,
318,
6889,
2668,
18947,
9,
3462,
536,
6134,
317,
296,
18947,
1652,
11,
12123,
3399,
15182,
273,
4513,
3399,
270,
11359,
273,
533,
18,
270,
11359,
666,
273,
533... |
i.timeleft = self.getTime((i.size - i.currentbytes)/i.speed/1024) | if i.speed <= 0.0: i.timeleft = "∞" else: i.timeleft = self.getTime((i.size - i.currentbytes)/i.speed/1024) | def FileDownload(self, msg): """ A file download is in progress""" needupdate = 1 config = self.eventprocessor.config.sections for i in self.downloads: if i.conn != msg.conn: continue try: if i.transfertimer is not None: i.transfertimer.cancel() curtime = time.time() i.currentbytes = msg.file.tell() if i.lastbytes is None: i.lastbytes = i.currentbytes if i.starttime is None: i.starttime = curtime if i.lasttime is None: i.lasttime = curtime - 1 #i.status = "%s" %(str(i.currentbytes)) i.status = "Transferring" oldelapsed = i.timeelapsed i.timeelapsed = self.getTime(curtime - i.starttime) if curtime > i.starttime and i.currentbytes > i.offset: i.speed = (i.currentbytes - i.lastbytes)/(curtime - i.lasttime)/1024 i.timeleft = self.getTime((i.size - i.currentbytes)/i.speed/1024) i.lastbytes = i.currentbytes i.lasttime = curtime if i.size > i.currentbytes: if oldelapsed == i.timeelapsed: needupdate = 0 #i.status = str(i.currentbytes) i.status = "Transferring" else: msg.file.close() basename = self.CleanPath(self.encode(string.split(i.filename,'\\')[-1], i.user)) downloaddir = config["transfers"]["downloaddir"] if i.path and i.path[0] == '/': folder = self.CleanPath(i.path) else: folder = os.path.join(downloaddir, self.encode(i.path)) if not os.access(folder, os.F_OK): os.makedirs(folder) newname = self.getRenamed(os.path.join(folder, basename)) try: if win32: os.rename(msg.file.name, u"%s" % newname) else: os.rename(msg.file.name, newname) except OSError: try: f1 = open(msg.file.name, "rb") d = f1.read() if win32: f1 = open(u"%s" % newname, "wb") else: f1 = open(newname, "wb") f1.write(d) f1.close() os.remove(msg.file.name) except OSError: self.eventprocessor.logMessage(_("Couldn't move '%(tempfile)s' to '%(file)s'") % {'tempfile':self.decode(msg.file.name), 'file':self.decode(newname)}) i.status = "Finished" self.eventprocessor.logMessage(_("Download finished: %(file)s") % {'file':u"%s" % newname}) self.eventprocessor.logTransfer(_("Download finished: user %(user)s, file %(file)s") % {'user':i.user, 'file':self.decode(i.filename)}) self.queue.put(slskmessages.ConnClose(msg.conn)) #if i.speed is not None: #self.queue.put(slskmessages.SendSpeed(i.user, int(i.speed*1024))) #Removed due to misuse. Replaced by SendUploadSpeed i.conn = None if win32: self.addToShared(u"%s" % newname) else: self.addToShared(newname) self.eventprocessor.sendNumSharedFoldersFiles() self.SaveDownloads() self.downloadspanel.update(i) if config["transfers"]["shownotification"]: self.eventprocessor.frame.NewNotification(_("%(file)s downloaded from %(user)s") % {'user':i.user, "file":newname.rsplit(os.sep, 1)[1]}, title=_("Nicotine+ :: file downloaded")) | b6fd2f0d2d36b4d487b0f7f515dd0fb6dfa84cde /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8738/b6fd2f0d2d36b4d487b0f7f515dd0fb6dfa84cde/transfers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1387,
7109,
12,
2890,
16,
1234,
4672,
3536,
432,
585,
4224,
353,
316,
4007,
8395,
1608,
2725,
273,
404,
642,
273,
365,
18,
2575,
8700,
18,
1425,
18,
11657,
364,
277,
316,
365,
18,
7813... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1387,
7109,
12,
2890,
16,
1234,
4672,
3536,
432,
585,
4224,
353,
316,
4007,
8395,
1608,
2725,
273,
404,
642,
273,
365,
18,
2575,
8700,
18,
1425,
18,
11657,
364,
277,
316,
365,
18,
7813... |
dcall_discard(self, 'requestBlocks_dcall') | def scheduleRequestBlocks(self): | 7c88a4eb1e925976a8217ff9c7b1d1eaba42f8f7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8524/7c88a4eb1e925976a8217ff9c7b1d1eaba42f8f7/dtella_bridgeclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4788,
691,
6450,
12,
2890,
4672,
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,
0,
0,
0,
0,... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4788,
691,
6450,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
tree = _postProcessHelper(tree, id, process, variants) | tree = _postProcessHelper(tree, id, process, variants) | def getCompiled(id, variants, process): global classes global verbose variantsId = generateVariantCombinationId(variants) processId = generateProcessCombinationId(process) cache = readCache(id, "compiled-" + variantsId + "-" + processId, classes[id]["path"]) if cache != None: return cache tokens = getTokens(id) tree = copy.deepcopy(getVariantsTree(id, variants)) if verbose: print " - Postprocessing tree: %s..." % id tree = _postProcessHelper(tree, id, process, variants) if verbose: print " - Compiling tree: %s..." % id compiled = _compileClassHelper(tree) writeCache(id, "compiled-" + variantsId + "-" + processId, compiled) return compiled | e3364bd2416dfe75fd85aeea0ded427372ef3d08 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/e3364bd2416dfe75fd85aeea0ded427372ef3d08/generator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
20733,
12,
350,
16,
12935,
16,
1207,
4672,
2552,
3318,
2552,
3988,
225,
12935,
548,
273,
2103,
9356,
26062,
548,
12,
15886,
13,
1207,
548,
273,
2103,
2227,
26062,
548,
12,
2567,
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,
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,
20733,
12,
350,
16,
12935,
16,
1207,
4672,
2552,
3318,
2552,
3988,
225,
12935,
548,
273,
2103,
9356,
26062,
548,
12,
15886,
13,
1207,
548,
273,
2103,
2227,
26062,
548,
12,
2567,
13,... |
logging.debug( "log level:", self.pytrainer_main.log_level, "validate:", self.pytrainer_main.validate, "check:", self.pytrainer_main.check, "gm3:", self.pytrainer_main.gm3, "testimport:", self.pytrainer_main.testimport ) | def init_params_tab(self): logging.debug( "log level:", self.pytrainer_main.log_level, "validate:", self.pytrainer_main.validate, "check:", self.pytrainer_main.check, "gm3:", self.pytrainer_main.gm3, "testimport:", self.pytrainer_main.testimport ) #Show log level if self.pytrainer_main.log_level == logging.ERROR: self.comboboxLogLevel.set_active(0) elif self.pytrainer_main.log_level == logging.WARNING: self.comboboxLogLevel.set_active(1) elif self.pytrainer_main.log_level == logging.INFO: self.comboboxLogLevel.set_active(2) elif self.pytrainer_main.log_level == logging.DEBUG: self.comboboxLogLevel.set_active(3) else: self.comboboxLogLevel.set_active(4) print "Unknown logging level specified" | 6cd582a33946efe205b9b39ec2041bc616acf1bf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11865/6cd582a33946efe205b9b39ec2041bc616acf1bf/windowprofile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
2010,
67,
7032,
12,
2890,
4672,
468,
5706,
613,
1801,
309,
365,
18,
2074,
313,
1521,
67,
5254,
18,
1330,
67,
2815,
422,
2907,
18,
3589,
30,
365,
18,
9301,
27570,
21806,
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,
1208,
67,
2010,
67,
7032,
12,
2890,
4672,
468,
5706,
613,
1801,
309,
365,
18,
2074,
313,
1521,
67,
5254,
18,
1330,
67,
2815,
422,
2907,
18,
3589,
30,
365,
18,
9301,
27570,
21806,
18,
... | |
security.declareProtected(view_management_screens, 'list_all_roles') | def delRole(self, roles=[], REQUEST=None): """ delete role""" if not roles: raise Exception, 'You must specify a role name' roles = self.utConvertToList(roles) self._delRole(roles) if REQUEST is not None: return REQUEST.RESPONSE.redirect('manage_roles_html') | ed400876be7bc2f645c44299f0e3a93a75b63f00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/ed400876be7bc2f645c44299f0e3a93a75b63f00/Role.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
2996,
12,
2890,
16,
4900,
22850,
6487,
12492,
33,
7036,
4672,
3536,
1430,
2478,
8395,
309,
486,
4900,
30,
1002,
1185,
16,
296,
6225,
1297,
4800,
279,
2478,
508,
11,
4900,
273,
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,
1464,
2996,
12,
2890,
16,
4900,
22850,
6487,
12492,
33,
7036,
4672,
3536,
1430,
2478,
8395,
309,
486,
4900,
30,
1002,
1185,
16,
296,
6225,
1297,
4800,
279,
2478,
508,
11,
4900,
273,
365,... | |
if debug: print "Opening oofem output file:", oofemoutfilename[:-1] infile = open(oofemoutfilename[:-1]) for i in range(len(userrec)): recVal[i]='--' for line in infile: while (line): line = match_primary_rec (line) | if debug: print "Opening oofem output file:", oofemoutfilename[:-1] infile = open(oofemoutfilename[:-1]) for i in range(len(userrec)): recVal[i]='--' for line in infile: while (line): line = match_primary_rec (line) | def main(): global userrec, recval, infile, infilename, mode, tolerance try: # options expecting value followed by ':', see also Unix getopt opts, args = getopt.getopt (sys.argv[1:],'cf:') except getopt.GetoptError, err: print str(err) usage() exit(1) # flag whether -f compulsory option provided infileflag = 0 #print opts for o, a in opts: if o == "-f": infilename = a infileflag = 1 elif o == "-c": mode = 'c' else: usage() assert False, "unhandled option" if infileflag == 0: usage() assert False, "-f option required" # open oofem input file if debug: print "Opening oofem input file:", sys.argv[1] infile=open(infilename) | aa37b2bdfae39b7dbc77c6303652ba62381c3298 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1573/aa37b2bdfae39b7dbc77c6303652ba62381c3298/extractor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
729,
3927,
16,
1950,
1125,
16,
14568,
16,
316,
3459,
16,
1965,
16,
10673,
775,
30,
468,
702,
17012,
460,
10860,
635,
4290,
2187,
2621,
2546,
9480,
336,
3838,
1500,
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,
2774,
13332,
2552,
729,
3927,
16,
1950,
1125,
16,
14568,
16,
316,
3459,
16,
1965,
16,
10673,
775,
30,
468,
702,
17012,
460,
10860,
635,
4290,
2187,
2621,
2546,
9480,
336,
3838,
1500,
16,... |
from pypy.translator.cli.support import patch, unpatch, NT_OS | from pypy.translator.oosupport.support import patch_os, unpatch_os, NT_OS | def test_patch_os(self): import os from pypy.translator.cli.support import patch, unpatch, NT_OS original_O_CREAT = os.O_CREAT olddefs = patch() assert os.O_CREAT == NT_OS['O_CREAT'] unpatch(*olddefs) assert os.O_CREAT == original_O_CREAT | f7ae5e753b703f0e85397b17fcff4841364627d3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/f7ae5e753b703f0e85397b17fcff4841364627d3/runtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2272,
67,
538,
12,
2890,
4672,
1930,
1140,
628,
18951,
93,
18,
17879,
18,
83,
538,
416,
655,
18,
13261,
1930,
4729,
67,
538,
16,
640,
2272,
67,
538,
16,
20064,
67,
4618,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2272,
67,
538,
12,
2890,
4672,
1930,
1140,
628,
18951,
93,
18,
17879,
18,
83,
538,
416,
655,
18,
13261,
1930,
4729,
67,
538,
16,
640,
2272,
67,
538,
16,
20064,
67,
4618,
22... |
'Color', 'Coord', | 'Color', 'Coord', 'ColorBand', | def register_fonts(path=fontscollectionpath): """Recursively register fonts using path argument as base directory""" for dirpath, _, filenames in os.walk(path): for filename in filenames: if os.path.splitext(filename)[1] == '.ttf': FontEngine.instance().register_font(os.path.join(dirpath, filename)) | f35b9bc7d08ee366b9fcfe5b737ce5c1f257200a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12100/f35b9bc7d08ee366b9fcfe5b737ce5c1f257200a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
67,
22052,
12,
803,
33,
5776,
1017,
355,
942,
803,
4672,
3536,
12474,
1744,
16450,
1450,
589,
1237,
487,
1026,
1867,
8395,
364,
17803,
16,
389,
16,
9066,
316,
1140,
18,
11348,
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,
1744,
67,
22052,
12,
803,
33,
5776,
1017,
355,
942,
803,
4672,
3536,
12474,
1744,
16450,
1450,
589,
1237,
487,
1026,
1867,
8395,
364,
17803,
16,
389,
16,
9066,
316,
1140,
18,
11348,
12,
... |
userlang = mlist.GetPreferredLanguage(user) | cgidata = cgi.FieldStorage() userlang = cgidata.getvalue('language', mlist.GetPreferredLanguage(user)) | def main(): doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) parts = Utils.GetPathPieces() if not parts or len(parts) < 2: title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('Invalid options to CGI script.')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() return # get the list and user's name listname = parts[0].lower() # open list try: mlist = MailList.MailList(listname, lock=0) except Errors.MMListError, e: title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('No such list <em>%(listname)s</em>')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() syslog('error', 'No such list "%s": %s\n', listname, e) return # Now we know which list is requested, so we can set the language to the # list's preferred language. i18n.set_language(mlist.preferred_language) doc.set_language(mlist.preferred_language) # Sanity check the user user = Utils.UnobscureEmail(SLASH.join(parts[1:])) user = Utils.LCDomain(user) if not mlist.IsMember(user): realname = mlist.real_name title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message( doc, _('List "%(realname)s" has no such member: %(user)s.')) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format() return # Find the case preserved email address (the one the user subscribed with) lcuser = mlist.FindUser(user) cpuser = mlist.GetUserSubscribedAddress(lcuser) if lcuser == cpuser: cpuser = None # And now we know the user making the request, so set things up for the # user's preferred language. userlang = mlist.GetPreferredLanguage(user) doc.set_language(userlang) i18n.set_language(userlang) # Are we processing an unsubscription request from the login screen? cgidata = cgi.FieldStorage() if cgidata.has_key('login-unsub'): # Because they can't supply a password for unsubscribing, we'll need # to do the confirmation dance. mlist.ConfirmUnsubscription(user, userlang) add_error_message( doc, _('The confirmation email has been sent.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Are we processing a password reminder from the login screen? if cgidata.has_key('login-remind'): mlist.MailUserPassword(user) add_error_message( doc, _('A reminder of your password has been emailed to you.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Authenticate, possibly using the password supplied in the login page password = cgidata.getvalue('password', '').strip() if not mlist.WebAuthenticate((mm_cfg.AuthUser, mm_cfg.AuthListAdmin, mm_cfg.AuthSiteAdmin), password, user): # Not authenticated, so throw up the login page again. If they tried # to authenticate via cgi (instead of cookie), then print an error # message. if cgidata.has_key('login'): add_error_message(doc, _('Authentication failed.')) loginpage(mlist, doc, user, cgidata) print doc.Format() return # From here on out, the user is okay to view and modify their membership # options. The first set of checks does not require the list to be # locked. if cgidata.has_key('logout'): print mlist.ZapCookie(mm_cfg.AuthUser, user) loginpage(mlist, doc, user, cgidata) print doc.Format() return if cgidata.has_key('emailpw'): mlist.MailUserPassword(user) options_page( mlist, doc, user, cpuser, userlang, _('A reminder of your password has been emailed to you.')) print doc.Format() return if cgidata.has_key('othersubs'): hostname = mlist.host_name title = _('List subscriptions for %(user)s on %(hostname)s') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.AddItem(_('''Click on a link to visit your options page for the requested mailing list.''')) # Troll through all the mailing lists that match host_name and see if # the user is a member. If so, add it to the list. onlists = [] for gmlist in lists_of_member(mlist.host_name, user): url = gmlist.GetOptionsURL(user) link = Link(url, gmlist.real_name) onlists.append((gmlist.real_name, link)) onlists.sort() items = OrderedList(*[link for name, link in onlists]) doc.AddItem(items) print doc.Format() return if cgidata.has_key('change-of-address'): newaddr = cgidata.getvalue('new-address') confirmaddr = cgidata.getvalue('confirm-address') if not newaddr or not confirmaddr: options_page(mlist, doc, user, cpuser, userlang, _('Addresses may not be blank')) print doc.Format() return if newaddr <> confirmaddr: options_page(mlist, doc, user, cpuser, userlang, _('Addresses did not match!')) print doc.Format() return # See if the user wants to change their email address globally globally = cgidata.getvalue('changeaddr-globally') # Standard sigterm handler. def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Register the pending change after the list is locked msg = _('A confirmation message has been sent to %(newaddr)s') mlist.Lock() try: try: signal.signal(signal.SIGTERM, sigterm_handler) mlist.ChangeMemberAddress(user, newaddr, globally) mlist.Save() finally: mlist.Unlock() except Errors.MMBadEmailError: msg = _('Bad email address provided') except Errors.MMHostileAddress: msg = _('Illegal email address provided') except Errors.MMAlreadyAMember: msg = _('%(newaddr)s is already a member of the list.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return if cgidata.has_key('changepw'): newpw = cgidata.getvalue('newpw') confirmpw = cgidata.getvalue('confpw') if not newpw or not confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords may not be blank')) print doc.Format() return if newpw <> confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords did not match!')) print doc.Format() return # See if the user wants to change their passwords globally if cgidata.getvalue('pw-globally'): mlists = lists_of_member(mlist.host_name, user) else: mlists = [mlist] for gmlist in mlists: change_password(gmlist, user, newpw, confirmpw) # Regenerate the cookie so a re-authorization isn't necessary print mlist.MakeCookie(mm_cfg.AuthUser, user) options_page(mlist, doc, user, cpuser, userlang, _('Password successfully changed.')) print doc.Format() return if cgidata.has_key('unsub'): # Was the confirming check box turned on? if not cgidata.getvalue('unsubconfirm'): options_page( mlist, doc, user, cpuser, userlang, _('''You must confirm your unsubscription request by turning on the checkbox below the <em>Unsubscribe</em> button. You have not been unsubscribed!''')) print doc.Format() return # Standard signal handler def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Okay, zap them. Leave them sitting at the list's listinfo page. We # must own the list lock, and we want to make sure the user (BAW: and # list admin?) is informed of the removal. mlist.Lock() try: signal.signal(signal.SIGTERM, sigterm_handler) mlist.DeleteMember(user, _('via the member options page'), admin_notif=1, userack=1) mlist.Save() finally: mlist.Unlock() # Now throw up some results page, with appropriate links. We can't # drop them back into their options page, because that's gone now! fqdn_listname = mlist.GetListEmail() owneraddr = mlist.GetOwnerEmail() url = mlist.GetScriptURL('listinfo', absolute=1) title = _('Unsubscription results') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.AddItem(_("""You have been successfully unsubscribed from the mailing list %(fqdn_listname)s. If you were receiving digest deliveries you may get one more digest. If you have any questions about your unsubscription, please contact the list owners at %(owneraddr)s.""")) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format() return if cgidata.has_key('options-submit'): # Digest action flags digestwarn = 0 cantdigest = 0 mustdigest = 0 newvals = [] # First figure out which options have changed. The item names come # from FormatOptionButton() in HTMLFormatter.py for item, flag in (('digest', mm_cfg.Digests), ('mime', mm_cfg.DisableMime), ('dontreceive', mm_cfg.DontReceiveOwnPosts), ('ackposts', mm_cfg.AcknowledgePosts), ('disablemail', mm_cfg.DisableDelivery), ('conceal', mm_cfg.ConcealSubscription), ('remind', mm_cfg.SuppressPasswordReminder), ): try: newval = int(cgidata.getvalue(item)) except (TypeError, ValueError): newval = None # Skip this option if there was a problem or it wasn't changed if newval is None or newval == mlist.GetUserOption(user, flag): continue newvals.append((flag, newval)) # The user language is handled a little differently userlang = cgidata.getvalue('language') if userlang not in mlist.GetAvailableLanguages(): newvals.append((SETLANGUAGE, mlist.preferred_language)) else: newvals.append((SETLANGUAGE, userlang)) # The standard sigterm handler (see above) def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Now, lock the list and perform the changes mlist.Lock() try: signal.signal(signal.SIGTERM, sigterm_handler) # `values' is a tuple of flags and the web values for flag, newval in newvals: # Handle language settings differently if flag == SETLANGUAGE: mlist.SetPreferredLanguage(user, newval) continue mlist.SetUserOption(user, flag, newval, save_list=0) # Digests also need another setting, which is a bit bogus, as # SetUserOption() should be taught about this special step. if flag == mm_cfg.Digests: try: mlist.SetUserDigest(user, newval) if newval == 0: digestwarn = 1 except (Errors.MMAlreadyDigested, Errors.MMAlreadyUndigested): pass except Errors.MMCantDigestError: cantdigest = 1 except Errors.MMMustDigestError: mustdigest = 1 # All done mlist.Save() finally: mlist.Unlock() # The enable/disable option and the password remind option may have # their global flags sets. global_enable = None if cgidata.getvalue('deliver-globally'): # Yes, this is inefficient, but the list is so small it shouldn't # make much of a difference. for flag, newval in newvals: if flag == mm_cfg.DisableDelivery: global_enable = newval break global_remind = None if cgidata.getvalue('remind-globally'): for flag, newval in newvals: if flag == mm_cfg.SuppressPasswordReminder: global_remind = newval break if global_enable is not None or global_remind is not None: for gmlist in lists_of_member(mlist.host_name, user): global_options(gmlist, user, global_enable, global_remind) # Now print the results if cantdigest: msg = _('''The list administrator has disabled digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') elif mustdigest: msg = _('''The list administrator has disabled non-digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') else: msg = _('You have successfully set your options.') if digestwarn: msg += _('You may get one last digest.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return options_page(mlist, doc, user, cpuser, userlang) print doc.Format() | 11de8bd8bd26a09e2b9fd4a6960f2b48639a75e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/11de8bd8bd26a09e2b9fd4a6960f2b48639a75e1/options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
309,
486,
2140,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
997,
273,
4319,
1435,
997,
18,
542,
67,
4923,
12,
7020,
67,
7066,
18,
5280,
67,
4370,
67,
15547,
13,
225,
2140,
273,
6091,
18,
967,
743,
16539,
8610,
1435,
309,
486,
2140,... |
class dispatcher_with_send (dispatcher): def __init__ (self, sock=None): dispatcher.__init__ (self, sock) | class dispatcher_with_send(dispatcher): def __init__(self, sock=None): dispatcher.__init__(self, sock) | def handle_close (self): self.log_info ('unhandled close event', 'warning') self.close() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
4412,
261,
2890,
4672,
365,
18,
1330,
67,
1376,
7707,
318,
14387,
1746,
871,
2187,
296,
8551,
6134,
365,
18,
4412,
1435,
2,
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,
1640,
67,
4412,
261,
2890,
4672,
365,
18,
1330,
67,
1376,
7707,
318,
14387,
1746,
871,
2187,
296,
8551,
6134,
365,
18,
4412,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def Play(self, mode, tuner_channel=None): | def Play(self, mode, tuner_channel=None, channel_change=0): | def Play(self, mode, tuner_channel=None): | 59fd9d0867101d01bf136193a2f1e0c1acff0de0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/59fd9d0867101d01bf136193a2f1e0c1acff0de0/mplayer_tv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19592,
12,
2890,
16,
1965,
16,
268,
29640,
67,
4327,
33,
7036,
4672,
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,... | [
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19592,
12,
2890,
16,
1965,
16,
268,
29640,
67,
4327,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
mx.DateTime.DateTimeDelta(1)) ks = reports.KeyStatistic(_('Avg'), sum(logs)/len(rp), _('logged')+'/'+_(unit)) | mx.DateTime.DateTimeDeltaFromSeconds(time_interval)) ks = reports.KeyStatistic(_('Avg Blocked'), sum(blocks)/len(rp), _('blocks')+'/'+_(unit)) | def get_graph(self, end_date, report_days, host=None, user=None, email=None): if email: return None | ad66c393dd80008ea66d6cf497f95396c6a20579 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/87/ad66c393dd80008ea66d6cf497f95396c6a20579/untangle_node_firewall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4660,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
30,
327,
599,
2,
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,
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,
336,
67,
4660,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
30,
327,
599,
2,
-100,
-100,
-100,
-100,
... |
&alpha, | &alpha, | def c_code(self, node, name, (img2d, filtersflipped), (z, ), sub): if node.inputs[0].type.dtype != node.inputs[1].type.dtype: raise NotImplementedError() assert node.inputs[0].type.dtype == node.inputs[1].type.dtype d=locals() d.update(sub) | aaea1d322c657ba643c240526cb3f00d5d2d997d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/aaea1d322c657ba643c240526cb3f00d5d2d997d/conv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
6081,
22,
72,
16,
3415,
12357,
1845,
3631,
261,
94,
16,
262,
16,
720,
4672,
309,
756,
18,
10029,
63,
20,
8009,
723,
18,
8972,
480... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
6081,
22,
72,
16,
3415,
12357,
1845,
3631,
261,
94,
16,
262,
16,
720,
4672,
309,
756,
18,
10029,
63,
20,
8009,
723,
18,
8972,
480... |
set_fieldset_required("nis", False) | set_fieldset_required("auth_nis", False) | def set_fieldset_required(fieldset_id, required): for fieldset in self.Meta.fieldsets: if 'id' in fieldset and fieldset['id'] == fieldset_id: for field in fieldset['fields']: self.fields[field].required = required | 43aea6f5ebf8440280aa818aafc0bc27b953bc2c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1600/43aea6f5ebf8440280aa818aafc0bc27b953bc2c/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
23397,
67,
4718,
12,
23397,
67,
350,
16,
1931,
4672,
364,
16885,
316,
365,
18,
2781,
18,
1518,
4424,
30,
309,
296,
350,
11,
316,
16885,
471,
16885,
3292,
350,
3546,
422,
16885... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
67,
23397,
67,
4718,
12,
23397,
67,
350,
16,
1931,
4672,
364,
16885,
316,
365,
18,
2781,
18,
1518,
4424,
30,
309,
296,
350,
11,
316,
16885,
471,
16885,
3292,
350,
3546,
422,
16885... |
mtr = getUtility(IMimetypesRegistryTool) | mtr = queryUtility(IMimetypesRegistryTool) | def guessMimetype(data, filename=None): """ guess the mime-type from the given file-like object, optionally using the filename as a hint; the current position in the file is tried to be preserved """ pos = data.tell() mtr = getUtility(IMimetypesRegistryTool) if mtr is not None: d, f, mimetype = mtr(data.read(1 << 14), mimetype=None, filename=filename) else: mimetype, enc = guess_content_type(filename, data, mimetype=None) data.seek(pos) return str(mimetype) | 7a960c13c2352d0e730eb538e1f469da4857724f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12182/7a960c13c2352d0e730eb538e1f469da4857724f/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7274,
49,
10076,
12,
892,
16,
1544,
33,
7036,
4672,
3536,
7274,
326,
4892,
17,
723,
628,
326,
864,
585,
17,
5625,
733,
16,
8771,
1450,
326,
1544,
487,
279,
7380,
31,
225,
326,
783,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7274,
49,
10076,
12,
892,
16,
1544,
33,
7036,
4672,
3536,
7274,
326,
4892,
17,
723,
628,
326,
864,
585,
17,
5625,
733,
16,
8771,
1450,
326,
1544,
487,
279,
7380,
31,
225,
326,
783,
1... |
@param string name name of process to start | @param string name name of process group to add | def addProcessGroup(self, name): """ Update the config for a running process from config file. | 97a6e19ffc961bff4d26442b0dad8361e2b52578 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13620/97a6e19ffc961bff4d26442b0dad8361e2b52578/rpcinterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
2227,
1114,
12,
2890,
16,
508,
4672,
3536,
2315,
326,
642,
364,
279,
3549,
1207,
628,
642,
585,
18,
2,
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,
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,
527,
2227,
1114,
12,
2890,
16,
508,
4672,
3536,
2315,
326,
642,
364,
279,
3549,
1207,
628,
642,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ddc_discrepancy_filename() are tested. | dcc_discrepancy_filename() are tested. | def runtest(self): self.compile() glob_result = glob.glob(dep_glob) dotd_result.extend(glob_result) | 55e713ea42e80d4a6f1a15b113cf00c2e3105061 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4521/55e713ea42e80d4a6f1a15b113cf00c2e3105061/testdistcc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3813,
12,
2890,
4672,
365,
18,
11100,
1435,
4715,
67,
2088,
273,
4715,
18,
10581,
12,
15037,
67,
10581,
13,
3928,
72,
67,
2088,
18,
14313,
12,
10581,
67,
2088,
13,
225,
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,
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,
3813,
12,
2890,
4672,
365,
18,
11100,
1435,
4715,
67,
2088,
273,
4715,
18,
10581,
12,
15037,
67,
10581,
13,
3928,
72,
67,
2088,
18,
14313,
12,
10581,
67,
2088,
13,
225,
2,
-100,
... |
elif score >= 4.5: | elif avg_score >= 4.5: | def tmpl_mini_review(self, recID, ln=cdslang, action='SUBMIT', avg_score=0, nb_comments_total=0): """Display the mini version of reviews (only the grading part)""" | 36a0e89bced3e423db4f731466fa7281d2e725fb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/36a0e89bced3e423db4f731466fa7281d2e725fb/webcomment_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
1154,
77,
67,
16041,
12,
2890,
16,
1950,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1301,
2218,
8362,
6068,
2187,
11152,
67,
6355,
33,
20,
16,
4264,
67,
9231,
67,
4963,
33,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
1154,
77,
67,
16041,
12,
2890,
16,
1950,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1301,
2218,
8362,
6068,
2187,
11152,
67,
6355,
33,
20,
16,
4264,
67,
9231,
67,
4963,
33,
2... |
if alg=="scipy": | if algorithm=="scipy": | def spherical_bessel_Y(n,var, alg="maxima"): r""" Returns the spherical Bessel function of the second kind for integers n > -1. Reference: A&S 10.1.9 page 437 and A&S 10.1.15 page 439. EXAMPLES: sage: x = PolynomialRing(QQ, 'x').gen() sage: spherical_bessel_Y(2,x) -(3*sin(x)/x - (1 - 24/(8*x^2))*cos(x))/x """ if alg=="scipy": import scipy.special ans = str(scipy.special.sph_yn(int(n),float(var))) ans = ans.replace("(","") ans = ans.replace(")","") ans = ans.replace("j","*I") return sage_eval(ans) _init() return meval("spherical_bessel_y(%s,%s)"%(ZZ(n),var)) | 28583b63e951675be5d37abb781bb0ef0026cb95 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/28583b63e951675be5d37abb781bb0ef0026cb95/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
21570,
67,
70,
403,
292,
67,
61,
12,
82,
16,
1401,
16,
11989,
1546,
1896,
13888,
6,
4672,
436,
8395,
2860,
326,
272,
21570,
605,
403,
292,
445,
434,
326,
2205,
3846,
364,
12321,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
272,
21570,
67,
70,
403,
292,
67,
61,
12,
82,
16,
1401,
16,
11989,
1546,
1896,
13888,
6,
4672,
436,
8395,
2860,
326,
272,
21570,
605,
403,
292,
445,
434,
326,
2205,
3846,
364,
12321,
... |
cb_op = sgtbx.change_of_basis_op( params.reindex_utils.parameters.reindex.law ) | cb_op = sgtbx.change_of_basis_op( params.reindex_utils.parameters.reindex.user_supplied_law ) | def reindex_utils(args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plots = StringIO() log.register(label="log_buffer", file_object=string_buffer) phil_objects = [] argument_interpreter = libtbx.phil.command_line.argument_interpreter( master_params=master_params, home_scope="map_coefs") print >> log, "#phil __OFF__" print >> log, "=================" print >> log, " REINDEX " print >> log, "A reindexing tool" print >> log, "=================" print >> log for arg in args: command_line_params = None arg_is_processed = False # is it a file? if (os.path.isfile(arg)): ## is this a file name? # check if it is a phil file try: command_line_params = iotbx.phil.parse(file_name=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass else: try: command_line_params = argument_interpreter.process(arg=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass if not arg_is_processed: print >> log, "##----------------------------------------------##" print >> log, "## Unknown file or keyword:", arg print >> log, "##----------------------------------------------##" print >> log raise Sorry("Unknown file or keyword: %s" % arg) effective_params = master_params.fetch(sources=phil_objects) params = effective_params.extract() # now get the unit cell from the files hkl_xs = None pdb_xs = None if params.reindex_utils.input.xray_data.file_name is not None: hkl_xs = crystal_symmetry_from_any.extract_from( file_name=params.reindex_utils.input.xray_data.file_name) if params.reindex_utils.input.model.file_name is not None: pdb_xs = crystal_symmetry_from_any.extract_from( file_name=params.reindex_utils.input.model.file_name) phil_xs = crystal.symmetry( unit_cell=params.reindex_utils.input.unit_cell, space_group_info=params.reindex_utils.input.space_group ) combined_xs = crystal.select_crystal_symmetry( None,phil_xs, [pdb_xs],[hkl_xs]) # inject the unit cell and symmetry in the phil scope please params.reindex_utils.input.unit_cell = combined_xs.unit_cell() params.reindex_utils.input.space_group = \ sgtbx.space_group_info( group = combined_xs.space_group() ) print >> log, "#phil __ON__" new_params = master_params.format(python_object=params) new_params.show(out=log) print >> log, "#phil __END__" if params.reindex_utils.input.unit_cell is None: raise Sorry("unit cell not specified") if params.reindex_utils.input.space_group is None: raise Sorry("space group not specified") #----------------------------------------------------------- # # step 1: read in the reflection file # miller_array = None if params.reindex_utils.input.xray_data.file_name is not None: phil_xs = crystal.symmetry( unit_cell=params.reindex_utils.input.unit_cell, space_group_info=params.reindex_utils.input.space_group ) xray_data_server = reflection_file_utils.reflection_file_server( crystal_symmetry = phil_xs, force_symmetry = True, reflection_files=[]) miller_array = xray_data_server.get_xray_data( file_name = params.reindex_utils.input.xray_data.file_name, labels = params.reindex_utils.input.xray_data.labels, ignore_all_zeros = True, parameter_scope = 'reindex_utils.input.xray_data', parameter_name = 'labels' ) info = miller_array.info() miller_array = miller_array.map_to_asu() miller_array = miller_array.select( miller_array.indices() != (0,0,0)) miller_array = miller_array.select( miller_array.data() > 0 ) if miller_array.sigmas() is not None: miller_array = miller_array.select( miller_array.sigmas() > 0 ) if (miller_array.is_xray_intensity_array()): miller_array = miller_array.f_sq_as_f() elif (miller_array.is_complex_array()): miller_array = abs(miller_array) miller_array.set_info(info) print >> log print >> log, "Summary info of observed data" print >> log, "=============================" miller_array.show_summary(f=log) print >> log #---------------------------------------------------------------- # Step 2: get an xray structure from the PDB file # pdb_model = None if params.reindex_utils.input.model.file_name is not None: pdb_model = pdb.input(file_name=params.reindex_utils.input.model.file_name) model = pdb_model.xray_structure_simple(crystal_symmetry=phil_xs) print >> log, "Atomic model summary" print >> log, "====================" model.show_summary() print >> log if params.reindex_utils.parameters.action=="reindex": #---------------------------------------------------------------- # step 3: get the reindex laws xs = crystal.symmetry(unit_cell = model.unit_cell(), space_group = model.space_group() ) to_niggli = xs.change_of_basis_op_to_niggli_cell() to_reference = xs.change_of_basis_op_to_reference_setting() to_inverse = xs.change_of_basis_op_to_inverse_hand() cb_op = None if (params.reindex_utils.parameters.reindex.standard_laws == "niggli"): cb_op = to_niggli if (params.reindex_utils.parameters.reindex.standard_laws == "reference_setting"): cb_op = to_reference if (params.reindex_utils.parameters.reindex.standard_laws == "invert"): cb_op = to_inverse if (params.reindex_utils.parameters.reindex.standard_laws == "user_supplied"): cb_op = sgtbx.change_of_basis_op( params.reindex_utils.parameters.reindex.law ) if cb_op is None: raise Sorry("No change of basis operation is supplied.") print >> log, "Supplied reindexing law:" print >> log, "========================" print >> log, "hkl notation: ", cb_op.as_hkl() print >> log, "xyz notation: ", cb_op.as_xyz() print >> log, "abc notation: ", cb_op.as_abc() #---------------------------------------------------------------- # step 4: do the reindexing # # step 4a: first do the miller array object new_miller_array = None if miller_array is not None: new_miller_array = miller_array.change_basis( cb_op ) # # step 4b: the xray structure new_model = None if pdb_model is not None: new_model = model.change_basis( cb_op ) #---------------------------------------------------------------- # step 5a: write the new mtz file print >> log print >> log, "The data and model have been reindexed" print >> log, "--------------------------------------" print >> log print >> log, "Writing output files...." if miller_array is not None: print >> log, "writing mtz file with name %s"%(params.reindex_utils.output.hklout) mtz_dataset = new_miller_array.as_mtz_dataset( column_root_label="FOBS") """ #This is how to add (possibly) a free r flag column that has been reindexed as well mtz_dataset = mtz_dataset.add_miller_array( miller_array = new_set_of_free_flags, column_root_label = "Free_R_Flag" ) """ mtz_dataset.mtz_object().write( file_name=params.reindex_utils.output.hklout) #step 5b: write the new pdb file if new_model is not None: pdb_file = open( params.reindex_utils.output.xyzout, 'w') print >> log, "Wring pdb file to: %s"%(params.reindex_utils.output.xyzout) write_as_pdb_file( input_pdb = pdb_model, input_xray_structure = new_model, out = pdb_file, chain_id_increment=params.reindex_utils.parameters.chain_id_increment, additional_remark = "GENERATED BY PHENIX.REINDEX") pdb_file.close() if ( [miller_array,new_model]).count(None)==2: print >>log, "No input reflection of coordinate files have been given" if params.reindex_utils.parameters.action=="operator": rt_mx = sgtbx.rt_mx( params.reindex_utils.parameters.apply_operator.user_supplied_operator ) sites = model.sites_frac() new_sites = flex.vec3_double() for site in sites: new_site = rt_mx.r()*matrix.col(site) new_site = flex.double(new_site)+flex.double( rt_mx.t().as_double() ) new_sites.push_back( tuple(new_site) ) model.set_sites_frac( new_sites ) # write the new [pdb file please pdb_file = open( params.reindex_utils.output.xyzout, 'w') print >> log, "Wring pdb file to: %s"%(params.reindex_utils.output.xyzout) write_as_pdb_file( input_pdb = pdb_model, input_xray_structure = model, out = pdb_file, chain_id_increment = params.reindex_utils.parameters.chain_id_increment, additional_remark = "GENERATED BY PHENIX") pdb_file.close() #write the logfile logger = open( params.reindex_utils.output.logfile, 'w') print >> log, "writing log file with name %s"%(params.reindex_utils.output.logfile) print >> log print >> logger, string_buffer.getvalue() | 7b7d1ba8fe61e667ec87a8eecc90e9b4a5269dfe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/7b7d1ba8fe61e667ec87a8eecc90e9b4a5269dfe/reindex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17492,
67,
5471,
12,
1968,
4672,
309,
562,
12,
1968,
13,
631,
20,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
5201,
6,
316,
833,
262,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
76,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17492,
67,
5471,
12,
1968,
4672,
309,
562,
12,
1968,
13,
631,
20,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
5201,
6,
316,
833,
262,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
76,
6,... |
'cmdclass': {'install_data': smart_install_data}, | def do_setup(): kwargs = package_data.copy() extras = get_extras() if extras: kwargs['py_modules'] = extras if sys.hexversion >= 0x02030000: # Python 2.3 kwargs['classifiers'] = classifiers else: kwargs['cmdclass'] = {'build_py': dual_build_py} dist = setup(**kwargs) return dist | 13b4da77e84b6f68b05f278051193582d2f8b3e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/13b4da77e84b6f68b05f278051193582d2f8b3e0/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
8401,
13332,
1205,
273,
2181,
67,
892,
18,
3530,
1435,
11875,
273,
336,
67,
23687,
1435,
309,
11875,
30,
1205,
3292,
2074,
67,
6400,
3546,
273,
11875,
309,
2589,
18,
7118,
1589,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
67,
8401,
13332,
1205,
273,
2181,
67,
892,
18,
3530,
1435,
11875,
273,
336,
67,
23687,
1435,
309,
11875,
30,
1205,
3292,
2074,
67,
6400,
3546,
273,
11875,
309,
2589,
18,
7118,
1589,... | |
if cl.super: | if hasattr(cl, "super") and cl.super: | def listclasses(self): dir, file = os.path.split(self.file) name, ext = os.path.splitext(file) if os.path.normcase(ext) != ".py": return [] try: dict = pyclbr.readmodule_ex(name, [dir] + sys.path) except ImportError, msg: return [] items = [] self.classes = {} for key, cl in dict.items(): if cl.module == name: s = key if cl.super: supers = [] for sup in cl.super: if type(sup) is type(''): sname = sup else: sname = sup.name if sup.module != cl.module: sname = "%s.%s" % (sup.module, sname) supers.append(sname) s = s + "(%s)" % ", ".join(supers) items.append((cl.lineno, s)) self.classes[s] = cl items.sort() list = [] for item, s in items: list.append(s) return list | 18acea7c8ea44fe1e655d64fe4f04fc9710f9ea7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/18acea7c8ea44fe1e655d64fe4f04fc9710f9ea7/ClassBrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
4701,
12,
2890,
4672,
1577,
16,
585,
273,
1140,
18,
803,
18,
4939,
12,
2890,
18,
768,
13,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
768,
13,
309,
1140,
18,
803,
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,
666,
4701,
12,
2890,
4672,
1577,
16,
585,
273,
1140,
18,
803,
18,
4939,
12,
2890,
18,
768,
13,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
768,
13,
309,
1140,
18,
803,
18... |
url = "<br /><a href=" + rsrcpath + ">" + title + " </a>\r\n" | url = "<br /><a href=" + rsrcpath + ">" + title + " </a>\n" if isinstance(url, unicode): url = url.encode('utf-8') | def _create_html_root(self, hhcpath, log): hhcdata = self._read_file(hhcpath) hhcroot = html.fromstring(hhcdata) chapters = self._process_nodes(hhcroot) #print "=============================" #print "Printing hhcroot" #print etree.tostring(hhcroot, pretty_print=True) #print "=============================" log.debug('Found %d section nodes' % len(chapters)) htmlpath = os.path.splitext(hhcpath)[0] + ".html" f = open(htmlpath, 'wb') f.write("<HTML><HEAD></HEAD><BODY>\r\n") | f871846e18535f0f706d7f7df7c46dd232c98ffc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/f871846e18535f0f706d7f7df7c46dd232c98ffc/input.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
2620,
67,
3085,
12,
2890,
16,
18629,
71,
803,
16,
613,
4672,
18629,
71,
892,
273,
365,
6315,
896,
67,
768,
12,
21622,
71,
803,
13,
18629,
71,
3085,
273,
1729,
18,
2080... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
67,
2620,
67,
3085,
12,
2890,
16,
18629,
71,
803,
16,
613,
4672,
18629,
71,
892,
273,
365,
6315,
896,
67,
768,
12,
21622,
71,
803,
13,
18629,
71,
3085,
273,
1729,
18,
2080... |
otherside = otherside._rescale(exp, context=context, watchexp=0) | otherside = otherside._rescale(exp, context=context, watchexp=0) | def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision. | 2987962c266a487e19674e69ca08f8ac738322b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2987962c266a487e19674e69ca08f8ac738322b8/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2892,
831,
12,
2890,
16,
1308,
16,
26105,
273,
374,
16,
819,
33,
7036,
4672,
3536,
990,
279,
342,
324,
16,
358,
819,
18,
4036,
6039,
18,
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,
389,
2892,
831,
12,
2890,
16,
1308,
16,
26105,
273,
374,
16,
819,
33,
7036,
4672,
3536,
990,
279,
342,
324,
16,
358,
819,
18,
4036,
6039,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.header({'Set-Cookie': 'roundup_user="%s"; expires="%s"; Path="%s";' % ( | self.header({'Set-Cookie': 'roundup_user=%s; expires=%s; Path=%s;' % ( | def set_cookie(self, user, password): # construct the cookie user = binascii.b2a_base64('%s:%s'%(user, password)).strip() expire = Cookie._getdate(86400*365) path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'])) self.header({'Set-Cookie': 'roundup_user="%s"; expires="%s"; Path="%s";' % ( user, expire, path)}) | 840711450a17a487dedb2c002794e3833b9f747b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/840711450a17a487dedb2c002794e3833b9f747b/cgi_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
8417,
12,
2890,
16,
729,
16,
2201,
4672,
468,
4872,
326,
3878,
729,
273,
28222,
18,
70,
22,
69,
67,
1969,
1105,
29909,
87,
5319,
87,
11,
17105,
1355,
16,
2201,
13,
2934,
640... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
444,
67,
8417,
12,
2890,
16,
729,
16,
2201,
4672,
468,
4872,
326,
3878,
729,
273,
28222,
18,
70,
22,
69,
67,
1969,
1105,
29909,
87,
5319,
87,
11,
17105,
1355,
16,
2201,
13,
2934,
640... |
print "handlerB invoked", args raise HandlerBCalled(*args) | print "handlerB invoked from signal %s at:\n%s" % ( signum, self.format_frame(frame, limit=1)) raise HandlerBCalled(signum, self.format_frame(frame)) | def handlerB(self, *args): self.b_called = True if test_support.verbose: print "handlerB invoked", args raise HandlerBCalled(*args) | ee76777846124bb5b7e08feb488d5bab949c76a5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/ee76777846124bb5b7e08feb488d5bab949c76a5/test_signal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1838,
38,
12,
2890,
16,
380,
1968,
4672,
365,
18,
70,
67,
11777,
273,
1053,
309,
1842,
67,
13261,
18,
11369,
30,
1172,
315,
4176,
38,
8187,
3113,
833,
1002,
4663,
38,
8185,
30857,
1968... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1838,
38,
12,
2890,
16,
380,
1968,
4672,
365,
18,
70,
67,
11777,
273,
1053,
309,
1842,
67,
13261,
18,
11369,
30,
1172,
315,
4176,
38,
8187,
3113,
833,
1002,
4663,
38,
8185,
30857,
1968... |
include_graphics_options.append('height=%s' % ( self.latex_image_length(attrs['height']), )) | h = self.latex_image_length(attrs['height']) include_graphics_options.append('height=%s' % h) | def visit_image(self, node): attrs = node.attributes pre = [] # in reverse order post = [] include_graphics_options = [] inline = isinstance(node.parent, nodes.TextElement) if attrs.has_key('scale'): # Could also be done with ``scale`` option to # ``\includegraphics``; doing it this way for consistency. pre.append('\\scalebox{%f}{' % (attrs['scale'] / 100.0,)) post.append('}') if attrs.has_key('width'): include_graphics_options.append('width=%s' % ( self.latex_image_length(attrs['width']), )) if attrs.has_key('height'): include_graphics_options.append('height=%s' % ( self.latex_image_length(attrs['height']), )) if attrs.has_key('align'): align_prepost = { # By default latex aligns the top of an image. (1, 'top'): ('', ''), (1, 'middle'): ('\\raisebox{-0.5\\height}{', '}'), (1, 'bottom'): ('\\raisebox{-\\height}{', '}'), (0, 'center'): ('{\\hfill', '\\hfill}'), # These 2 don't exactly do the right thing. The image should # be floated alongside the paragraph. See # http://www.w3.org/TR/html4/struct/objects.html#adef-align-IMG (0, 'left'): ('{', '\\hfill}'), (0, 'right'): ('{\\hfill', '}'),} try: pre.append(align_prepost[inline, attrs['align']][0]) post.append(align_prepost[inline, attrs['align']][1]) except KeyError: pass # XXX complain here? if not inline: pre.append('\n') post.append('\n') pre.reverse() if node['uri'] in self.builder.images: uri = self.builder.images[node['uri']] else: # missing image! if self.ignore_missing_images: return uri = node['uri'] if uri.find('://') != -1: # ignore remote images return self.body.extend(pre) options = '' if include_graphics_options: options = '[%s]' % ','.join(include_graphics_options) self.body.append('\\includegraphics%s{%s}' % (options, uri)) self.body.extend(post) | 5ce1a0ff77da4c55cea55ddcfaa360ac43c66033 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7032/5ce1a0ff77da4c55cea55ddcfaa360ac43c66033/latexwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
3422,
273,
756,
18,
4350,
675,
273,
5378,
13491,
468,
316,
4219,
1353,
1603,
273,
5378,
2341,
67,
31586,
67,
2116,
273,
5378,
6370,
273,
1549,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
3422,
273,
756,
18,
4350,
675,
273,
5378,
13491,
468,
316,
4219,
1353,
1603,
273,
5378,
2341,
67,
31586,
67,
2116,
273,
5378,
6370,
273,
1549,
... |
except TypeError: | except (AttributeError, TypeError): | def cantset(obj, name, value): verify(hasattr(obj, name)) # Otherwise it's probably a typo try: setattr(obj, name, value) except TypeError: pass else: raise TestFailed, "shouldn't be able to set %s to %r" % (name, value) try: delattr(obj, name) except TypeError: pass else: raise TestFailed, "shouldn't be able to del %s" % name | df8902c81e6eb4fcbf46b9a79be8e214b937e033 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/df8902c81e6eb4fcbf46b9a79be8e214b937e033/test_funcattrs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
848,
88,
542,
12,
2603,
16,
508,
16,
460,
4672,
3929,
12,
5332,
1747,
12,
2603,
16,
508,
3719,
468,
5272,
518,
1807,
8656,
279,
3815,
83,
775,
30,
9241,
12,
2603,
16,
508,
16,
460,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
848,
88,
542,
12,
2603,
16,
508,
16,
460,
4672,
3929,
12,
5332,
1747,
12,
2603,
16,
508,
3719,
468,
5272,
518,
1807,
8656,
279,
3815,
83,
775,
30,
9241,
12,
2603,
16,
508,
16,
460,
... |
im.paste(im2, None, im2) | paste_transparent(im, None, im2) | def profile_image(request, username): user = get_object_or_404(User, username=username) parts = [p.part for p in user.selectedfaceparts.all()] # Use part.image.path as full path to the file im = Image.open(os.path.join( settings.OUR_ROOT, 'static/img/blank-face.png' )) for part in parts: im2 = Image.open(part.image.path) im.paste(im2, None, im2) # Using im2 as both content and mask response = HttpResponse(content_type = 'image/png') im.save(response, format = 'png') return response | 7eae89d7c5a10ff1785b932f0ef2b991c7aee2bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9909/7eae89d7c5a10ff1785b932f0ef2b991c7aee2bb/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3042,
67,
2730,
12,
2293,
16,
2718,
4672,
729,
273,
336,
67,
1612,
67,
280,
67,
11746,
12,
1299,
16,
2718,
33,
5053,
13,
2140,
273,
306,
84,
18,
2680,
364,
293,
316,
729,
18,
8109,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3042,
67,
2730,
12,
2293,
16,
2718,
4672,
729,
273,
336,
67,
1612,
67,
280,
67,
11746,
12,
1299,
16,
2718,
33,
5053,
13,
2140,
273,
306,
84,
18,
2680,
364,
293,
316,
729,
18,
8109,
... |
handler = self.handler(sock, self) | try: handler = self.handler(sock, self) except socket.error, err: logerror(str(err)) return | def handle_accept(self): """Called when remote client initiates a connection.""" try: sock, addr = self.accept() except TypeError: # sometimes accept() might return None (see issue 91) return except socket.error, err: # ECONNABORTED might be thrown on *BSD (see issue 105) if err[0] != errno.ECONNABORTED: logerror(traceback.format_exc()) return else: # sometimes addr == None instead of (ip, port) (see issue 104) if addr == None: return | 39505a80171c8ad22ffaadab7243ef2a37abdc5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3782/39505a80171c8ad22ffaadab7243ef2a37abdc5b/ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
9436,
12,
2890,
4672,
3536,
8185,
1347,
2632,
1004,
1208,
16020,
279,
1459,
12123,
775,
30,
7313,
16,
3091,
273,
365,
18,
9436,
1435,
1335,
3580,
30,
468,
16594,
2791,
1435,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1640,
67,
9436,
12,
2890,
4672,
3536,
8185,
1347,
2632,
1004,
1208,
16020,
279,
1459,
12123,
775,
30,
7313,
16,
3091,
273,
365,
18,
9436,
1435,
1335,
3580,
30,
468,
16594,
2791,
1435,
48... |
if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth) if auth: h.putheader('Authorization: Basic %s' % auth) | if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth) if auth: h.putheader('Authorization', 'Basic %s' % auth) | def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None proxy_passwd = None if isinstance(url, str): host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url # here, we determine, whether the proxy contains authorization information proxy_passwd, host = splituser(host) urltype, rest = splittype(selector) url = rest user_passwd = None if urltype.lower() != 'https': realhost = None else: realhost, rest = splithost(rest) if realhost: user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest) #print "proxy via https:", host, selector if not host: raise IOError, ('https error', 'no host given') if proxy_passwd: import base64 proxy_auth = base64.b64encode(proxy_passwd).strip() else: proxy_auth = None if user_passwd: import base64 auth = base64.b64encode(user_passwd).strip() else: auth = None h = httplib.HTTPS(host, 0, key_file=self.key_file, cert_file=self.cert_file) if data is not None: h.putrequest('POST', selector) h.putheader('Content-Type', 'application/x-www-form-urlencoded') h.putheader('Content-Length', '%d' % len(data)) else: h.putrequest('GET', selector) if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth) if auth: h.putheader('Authorization: Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) h.endheaders() if data is not None: h.send(data) errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == 200: return addinfourl(fp, headers, "https:" + url) else: if data is None: return self.http_error(url, fp, errcode, errmsg, headers) else: return self.http_error(url, fp, errcode, errmsg, headers, data) | 522785732f09b0be6d4bc06a2782ecda66fc83af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/522785732f09b0be6d4bc06a2782ecda66fc83af/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
4528,
12,
2890,
16,
880,
16,
501,
33,
7036,
4672,
3536,
3727,
18904,
1771,
12123,
1930,
15851,
6673,
729,
67,
24002,
273,
599,
2889,
67,
24002,
273,
599,
309,
1549,
12,
718,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1696,
67,
4528,
12,
2890,
16,
880,
16,
501,
33,
7036,
4672,
3536,
3727,
18904,
1771,
12123,
1930,
15851,
6673,
729,
67,
24002,
273,
599,
2889,
67,
24002,
273,
599,
309,
1549,
12,
718,
... |
errfunc(101010, "Max timeout retry count reached. Discontinuing download.\n", file) | errfunc(101010, "Max timeout retry count reached. Discontinuing download.\n", url) | def download_from_web(self, url, file, download_dir): '''url = url to fetch file = file to save to donwload_dir = download path''' try: block_size = 4096 i = 0 counter = 0 os.chdir(download_dir) temp = urllib2.urlopen(url) headers = temp.info() size = int(headers['Content-Length']) data = open(file,'wb') #INFO: Add the download thread into the Global ProgressBar Thread self.addItem(size) | da63a417a8560a39ca821994468a1533f4c1445a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12499/da63a417a8560a39ca821994468a1533f4c1445a/AptOfflineCoreLib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
2080,
67,
4875,
12,
2890,
16,
880,
16,
585,
16,
4224,
67,
1214,
4672,
9163,
718,
273,
880,
358,
2158,
585,
273,
585,
358,
1923,
358,
2727,
91,
945,
67,
1214,
273,
4224,
589... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4224,
67,
2080,
67,
4875,
12,
2890,
16,
880,
16,
585,
16,
4224,
67,
1214,
4672,
9163,
718,
273,
880,
358,
2158,
585,
273,
585,
358,
1923,
358,
2727,
91,
945,
67,
1214,
273,
4224,
589... |
....: def __init__(self): ....: 'docstring' ....: pass ....: | ... def __init__(self): ... 'docstring' ... pass ... | ....: def __init__(self): | ac30681adecb60ad7f54407901ac8523b90ec56c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/ac30681adecb60ad7f54407901ac8523b90ec56c/sageinspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
29710,
377,
1652,
1001,
2738,
972,
12,
2890,
4672,
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,
... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
29710,
377,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
ret = [isinstance(x, tuple) and x[0] or x for x in self.choices] | ret = [not isinstance(x, tuple) and x or x[0] for x in self.choices] | def __list__(self): if self.type == choicesList.LIST_TYPE_LIST: ret = [isinstance(x, tuple) and x[0] or x for x in self.choices] else: ret = self.choices.keys() return ret or [""] | cfb43dc930adbbf59879abf8f3f0297caa94a050 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/cfb43dc930adbbf59879abf8f3f0297caa94a050/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1098,
972,
12,
2890,
4672,
309,
365,
18,
723,
422,
7246,
682,
18,
7085,
67,
2399,
67,
7085,
30,
325,
273,
306,
902,
1549,
12,
92,
16,
3193,
13,
471,
619,
578,
619,
63,
20,
65... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1098,
972,
12,
2890,
4672,
309,
365,
18,
723,
422,
7246,
682,
18,
7085,
67,
2399,
67,
7085,
30,
325,
273,
306,
902,
1549,
12,
92,
16,
3193,
13,
471,
619,
578,
619,
63,
20,
65... |
self.args.setdefault("CloseBlockSize", None) | self.args.setdefault("CloseBlockSize", "None") | def __init__(self, **args): self.args = {} | 569d3fce643c2d70ef164e19a67e0b2d581a2fbd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/569d3fce643c2d70ef164e19a67e0b2d581a2fbd/DBSComponent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
365,
18,
1968,
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,
... | [
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
365,
18,
1968,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if prefix is None: | if not prefix or prefix == 'xmlns': | def attribute(self, name, value, namespace=None): """ add an attribute to an element | dc0c21626583332dd8580bfed28081989b0a28ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14078/dc0c21626583332dd8580bfed28081989b0a28ee/xmlwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1566,
12,
2890,
16,
508,
16,
460,
16,
1981,
33,
7036,
4672,
3536,
527,
392,
1566,
358,
392,
930,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1566,
12,
2890,
16,
508,
16,
460,
16,
1981,
33,
7036,
4672,
3536,
527,
392,
1566,
358,
392,
930,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ids = bridgedb.Bridges.chopString(ids_str, bridgedb.Bridges.ID_LEN) logging.info("We've seen %r before. Sending the same %d bridges" " as last time", emailaddress, len(ids)) for ident in ids: | logging.info("We've seen %r before. Sending the same bridges" " as last time", emailaddress) for ident in bridgedb.Bridges.chopString(ids_str, bridgedb.Bridges.ID_LEN): | def getBridgesForEmail(self, emailaddress, epoch, N=1): """Return a list of bridges to give to a user. emailaddress -- the user's email address, as given in a from line. epoch -- the time period when we got this request. This can be any string, so long as it changes with every period. N -- the number of bridges to try to give back. """ emailaddress = normalizeEmail(emailaddress, self.domainmap) if emailaddress is None: return [] #XXXX raise an exception. if self.store.has_key(emailaddress): result = [] ids_str = self.store[emailaddress] ids = bridgedb.Bridges.chopString(ids_str, bridgedb.Bridges.ID_LEN) logging.info("We've seen %r before. Sending the same %d bridges" " as last time", emailaddress, len(ids)) for ident in ids: b = self.ring.getBridgeByID(ident) if b != None: result.append(b) return result | 7ed74c90857eb65b7d2fa3bc8733531824332e58 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5458/7ed74c90857eb65b7d2fa3bc8733531824332e58/Dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2882,
1691,
2852,
1290,
4134,
12,
2890,
16,
2699,
2867,
16,
7632,
16,
423,
33,
21,
4672,
3536,
990,
279,
666,
434,
324,
1691,
2852,
358,
8492,
358,
279,
729,
18,
2699,
2867,
1493,
326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2882,
1691,
2852,
1290,
4134,
12,
2890,
16,
2699,
2867,
16,
7632,
16,
423,
33,
21,
4672,
3536,
990,
279,
666,
434,
324,
1691,
2852,
358,
8492,
358,
279,
729,
18,
2699,
2867,
1493,
326,... |
need_blank_after_doc = 1 for attr, tag in [('fget', '<get>'), ('fset', '<set>'), ('fdel', '<delete>')]: func = getattr(value, attr) if func is not None: if need_blank_after_doc: push('') need_blank_after_doc = 0 base = self.document(func, tag, mod) push(self.indent(base)) return '\n'.join(results) | push('\n') return ''.join(results) | def _docproperty(self, name, value, mod): results = [] push = results.append | 41b8b8a0df4f3e404b0e2be71e8c5ba7ae6ac80c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/41b8b8a0df4f3e404b0e2be71e8c5ba7ae6ac80c/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2434,
4468,
12,
2890,
16,
508,
16,
460,
16,
681,
4672,
1686,
273,
5378,
1817,
273,
1686,
18,
6923,
2,
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,
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,
389,
2434,
4468,
12,
2890,
16,
508,
16,
460,
16,
681,
4672,
1686,
273,
5378,
1817,
273,
1686,
18,
6923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits=(16, 2)), 'leaves': fields.float('Leave Deductions', readonly=True, digits=(16, 2)), 'basic': fields.float('Net Basic', readonly=True, digits=(16, 2)), 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 2)), 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 2)), 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 2)), 'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits=(16, 2)), 'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits=(16, 2)), 'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits=(16, 2)), | 'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits_compute=dp.get_precision('Account')), 'leaves': fields.float('Leave Deductions', readonly=True, digits_compute=dp.get_precision('Account')), 'basic': fields.float('Net Basic', readonly=True, digits_compute=dp.get_precision('Account')), 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', digits_compute=dp.get_precision('Account')), 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits_compute=dp.get_precision('Account')), 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits_compute=dp.get_precision('Account')), 'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits_compute=dp.get_precision('Account')), 'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits_compute=dp.get_precision('Account')), 'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits_compute=dp.get_precision('Account')), | def _calculate(self, cr, uid, ids, field_names, arg, context=None): slip_line_obj = self.pool.get('hr.payslip.line') if context is None: context = {} res = {} for rs in self.browse(cr, uid, ids, context=context): allow = 0.0 deduct = 0.0 others = 0.0 obj = {'basic':rs.basic} if rs.igross > 0: obj['gross'] = rs.igross if rs.inet > 0: obj['net'] = rs.inet for line in rs.line_ids: amount = 0.0 if line.amount_type == 'per': try: amount = line.amount * eval(str(line.category_id.base), obj) except Exception, e: raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e))) elif line.amount_type in ('fix', 'func'): amount = line.amount cd = line.category_id.code.lower() obj[cd] = amount contrib = 0.0 if line.type == 'allowance': allow += amount others += contrib amount -= contrib elif line.type == 'deduction': deduct += amount others -= contrib amount += contrib elif line.type == 'advance': others += amount elif line.type == 'loan': others += amount elif line.type == 'otherpay': others += amount slip_line_obj.write(cr, uid, [line.id], {'total':amount}, context=context) | e0bd6974e23888d11f0954c282c2f73add98d1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e0bd6974e23888d11f0954c282c2f73add98d1f2/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11162,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
272,
3169,
67,
1369,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
7256,
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,
389,
11162,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
272,
3169,
67,
1369,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
7256,
18,
... |
x = c_escape_char(x) | ex = c_escape_char(x) | def wrap_string(s, width): lines = [] l = '' for x in s: x = c_escape_char(x) # Require l to be nonempty to always add at least one character if l and len(l + x) + 2 >= width: lines.append('"' + l + '"') l = '' l += x if l: lines.append('"' + l + '"') return lines | 114cac45dadfc286cbe3ad8698ed8c5a368e46f0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6176/114cac45dadfc286cbe3ad8698ed8c5a368e46f0/flatten.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
67,
1080,
12,
87,
16,
1835,
4672,
2362,
273,
5378,
328,
273,
875,
364,
619,
316,
272,
30,
431,
273,
276,
67,
6939,
67,
3001,
12,
92,
13,
468,
12981,
328,
358,
506,
1661,
5531,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2193,
67,
1080,
12,
87,
16,
1835,
4672,
2362,
273,
5378,
328,
273,
875,
364,
619,
316,
272,
30,
431,
273,
276,
67,
6939,
67,
3001,
12,
92,
13,
468,
12981,
328,
358,
506,
1661,
5531,
... |
try: socket.getpeername(self) except socket_error as e: if e.errno != errno.ENOTCONN: raise self._sslobj = None else: | self._closed = False self._sslobj = None if connected: | def __init__(self, sock=None, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version=PROTOCOL_SSLv23, ca_certs=None, do_handshake_on_connect=True, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, suppress_ragged_eofs=True, ciphers=None): | a1c7286025d111d72a7197fa62a3504d8e16a31c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/a1c7286025d111d72a7197fa62a3504d8e16a31c/ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7313,
33,
7036,
16,
28632,
33,
7036,
16,
3320,
768,
33,
7036,
16,
1438,
67,
5564,
33,
8381,
16,
3320,
67,
25782,
33,
22367,
67,
9826,
16,
5832,
67,
158... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7313,
33,
7036,
16,
28632,
33,
7036,
16,
3320,
768,
33,
7036,
16,
1438,
67,
5564,
33,
8381,
16,
3320,
67,
25782,
33,
22367,
67,
9826,
16,
5832,
67,
158... |
.tolist() | .to_list() | def difference(self): return Query(self.S1) \ .difference(Query(self.S2)) \ .tolist() | f134b825431ac82f3dbba76e7a945a0e195d27cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14315/f134b825431ac82f3dbba76e7a945a0e195d27cf/pyquery.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7114,
12,
2890,
4672,
327,
2770,
12,
2890,
18,
55,
21,
13,
521,
263,
23444,
12,
1138,
12,
2890,
18,
55,
22,
3719,
521,
263,
3490,
376,
1435,
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,
7114,
12,
2890,
4672,
327,
2770,
12,
2890,
18,
55,
21,
13,
521,
263,
23444,
12,
1138,
12,
2890,
18,
55,
22,
3719,
521,
263,
3490,
376,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if lastchange < self.namespace_timestamp and dump==0: return isdict = re.compile(self.cfg.page_dict_regex, re.UNICODE).search isgroup = re.compile(self.cfg.page_group_regex, re.UNICODE).search if now - self.namespace_timestamp >= wikiutil.timestamp2version(60): dictpages = self.request.rootpage.getPageList(user='', filter=isdict) grouppages = self.request.rootpage.getPageList(user='', filter=isgroup) olddictdict = self.dictdict.copy() oldgroupdict = self.groupdict.copy() self.dictdict = {} self.groupdict = {} for pagename in dictpages: if olddictdict.has_key(pagename): self.dictdict[pagename] = olddictdict[pagename] del olddictdict[pagename] else: self.adddict(self.request, pagename) | if lastchange >= self.namespace_timestamp or dump: isdict = re.compile(self.cfg.page_dict_regex, re.UNICODE).search isgroup = re.compile(self.cfg.page_group_regex, re.UNICODE).search if now - self.namespace_timestamp >= wikiutil.timestamp2version(60): dictpages = request.rootpage.getPageList(user='', filter=isdict) grouppages = request.rootpage.getPageList(user='', filter=isgroup) olddictdict = self.dictdict.copy() oldgroupdict = self.groupdict.copy() self.dictdict = {} self.groupdict = {} for pagename in dictpages: if olddictdict.has_key(pagename): self.dictdict[pagename] = olddictdict[pagename] del olddictdict[pagename] else: self.adddict(request, pagename) dump = 1 for pagename in grouppages: if olddictdict.has_key(pagename): self.dictdict[pagename] = olddictdict[pagename] self.groupdict[pagename] = oldgroupdict[pagename] del olddictdict[pagename] else: self.addgroup(request, pagename) dump = 1 if olddictdict: | def scandicts(self): """scan all pages matching the dict / group regex and init the dictdict""" dump = 0 | d95095226b8672f9e208610d28f8a5240edbbfb2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/d95095226b8672f9e208610d28f8a5240edbbfb2/wikidicts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
464,
933,
87,
12,
2890,
4672,
3536,
9871,
777,
4689,
3607,
326,
2065,
342,
1041,
3936,
471,
1208,
326,
2065,
1576,
8395,
4657,
273,
374,
2,
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,
888,
464,
933,
87,
12,
2890,
4672,
3536,
9871,
777,
4689,
3607,
326,
2065,
342,
1041,
3936,
471,
1208,
326,
2065,
1576,
8395,
4657,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
try: | self.NotifyBlockToSaveValue() self._swapControls(self.staticControl) event.Skip() def OnEditKeyUp(self, event): if event.m_keyCode == wx.WXK_RETURN: self.NotifyBlockToSaveValue() self.Navigate() event.Skip() def NotifyBlockToSaveValue(self): """ Tell the block associated with us to save our value now. I wish there were a cleaner way to do this notification. """ try: | def OnEditLoseFocus(self, event): # when we lose focus, check if we have a block and tell it # to save the value. try: saveMethod = self.blockItem.saveValue except AttributeError: pass else: saveMethod() self._swapControls(self.staticControl) event.Skip() | df1217fc40403fcbb793cd794b03e3f56a7c2b57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/df1217fc40403fcbb793cd794b03e3f56a7c2b57/AttributeEditors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4666,
1504,
307,
9233,
12,
2890,
16,
871,
4672,
468,
1347,
732,
29612,
7155,
16,
866,
309,
732,
1240,
279,
1203,
471,
9276,
518,
468,
225,
358,
1923,
326,
460,
18,
365,
18,
9168,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2755,
4666,
1504,
307,
9233,
12,
2890,
16,
871,
4672,
468,
1347,
732,
29612,
7155,
16,
866,
309,
732,
1240,
279,
1203,
471,
9276,
518,
468,
225,
358,
1923,
326,
460,
18,
365,
18,
9168,... |
sensitivies[det]=1.0 | sensitivities[det]=1.0 | def detector_thresholds(min_threshold, ifos, RA, dec, gps_time, sensitivities=None): """ Return a dictionary of sensitivity thresholds for each detector, based on a minimum threshold of min_threshold in the least sensitive one, for a source at position (RA,dec) specified in radians at time gps_time. Specifying a dictionary of sensitivities allows one to weight also by the relative SNR of a reference system in each detector to handle different noise curves. """ # Recurse if multiple RA, dec and GPS times are specified if type(gps_time)!=float or type(RA)!=float or type(dec)!=float: assert len(gps_time)==len(RA),len(gps_time)==len(dec) return map(lambda (a,b,c): detector_thresholds(min_threshold,ifos,a,b,c,sensitivities), zip(RA,dec,gps_time)) from pylal import antenna # Sensitivies specifies relative SNRs of a reference signal (BNS) if sensitivities is None: sensitivities={} for det in ifos: sensitivies[det]=1.0 else: assert len(ifos)==len(sensitivites) # Normalise sensitivities minsens=min(sensitivities.values()) for det in ifos: sensitivities[det]/=minsens resps={} threshs={} # Make a dictionary of average responses for det in ifos: resps[det]=antenna.response(gps_time,RA,dec,0,0,'radians',det)[2] worst_resp=min(resps.values()) # Assuming that lowest threshold is in worst detector, return thresholds for det in ifos: threshs[det]=min_threshold*(resps[det]/worst_resp)*sensitivities[det] return threshs | 53a79e706267554633da0f19dc24a8fc82ee14b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/53a79e706267554633da0f19dc24a8fc82ee14b9/grbsummary.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13826,
67,
8699,
87,
12,
1154,
67,
8699,
16,
309,
538,
16,
26880,
16,
2109,
16,
20985,
67,
957,
16,
15390,
305,
427,
1961,
33,
7036,
4672,
3536,
2000,
279,
3880,
434,
15390,
20862,
199... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13826,
67,
8699,
87,
12,
1154,
67,
8699,
16,
309,
538,
16,
26880,
16,
2109,
16,
20985,
67,
957,
16,
15390,
305,
427,
1961,
33,
7036,
4672,
3536,
2000,
279,
3880,
434,
15390,
20862,
199... |
write_segments_to_xml(doc, proc_id, result) | add_to_segment(doc, proc_id, new_seg_def_id, result) | def run_query_segments(doc, proc_id, engine, gps_start_time, gps_end_time, included_segments_string, excluded_segments_string = None, write_segments = True, start_pad = 0, end_pad = 0): """Runs a segment query. This was originally part of ligolw_query_segments, but now is also used by ligolw_segments_from_cats. The write_segments option is provided so callers can coalesce segments obtained over sever invocations (as segments_from_cats does). """ # Find or create the tables we'll need try: seg_def_table = table.get_table(doc, lsctables.SegmentDefTable.tableName) new_seg_def_id = seg_def_table[0].segment_def_id except ValueError: seg_def_table = lsctables.New(lsctables.SegmentDefTable, columns = ["process_id", "segment_def_id", "ifos", "name", "version", "comment"]) doc.childNodes[0].appendChild(seg_def_table) # Add ourselves as a segment definer new_seg_def_id = seg_def_table.get_next_id() segment_definer = lsctables.SegmentDef() segment_definer.process_id = proc_id segment_definer.segment_def_id = new_seg_def_id segment_definer.ifos = split_segment_ids(included_segments_string.split(','))[0][0] segment_definer.name = "result" segment_definer.version = 0 segment_definer.comment = '' seg_def_table.append(segment_definer) try: seg_sum_table = table.get_table(doc, lsctables.SegmentSumTable.tableName) except: seg_sum_table = lsctables.New(lsctables.SegmentSumTable, columns = ['process_id','segment_def_id','segment_sum_id','start_time', 'end_time']) doc.childNodes[0].appendChild(seg_sum_table) # with a segment summary spanning the interval from the command line segment_summary = lsctables.SegmentSumTable() segment_summary.process_id = proc_id segment_summary.segment_def_id = new_seg_def_id segment_summary.segment_sum_id = seg_sum_table.get_next_id() segment_summary.start_time = gps_start_time segment_summary.end_time = gps_end_time seg_sum_table.append(segment_summary) try: segtable = table.get_table(doc, lsctables.SegmentTable.tableName) except: segtable = lsctables.New(lsctables.SegmentTable, columns = ["process_id", "segment_def_id", "segment_id", "start_time", "end_time"]) doc.childNodes[0].appendChild(segtable) included_segments = glue.segments.segmentlist([]) excluded_segments = glue.segments.segmentlist([]) for ifo, segment_name, version in split_segment_ids(included_segments_string.split(',')): sum_segments, seg_segments = build_segment_list(engine, gps_start_time, gps_end_time, ifo, segment_name, version, start_pad, end_pad) seg_def_id = seg_def_table.get_next_id() segment_definer = lsctables.SegmentDef() segment_definer.process_id = proc_id segment_definer.segment_def_id = seg_def_id segment_definer.ifos = ifo segment_definer.name = segment_name segment_definer.version = version segment_definer.comment = '' seg_def_table.append(segment_definer) # Add segment summary entries for sum_segment in sum_segments: segment_summary = lsctables.SegmentSumTable() segment_summary.process_id = proc_id segment_summary.segment_def_id = seg_def_id segment_summary.segment_sum_id = seg_sum_table.get_next_id() segment_summary.start_time = sum_segment[0] segment_summary.end_time = sum_segment[1] seg_sum_table.append(segment_summary) # and accumulate segments included_segments |= seg_segments # Excluded segments are not required if excluded_segments_string: for ifo, segment_name, version in split_segment_ids(excluded_segments_string.split(',')): sum_segments, seg_segments = build_segment_list(engine, gps_start_time, gps_end_time, ifo, segment_name, version) excluded_segments |= seg_segments result = included_segments - excluded_segments result.coalesce() # Add the segments if write_segments: write_segments_to_xml(doc, proc_id, result) return result | 49a45a3a5ce71e6363dff6edb2856ae35cb56ca6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/49a45a3a5ce71e6363dff6edb2856ae35cb56ca6/segmentdb_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
2271,
67,
12838,
12,
2434,
16,
5418,
67,
350,
16,
4073,
16,
20985,
67,
1937,
67,
957,
16,
20985,
67,
409,
67,
957,
16,
5849,
67,
12838,
67,
1080,
16,
8845,
67,
12838,
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,
1086,
67,
2271,
67,
12838,
12,
2434,
16,
5418,
67,
350,
16,
4073,
16,
20985,
67,
1937,
67,
957,
16,
20985,
67,
409,
67,
957,
16,
5849,
67,
12838,
67,
1080,
16,
8845,
67,
12838,
67,
... |
return d.addCallback(gotClient) | d2.addCallback(gotClient) return defer.gatherResults([d1, d2]) | def gotClient(client): self.client = client | 6dc2595124ed21d282576cfb553463fbb3d540f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6dc2595124ed21d282576cfb553463fbb3d540f3/test_ftp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
1227,
12,
2625,
4672,
365,
18,
2625,
273,
1004,
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,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
1227,
12,
2625,
4672,
365,
18,
2625,
273,
1004,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
original_id, chromosome, start, stop, size_affected = row[:5] if run_type==2: score = float(row[-1]) | if run_type ==1: cnv_qc_call = self.generateCNVQCCallObjType1(session, row, data_source_obj, cnv_type_obj, cnv_method_obj) elif run_type ==2: cnv_qc_call = self.generateCNVQCCallObjType2(session, row, data_source_obj, cnv_type_obj, cnv_method_obj) elif run_type==3: cnv_qc_call = self.generateCNVQCCallObjFromBobSchmitzData(session, row, data_source_obj, cnv_type_obj,\ cnv_method_obj, original_id=original_id) | def putQCIntoDB(self, session, input_fname, no_of_lines_to_skip, data_source_obj, cnv_type_obj, cnv_method_obj=None, run_type=1): """ 2009-10-28 """ sys.stderr.write("Putting QC data into database ...") reader = csv.reader(open(input_fname), delimiter=figureOutDelimiter(input_fname)) for i in range(no_of_lines_to_skip): reader.next() for row in reader: original_id, chromosome, start, stop, size_affected = row[:5] if run_type==2: score = float(row[-1]) # Data from Korbinian and Stephan has pvalues. else: score = None chromosome = int(chromosome) start = int(start) stop = int(stop) size_affected = int(size_affected) acc_obj = self.getCNVQCAccessionObj(session, original_id, data_source_obj) cnv_qc_call = Stock_250kDB.CNVQCCalls(chromosome=chromosome, start=start, stop=stop, \ size_affected=size_affected, score=score) cnv_qc_call.accession = acc_obj cnv_qc_call.cnv_type = cnv_type_obj cnv_qc_call.cnv_method = cnv_method_obj session.save(cnv_qc_call) session.flush() sys.stderr.write("Done.\n") | e6409a213b00133552c26c26724e615e15749a74 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/e6409a213b00133552c26c26724e615e15749a74/CNVQCConstruct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
53,
39,
5952,
2290,
12,
2890,
16,
1339,
16,
810,
67,
12749,
16,
1158,
67,
792,
67,
3548,
67,
869,
67,
7457,
16,
501,
67,
3168,
67,
2603,
16,
6227,
90,
67,
723,
67,
2603,
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,
1378,
53,
39,
5952,
2290,
12,
2890,
16,
1339,
16,
810,
67,
12749,
16,
1158,
67,
792,
67,
3548,
67,
869,
67,
7457,
16,
501,
67,
3168,
67,
2603,
16,
6227,
90,
67,
723,
67,
2603,
16,
... |
ATOMARY = measure_counter() | ATOMARY = unit_counter() | def __call__(self): self.counter += 1 return self.counter | d7e53d29fe719b1e45bc2352292905063a9da8bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11053/d7e53d29fe719b1e45bc2352292905063a9da8bc/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
365,
18,
7476,
1011,
404,
327,
365,
18,
7476,
225,
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... | [
1,
1,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
365,
18,
7476,
1011,
404,
327,
365,
18,
7476,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
user_pass = base64.encode_string(unquote(user_passw)).strip() req.addheader('Proxy-Authorization', user_pass) | user_pass = base64.encodestring(unquote(user_pass)).strip() req.add_header('Proxy-Authorization', 'Basic '+user_pass) | def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) user_pass = base64.encode_string(unquote(user_passw)).strip() req.addheader('Proxy-Authorization', user_pass) host = unquote(host) req.set_proxy(host, type) if orig_type == type: # let other handlers take care of it # XXX this only makes sense if the proxy is before the # other handlers return None else: # need to start over, because the other handlers don't # grok the proxy's URL type return self.parent.open(req) | a9622a9af8d20bbd03a15a63df4b8c3261cfa69f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a9622a9af8d20bbd03a15a63df4b8c3261cfa69f/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2889,
67,
3190,
12,
2890,
16,
1111,
16,
2889,
16,
618,
4672,
1647,
67,
723,
273,
1111,
18,
588,
67,
723,
1435,
618,
16,
436,
67,
723,
273,
1416,
723,
12,
5656,
13,
1479,
16,
11329,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2889,
67,
3190,
12,
2890,
16,
1111,
16,
2889,
16,
618,
4672,
1647,
67,
723,
273,
1111,
18,
588,
67,
723,
1435,
618,
16,
436,
67,
723,
273,
1416,
723,
12,
5656,
13,
1479,
16,
11329,
... |
def startLiveVideo(self, force): if (self.ca.glive.window == self.liveVideoWindow and self.ca.props.active and not force): return self.liveVideoWindow.set_glive(self.ca.glive) | def startLiveVideo(self): | def startLiveVideo(self, force): #We need to know which window and which pipe here | 3fc5af5916d50b6e7a078f21a364a17429e82f23 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6451/3fc5af5916d50b6e7a078f21a364a17429e82f23/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12328,
10083,
12,
2890,
16,
2944,
4672,
468,
3218,
1608,
358,
5055,
1492,
2742,
471,
1492,
6010,
2674,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12328,
10083,
12,
2890,
16,
2944,
4672,
468,
3218,
1608,
358,
5055,
1492,
2742,
471,
1492,
6010,
2674,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def translation(domain, localedir=None, languages=None, class_=None): | def translation(domain, localedir=None, languages=None, class_=None, fallback=0): | def translation(domain, localedir=None, languages=None, class_=None): if class_ is None: class_ = GNUTranslations mofile = find(domain, localedir, languages) if mofile is None: raise IOError(ENOENT, 'No translation file found for domain', domain) key = os.path.abspath(mofile) # TBD: do we need to worry about the file pointer getting collected? # Avoid opening, reading, and parsing the .mo file after it's been done # once. t = _translations.get(key) if t is None: t = _translations.setdefault(key, class_(open(mofile, 'rb'))) return t | 1c90bcccc8face48d4f18328c0c3cb8d8262f998 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1c90bcccc8face48d4f18328c0c3cb8d8262f998/gettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4794,
12,
4308,
16,
1191,
23210,
33,
7036,
16,
8191,
33,
7036,
16,
667,
67,
33,
7036,
16,
5922,
33,
20,
4672,
309,
667,
67,
353,
599,
30,
667,
67,
273,
611,
50,
57,
12297,
7344,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4794,
12,
4308,
16,
1191,
23210,
33,
7036,
16,
8191,
33,
7036,
16,
667,
67,
33,
7036,
16,
5922,
33,
20,
4672,
309,
667,
67,
353,
599,
30,
667,
67,
273,
611,
50,
57,
12297,
7344,
76... |
self.logger.info(packages) self.cmd.run("emerge --unmerge --quiet =%s" % " =".join(packages)) | self.logger.info(pkgnames) self.cmd.run("emerge --unmerge --quiet %s" % " ".join(pkgnames.split(' '))) | def RemovePackages(self, packages): '''Deal with extra configuration detected''' if len(packages) > 0: self.logger.info('Removing packages:') self.logger.info(packages) self.cmd.run("emerge --unmerge --quiet =%s" % " =".join(packages)) self.RefreshPackages() self.extra = self.FindExtraPackages() | 35bac7c7a1c023f0dbda7a43e647a0372f669a76 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/35bac7c7a1c023f0dbda7a43e647a0372f669a76/Portage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3581,
11425,
12,
2890,
16,
5907,
4672,
9163,
758,
287,
598,
2870,
1664,
8316,
26418,
309,
562,
12,
10308,
13,
405,
374,
30,
365,
18,
4901,
18,
1376,
2668,
18939,
5907,
2497,
13,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3581,
11425,
12,
2890,
16,
5907,
4672,
9163,
758,
287,
598,
2870,
1664,
8316,
26418,
309,
562,
12,
10308,
13,
405,
374,
30,
365,
18,
4901,
18,
1376,
2668,
18939,
5907,
2497,
13,
365,
1... |
override = kwargs.pop('priority') or 2 | override_priority = kwargs.pop('priority') or 2 | def delay(self, *args, **kwargs): try: override = kwargs.pop('priority') or 2 except KeyError: override = priority | 3541697e3bd4727f67713283a769e023f8cff9b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14092/3541697e3bd4727f67713283a769e023f8cff9b6/tasks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4624,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
775,
30,
3849,
67,
8457,
273,
1205,
18,
5120,
2668,
8457,
6134,
578,
576,
1335,
4999,
30,
3849,
273,
4394,
2,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4624,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
775,
30,
3849,
67,
8457,
273,
1205,
18,
5120,
2668,
8457,
6134,
578,
576,
1335,
4999,
30,
3849,
273,
4394,
2,
-100,
-100,
-100,
-10... |
self.exec_prefix = sys.exec_prefix | self.exec_prefix = os.path.normpath (sys.exec_prefix) | def set_final_options (self): | f0a18abab7ed197a1eae965cc7198ad45b4bc275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f0a18abab7ed197a1eae965cc7198ad45b4bc275/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
6385,
67,
2116,
261,
2890,
4672,
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,
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,
444,
67,
6385,
67,
2116,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
Returns the Cartan Type. | Returns the Cartan type. | def cartan_type(self): """ Returns the Cartan Type. | 67d654215599230a09c5cccc4e460acbf57b6338 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/67d654215599230a09c5cccc4e460acbf57b6338/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7035,
304,
67,
723,
12,
2890,
4672,
3536,
2860,
326,
17695,
304,
1412,
18,
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,
... | [
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7035,
304,
67,
723,
12,
2890,
4672,
3536,
2860,
326,
17695,
304,
1412,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if ascent >= 0 and descent >= 0: | if ascent >= 0 or descent >= 0: | def extract_metrics_info(dvipng_stdout, metrics_file): metrics = open(metrics_file, 'w') | eedb4c6821c23344b8d26be2cba36e10c38c3037 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/eedb4c6821c23344b8d26be2cba36e10c38c3037/lyxpreview2bitmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
9597,
67,
1376,
12,
72,
522,
6446,
67,
10283,
16,
4309,
67,
768,
4672,
4309,
273,
1696,
12,
9597,
67,
768,
16,
296,
91,
6134,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
9597,
67,
1376,
12,
72,
522,
6446,
67,
10283,
16,
4309,
67,
768,
4672,
4309,
273,
1696,
12,
9597,
67,
768,
16,
296,
91,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
search_keywords = u' or '.join((folder.getLocalProperty('keywords', 'en')+' '+folder.getLocalProperty('title', 'en')).split()) expr = 'self.getCatalogedObjects(meta_type=\'%s\', approved=1, objectkeywords_%s=search_keywords)' % (METATYPE_NYSEMPROJECT, 'en') return eval(expr) | search_keywords = u' or '.join((folder.getLocalProperty('keywords', 'en')+' '+folder.getLocalProperty('title', 'en')).split()) expr = 'self.getCatalogedObjects(meta_type=\'%s\', approved=1, objectkeywords_%s=search_keywords)' % (METATYPE_NYSEMPROJECT, 'en') return eval(expr) | def getInitiativesProjects(self, folder=None): """returns a list with projects related with a folder inside the Initiatives folder""" try: search_keywords = u' or '.join((folder.getLocalProperty('keywords', 'en')+' '+folder.getLocalProperty('title', 'en')).split()) expr = 'self.getCatalogedObjects(meta_type=\'%s\', approved=1, objectkeywords_%s=search_keywords)' % (METATYPE_NYSEMPROJECT, 'en') return eval(expr) except: return None | 9bafd90013beef4170a14ef742a93e7bdabaa85c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/9bafd90013beef4170a14ef742a93e7bdabaa85c/SEMIDESite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26458,
77,
8785,
15298,
12,
2890,
16,
3009,
33,
7036,
4672,
3536,
6154,
279,
666,
598,
10137,
3746,
598,
279,
3009,
4832,
326,
4378,
77,
8785,
3009,
8395,
775,
30,
1623,
67,
11771,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26458,
77,
8785,
15298,
12,
2890,
16,
3009,
33,
7036,
4672,
3536,
6154,
279,
666,
598,
10137,
3746,
598,
279,
3009,
4832,
326,
4378,
77,
8785,
3009,
8395,
775,
30,
1623,
67,
11771,
273,
... |
A resource specificiation dict of the form {'rspec_type':type, 'number_of_nodes':num} | A resource specification dict of the form {'rspec_type':type, 'number_of_nodes':num} | def acquire_resources(auth, rspec): """ <Purpose> Acquires resources for users over XMLRPC. <Arguments> auth An authorization dict of the form {'username':username, 'password':password} rspec A resource specificiation dict of the form {'rspec_type':type, 'number_of_nodes':num} <Exceptions> Raises xmlrpclib Fault objects: 100, "GENIOpError" for internal errors. 103, "GENINotEnoughCredits" if user has insufficient vessel credits to complete request. <Returns> A list of 'info' dictionaries, each 'infodict' contains acquired vessel info. """ geni_user = _auth(auth) resource_type = rspec['rspec_type'] num_vessels = rspec['number_of_nodes'] acquired_vessels = [] # validate rspec data if not isinstance(resource_type, str) or not isinstance(num_vessels, int): raise xmlrpclib.Fault(102, "GENIInvalidUserInput: rspec has invalid data types.") if (resource_type != "lan" and resource_type != "wan" and \ resource_type != "random") or num_vessels < 1: raise xmlrpclib.Fault(102, "GENIInvalidUserInput: rspec has invalid values.") # since acquired_vessels expects rand instead of random if resource_type == 'random': resource_type = 'rand' try: acquired_vessels = interface.acquire_vessels(geni_user, num_vessels, resource_type) except DoesNotExistError: raise xmlrpclib.Fault(100, "GENIOpError: Internal GENI Error! Recieved a DoesNotExistError while calling interface.acquire_vessels") except UnableToAcquireResourcesError, err: raise xmlrpclib.Fault(100, "GENIOpError: Internal GENI Error! Unable to fulfill vessel acquire request at this given time. Please try again later.") except InsufficientUserResourcesError, err: raise xmlrpclib.Fault(103, "GENINotEnoughCredits: You do not have enough vessel credits to acquire the number of vessels requested.") except ProgrammerError, err: raise xmlrpclib.Fault(100, "GENIOpError: Internal GENI Error! Recieved a ProgrammerError while calling interface.acquire_vessels. Details: " + str(err)) # since acquire_vessels returns a list of Vessel objects, we # need to convert them into a list of 'info' dictionaries. return interface.get_vessel_infodict_list(acquired_vessels) | e15bef7c1eeeea6ae4b8f7315efcfc14ff360ad0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/e15bef7c1eeeea6ae4b8f7315efcfc14ff360ad0/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
67,
4683,
12,
1944,
16,
436,
2793,
4672,
3536,
411,
10262,
4150,
34,
12848,
4138,
2703,
364,
3677,
1879,
3167,
8087,
18,
411,
4628,
34,
1357,
1922,
6093,
2065,
434,
326,
646,
1366... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10533,
67,
4683,
12,
1944,
16,
436,
2793,
4672,
3536,
411,
10262,
4150,
34,
12848,
4138,
2703,
364,
3677,
1879,
3167,
8087,
18,
411,
4628,
34,
1357,
1922,
6093,
2065,
434,
326,
646,
1366... |
object, this object mimics the mapped class using a | object, this object mimics the mapped class using a | def replace(self, elem): entity = elem._annotations.get('parentmapper', None) if not entity or entity.isa(self.mapper): return sql_util.ColumnAdapter.replace(self, elem) else: return None | 40b20c680a5fe8ef85b9b99b23769f4dc59f1504 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1074/40b20c680a5fe8ef85b9b99b23769f4dc59f1504/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
12,
2890,
16,
3659,
4672,
1522,
273,
3659,
6315,
14670,
18,
588,
2668,
2938,
13919,
2187,
599,
13,
309,
486,
1522,
578,
1522,
18,
291,
69,
12,
2890,
18,
13919,
4672,
327,
1847,
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,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
12,
2890,
16,
3659,
4672,
1522,
273,
3659,
6315,
14670,
18,
588,
2668,
2938,
13919,
2187,
599,
13,
309,
486,
1522,
578,
1522,
18,
291,
69,
12,
2890,
18,
13919,
4672,
327,
1847,
6... |
logs = opslogfile.read() parts = split_logs_into_loops(logs) | log = logparser.parse_log_file(str(opslogfile)) parts = logparser.extract_category(log, 'jit-log-opt-') | def parse_loops(self, opslogfile): from pypy.jit.metainterp.test.oparser import parse, split_logs_into_loops assert opslogfile.check() logs = opslogfile.read() parts = split_logs_into_loops(logs) # skip entry bridges, they can contain random things self.loops = [parse(part, no_namespace=True) for part in parts if "entry bridge" not in part] self.sliced_loops = [] # contains all bytecodes of all loops for loop in self.loops: for op in loop.operations: if op.getopname() == "debug_merge_point": sliced_loop = BytecodeTrace() sliced_loop.bytecode = op.args[0]._get_str().rsplit(" ", 1)[1] self.sliced_loops.append(sliced_loop) else: sliced_loop.append(op) self.check_0_op_bytecodes() | 97ffdf6dc66366ed037330ba6471e27eef2e48bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/97ffdf6dc66366ed037330ba6471e27eef2e48bc/test_pypy_c.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
383,
4473,
12,
2890,
16,
6727,
28806,
4672,
628,
18951,
93,
18,
78,
305,
18,
10578,
11606,
84,
18,
3813,
18,
556,
297,
550,
1930,
1109,
16,
1416,
67,
10011,
67,
18591,
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,
1109,
67,
383,
4473,
12,
2890,
16,
6727,
28806,
4672,
628,
18951,
93,
18,
78,
305,
18,
10578,
11606,
84,
18,
3813,
18,
556,
297,
550,
1930,
1109,
16,
1416,
67,
10011,
67,
18591,
67,
... |
try: image_num = int(path[0]) filename = self.remotefilelist[image_num] dest_filename = os.path.expanduser("~/.covers/" + self.remote_artist + "-" + self.remote_album + ".jpg") if os.path.exists(filename): | image_num = int(path[0]) filename = self.remotefilelist[image_num] dest_filename = os.path.expanduser("~/.covers/" + self.remote_artist + "-" + self.remote_album + ".jpg") if os.path.exists(filename): try: | def replace_cover(self, iconview, path, dialog): self.stop_art_update = True try: image_num = int(path[0]) filename = self.remotefilelist[image_num] dest_filename = os.path.expanduser("~/.covers/" + self.remote_artist + "-" + self.remote_album + ".jpg") if os.path.exists(filename): # Move temp file to actual file: os.remove(dest_filename) os.rename(filename, dest_filename) # And finally, set the image in the interface: self.lastalbumart = None # When called from a signal handler, we must use idle_add (see FAQ 20.15) gobject.idle_add(self.update_album_art) # Clean up.. if os.path.exists(os.path.dirname(filename)): removeall(os.path.dirname(filename)) except: pass dialog.destroy() while self.downloading_image: gtk.main_iteration() | befca61320fc2a23a6097565158d29e764e5b07c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/befca61320fc2a23a6097565158d29e764e5b07c/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
67,
3165,
12,
2890,
16,
4126,
1945,
16,
589,
16,
6176,
4672,
365,
18,
5681,
67,
485,
67,
2725,
273,
1053,
775,
30,
1316,
67,
2107,
273,
509,
12,
803,
63,
20,
5717,
1544,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1453,
67,
3165,
12,
2890,
16,
4126,
1945,
16,
589,
16,
6176,
4672,
365,
18,
5681,
67,
485,
67,
2725,
273,
1053,
775,
30,
1316,
67,
2107,
273,
509,
12,
803,
63,
20,
5717,
1544,
273,
... |
<description>bla </description> | <description><![CDATA[bla ]]></description> | def testRdfDescription (self): self.filt("""<?xml version="1.0" encoding="ISO-8859-1"?> | ae882b652ae62ad0507759dc05158de20a7b6d5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/ae882b652ae62ad0507759dc05158de20a7b6d5a/test_xmlrewriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
27616,
3291,
261,
2890,
4672,
365,
18,
30991,
2932,
3660,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
12609,
17,
17258,
17,
21,
6,
35,
34,
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,
1842,
27616,
3291,
261,
2890,
4672,
365,
18,
30991,
2932,
3660,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
12609,
17,
17258,
17,
21,
6,
35,
34,
2,
-100,
-100,
-100,
-100,
-100... |
if not self.start_time: self.start_time = time.time() | def update(self, value): "Updates the progress bar to a new value." assert 0 <= value <= self.maxval self.currval = value if not self._need_update() or self.finished: return if not self.start_time: self.start_time = time.time() self.seconds_elapsed = time.time() - self.start_time self.prev_percentage = self.percentage() if value != self.maxval: self.fd.write(self._format_line() + '\r') else: self.finished = True self.fd.write(self._format_line() + '\n') | c109edddd8f1b11193779fab960ac9b94b56e2c9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11527/c109edddd8f1b11193779fab960ac9b94b56e2c9/progressbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
460,
4672,
315,
5121,
326,
4007,
4653,
358,
279,
394,
460,
1199,
1815,
374,
1648,
460,
1648,
365,
18,
1896,
1125,
365,
18,
17016,
1125,
273,
460,
309,
486,
365,
631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
12,
2890,
16,
460,
4672,
315,
5121,
326,
4007,
4653,
358,
279,
394,
460,
1199,
1815,
374,
1648,
460,
1648,
365,
18,
1896,
1125,
365,
18,
17016,
1125,
273,
460,
309,
486,
365,
631... | |
endput = endput+testname+"\nString 'Success' or 'killing' not in logdata\n\n" | endput = endput+testname+"\nString 'Success' or 'kill' not in logdata\n\n" | def do_actual_test(testtype, restrictionfn, testname, is_python_test): global endput global mobileNoSubprocess # match python if testtype == 's': if not mobileNoSubprocess: (pyout, pyerr) = exec_command('python '+testname) (testout, testerr) = exec_repy_script(testname, restrictionfn, {'simple':''}) else: # TODO: Read in captured tests and compare with exec repy script output? (testout, testerr) = exec_repy_script(testname, restrictionfn, {'simple':''}) pyout = testout pyerr = testerr capture_test_result(testname, pyout, pyerr, ".py") capture_test_result(testname, testout, testerr, ".repy") same = True if pyout != testout: # stdout differs endput = endput+testname+"\n"+ "standard out mismatch '"+pyout+"' != '"+testout+"'\n\n" same = False if pyerr != testerr: # stderr differs endput = endput+testname+"\n"+ "standard err mismatch '"+pyerr+"' != '"+testerr+"'\n\n" same = False return same # any out, no err... elif testtype == 'n': if is_python_test: (testout, testerr) = exec_repy_script(testname, '') else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if (not mobileNoSubprocess) and testout != '' and testerr == '': return True elif mobileNoSubprocess and testout != '' and testout.find('Traceback') == -1: return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # any err, no out... elif testtype == 'e': if is_python_test: (testout, testerr) = exec_repy_script(testname, '') else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if (not mobileNoSubprocess) and testout == '' and testerr != '': return True elif mobileNoSubprocess and testout.find('Traceback') != -1: return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # no err, no out... elif testtype == 'z': if is_python_test: (testout, testerr) = exec_command("python " + testname) else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if testout == '' and testerr == '': return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # any err, any out... elif testtype == 'b': if is_python_test: (testout, testerr) = exec_repy_script(testname, '') else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if (not mobileNoSubprocess) and testout != '' and testerr != '': return True elif mobileNoSubprocess and testout.find('Traceback') != -1: return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # no err, no out (logging)... elif testtype == 'l': # remove any existing log try: os.remove("experiment.log.old") os.remove("experiment.log.new") except OSError: pass # run the experiment if not mobileNoSubprocess: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'logfile':'experiment.log', 'status':'foo'}) else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") # first, check to make sure there was no output or error if mobileNoSubprocess or (testout == '' and testerr == ''): if not mobileNoSubprocess: try: myfo = file("experiment.log.old","r") logdata = myfo.read() myfo.close() if os.path.exists("experiment.log.new"): myfo = file("experiment.log.new","r") logdata = logdata + myfo.read() myfo.close() # use only the last 16KB logdata = logdata[-16*1024:] except: endput = endput+testname+"\nCan't read log!\n\n" return False else: logdata = testout if "Fail" in logdata: endput = endput+testname+"\nString 'Fail' in logdata\n\n" return False # Armon: Use this to test that logging from the external process is working elif "killing" in logdata: return True elif "Success" not in logdata: endput = endput+testname+"\nString 'Success' or 'killing' not in logdata\n\n" return False else: return True else: endput = endput+testname+"\nHad output or errput! out:"+testout+"err:"+ testerr+"\n\n" return False else: raise Exception, "Unknown test type '"+str(testout)+"'" | d8ac0874850202813e63a494191075408d02a897 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/d8ac0874850202813e63a494191075408d02a897/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
18672,
67,
3813,
12,
3813,
723,
16,
9318,
4293,
16,
1842,
529,
16,
353,
67,
8103,
67,
3813,
4672,
2552,
679,
458,
2552,
13411,
2279,
1676,
2567,
225,
468,
845,
5790,
309,
1842... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
67,
18672,
67,
3813,
12,
3813,
723,
16,
9318,
4293,
16,
1842,
529,
16,
353,
67,
8103,
67,
3813,
4672,
2552,
679,
458,
2552,
13411,
2279,
1676,
2567,
225,
468,
845,
5790,
309,
1842... |
if data.domain.classVar.varType == orange.VarTypes.Discrete: if self.kValueFormula == 0: self.kValue = int(sqrt(len(data))) elif self.kValueFormula == 1: self.kValue = int(len(data) / len(data.domain.classVar.values)) else: self.kValue = 10 | if self.kValueFormula == 0 or not data.domain.classVar or data.domain.classVar.varType == orange.VarTypes.Continuous: self.kValue = int(sqrt(len(data))) elif self.kValueFormula == 1: self.kValue = int(len(data) / len(data.domain.classVar.values)) | def setData(self, data): self.data = data | b5459e3f81932e8425c20f13ca454f5068080f1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/b5459e3f81932e8425c20f13ca454f5068080f1a/orngVizRank.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
501,
4672,
365,
18,
892,
273,
501,
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,
... | [
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,
7929,
12,
2890,
16,
501,
4672,
365,
18,
892,
273,
501,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
elif SectionHeader[1] == '.data': | elif SectionHeader[0] in ['.data', '.sdata']: | def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOffset = True, ModeIsSmm = False): if ModeIsSmm: AddrIsOffset = False InfFileNameList = ModuleList.keys() #InfFileNameList.sort() for InfFile in InfFileNameList: sys.stdout.write (".") sys.stdout.flush() ModuleInfo = ModuleList[InfFile] ModuleName = ModuleInfo.BaseName ## for SMM module in SMRAM, the SMRAM will be allocated from base to top. if not ModeIsSmm: BaseAddress = BaseAddress - ModuleInfo.Image.Size # # Update Image to new BaseAddress by GenFw tool # LaunchCommand(["GenFw", "--rebase", str(BaseAddress), "-r", ModuleInfo.Image.FileName], ModuleInfo.OutpuDir) else: # # Set new address to the section header only for SMM driver. # LaunchCommand(["GenFw", "--address", str(BaseAddress), "-r", ModuleInfo.Image.FileName], ModuleInfo.OutpuDir) # # Add general information. # if ModeIsSmm: MapBuffer.write('\n\n%s (Fix SMRAM Offset, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint)) elif AddrIsOffset: MapBuffer.write('\n\n%s (Fix Memory Offset, BaseAddress=-0x%010X, EntryPoint=-0x%010X)\n' % (ModuleName, 0 - BaseAddress, 0 - (BaseAddress + ModuleInfo.Image.EntryPoint))) else: MapBuffer.write('\n\n%s (Fix Memory Address, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint)) # # Add guid and general seciton section. # TextSectionAddress = 0 DataSectionAddress = 0 for SectionHeader in ModuleInfo.Image.SectionHeaderList: if SectionHeader[0] == '.text': TextSectionAddress = SectionHeader[1] elif SectionHeader[1] == '.data': DataSectionAddress = SectionHeader[1] if AddrIsOffset: MapBuffer.write('(GUID=%s, .textbaseaddress=-0x%010X, .databaseaddress=-0x%010X)\n\n' % (ModuleInfo.Guid, 0 - (BaseAddress + TextSectionAddress), 0 - (BaseAddress + DataSectionAddress))) else: MapBuffer.write('(GUID=%s, .textbaseaddress=0x%010X, .databaseaddress=0x%010X)\n\n' % (ModuleInfo.Guid, BaseAddress + TextSectionAddress, BaseAddress + DataSectionAddress)) # # Add funtion address # ImageMapTable = ModuleInfo.Image.FileName.replace('.efi', '.map') if not os.path.exists(ImageMapTable): continue ImageMap = open (ImageMapTable, 'r') for LinStr in ImageMap: if len (LinStr.strip()) == 0: continue StrList = LinStr.split() if len (StrList) > 4: if StrList[3] == 'f' or StrList[3] =='F': if AddrIsOffset: MapBuffer.write(' -0x%010X %s\n' % (0 - (BaseAddress + int (StrList[2], 16)), StrList[1])) else: MapBuffer.write(' 0x%010X %s\n' % (BaseAddress + int (StrList[2], 16), StrList[1])) ImageMap.close() | ef3747968bba5f59e31e3a867cfc32eb8a676f78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/914/ef3747968bba5f59e31e3a867cfc32eb8a676f78/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
426,
1969,
3120,
261,
2890,
16,
1635,
1892,
16,
3360,
1887,
16,
5924,
682,
16,
10216,
2520,
2335,
273,
1053,
16,
8126,
2520,
55,
7020,
273,
1083,
4672,
309,
8126,
2520,
55,
7020,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
426,
1969,
3120,
261,
2890,
16,
1635,
1892,
16,
3360,
1887,
16,
5924,
682,
16,
10216,
2520,
2335,
273,
1053,
16,
8126,
2520,
55,
7020,
273,
1083,
4672,
309,
8126,
2520,
55,
7020,
... |
eval(args_left.pop(0)) | exec args_left.pop(0) | def AddToPath(path): # if it's a relative path and we know what directory the current # python script is in, make the path relative to that directory. if not os.path.isabs(path) and sys.path[0]: path = os.path.join(sys.path[0], path) path = os.path.realpath(path) # sys.path[0] should always refer to the current script's directory, # so place the new dir right after that. sys.path.insert(1, path) | 295c7a908cfeecc7276f559ff53282a177f4eb66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/295c7a908cfeecc7276f559ff53282a177f4eb66/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
774,
743,
12,
803,
4672,
468,
309,
518,
1807,
279,
3632,
589,
471,
732,
5055,
4121,
1867,
326,
783,
468,
5790,
2728,
353,
316,
16,
1221,
326,
589,
3632,
358,
716,
1867,
18,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
774,
743,
12,
803,
4672,
468,
309,
518,
1807,
279,
3632,
589,
471,
732,
5055,
4121,
1867,
326,
783,
468,
5790,
2728,
353,
316,
16,
1221,
326,
589,
3632,
358,
716,
1867,
18,
309,
... |
pos.append({"position":"img", "window":self.liveVideoWindow}) pos.append({"position":"max", "window":self.maxWindow} ) pos.append({"position":"eye", "window":self.recordWindow} ) | if (not self.COUNTINGDOWN): pos.append({"position":"img", "window":self.liveVideoWindow} ) pos.append({"position":"max", "window":self.maxWindow} ) pos.append({"position":"eye", "window":self.recordWindow} ) else: pos.append({"position":"img", "window":self.liveVideoWindow} ) pos.append({"position":"max", "window":self.maxWindow} ) pos.append({"position":"tmr", "window":self.progressWindow} ) | def updateVideoComponents( self ): if ( (self.LAST_MODE == self.ca.m.MODE) and (self.LAST_FULLSCREEN == self.FULLSCREEN) and (self.LAST_LIVE == self.LIVEMODE) and (self.LAST_RECD_INFO == self.RECD_INFO_ON) and (self.LAST_TRANSCODING == self.TRANSCODING)): return | a2ca8daca04eab073f1d77b9c429e2a44ce76e17 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6451/a2ca8daca04eab073f1d77b9c429e2a44ce76e17/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
10083,
7171,
12,
365,
262,
30,
309,
261,
202,
12,
2890,
18,
14378,
67,
7038,
422,
365,
18,
5353,
18,
81,
18,
7038,
13,
471,
261,
2890,
18,
14378,
67,
18111,
27908,
422,
365,
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,
1089,
10083,
7171,
12,
365,
262,
30,
309,
261,
202,
12,
2890,
18,
14378,
67,
7038,
422,
365,
18,
5353,
18,
81,
18,
7038,
13,
471,
261,
2890,
18,
14378,
67,
18111,
27908,
422,
365,
18... |
is_terminilogy_project = property(lambda self: self.project.code == "terminology") | is_terminology_project = property(lambda self: self.project.code == "terminology") stores = property(lambda self: Store.objects.filter(pootle_path__startswith=self.directory.pootle_path)) | def getsuggestions(self, pofile, item): """find all the suggestions submitted for the given (pofile or pofilename) and item""" if isinstance(pofile, (str, unicode)): pofilename = pofile pofile = self.getpofile(pofilename) suggestpos = pofile.getsuggestions(item) return suggestpos | 427d64bb9fd3de0451356553247e71a46cc68061 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11388/427d64bb9fd3de0451356553247e71a46cc68061/translation_project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5571,
12500,
12,
2890,
16,
8275,
768,
16,
761,
4672,
3536,
4720,
777,
326,
17969,
9638,
364,
326,
864,
261,
1631,
768,
578,
293,
792,
2550,
13,
471,
761,
8395,
309,
1549,
12,
1631,
768... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5571,
12500,
12,
2890,
16,
8275,
768,
16,
761,
4672,
3536,
4720,
777,
326,
17969,
9638,
364,
326,
864,
261,
1631,
768,
578,
293,
792,
2550,
13,
471,
761,
8395,
309,
1549,
12,
1631,
768... |
'sys_prefix': sysconfig.PREFIX, 'sys_exec_prefix': sysconfig.EXEC_PREFIX, | 'sys_prefix': prefix, 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, | def finalize_options (self): | af4f11a32ca7b8c0e15c3cc8c33f5d588f9c9a33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/af4f11a32ca7b8c0e15c3cc8c33f5d588f9c9a33/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
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,
0,
0,
0,
0... | [
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
('[[DateTime(2000-01-01T00:00:00Z)]]', '2000-01-01 00:00:00'), | ('[[DateTime(2000-01-01T00:00:00Z)]]', '2000-01-01 00:00:00'), | def testHeadingWithWhiteSpace(self): """ parser.wiki: TOC links to headings with white space | d47c7c86451ce60847ae5d54b86e7a3130bdd76a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/d47c7c86451ce60847ae5d54b86e7a3130bdd76a/test_text_moin_wiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
21867,
1190,
23108,
12,
2890,
4672,
3536,
2082,
18,
13044,
30,
8493,
39,
4716,
358,
910,
899,
598,
9578,
3476,
2,
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,
1842,
21867,
1190,
23108,
12,
2890,
4672,
3536,
2082,
18,
13044,
30,
8493,
39,
4716,
358,
910,
899,
598,
9578,
3476,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.file_type = "image/gcompris+draw image/svg+xml" | self.file_type = "image/gcompris+draw" if python_xml: self.file_type = self.file_type + " image/svg+xml" | def __init__(self, gcomprisBoard): | 0f71000645566dbe734440e44a39b9a57c6972bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/0f71000645566dbe734440e44a39b9a57c6972bd/anim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
314,
832,
683,
291,
22233,
4672,
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,
... | [
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
314,
832,
683,
291,
22233,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'defaults' is an n-tuple of the default values of the last n arguments.""" if not isfunction(func): raise TypeError, 'arg is not a Python function' | 'defaults' is an n-tuple of the default values of the last n arguments. """ if ismethod(func): func = func.im_func if not isfunction(func): raise TypeError('arg is not a Python function') | def getargspec(func): """Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'defaults' is an n-tuple of the default values of the last n arguments.""" if not isfunction(func): raise TypeError, 'arg is not a Python function' args, varargs, varkw = getargs(func.func_code) return args, varargs, varkw, func.func_defaults | 8cd1a0aaff3375b10b5ddbfb15182e95a3bb7202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cd1a0aaff3375b10b5ddbfb15182e95a3bb7202/inspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
23172,
12,
644,
4672,
3536,
967,
326,
1257,
471,
805,
924,
434,
279,
445,
1807,
1775,
18,
225,
432,
3193,
434,
12792,
9198,
353,
2106,
30,
261,
1968,
16,
19732,
16,
569,
9987,
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,
336,
23172,
12,
644,
4672,
3536,
967,
326,
1257,
471,
805,
924,
434,
279,
445,
1807,
1775,
18,
225,
432,
3193,
434,
12792,
9198,
353,
2106,
30,
261,
1968,
16,
19732,
16,
569,
9987,
16,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.