rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
extracted = [] while data: chunk = data[0] lines = chunk.splitlines(True) if len(lines) > 1: extracted += lines[:-1] if endswith_linesep(lines[-1]): extracted.append(lines[-1]) data.pop(0) else: data[0] = lines[-1] elif endswith_linesep(chunk): extracted.append(chunk) data.pop(0) elif len(data) > 2: data[1] = data[0] + data[1] data.pop(0) | buf = ''.join(data) lines = buf.splitlines(True) if len(lines) > 1: extracted += lines[:-1] if _endswith_linesep(lines[-1]): extracted.append(lines[-1]) buf = '' | def endswith_linesep(string): for linesep in ('\n', '\r\n', '\r'): if lines[0].endswith(linesep): return True | 2a8b9785afc5b1d516b0bdf507c8e4b986d266a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4547/2a8b9785afc5b1d516b0bdf507c8e4b986d266a0/cmdline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6879,
67,
3548,
881,
12,
1080,
4672,
364,
24223,
316,
7707,
64,
82,
2187,
2337,
86,
64,
82,
2187,
2337,
86,
11,
4672,
309,
2362,
63,
20,
8009,
5839,
1918,
12,
3548,
881,
4672,
327,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6879,
67,
3548,
881,
12,
1080,
4672,
364,
24223,
316,
7707,
64,
82,
2187,
2337,
86,
64,
82,
2187,
2337,
86,
11,
4672,
309,
2362,
63,
20,
8009,
5839,
1918,
12,
3548,
881,
4672,
327,
1... |
dataset1 = DataSet.objects.create(creator=bob, name='dataset1', description='this is the first dataset', is_active=True) dataset2 = DataSet.objects.create(creator=admin, name='dataset2', description='this is the second dataset', is_active=True) | dataset1 = DataSet.objects.create(creator=david, name='HIV/AIDS', description= '''Acquired immune deficiency syndrome or acquired immunodeficiency syndrome (AIDS) is a disease of the human immune system caused by the human immunodeficiency virus (HIV). This condition progressively reduces the effectiveness of the immune system and leaves individuals susceptible to opportunistic infections and tumors. HIV is transmitted through direct contact of a mucous membrane or the bloodstream with a bodily fluid containing HIV, such as blood, semen, vaginal fluid, preseminal fluid, and breast milk.''', is_active=True) _tag_dataset1(dataset1) dataset2 = DataSet.objects.create(creator=alex, name='Spanish Flu', description= '''The 1918 flu pandemic (commonly referred to as the Spanish flu) was an influenza pandemic that spread to nearly every part of the world. It was caused by an unusually virulent and deadly Influenza A virus strain of subtype H1N1. Historical and epidemiological data are inadequate to identify the geographic origin of the virus. Most of its victims were healthy young adults, in contrast to most influenza outbreaks which predominantly affect juvenile, elderly, or otherwise weakened patients. The flu pandemic has also been implicated in the sudden outbreak of Encephalitis lethargica in the 1920s.''', is_active=True) _tag_dataset2(dataset2) dataset3 = DataSet.objects.create(creator=micah, name='Poliomyelitis', description= '''Poliomyelitis, often called infantile paralysis, is an acute viral infectious disease spread from person to person, primarily via the fecal-oral route. The term derives from the Greek polios, meaning "grey", myelos, referring to the "spinal cord", and the suffix-itis, which denotes inflammation. Although around 90% of polio infections cause no symptoms at all, affected individuals can exhibit a range of symptoms if the virus enters the blood stream. In about 1% of cases the virus enters the central nervous system, preferentially infecting and destroying motor neurons, leading to muscle weakness and acute flaccid paralysis. Different types of paralysis may occur, depending on the nerves involved. Spinal polio is the most common form, characterized by asymmetric paralysis that most often involves the legs. Bulbar polio leads to weakness of muscles innervated by cranial nerves. Bulbospinal polio is a combination of bulbar and spinal paralysis.''', is_active=True) _tag_dataset3(dataset3) dataset4 = DataSet.objects.create(creator=elisha, name='Third Pandemic', description= '''Third Pandemic is the designation of a major plague pandemic that began in the Yunnan province in China in 1855. This episode of bubonic plague spread to all inhabited continents, and ultimately killed more than 12 million people in India and China alone. According to the World Health Organization, the pandemic was considered active until 1959, when worldwide casualties dropped to 200 per year.''', is_active=True) _tag_dataset4(dataset4) dataset5 = DataSet.objects.create(creator=katy, name='Viral hemorrhagic fever', description= '''The viral hemorrhagic fevers (VHFs) are a diverse group of animal and human illnesses that are caused by five distinct families of RNA viruses: the Arenaviridae, Filoviridae, Bunyaviridae, Togaviridae, and Flaviviridae. All types of VHF are characterized by fever and bleeding disorders and all can progress to high fever, shock and death in extreme cases. Some of the VHF agents cause relatively mild illnesses, such as the Scandinavian nephropathia epidemica, whilst others, such as the African Ebola virus, can cause severe, life-threatening disease.''', is_active=True) _tag_dataset5(dataset5) def _katy_tag_dataset1(dataset1): katy_tags = "hiv aids" Tagging.objects.add_tags_and_return_added_tag_names( katy_tags, item=dataset1, user=katy) def _david_tag_dataset1(dataset1): david_tags = "bodily fluids" Tagging.objects.add_tags_and_return_added_tag_names( david_tags, item=dataset1, user=david) def _tag_dataset1(dataset1): _katy_tag_dataset1(dataset1) _david_tag_dataset1(dataset1) def _micah_tag_dataset2(dataset2): micah_tags = "spanish 1918" Tagging.objects.add_tags_and_return_added_tag_names( micah_tags, item=dataset2, user=micah) def _alex_tag_dataset2(dataset2): alex_tags = "flu" Tagging.objects.add_tags_and_return_added_tag_names( alex_tags, item=dataset2, user=alex) def _tag_dataset2(dataset2): _micah_tag_dataset2(dataset2) _alex_tag_dataset2(dataset2) def _patrick_tag_dataset3(dataset3): patrick_tags = "Poliomyelitis greek" Tagging.objects.add_tags_and_return_added_tag_names( patrick_tags, item=dataset3, user=patrick) def _chintan_tag_dataset3(dataset3): chintan_tags = "infantile" Tagging.objects.add_tags_and_return_added_tag_names( chintan_tags, item=dataset3, user=chintan) def _tag_dataset3(dataset3): _patrick_tag_dataset3(dataset3) _chintan_tag_dataset3(dataset3) def _jim_tag_dataset4(dataset4): jim_tags = "Third Pandemic" Tagging.objects.add_tags_and_return_added_tag_names( jim_tags, item=dataset4, user=jim) def _elisha_tag_dataset4(dataset4): elisha_tags = "1855" Tagging.objects.add_tags_and_return_added_tag_names( elisha_tags, item=dataset4, user=elisha) def _tag_dataset4(dataset4): _jim_tag_dataset4(dataset4) _elisha_tag_dataset4(dataset4) def _russell_tag_dataset5(dataset5): russell_tags = "spanish 1918" Tagging.objects.add_tags_and_return_added_tag_names( russell_tags, item=dataset5, user=russell) def _bruno_tag_dataset5(dataset5): bruno_tags = "flu" Tagging.objects.add_tags_and_return_added_tag_names( bruno_tags, item=dataset5, user=bruno) def _tag_dataset5(dataset5): _russell_tag_dataset5(dataset5) _bruno_tag_dataset5(dataset5) | def _create_datasets(): dataset1 = DataSet.objects.create(creator=bob, name='dataset1', description='this is the first dataset', is_active=True) dataset2 = DataSet.objects.create(creator=admin, name='dataset2', description='this is the second dataset', is_active=True) | e278cb3aea0ebfd6ad83075f5701c47f6ef27bfd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2706/e278cb3aea0ebfd6ad83075f5701c47f6ef27bfd/demo_data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
21125,
13332,
3709,
21,
273,
14065,
18,
6911,
18,
2640,
12,
20394,
33,
70,
947,
16,
508,
2218,
8682,
21,
2187,
2477,
2218,
2211,
353,
326,
1122,
3709,
2187,
353,
67,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
21125,
13332,
3709,
21,
273,
14065,
18,
6911,
18,
2640,
12,
20394,
33,
70,
947,
16,
508,
2218,
8682,
21,
2187,
2477,
2218,
2211,
353,
326,
1122,
3709,
2187,
353,
67,
353... |
return all_went_ok | else: login = self.uid_to_login(uid) logging.info('''Skipped reserved system account %s ''' '''(we don't check them at all).''' % styles.stylize(styles.ST_NAME, login)) return all_went_ok | def check_uid(uid, minimal=minimal, batch=batch, auto_answer=auto_answer): | 940d620d0570fcfb29886fd8671a43a6b4a18ede /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/940d620d0570fcfb29886fd8671a43a6b4a18ede/users.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1911,
12,
1911,
16,
16745,
33,
1154,
2840,
16,
2581,
33,
5303,
16,
3656,
67,
13490,
33,
6079,
67,
13490,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1911,
12,
1911,
16,
16745,
33,
1154,
2840,
16,
2581,
33,
5303,
16,
3656,
67,
13490,
33,
6079,
67,
13490,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
logging.warn("HTTP error while checking for updates") | logging.warn("HTTP error while checking for updates %s", error) | def _handle_error(error): """Error handler""" global check_in_progress check_in_progress = False logging.warn("HTTP error while checking for updates") eventloop.addTimeout(86400, check_for_updates, "Check for updates") | e46940863d329557c8ff438f61f01bbf44a79134 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/e46940863d329557c8ff438f61f01bbf44a79134/autoupdate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
1636,
12,
1636,
4672,
3536,
668,
1838,
8395,
2552,
866,
67,
267,
67,
8298,
866,
67,
267,
67,
8298,
273,
1083,
2907,
18,
8935,
2932,
3693,
555,
1323,
6728,
364,
4533,
738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4110,
67,
1636,
12,
1636,
4672,
3536,
668,
1838,
8395,
2552,
866,
67,
267,
67,
8298,
866,
67,
267,
67,
8298,
273,
1083,
2907,
18,
8935,
2932,
3693,
555,
1323,
6728,
364,
4533,
738... |
FILTER_PACKAGES.update([filter.strip() for filter in filter_fh]) | _FILTER_PACKAGES.update([filter.strip() for filter in filter_fh]) | def LoadFilterFile(filter_file): """Load a file with keywords on a per line basis. Args: filter_file: file to load into FILTER_PACKAGES """ filter_fh = open(filter_file) try: FILTER_PACKAGES.update([filter.strip() for filter in filter_fh]) finally: filter_fh.close() return FILTER_PACKAGES | f9923b016426891082612471d83a0270ac1d2811 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/f9923b016426891082612471d83a0270ac1d2811/prebuilt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
1586,
812,
12,
2188,
67,
768,
4672,
3536,
2563,
279,
585,
598,
7093,
603,
279,
1534,
980,
10853,
18,
225,
6634,
30,
1034,
67,
768,
30,
585,
358,
1262,
1368,
8919,
67,
19077,
55,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4444,
1586,
812,
12,
2188,
67,
768,
4672,
3536,
2563,
279,
585,
598,
7093,
603,
279,
1534,
980,
10853,
18,
225,
6634,
30,
1034,
67,
768,
30,
585,
358,
1262,
1368,
8919,
67,
19077,
55,
... |
else | else: | def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 110) else quickfix.DoubleField.__init__(self, 110, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
20168,
13,
469,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
20168,
13,
469,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
9... |
This will be a new view object if possible; otherwise, it will return a copy. | This will be a new view object if possible; otherwise, it will return a copy. | def reshape(a, newshape, order='C'): """Return an array that uses the data of the given array, but with a new shape. :Parameters: - `a` : array - `newshape` : shape tuple or int The new shape should be compatible with the original shape. If an integer, then the result will be a 1D array of that length. - `order` : 'C' or 'FORTRAN', optional (default='C') Whether the array data should be viewed as in C (row-major) order or FORTRAN (column-major) order. :Returns: - `reshaped_array` : array This will be a new view object if possible; otherwise, it will return a copy. :See also: numpy.ndarray.reshape() is the equivalent method. """ try: reshape = a.reshape except AttributeError: return _wrapit(a, 'reshape', newshape, order=order) return reshape(newshape, order=order) | fe2f8b811f8f87475f51396eca9a848d2746ab2b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/fe2f8b811f8f87475f51396eca9a848d2746ab2b/fromnumeric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6985,
12,
69,
16,
394,
4867,
16,
1353,
2218,
39,
11,
4672,
3536,
990,
392,
526,
716,
4692,
326,
501,
434,
326,
864,
526,
16,
1496,
598,
279,
394,
2179,
18,
225,
294,
2402,
30,
300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6985,
12,
69,
16,
394,
4867,
16,
1353,
2218,
39,
11,
4672,
3536,
990,
392,
526,
716,
4692,
326,
501,
434,
326,
864,
526,
16,
1496,
598,
279,
394,
2179,
18,
225,
294,
2402,
30,
300,
... |
if context is None: context = {} | def action_cancel(self, cr, uid, ids, context=None): '''Create a 'date_cancel' on the membership_line object''' if context is None: context = {} member_line_obj = self.pool.get('membership.membership_line') today = time.strftime('%Y-%m-%d') for invoice in self.browse(cr, uid, ids): mlines = member_line_obj.search(cr, uid, [('account_invoice_line','in', [ l.id for l in invoice.invoice_line])], context) member_line_obj.write(cr, uid, mlines, {'date_cancel':today}, context) return super(Invoice, self).action_cancel(cr, uid, ids, context) | 2a4c1e50cb967d4599507ed63424b4f85c7753ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2a4c1e50cb967d4599507ed63424b4f85c7753ea/membership.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
10996,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
9163,
1684,
279,
296,
712,
67,
10996,
11,
603,
326,
12459,
67,
1369,
733,
26418,
3140,
67,
1369,
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,
1301,
67,
10996,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
9163,
1684,
279,
296,
712,
67,
10996,
11,
603,
326,
12459,
67,
1369,
733,
26418,
3140,
67,
1369,
67,
... | |
recs = cPickle.loads(d.recommendations) | user_recs = cPickle.loads(d.recommendations) | def convert_bulk_ebook(parent, db, book_ids, out_format=None): changed = False jobs = [] bad = [] total = len(book_ids) if total == 0: return None, None, None parent.status_bar.showMessage(_('Starting conversion of %d books') % total, 2000) d = BulkConfig(parent, db, out_format) if d.exec_() != QDialog.Accepted: return jobs, changed, bad output_format = d.output_format recs = cPickle.loads(d.recommendations) book_ids = convert_existing(parent, db, book_ids, output_format) for i, book_id in enumerate(book_ids): temp_files = [] try: d = SingleConfig(parent, db, book_id, None, output_format) d.accept() mi = db.get_metadata(book_id, True) in_file = db.format_abspath(book_id, d.input_format, True) out_file = PersistentTemporaryFile('.' + output_format) out_file.write(output_format) out_file.close() temp_files = [] lrecs = list(recs) if d.opf_file is not None: lrecs.append(('read_metadata_from_opf', d.opf_file.name, OptionRecommendation.HIGH)) temp_files.append(d.opf_file) if d.cover_file is not None: lrecs.append(('cover', d.cover_file.name, OptionRecommendation.HIGH)) temp_files.append(d.cover_file) for x in list(lrecs): if x[0] == 'debug_pipeline': lrecs.remove(x) desc = _('Convert book %d of %d (%s)') % (i + 1, total, repr(mi.title)) args = [in_file, out_file.name, lrecs] temp_files.append(out_file) jobs.append(('gui_convert', args, desc, d.output_format.upper(), book_id, temp_files)) changed = True except NoSupportedInputFormats: bad.append(book_id) if bad != []: res = [] for id in bad: title = db.title(id, True) res.append('%s'%title) msg = '%s' % '\n'.join(res) warning_dialog(parent, _('Could not convert some books'), _('Could not convert %d of %d books, because no suitable ' 'source format was found.') % (len(res), total), msg).exec_() return jobs, changed, bad | 812fae59edbc2245f37125c748d20b892910bd6b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/812fae59edbc2245f37125c748d20b892910bd6b/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
14597,
67,
73,
3618,
12,
2938,
16,
1319,
16,
6978,
67,
2232,
16,
596,
67,
2139,
33,
7036,
4672,
3550,
273,
1083,
6550,
273,
5378,
5570,
273,
5378,
225,
2078,
273,
562,
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,
1765,
67,
14597,
67,
73,
3618,
12,
2938,
16,
1319,
16,
6978,
67,
2232,
16,
596,
67,
2139,
33,
7036,
4672,
3550,
273,
1083,
6550,
273,
5378,
5570,
273,
5378,
225,
2078,
273,
562,
12,
... |
spam_box.addListener(spam_trainer) | spam_train_box.addListener(spam_trainer) | def setup(): # Setup state, app, boxes, trainers and account state.createWorkers() proxyListeners = [] app = Application("SpambayesIMAPServer") spam_box = SpambayesMailbox("Spam", 0, options["Storage", "spam_cache"]) unsure_box = SpambayesMailbox("Unsure", 1, options["Storage", "unknown_cache"]) ham_train_box = SpambayesMailbox("TrainAsHam", 2, options["Storage", "ham_cache"]) inbox = SpambayesInbox(3) spam_trainer = Trainer(spam_box, True) ham_trainer = Trainer(ham_train_box, False) spam_box.addListener(spam_trainer) ham_train_box.addListener(ham_trainer) user_account = SpambayesAccount(options["imapserver", "username"], ham_train_box, spam_box, unsure_box, inbox) # add IMAP4 server f = OneParameterFactory() f.protocol = SpambayesIMAPServer f.parameter = user_account state.imap_port = options["imapserver", "port"] app.listenTCP(state.imap_port, f) # add POP3 proxy for (server, serverPort), proxyPort in zip(state.servers, state.proxyPorts): listener = MyBayesProxyListener(server, serverPort, proxyPort, spam_box, unsure_box) proxyListeners.append(listener) state.buildServerStrings() # add web interface httpServer = UserInterfaceServer(state.uiPort) serverUI = ServerUserInterface(state, _recreateState) httpServer.register(serverUI) return app | 015f3d563a5a237bd8c4901c7368d0ee044ad991 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/015f3d563a5a237bd8c4901c7368d0ee044ad991/sb_pop3dnd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13332,
468,
10939,
919,
16,
595,
16,
14356,
16,
4691,
414,
471,
2236,
919,
18,
2640,
15252,
1435,
2889,
5583,
273,
5378,
595,
273,
4257,
2932,
3389,
2536,
528,
281,
3445,
2203,
208... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3875,
13332,
468,
10939,
919,
16,
595,
16,
14356,
16,
4691,
414,
471,
2236,
919,
18,
2640,
15252,
1435,
2889,
5583,
273,
5378,
595,
273,
4257,
2932,
3389,
2536,
528,
281,
3445,
2203,
208... |
popup_menu.popup(None, None, None, button, activate_time, status_icon) | popup_menu.popup( None, None, None, button, activate_time, status_icon) def on_menu_enter(self, widget, event): self.using_menu = None def on_menu_leave(self, widget, event): self.using_menu = event.time + 1 def check_using_menu(self, data=None): if ((self.popup_menu is not None and self.using_menu is not None and self.using_menu < time.time())): self.popup_menu.popdown() self.popup_menu = None return False return True | def on_popup_menu(self, status_icon, button, activate_time): popup_menu = gtk.Menu() for label, callback in self.make_popup_menu_items(): if not label and not callback: item = gtk.SeparatorMenuItem() else: item = gtk.ImageMenuItem(label) item.connect('activate', callback) popup_menu.append(item) | 812de41352d3f8b21cc3c9240cd8e24cbaa8c220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/812de41352d3f8b21cc3c9240cd8e24cbaa8c220/trayicon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
16086,
67,
5414,
12,
2890,
16,
1267,
67,
3950,
16,
3568,
16,
10235,
67,
957,
4672,
10431,
67,
5414,
273,
22718,
18,
4599,
1435,
364,
1433,
16,
1348,
316,
365,
18,
6540,
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,
603,
67,
16086,
67,
5414,
12,
2890,
16,
1267,
67,
3950,
16,
3568,
16,
10235,
67,
957,
4672,
10431,
67,
5414,
273,
22718,
18,
4599,
1435,
364,
1433,
16,
1348,
316,
365,
18,
6540,
67,
... |
elif i == plot_points-1: | elif i == plot_points-1: | def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize = True): r""" Calculate plot points for a function f in the interval xrange. The adaptive refinement algorithm for plotting a function f. See the docstring for plot for a description of the algorithm. INPUT: - ``f`` - a function of one variable - ``p1, p2`` - two points to refine between - ``plot_points`` - (default: 5) the minimal number of plot points. - ``adaptive_recursion`` - (default: 5) how many levels of recursion to go before giving up when doing adaptive refinement. Setting this to 0 disables adaptive refinement. - ``adaptive_tolerance`` - (default: 0.01) how large a difference should be before the adaptive refinement code considers it significant. See the documentation for plot() for more information. OUTPUT: - a list of points (x, f(x)) in the interval xrange, which aproximate the function f. TESTS:: sage: from sage.plot.plot import generate_plot_points sage: generate_plot_points(sin, (0, pi), plot_points=2, adaptive_recursion=0) [(0.0, 0.0), (3.1415926535897931, 1.2246...e-16)] sage: generate_plot_points(sin(x).function(x), (-pi, pi), randomize=False) [(-3.1415926535897931, -1.2246...e-16), (-2.748893571891069, -0.3826834323650898...), (-2.3561944901923448, -0.707106781186547...), (-2.1598449493429825, -0.831469612302545...), (-1.9634954084936207, -0.92387953251128674), (-1.7671458676442586, -0.98078528040323043), (-1.5707963267948966, -1.0), (-1.3744467859455345, -0.98078528040323043), (-1.1780972450961724, -0.92387953251128674), (-0.98174770424681035, -0.831469612302545...), (-0.78539816339744828, -0.707106781186547...), (-0.39269908169872414, -0.38268343236508978), (0.0, 0.0), (0.39269908169872414, 0.38268343236508978), (0.78539816339744828, 0.707106781186547...), (0.98174770424681035, 0.831469612302545...), (1.1780972450961724, 0.92387953251128674), (1.3744467859455345, 0.98078528040323043), (1.5707963267948966, 1.0), (1.7671458676442586, 0.98078528040323043), (1.9634954084936207, 0.92387953251128674), (2.1598449493429825, 0.831469612302545...), (2.3561944901923448, 0.707106781186547...), (2.748893571891069, 0.3826834323650898...), (3.1415926535897931, 1.2246...e-16)] This shows that lowering adaptive_tolerance and raising adaptive_recursion both increase the number of subdivision points:: sage: x = var('x') sage: f(x) = sin(1/x) sage: [len(generate_plot_points(f, (-pi, pi), adaptive_tolerance=i)) for i in [0.01, 0.001, 0.0001]] [42, 67, 104] sage: [len(generate_plot_points(f, (-pi, pi), adaptive_recursion=i)) for i in [5, 10, 15]] [34, 144, 897] """ x, data = var_and_list_of_values(xrange, plot_points) xmin = data[0] xmax = data[-1] delta = float(xmax-xmin) / plot_points random = current_randstate().python_random().random exceptions = 0; msg='' exception_indices = [] for i in range(len(data)): xi = data[i] # Slightly randomize the interior sample points if # randomize is true if randomize and i > 0 and i < plot_points-1: xi += delta*(random() - 0.5) try: data[i] = (float(xi), float(f(xi))) if str(data[i][1]) in ['nan', 'NaN', 'inf', '-inf']: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) exceptions += 1 exception_indices.append(i) except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) if i == 0: for j in range(1, 99): xj = xi + delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) elif i == plot_points-1: for j in range(1, 99): xj = xi - delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) else: exceptions += 1 exception_indices.append(i) exceptions += 1 exception_indices.append(i) data = [data[i] for i in range(len(data)) if i not in exception_indices] # adaptive refinement i, j = 0, 0 adaptive_tolerance = delta * float(adaptive_tolerance) adaptive_recursion = int(adaptive_recursion) while i < len(data) - 1: for p in adaptive_refinement(f, data[i], data[i+1], adaptive_tolerance=adaptive_tolerance, adaptive_recursion=adaptive_recursion): data.insert(i+1, p) i += 1 i += 1 if (len(data) == 0 and exceptions > 0) or exceptions > 10: sage.misc.misc.verbose("WARNING: When plotting, failed to evaluate function at %s points."%exceptions, level=0) sage.misc.misc.verbose("Last error message: '%s'"%msg, level=0) return data | 53bc30b3387bfc0f18049d2b64fd1492c7912453 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/53bc30b3387bfc0f18049d2b64fd1492c7912453/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2103,
67,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... |
valfmt='%3i') axtime = pylab.axes([0.25, 0.15, 0.65, 0.03], axisbg=axcolor) g_timeSlide = Slider(axtime, 'Time', 0 , images[0].get_shape()[3]-1, valinit=0, \ | def imshowslice(dir, slnum, time): if dir == 'x-y': data = [images[0].get_data()[:,i,slnum,time] for i in range(images[0].get_shape()[1])] elif dir == 'y-z': data = [images[0].get_data()[slnum,:,i,time] for i in range(images[0].get_shape()[2])] elif dir == 'x-z': data = [images[0].get_data()[:,slnum,i,time] for i in range(images[0].get_shape()[2])] pylab.subplot(111) pylab.imshow(data,cmap='gray', origin='lower', interpolation='nearest') | d4cec4e4e439c1f0ea7d11af15dcf13515ede240 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5491/d4cec4e4e439c1f0ea7d11af15dcf13515ede240/bview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31219,
6665,
12,
1214,
16,
2020,
2107,
16,
813,
4672,
309,
1577,
422,
296,
92,
17,
93,
4278,
501,
273,
306,
7369,
63,
20,
8009,
588,
67,
892,
1435,
10531,
16,
77,
16,
2069,
2107,
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,
31219,
6665,
12,
1214,
16,
2020,
2107,
16,
813,
4672,
309,
1577,
422,
296,
92,
17,
93,
4278,
501,
273,
306,
7369,
63,
20,
8009,
588,
67,
892,
1435,
10531,
16,
77,
16,
2069,
2107,
16,... | |
open(info_file,'U'), info_file, ('.py','U',1)) | open(info_file,filedescriptor[1]), info_file, filedescriptor) | def _init_info_modules(self, packages=None): """Initialize info_modules = {<package_name>: <package info.py module>}. """ import imp from glob import glob if packages is None: info_files = glob(os.path.join(self.parent_path,'*','info.py')) else: info_files = [] for package in packages: package = os.path.join(*package.split('.')) info_files.append(os.path.join(self.parent_path,package,'info.py')) | 48d93641c456ee1642c589bf077db5079386b9fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/48d93641c456ee1642c589bf077db5079386b9fe/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
1376,
67,
6400,
12,
2890,
16,
5907,
33,
7036,
4672,
3536,
7520,
1123,
67,
6400,
273,
288,
32,
5610,
67,
529,
28593,
411,
5610,
1123,
18,
2074,
1605,
34,
5496,
3536,
1930... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
1376,
67,
6400,
12,
2890,
16,
5907,
33,
7036,
4672,
3536,
7520,
1123,
67,
6400,
273,
288,
32,
5610,
67,
529,
28593,
411,
5610,
1123,
18,
2074,
1605,
34,
5496,
3536,
1930... |
else: H1=[self(0)] for m in range(1,ni[1]): H1.append(H1[-1]+pts[1]) return [P+Q for P in H0 for Q in H1] | H1=[self(0)] for m in range(1,ni[1]): H1.append(H1[-1]+pts[1]) return [P+Q for P in H0 for Q in H1] | def _points_via_group_structure(self): """ Return a list of all the points on the curve, for prime fields only (see points() for the general case) | cc7d2d5af36838a23324ce9fb3e43ec769cc9d02 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/cc7d2d5af36838a23324ce9fb3e43ec769cc9d02/ell_finite_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4139,
67,
21985,
67,
1655,
67,
7627,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
777,
326,
3143,
603,
326,
8882,
16,
364,
17014,
1466,
1338,
261,
5946,
3143,
1435,
364,
326,
7470,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
4139,
67,
21985,
67,
1655,
67,
7627,
12,
2890,
4672,
3536,
2000,
279,
666,
434,
777,
326,
3143,
603,
326,
8882,
16,
364,
17014,
1466,
1338,
261,
5946,
3143,
1435,
364,
326,
7470,
... |
choices=[ ('plain', 'plain'), \ ('drdb', 'drdb'), \ ('file','file'), \ ('diskless', 'diskless') ]) pnode = forms.ChoiceField(label='Primary Node', choices=[]) snode = forms.ChoiceField(label='Secondary Node', choices=[]) os = forms.ChoiceField(label='Operating System', choices=[]) | choices=templates) pnode = forms.ChoiceField(label='Primary Node', choices=[(u'', u'---------')]) snode = forms.ChoiceField(label='Secondary Node', choices=[(u'', u'---------')]) os = forms.ChoiceField(label='Operating System', choices=[(u'', u'---------')]) | def cluster_options(request, cluster_slug): """ Ajax view for retrieving node and operating system choices for a given cluster. """ cluster = get_object_or_404(Cluster, slug__exact=cluster_slug) user = request.user if not (user.is_superuser or user.has_perm('create_vm', cluster) or \ user.has_perm('admin', cluster)): return HttpResponseForbidden() content = json.dumps({'nodes':cluster.nodes(), \ 'os':cluster.rapi.GetOperatingSystems()}) return HttpResponse(content, mimetype='application/json') | 9697cb3953ca5bc1122dc693057714e70624634e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/9697cb3953ca5bc1122dc693057714e70624634e/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2855,
67,
2116,
12,
2293,
16,
2855,
67,
6436,
4672,
3536,
18772,
1476,
364,
17146,
756,
471,
16929,
2619,
7246,
364,
279,
864,
2855,
18,
3536,
2855,
273,
336,
67,
1612,
67,
280,
67,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2855,
67,
2116,
12,
2293,
16,
2855,
67,
6436,
4672,
3536,
18772,
1476,
364,
17146,
756,
471,
16929,
2619,
7246,
364,
279,
864,
2855,
18,
3536,
2855,
273,
336,
67,
1612,
67,
280,
67,
11... |
if colpoint == -1: | if colpoint == -1 or colpoint < atpoint: | def getrealhost(host): """ Slice off username/passwd and portnum """ atpoint = host.find('@') + 1 colpoint = host.rfind(':') if colpoint == -1: return host[atpoint:] else: return host[atpoint:colpoint] | f16599267b9adcda285bcd52ccff68291668e299 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/f16599267b9adcda285bcd52ccff68291668e299/transport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
7688,
2564,
12,
2564,
4672,
3536,
10506,
3397,
2718,
19,
24002,
471,
1756,
2107,
3536,
622,
1153,
273,
1479,
18,
4720,
2668,
36,
6134,
397,
404,
645,
1153,
273,
1479,
18,
86,
4720,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7688,
2564,
12,
2564,
4672,
3536,
10506,
3397,
2718,
19,
24002,
471,
1756,
2107,
3536,
622,
1153,
273,
1479,
18,
4720,
2668,
36,
6134,
397,
404,
645,
1153,
273,
1479,
18,
86,
4720,
... |
self.writeline('for event in block_%s(context):' % node.name) | self.writeline('for event in context.blocks[-1][%r](context):' % node.name) | def visit_Block(self, node, frame): """Call a block and register it for the template.""" # if we know that we are a child template, there is no need to # check if we are one if self.has_known_extends: return if frame.toplevel: self.writeline('if parent_root is None:') self.indent() self.writeline('for event in block_%s(context):' % node.name) self.indent() self.writeline('yield event') self.outdent(1 + frame.toplevel) | 7a52df8ec3d2987076181171b3227ab56154ab10 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14446/7a52df8ec3d2987076181171b3227ab56154ab10/compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
1768,
12,
2890,
16,
756,
16,
2623,
4672,
3536,
1477,
279,
1203,
471,
1744,
518,
364,
326,
1542,
12123,
468,
309,
732,
5055,
716,
732,
854,
279,
1151,
1542,
16,
1915,
353,
115... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1768,
12,
2890,
16,
756,
16,
2623,
4672,
3536,
1477,
279,
1203,
471,
1744,
518,
364,
326,
1542,
12123,
468,
309,
732,
5055,
716,
732,
854,
279,
1151,
1542,
16,
1915,
353,
115... |
values['state_id']=form['state_id'] | values['state_id'] = form['state_id'] | def _update(self, cr, uid, data, context): pool=pooler.get_pool(cr.dbname) form=data['form'] if 'profile' in data['form'] and data['form']['profile'] > 0: module_obj=pool.get('ir.module.module') module_obj.state_update(cr, uid, [data['form']['profile']], 'to install', ['uninstalled'], context) | 80824824fbdb4da10af4e162224e3745e1c3a054 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/80824824fbdb4da10af4e162224e3745e1c3a054/wizard_base_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
33,
6011,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
646,
33,
892,
3292,
687,
3546,
309,
296,
5040,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
33,
6011,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
646,
33,
892,
3292,
687,
3546,
309,
296,
5040,
11,
... |
self.whenLocoHorn(event, True) | self.doLocoHorn(event, True) | def whenLocoHornOn(self, event) : self.whenLocoHorn(event, True) return | 79baa866e687b74ac4f77e3c3432eb8cbbfb5a3e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2146/79baa866e687b74ac4f77e3c3432eb8cbbfb5a3e/RobotThrottle2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
1333,
83,
44,
14245,
1398,
12,
2890,
16,
871,
13,
294,
365,
18,
2896,
1333,
83,
44,
14245,
12,
2575,
16,
1053,
13,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1347,
1333,
83,
44,
14245,
1398,
12,
2890,
16,
871,
13,
294,
365,
18,
2896,
1333,
83,
44,
14245,
12,
2575,
16,
1053,
13,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._must_close = True | def __init__(self, sock, debuglevel=0, strict=0, method=None, buffering=False): if buffering: # The caller won't be using any sock.recv() calls, so buffering # is fine and recommended for performance. self.fp = sock.makefile('rb') # As our sock.makefile() object may receive data into its buffer # beyond that needed to satisfy this response, we must close # afterwards. self._must_close = True else: # The buffer size is specified as zero, because the headers of # the response are read with readline(). If the reads were # buffered the readline() calls could consume some of the # response, which make be read via a recv() on the underlying # socket. self.fp = sock.makefile('rb', 0) self._must_close = False self.debuglevel = debuglevel self.strict = strict self._method = method | 282eab1e2a9a5c7b36139fad21705a9675ed7cfe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/282eab1e2a9a5c7b36139fad21705a9675ed7cfe/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7313,
16,
1198,
2815,
33,
20,
16,
5490,
33,
20,
16,
707,
33,
7036,
16,
25056,
33,
8381,
4672,
309,
25056,
30,
468,
1021,
4894,
8462,
1404,
506,
1450,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
1198,
2815,
33,
20,
16,
5490,
33,
20,
16,
707,
33,
7036,
16,
25056,
33,
8381,
4672,
309,
25056,
30,
468,
1021,
4894,
8462,
1404,
506,
1450,
1... | |
ext, launcher = '-script.py', 'cli.exe' | ext, launcher = '-script.py', 'cli-%d.exe' % word_size | def get_script_args(dist, executable=sys_executable, wininst=False): """Yield write_script() argument tuples for a distribution's entrypoints""" spec = str(dist.as_requirement()) header = get_script_header("", executable, wininst) for group in 'console_scripts', 'gui_scripts': for name,ep in dist.get_entry_map(group).items(): script_text = ( "# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n" "__requires__ = %(spec)r\n" "import sys\n" "from pkg_resources import load_entry_point\n" "\n" "sys.exit(\n" " load_entry_point(%(spec)r, %(group)r, %(name)r)()\n" ")\n" ) % locals() if sys.platform=='win32' or wininst: # On Windows/wininst, add a .py extension and an .exe launcher if group=='gui_scripts': ext, launcher = '-script.pyw', 'gui.exe' old = ['.pyw'] new_header = re.sub('(?i)python.exe','pythonw.exe',header) else: ext, launcher = '-script.py', 'cli.exe' old = ['.py','.pyc','.pyo'] new_header = re.sub('(?i)pythonw.exe','python.exe',header) if os.path.exists(new_header[2:-1]) or sys.platform!='win32': hdr = new_header else: hdr = header yield (name+ext, hdr+script_text, 't', [name+x for x in old]) yield ( name+'.exe', resource_string('setuptools', launcher), 'b' # write in binary mode ) else: # On other platforms, we assume the right thing to do is to # just write the stub with no extension. yield (name, header+script_text) | a7a02f8847891a27812df0841fba5b528734c9ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8186/a7a02f8847891a27812df0841fba5b528734c9ba/easy_install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4263,
67,
1968,
12,
4413,
16,
9070,
33,
9499,
67,
17751,
16,
5657,
8591,
33,
8381,
4672,
3536,
16348,
1045,
67,
4263,
1435,
1237,
10384,
364,
279,
7006,
1807,
1241,
4139,
8395,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4263,
67,
1968,
12,
4413,
16,
9070,
33,
9499,
67,
17751,
16,
5657,
8591,
33,
8381,
4672,
3536,
16348,
1045,
67,
4263,
1435,
1237,
10384,
364,
279,
7006,
1807,
1241,
4139,
8395,
... |
"""returns channel information given by frequency | """ Returns channel information given by frequency. | def getChannel(self, freq, iwrange): """returns channel information given by frequency | 05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3159/05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258/iwlibs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16454,
12,
2890,
16,
7684,
16,
25522,
3676,
4672,
3536,
6154,
1904,
1779,
864,
635,
8670,
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,
... | [
1,
1,
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,
16454,
12,
2890,
16,
7684,
16,
25522,
3676,
4672,
3536,
6154,
1904,
1779,
864,
635,
8670,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
index = self.__CurrentLine()[self.CurrentOffsetWithinLine : -1].upper().find(string.upper()) else: index = self.__CurrentLine()[self.CurrentOffsetWithinLine : -1].find(string) | index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].upper().find(string.upper()) else: index = self.__CurrentLine()[self.CurrentOffsetWithinLine : ].find(string) | def __IsToken(self, string, ignoreCase = False): self.__SkipWhiteSpace() | 2b73379b74c03e8fb1ec1b2b8ec5f1eaf0738a70 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/2b73379b74c03e8fb1ec1b2b8ec5f1eaf0738a70/FdfParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2520,
1345,
12,
2890,
16,
533,
16,
27681,
273,
1083,
4672,
365,
16186,
6368,
23108,
1435,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2520,
1345,
12,
2890,
16,
533,
16,
27681,
273,
1083,
4672,
365,
16186,
6368,
23108,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.plotheigth=heigth | self.plotheight=height | def __init__( self, owner, scale_type, root, width, heigth ): | 2e4e7c5daa9d6b052171f723237d43de6db2f864 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/2e4e7c5daa9d6b052171f723237d43de6db2f864/Plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
3410,
16,
3159,
67,
723,
16,
1365,
16,
1835,
16,
3904,
360,
451,
262,
30,
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,
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,
1001,
2738,
972,
12,
365,
16,
3410,
16,
3159,
67,
723,
16,
1365,
16,
1835,
16,
3904,
360,
451,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if self.kw['use_unicode'] and colClass is col.StringCol: | if self.kw.get('use_unicode') and colClass is col.StringCol: | def columnsFromSchema(self, tableName, soClass): colData = self.queryAll("SHOW COLUMNS FROM %s" % tableName) results = [] for field, t, nullAllowed, key, default, extra in colData: if field == 'id': continue colClass, kw = self.guessClass(t) if self.kw['use_unicode'] and colClass is col.StringCol: colClass = col.UnicodeCol if self.dbEncoding: kw['dbEncoding'] = self.dbEncoding kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field) kw['notNone'] = not nullAllowed if default and t.startswith('int'): kw['default'] = int(default) else: kw['default'] = default # @@ skip key... # @@ skip extra... results.append(colClass(**kw)) return results | f095f224a1cb8a25e1c081ce2c1d207e6de55e59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6718/f095f224a1cb8a25e1c081ce2c1d207e6de55e59/mysqlconnection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2168,
1265,
3078,
12,
2890,
16,
4775,
16,
1427,
797,
4672,
645,
751,
273,
365,
18,
2271,
1595,
2932,
16677,
5597,
19639,
4571,
738,
87,
6,
738,
4775,
13,
1686,
273,
5378,
364,
652,
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,
2168,
1265,
3078,
12,
2890,
16,
4775,
16,
1427,
797,
4672,
645,
751,
273,
365,
18,
2271,
1595,
2932,
16677,
5597,
19639,
4571,
738,
87,
6,
738,
4775,
13,
1686,
273,
5378,
364,
652,
16,... |
s = (' 1 2 -1 23.34 4.56\n' ' 2 -3 9 12.45 6.12\r\n' '99999999999999999.9999999.99\n' '-999-999-999-9999.99-9999.99\n') if end_line: s += ' 0 0 0 0.00 0.00\n' s = (s) fast = hklf.fast_reader(file_object=StringIO(s)) slow = hklf.python_reader(file_object=StringIO(s)) simple = hklf.simple_reader(file_object=StringIO(s)) for r in (fast, slow, simple): assert approx_equal(r.sigmas(), [4.56, 6.12, 99999.99, -9999.99, ]) assert r.alphas() is None assert r.batch_numbers() is None | for something_after_end_line in (True, False): s = (' 1 2 -1 23.34 4.56\n' ' 2 -3 9 12.45 6.12\r\n' '99999999999999999.9999999.99\n' '-999-999-999-9999.99-9999.99\n') if end_line: s += ' 0 0 0 0.00 0.00\n' if something_after_end_line: s += ' -5 1 0 123.45 66.12\n' s = (s) fast = hklf.fast_reader(file_object=StringIO(s)) slow = hklf.python_reader(file_object=StringIO(s)) simple = hklf.simple_reader(file_object=StringIO(s)) for r in (fast, slow, simple): assert approx_equal(r.sigmas(), [4.56, 6.12, 99999.99, -9999.99, ]) assert r.alphas() is None assert r.batch_numbers() is None | def exercise_fast_hkl_reading(): s = (' 1 2 -1 -23.34 4.56 1\n' ' 2 -3 9 12.45 6.12 2\r\n' '99999999999999999.9999999.999999\n' '-999-999-999-9999.99-9999.99-999\r\n' ' 0 0 0 0.00 0.00 0\n') fast = hklf.fast_reader(file_object=StringIO(s)) slow = hklf.python_reader(file_object=StringIO(s)) simple = hklf.simple_reader(file_object=StringIO(s)) for r in (fast, slow, simple): assert list(r.indices()) == [ (1, 2, -1), (2, -3, 9), (9999, 9999, 9999), (-999, -999, -999), ] assert approx_equal(r.data(), [-23.34, 12.45, 99999.99, -9999.99, ]) assert approx_equal(r.sigmas(), [4.56, 6.12, 99999.99, -9999.99, ]) assert approx_equal(r.batch_numbers(), [1, 2, 9999, -999, ]) assert approx_equal(r.alphas(), [1, 2, 9999, -999, ]) for ma in r.as_miller_arrays(): assert ma.indices().all_eq(r.indices()) ma = r.as_miller_arrays()[0] assert ma.data().all_approx_equal(r.data()) assert ma.sigmas().all_approx_equal(r.sigmas()) ma = r.as_miller_arrays()[1] assert ma.data().all_eq(r.alphas()) assert ma.sigmas() is None s = (' 0 2 3 1816.00 20.00\n' ' 0 2 415508.00 138.00\n' ' 0 2 5 4776.00 40.00\n') fast = hklf.fast_reader(file_object=StringIO(s)) slow = hklf.python_reader(file_object=StringIO(s)) simple = hklf.simple_reader(file_object=StringIO(s)) for r in (fast, slow, simple): assert list(r.indices()) == [ (0,2,3), (0,2,4), (0,2,5) ] for end_line in (True, False): s = (' 1 2 -1 23.34 4.56\n' ' 2 -3 9 12.45 6.12\r\n' '99999999999999999.9999999.99\n' '-999-999-999-9999.99-9999.99\n') if end_line: s += ' 0 0 0 0.00 0.00\n' s = (s) fast = hklf.fast_reader(file_object=StringIO(s)) slow = hklf.python_reader(file_object=StringIO(s)) simple = hklf.simple_reader(file_object=StringIO(s)) for r in (fast, slow, simple): assert approx_equal(r.sigmas(), [4.56, 6.12, 99999.99, -9999.99, ]) assert r.alphas() is None assert r.batch_numbers() is None s = '' for rt in (hklf.fast_reader, hklf.simple_reader, hklf.python_reader): try: r = rt(file_object=StringIO(s)) except RuntimeError: pass else: raise Exception_expected s = (' 1 2 -1 23.34 4.56 1\n' ' 2 -3 a9 12.45 6.12 2\n' ' 0 0 0 0.00 0.00 0\n') for rt in (hklf.fast_reader, hklf.python_reader): try: r = rt(file_object=StringIO(s)) except Exception: pass else: raise Exception_expected try: r = hklf.simple_reader(file_object=StringIO(s)) except Exception: raise Exception_not_expected s = (' 1 2 -1 23.34 4.56 1 45.36\n' ' 2 -3 9 -12.45 -6.12 2 45.36\n' ' 0 0 0 0.00 0.00 0 0\n') for rt in (hklf.fast_reader, hklf.simple_reader, hklf.python_reader): try: r = rt(file_object=StringIO(s)) except RuntimeError: pass else: raise Exception_expected fast = hklf.fast_reader(file_object=StringIO(s), strict=False) simple = hklf.simple_reader(file_object=StringIO(s), strict=False) for r in (fast, simple): assert list(r.indices()) == [ (1, 2, -1), (2, -3, 9), ] assert approx_equal(r.data(), [23.34, -12.45, ]) assert approx_equal(r.sigmas(), [4.56, -6.12, ]) assert approx_equal(r.batch_numbers(), [1, 2, ]) s = (' 1 2 -1 23. 4. 1\n' ' -2 1 3 -1. 3. 1\n' ' 0 0 0 0. 0. 0\n') for rt in (hklf.fast_reader, hklf.simple_reader, hklf.python_reader): r = rt(file_object=StringIO(s)) assert list(r.indices()) == [(1, 2, -1), (-2, 1, 3)] assert approx_equal(r.data(), [23, -1]) assert approx_equal(r.sigmas(), [4, 3]) s = ( | 6264e830e79ffd2440af26518cc8723206ba0b77 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/696/6264e830e79ffd2440af26518cc8723206ba0b77/tst_hklf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24165,
67,
8076,
67,
76,
16391,
67,
21803,
13332,
272,
273,
7707,
282,
404,
282,
576,
225,
300,
21,
225,
300,
4366,
18,
5026,
565,
1059,
18,
4313,
282,
404,
64,
82,
11,
296,
282,
576... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24165,
67,
8076,
67,
76,
16391,
67,
21803,
13332,
272,
273,
7707,
282,
404,
282,
576,
225,
300,
21,
225,
300,
4366,
18,
5026,
565,
1059,
18,
4313,
282,
404,
64,
82,
11,
296,
282,
576... |
old = self._given_screenshot_dir | old = self._screenshot_dir | def set_screenshot_directory(self, path): """Sets the directory where screenshots are saved. | 635119ada8d3da897dcc48e0d162f3ac5aaf6329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/635119ada8d3da897dcc48e0d162f3ac5aaf6329/Screenshot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
29435,
67,
5149,
12,
2890,
16,
589,
4672,
3536,
2785,
326,
1867,
1625,
17179,
87,
854,
5198,
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,
444,
67,
29435,
67,
5149,
12,
2890,
16,
589,
4672,
3536,
2785,
326,
1867,
1625,
17179,
87,
854,
5198,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if oldlines[i] == "": | if oldlines[i] == "" and newlines[i] == "": new_tag = "equal" elif oldlines[i] == "": | def process_chunk(tag, lines, numlines): if tag == 'equal' and \ numlines >= settings.DIFF_CONTEXT_COLLAPSE_THRESHOLD: last_range_start = numlines - settings.DIFF_CONTEXT_NUM_LINES | afe6ce98bb6e64bf5b9d33578f51240cf47c88c9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1600/afe6ce98bb6e64bf5b9d33578f51240cf47c88c9/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
6551,
12,
2692,
16,
2362,
16,
818,
3548,
4672,
309,
1047,
422,
296,
9729,
11,
471,
521,
818,
3548,
1545,
1947,
18,
2565,
2246,
67,
13181,
67,
4935,
48,
2203,
1090,
67,
23840,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1207,
67,
6551,
12,
2692,
16,
2362,
16,
818,
3548,
4672,
309,
1047,
422,
296,
9729,
11,
471,
521,
818,
3548,
1545,
1947,
18,
2565,
2246,
67,
13181,
67,
4935,
48,
2203,
1090,
67,
23840,... |
value += self._safe_read(chunk_left) | value.append(self._safe_read(chunk_left)) | def _read_chunked(self, amt): assert self.chunked != _UNKNOWN chunk_left = self.chunk_left value = '' | 49148cf5287e34a399ecfc1958d62d2d83339f64 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/49148cf5287e34a399ecfc1958d62d2d83339f64/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
67,
6551,
329,
12,
2890,
16,
25123,
4672,
1815,
365,
18,
6551,
329,
480,
389,
14737,
2441,
67,
4482,
273,
365,
18,
6551,
67,
4482,
460,
273,
875,
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,
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,
896,
67,
6551,
329,
12,
2890,
16,
25123,
4672,
1815,
365,
18,
6551,
329,
480,
389,
14737,
2441,
67,
4482,
273,
365,
18,
6551,
67,
4482,
460,
273,
875,
2,
-100,
-100,
-100,
-100,
... |
if id == -1: id = wx.NewId() | def menuAdd(self, menu, name, fcn, id=-1, kind=wx.ITEM_NORMAL): if id == -1: id = wx.NewId() def _spl(st): if '\t' in st: return st.split('\t', 1) return st, '' | 3410e66579c93192596ad069b919af0e46780963 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/3410e66579c93192596ad069b919af0e46780963/multikey.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
986,
12,
2890,
16,
3824,
16,
508,
16,
8036,
82,
16,
612,
29711,
21,
16,
3846,
33,
27226,
18,
12674,
67,
15480,
4672,
1652,
389,
13106,
12,
334,
4672,
309,
2337,
88,
11,
316,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3824,
986,
12,
2890,
16,
3824,
16,
508,
16,
8036,
82,
16,
612,
29711,
21,
16,
3846,
33,
27226,
18,
12674,
67,
15480,
4672,
1652,
389,
13106,
12,
334,
4672,
309,
2337,
88,
11,
316,
38... | |
def sync_stdin (self): self.sync_stderr ('>>> ') line = sys.stdin.readline ()[:-1] | def sync_stdin_console (self): self.sync_stderr (self.sync_prompt_prefix) line = sys.stdin.readline () | def sync_stdin (self): self.sync_stderr ('>>> ') line = sys.stdin.readline ()[:-1] if line == '': self.select_trigger ((self.async_prompt, ())) return | 7eef55564ab71cf446ae63ad89bf2a261c743f8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/7eef55564ab71cf446ae63ad89bf2a261c743f8d/sync_stdio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
67,
21772,
67,
8698,
261,
2890,
4672,
365,
18,
8389,
67,
11241,
261,
2890,
18,
8389,
67,
13325,
67,
3239,
13,
980,
273,
2589,
18,
21772,
18,
896,
1369,
1832,
309,
980,
422,
875,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3792,
67,
21772,
67,
8698,
261,
2890,
4672,
365,
18,
8389,
67,
11241,
261,
2890,
18,
8389,
67,
13325,
67,
3239,
13,
980,
273,
2589,
18,
21772,
18,
896,
1369,
1832,
309,
980,
422,
875,
... |
debug(" non-local domain %s contains no embedded dot", domain) | _debug(" non-local domain %s contains no embedded dot", domain) | def set_ok_domain(self, cookie, request): if self.is_blocked(cookie.domain): debug(" domain %s is in user block-list", cookie.domain) return False if self.is_not_allowed(cookie.domain): debug(" domain %s is not in user allow-list", cookie.domain) return False if cookie.domain_specified: req_host, erhn = eff_request_host(request) domain = cookie.domain if self.strict_domain and (domain.count(".") >= 2): # XXX This should probably be compared with the Konqueror # (kcookiejar.cpp) and Mozilla implementations, but it's a # losing battle. i = domain.rfind(".") j = domain.rfind(".", 0, i) if j == 0: # domain like .foo.bar tld = domain[i+1:] sld = domain[j+1:i] if sld.lower() in ("co", "ac", "com", "edu", "org", "net", "gov", "mil", "int", "aero", "biz", "cat", "coop", "info", "jobs", "mobi", "museum", "name", "pro", "travel", "eu") and len(tld) == 2: # domain like .co.uk debug(" country-code second level domain %s", domain) return False if domain.startswith("."): undotted_domain = domain[1:] else: undotted_domain = domain embedded_dots = (undotted_domain.find(".") >= 0) if not embedded_dots and domain != ".local": debug(" non-local domain %s contains no embedded dot", domain) return False if cookie.version == 0: if (not erhn.endswith(domain) and (not erhn.startswith(".") and not ("."+erhn).endswith(domain))): debug(" effective request-host %s (even with added " "initial dot) does not end end with %s", erhn, domain) return False if (cookie.version > 0 or (self.strict_ns_domain & self.DomainRFC2965Match)): if not domain_match(erhn, domain): debug(" effective request-host %s does not domain-match " "%s", erhn, domain) return False if (cookie.version > 0 or (self.strict_ns_domain & self.DomainStrictNoDots)): host_prefix = req_host[:-len(domain)] if (host_prefix.find(".") >= 0 and not IPV4_RE.search(req_host)): debug(" host prefix %s for domain %s contains a dot", host_prefix, domain) return False return True | 15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15f04d8bbaf4e2b7d0d25228ce9bc84f1e501e81/cookielib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
601,
67,
4308,
12,
2890,
16,
3878,
16,
590,
4672,
309,
365,
18,
291,
67,
23156,
12,
8417,
18,
4308,
4672,
1198,
2932,
282,
2461,
738,
87,
353,
316,
729,
1203,
17,
1098,
3113... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
601,
67,
4308,
12,
2890,
16,
3878,
16,
590,
4672,
309,
365,
18,
291,
67,
23156,
12,
8417,
18,
4308,
4672,
1198,
2932,
282,
2461,
738,
87,
353,
316,
729,
1203,
17,
1098,
3113... |
raise KeyError, 'name (=%s) already taken.'%name | return self.__worksheets[name] | def create_new_worksheet(self, name='untitled', passcode=''): if name in self.__worksheets.keys(): raise KeyError, 'name (=%s) already taken.'%name name = str(name) passcode = str(passcode) wids = self.worksheet_ids() id = 0 while id in wids: id += 1 | 63ccd3735958dee04086ff8d1ee60451b94f3e55 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/63ccd3735958dee04086ff8d1ee60451b94f3e55/notebook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2704,
67,
1252,
8118,
12,
2890,
16,
508,
2218,
10032,
305,
1259,
2187,
1342,
710,
2218,
11,
4672,
309,
508,
316,
365,
16186,
18597,
10245,
18,
2452,
13332,
327,
365,
16186,
1859... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2704,
67,
1252,
8118,
12,
2890,
16,
508,
2218,
10032,
305,
1259,
2187,
1342,
710,
2218,
11,
4672,
309,
508,
316,
365,
16186,
18597,
10245,
18,
2452,
13332,
327,
365,
16186,
1859... |
print print '------------ ' + `self.linenr` + ' --------------- ' + `error_code` print string.strip(self.line[0:-1]) | print '\n------------ ' + `self.linenr` + ' --------------- ' + `error_code` print string.strip(self.line[0:-1]), | def write(self, error_code): print print '------------ ' + `self.linenr` + ' --------------- ' + `error_code` print string.strip(self.line[0:-1]) | 86c195c37788a1004b55fdc9a23a6b068464da21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5247/86c195c37788a1004b55fdc9a23a6b068464da21/testfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
555,
67,
710,
4672,
1172,
1172,
296,
7620,
296,
397,
1375,
2890,
18,
7511,
275,
86,
68,
397,
296,
300,
17908,
296,
397,
1375,
1636,
67,
710,
68,
1172,
533,
18,
64... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
555,
67,
710,
4672,
1172,
1172,
296,
7620,
296,
397,
1375,
2890,
18,
7511,
275,
86,
68,
397,
296,
300,
17908,
296,
397,
1375,
1636,
67,
710,
68,
1172,
533,
18,
64... |
'trytond.modules.' + info['name'].lower(): info.get('xml', []), | 'trytond.modules.' + info['name'].lower(): info.get('xml', []) \ + info.get('translation', []), | def add_defaults(self): sdist.sdist.add_defaults(self) if self.distribution.has_pure_modules(): build_py = self.get_finalized_command('build_py') data = [] for package in build_py.packages: src_dir = build_py.get_package_dir(package) data.extend(build_py.find_data_files(package, src_dir)) self.filelist.extend(data) | 57bc8b5b859c01af5a0e3e2e5b6784d1803735dd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/534/57bc8b5b859c01af5a0e3e2e5b6784d1803735dd/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7606,
12,
2890,
4672,
272,
4413,
18,
87,
4413,
18,
1289,
67,
7606,
12,
2890,
13,
309,
365,
18,
16279,
18,
5332,
67,
84,
594,
67,
6400,
13332,
1361,
67,
2074,
273,
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,
527,
67,
7606,
12,
2890,
4672,
272,
4413,
18,
87,
4413,
18,
1289,
67,
7606,
12,
2890,
13,
309,
365,
18,
16279,
18,
5332,
67,
84,
594,
67,
6400,
13332,
1361,
67,
2074,
273,
365,
18,
... |
""" SMTP 'rset' command. Resets session. """ | """SMTP 'rset' command. Resets session.""" | def rset(self): """ SMTP 'rset' command. Resets session. """ code=self.docmd("rset") return code | dfd1c12c67bea1eda4e609be530e5ca4b71d8eb4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dfd1c12c67bea1eda4e609be530e5ca4b71d8eb4/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
542,
12,
2890,
4672,
3536,
55,
14636,
296,
86,
542,
11,
1296,
18,
1124,
2413,
1339,
12123,
981,
33,
2890,
18,
2434,
1264,
2932,
86,
542,
7923,
327,
981,
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,
436,
542,
12,
2890,
4672,
3536,
55,
14636,
296,
86,
542,
11,
1296,
18,
1124,
2413,
1339,
12123,
981,
33,
2890,
18,
2434,
1264,
2932,
86,
542,
7923,
327,
981,
2,
-100,
-100,
-100,
-100,... |
Indexed sequence of elements [1.0000000000000000, 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, 1.0000000000000000] indexed by [0, 1, 2, 3, 4, 5, 6, 7] | Indexed sequence: [1.00000000000000, 1.00000000000000, 1.00000000000000, 1.00000000000000, 1.00000000000000, 1.00000000000000, 1.00000000000000, 1.00000000000000] indexed by [0, 1, 2, 3, 4, 5, 6, 7] | def idwt(self,other="haar",wavelet_k=2): """ Implements the gsl WaveletTransform.backward in dwt.pyx. other must be an element of {"haar", "daubechies", "daubechies_centered", "haar_centered", "bspline", "bspline_centered"}. Assumes the length of the sample is a power of 2. Uses the GSL function gsl_wavelet_transform_backward. See the above docstring for dwt for further details. | 431e77dd49c749a75ebdd4465e177155608021e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/431e77dd49c749a75ebdd4465e177155608021e6/dft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
6046,
12,
2890,
16,
3011,
1546,
3395,
297,
3113,
24801,
808,
67,
79,
33,
22,
4672,
3536,
29704,
326,
314,
2069,
678,
842,
808,
4059,
18,
29275,
316,
302,
6046,
18,
2074,
92,
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,
612,
6046,
12,
2890,
16,
3011,
1546,
3395,
297,
3113,
24801,
808,
67,
79,
33,
22,
4672,
3536,
29704,
326,
314,
2069,
678,
842,
808,
4059,
18,
29275,
316,
302,
6046,
18,
2074,
92,
18,
... |
dict['prefixname'] = 'mwerks_plugin_config.h' | if hasattr(MacOS, 'runtimemodel') and MacOS.runtimemodel == "carbon": dict['prefixname'] = 'mwerks_carbonplugin_config.h' else: dict['prefixname'] = 'mwerks_plugin_config.h' | def __init__(self, dict, templatelist=TEMPLATELIST, templatename=None): if templatename == None: if hasattr(MacOS, 'runtimemodel'): templatename = 'template-%s'%MacOS.runtimemodel else: templatename = 'template' if os.sep in templatename: templatedir = templatename else: try: packagedir = os.path.split(__file__)[0] except NameError: packagedir = os.curdir templatedir = os.path.join(packagedir, templatename) if not os.path.exists(templatedir): raise Error, "Cannot find templatedir %s"%templatedir self.dict = dict if not dict.has_key('prefixname'): dict['prefixname'] = 'mwerks_plugin_config.h' self.templatelist = templatelist self.templatedir = templatedir | 63cc0456e362ac067f5b4178ce373992e3936b89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/63cc0456e362ac067f5b4178ce373992e3936b89/cwxmlgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2065,
16,
13988,
270,
5449,
33,
12205,
7085,
16,
13988,
270,
1069,
33,
7036,
4672,
309,
13988,
270,
1069,
422,
599,
30,
309,
3859,
12,
9990,
4618,
16,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2065,
16,
13988,
270,
5449,
33,
12205,
7085,
16,
13988,
270,
1069,
33,
7036,
4672,
309,
13988,
270,
1069,
422,
599,
30,
309,
3859,
12,
9990,
4618,
16,
29... |
if a['essid'] != "": list.append( (a['essid'], a['essid']) ) self.WlanList.append(a['essid']) if "hidden..." not in list: list.append( ( _("enter hidden network SSID"),_("hidden...") ) ) self.WlanList.append(_("hidden...")) return list def modeSelectionMade(self, index): self.modeSelect(index) def modeSelectionMoved(self): self.modeSelect(self.selection) def modeSelect(self, mode): self.ap = mode print "ModeSelected:", mode def restartNetwork(self): iNetwork.restartNetwork() self.checkNetwork() def isWlanPluginInstalled(self): | tmplist.append( (a['bssid'], a['essid']) ) complist.append( (a['bssid'], a['essid']) ) for entry in tmplist: if entry[1] == "": for compentry in complist: if compentry[0] == entry[0]: complist.remove(compentry) for entry in complist: self.APList.append( (entry[1], entry[1]) ) if "hidden..." not in self.APList: self.APList.append(( _("enter hidden network SSID"), "hidden..." )) self.rescanTimer.start(3000) return self.APList def AccessPointsSelectionMade(self, index): self.ap = index self.WlanList = [] currList = [] if (self.wizard[self.currStep].has_key("dynamiclist")): currList = self['list'].list for entry in currList: self.WlanList.append( (entry[1], entry[0]) ) self.AccessPointsSelect(index) def AccessPointsSelect(self, index): self.NextStep = 'wlanconfig' def AccessPointsSelectionMoved(self): self.AccessPointsSelect(self.selection) def checkWlanSelection(self): self.rescanTimer.stop() self.currStep = self.getStepWithID(self.NextStep) def isWlanPluginInstalled(self): | def listModes(self): list = [] self.WlanList = [] try: from Plugins.SystemPlugins.WirelessLan.Wlan import Wlan except ImportError: list.append( ( _("No networks found"),_("unavailable") ) ) self.WlanList.append(_("No networks found")) return list else: self.w = Wlan(self.selectedInterface) aps = self.w.getNetworkList() if aps is not None: print "[NetworkWizard.py] got Accespoints!" for ap in aps: a = aps[ap] if a['active']: if a['essid'] != "": #a['essid'] = a['bssid'] list.append( (a['essid'], a['essid']) ) self.WlanList.append(a['essid']) if "hidden..." not in list: list.append( ( _("enter hidden network SSID"),_("hidden...") ) ) self.WlanList.append(_("hidden...")) return list | d6e258a761abb1074a1157d17b9c42b7f28959ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/d6e258a761abb1074a1157d17b9c42b7f28959ce/NetworkWizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
18868,
12,
2890,
4672,
666,
273,
5378,
365,
18,
59,
6115,
682,
273,
5378,
775,
30,
628,
26849,
18,
3163,
9461,
18,
15249,
2656,
48,
304,
18,
59,
6115,
1930,
678,
6115,
1335,
11308... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18868,
12,
2890,
4672,
666,
273,
5378,
365,
18,
59,
6115,
682,
273,
5378,
775,
30,
628,
26849,
18,
3163,
9461,
18,
15249,
2656,
48,
304,
18,
59,
6115,
1930,
678,
6115,
1335,
11308... |
ssl_want_read_or_write = False | def close(self): ssl_want_read_or_write = False try: if isinstance(self.socket, ssl.SSLSocket): if self.socket._sslobj is not None: try: self.socket.unwrap() except ssl.SSLError, err: if err.args[0] in (ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE): ssl_want_read_or_write = True else: raise finally: if not ssl_want_read_or_write: super(SSLConnection, self).close() | 2c6799ab8c3b53b8e019415d4b61834f6dbdb320 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/2c6799ab8c3b53b8e019415d4b61834f6dbdb320/test_ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
775,
30,
309,
1549,
12,
2890,
18,
7814,
16,
5832,
18,
1260,
25831,
4672,
309,
365,
18,
7814,
6315,
1049,
383,
441,
353,
486,
599,
30,
775,
30,
365,
18,
7814,
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,
1746,
12,
2890,
4672,
775,
30,
309,
1549,
12,
2890,
18,
7814,
16,
5832,
18,
1260,
25831,
4672,
309,
365,
18,
7814,
6315,
1049,
383,
441,
353,
486,
599,
30,
775,
30,
365,
18,
7814,
18... | |
buildOperandNameMap(userDict, t.lexer.lineno) | buildOperandNameMap(user_dict, t.lexer.lineno) | 'error: %s in def operands block "%s".' % (exc, t[3])) | 2edab51be0ddf2ab546920745ef34147fff0cec8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7385/2edab51be0ddf2ab546920745ef34147fff0cec8/isa_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
296,
1636,
30,
738,
87,
316,
1652,
14883,
1203,
2213,
87,
12013,
738,
261,
10075,
16,
268,
63,
23,
22643,
2,
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,
296,
1636,
30,
738,
87,
316,
1652,
14883,
1203,
2213,
87,
12013,
738,
261,
10075,
16,
268,
63,
23,
22643,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
raise ValueError("EArray on file is not correct shape!") | raise ValueError("Source node on file is not correct shape!") | def opensourcefile(filename, atomshape, sourcetype=None): """Open the source term hdf5 file with filename.""" if not filename or not sourcetype: raise TypeError("Need to specify filename and type of source data to store [int(egrand)|(full)term]!") if sourcetype in ["int", "term"]: sarrname = "source" + sourcetype source_logger.debug("Source array type: " + sarrname) else: raise TypeError("Incorrect source type specified!") try: source_logger.debug("Trying to open source file " + filename) rf = tables.openFile(filename, "a", "Source term result") if not "results" in rf.root: source_logger.debug("Creating group 'results' in source file.") rf.createGroup(rf.root, "results", "Results") if not sarrname in rf.root.results: source_logger.debug("Creating array '" + sarrname + "' in source file.") sarr = rf.createEArray(rf.root.results, sarrname, tables.Float64Atom(), atomshape) else: sarr = rf.getNode(rf.root.results, sarrname) if sarr.shape[1:] != atomshape[1:]: raise ValueError("EArray on file is not correct shape!") except IOError: raise return rf, sarr | 6b54f97aa02f920aaa135ad35cf0dcaaade8dc5e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7283/6b54f97aa02f920aaa135ad35cf0dcaaade8dc5e/sosource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10400,
552,
768,
12,
3459,
16,
3179,
4867,
16,
272,
20989,
5872,
33,
7036,
4672,
3536,
3678,
326,
1084,
2481,
24217,
25,
585,
598,
1544,
12123,
309,
486,
1544,
578,
486,
272,
20989,
5872... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10400,
552,
768,
12,
3459,
16,
3179,
4867,
16,
272,
20989,
5872,
33,
7036,
4672,
3536,
3678,
326,
1084,
2481,
24217,
25,
585,
598,
1544,
12123,
309,
486,
1544,
578,
486,
272,
20989,
5872... |
if verbose: print | print | def main(): # Parse options verbose = 0 dostats = 1 try: opts, args = getopt.getopt(sys.argv[1:], "vS") except getopt.error, msg: usage(msg) return 2 for o, a in opts: if o == "-v": verbose = 1 if o == "-S": dostats = 0 verbose = 1 if len(args) != 1: usage("exactly one file argument required") return 2 filename = args[0] # Open file try: f = open(filename, "rb") except IOError, msg: print "can't open %s: %s" % (filename, msg) return 1 # Read file, gathering statistics, and printing each record if verbose rt0 = time.time() bycode = {} records = 0 versions = 0 t0 = te = None datarecords = 0 datasize = 0L file0 = file1 = 0 while 1: r = f.read(24) if len(r) < 24: break records += 1 ts, code, oid, serial = struct.unpack(">ii8s8s", r) if t0 is None: t0 = ts te = ts dlen, code = code & 0x7fffff00, code & 0xff if dlen: datarecords += 1 datasize += dlen version = '-' if code & 0x80: version = 'V' versions += 1 current = code & 1 if current: file1 += 1 else: file0 += 1 code = code & 0x7e bycode[code] = bycode.get(code, 0) + 1 if verbose: print "%s %d %02x %016x %016x %1s %s" % ( time.ctime(ts)[4:-5], current, code, U64(oid), U64(serial), version, dlen and str(dlen) or "") bytes = f.tell() f.close() rte = time.time() # Error if nothing was read if not records: print >>sys.stderr, "No records processed" return 1 # Print statistics if dostats: if verbose: print print "Read %s records (%s bytes) in %.1f seconds" % ( addcommas(records), addcommas(bytes), rte-rt0) print "Version: %s records" % addcommas(versions) print "First time: %s" % time.ctime(t0) print "Last time: %s" % time.ctime(te) print "Duration: %s seconds" % addcommas(te-t0) print "File stats: %s in file 0; %s in file 1" % ( addcommas(file0), addcommas(file1)) print "Data recs: %s (%.1f%%), average size %.1f KB" % ( addcommas(datarecords), 100.0 * datarecords / records, datasize / 1024.0 / datarecords) print codes = bycode.keys() codes.sort() print "%13s %4s %s" % ("Count", "Code", "Function (action)") for code in codes: print "%13s %02x %s" % ( addcommas(bycode.get(code, 0)), code, explain.get(code) or "*** unknown code ***") | 7dd84cc1ddfee84a8c28768c379062ad59fe02e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7dd84cc1ddfee84a8c28768c379062ad59fe02e6/stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
2884,
702,
3988,
273,
374,
302,
669,
2323,
273,
404,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
90,
55,
7923... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
2884,
702,
3988,
273,
374,
302,
669,
2323,
273,
404,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
315,
90,
55,
7923... |
self._transform = self._transform * rotation(angle) | self._transform = rotation(angle) * self._transform | def rotate (self, angle) : """Combine a rotation with the actual transformation of this element. :Parameters: - `angle` (float) - angle of the rotation around Oz in direct orientation. """ self._transform = self._transform * rotation(angle) | 8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e/svg_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8534,
261,
2890,
16,
5291,
13,
294,
3536,
21720,
279,
6752,
598,
326,
3214,
8620,
434,
333,
930,
18,
225,
294,
2402,
30,
300,
1375,
4341,
68,
261,
5659,
13,
300,
5291,
434,
326,
6752,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8534,
261,
2890,
16,
5291,
13,
294,
3536,
21720,
279,
6752,
598,
326,
3214,
8620,
434,
333,
930,
18,
225,
294,
2402,
30,
300,
1375,
4341,
68,
261,
5659,
13,
300,
5291,
434,
326,
6752,
... |
implements(IObjectPostValidatingEvent) | implements(IObjectPostValidatingEvent) | def __init__(self, object, REQUEST, errors): super(ObjectValidatingEvent, self).__init__(object) self.REQUEST = REQUEST self.errors = errors | f382eb08e9d49498f235a88b1628657e913e2309 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12165/f382eb08e9d49498f235a88b1628657e913e2309/event.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
733,
16,
12492,
16,
1334,
4672,
2240,
12,
921,
31496,
1133,
16,
365,
2934,
972,
2738,
972,
12,
1612,
13,
365,
18,
5519,
273,
12492,
365,
18,
4324,
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,
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,
733,
16,
12492,
16,
1334,
4672,
2240,
12,
921,
31496,
1133,
16,
365,
2934,
972,
2738,
972,
12,
1612,
13,
365,
18,
5519,
273,
12492,
365,
18,
4324,
273,
... |
self.suffixes = [ ] | def __init__(self): # we're definitely going to be importing something in the future, # so let's just load the OS-related facilities. if not _os_stat: _os_bootstrap() | 2de07507437c9c4f18a0ba8d79f54df846aa9524 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2de07507437c9c4f18a0ba8d79f54df846aa9524/imputil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
732,
4565,
2217,
25818,
8554,
358,
506,
25077,
5943,
316,
326,
3563,
16,
468,
1427,
2231,
1807,
2537,
1262,
326,
5932,
17,
9243,
5853,
5076,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
732,
4565,
2217,
25818,
8554,
358,
506,
25077,
5943,
316,
326,
3563,
16,
468,
1427,
2231,
1807,
2537,
1262,
326,
5932,
17,
9243,
5853,
5076,
18,
309... | |
'gmt+1300':'GMT+13','gmt-0100':'GMT-1','gmt-0200':'GMT-2', 'gmt-0300':'GMT-3','gmt-0400':'GMT-4','gmt-0500':'GMT-5', 'gmt-0600':'GMT-6','gmt-0700':'GMT-7','gmt-0800':'GMT-8', 'gmt-0900':'GMT-9','gmt-1000':'GMT-10','gmt-1100':'GMT-11', 'gmt-1200':'GMT-12','greenwich':'Greenwich','hongkong':'Hongkong', | 'gmt+1300':'GMT+13', 'gmt-0100':'GMT-1', 'gmt-0200':'GMT-2', 'gmt-0300':'GMT-3', 'gmt-0400':'GMT-4', 'gmt-0500':'GMT-5', 'gmt-0600':'GMT-6', 'gmt-0700':'GMT-7', 'gmt-0800':'GMT-8', 'gmt-0900':'GMT-9', 'gmt-1000':'GMT-10','gmt-1100':'GMT-11','gmt-1200':'GMT-12', 'gmt+1': 'GMT+1', 'gmt+2': 'GMT+2', 'gmt+3': 'GMT+3', 'gmt+4': 'GMT+4', 'gmt+5': 'GMT+5', 'gmt+6': 'GMT+6', 'gmt+7': 'GMT+7', 'gmt+8': 'GMT+8', 'gmt+9': 'GMT+9', 'gmt+10':'GMT+10','gmt+11':'GMT+11','gmt+12':'GMT+12', 'gmt+13':'GMT+13', 'gmt-1': 'GMT-1', 'gmt-2': 'GMT-2', 'gmt-3': 'GMT-3', 'gmt-4': 'GMT-4', 'gmt-5': 'GMT-5', 'gmt-6': 'GMT-6', 'gmt-7': 'GMT-7', 'gmt-8': 'GMT-8', 'gmt-9': 'GMT-9', 'gmt-10':'GMT-10','gmt-11':'GMT-11','gmt-12':'GMT-12', 'greenwich':'Greenwich','hongkong':'Hongkong', | def info(self,t=None): idx=self.index(t)[0] zs =self.az[self.tinfo[idx][2]:] return self.tinfo[idx][0],self.tinfo[idx][1],zs[:find(zs,'\000')] | e3c3fc51844495761b2c4fd0f0464373800ac912 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e3c3fc51844495761b2c4fd0f0464373800ac912/DateTime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
12,
2890,
16,
88,
33,
7036,
4672,
2067,
33,
2890,
18,
1615,
12,
88,
25146,
20,
65,
998,
87,
273,
2890,
18,
1561,
63,
2890,
18,
88,
1376,
63,
3465,
6362,
22,
14542,
65,
327,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
12,
2890,
16,
88,
33,
7036,
4672,
2067,
33,
2890,
18,
1615,
12,
88,
25146,
20,
65,
998,
87,
273,
2890,
18,
1561,
63,
2890,
18,
88,
1376,
63,
3465,
6362,
22,
14542,
65,
327,
3... |
"""Generate a new pool item. In order for the pool to function, either this method must be overriden in a subclass or pool must be created with `create`=callable argument. It accepts no arguments and returns a single instance of whatever thing the pool is supposed to contain. | """Generate a new pool item. In order for the pool to function, either this method must be overriden in a subclass or the pool must be constructed with the `create` argument. It accepts no arguments and returns a single instance of whatever thing the pool is supposed to contain. | def create(self): """Generate a new pool item. In order for the pool to function, either this method must be overriden in a subclass or pool must be created with `create`=callable argument. It accepts no arguments and returns a single instance of whatever thing the pool is supposed to contain. | 450f8853779024ce3f5028dddfffbc46855b03df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10078/450f8853779024ce3f5028dddfffbc46855b03df/pools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
4672,
3536,
4625,
279,
394,
2845,
761,
18,
225,
657,
1353,
364,
326,
2845,
358,
445,
16,
3344,
333,
707,
1297,
506,
31736,
316,
279,
10177,
578,
2845,
1297,
506,
2522,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
4672,
3536,
4625,
279,
394,
2845,
761,
18,
225,
657,
1353,
364,
326,
2845,
358,
445,
16,
3344,
333,
707,
1297,
506,
31736,
316,
279,
10177,
578,
2845,
1297,
506,
2522,
5... |
self.log.exception('Could not fetch stylesheet %s'% iurl) | self.log.exception('Could not fetch stylesheet ', iurl) | def process_stylesheets(self, soup, baseurl): diskpath = unicode_path(os.path.join(self.current_dir, 'stylesheets')) if not os.path.exists(diskpath): os.mkdir(diskpath) for c, tag in enumerate(soup.findAll(lambda tag: tag.name.lower()in ['link', 'style'] and tag.has_key('type') and tag['type'].lower() == 'text/css')): if tag.has_key('href'): iurl = tag['href'] if not urlparse.urlsplit(iurl).scheme: iurl = urlparse.urljoin(baseurl, iurl, False) with self.stylemap_lock: if self.stylemap.has_key(iurl): tag['href'] = self.stylemap[iurl] continue try: data = self.fetch_url(iurl) except Exception: self.log.exception('Could not fetch stylesheet %s'% iurl) continue stylepath = os.path.join(diskpath, 'style'+str(c)+'.css') with self.stylemap_lock: self.stylemap[iurl] = stylepath with open(stylepath, 'wb') as x: x.write(data) tag['href'] = stylepath else: for ns in tag.findAll(text=True): src = str(ns) m = self.__class__.CSS_IMPORT_PATTERN.search(src) if m: iurl = m.group(1) if not urlparse.urlsplit(iurl).scheme: iurl = urlparse.urljoin(baseurl, iurl, False) with self.stylemap_lock: if self.stylemap.has_key(iurl): ns.replaceWith(src.replace(m.group(1), self.stylemap[iurl])) continue try: data = self.fetch_url(iurl) except Exception: self.log.exception('Could not fetch stylesheet %s'% iurl) continue c += 1 stylepath = os.path.join(diskpath, 'style'+str(c)+'.css') with self.stylemap_lock: self.stylemap[iurl] = stylepath with open(stylepath, 'wb') as x: x.write(data) ns.replaceWith(src.replace(m.group(1), stylepath)) | 8376081885d49b129ba0af39092d092a90eadb47 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/8376081885d49b129ba0af39092d092a90eadb47/simple.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
10218,
10245,
12,
2890,
16,
15418,
16,
25427,
4672,
4234,
803,
273,
5252,
67,
803,
12,
538,
18,
803,
18,
5701,
12,
2890,
18,
2972,
67,
1214,
16,
296,
10218,
10245,
26112,
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,
1207,
67,
10218,
10245,
12,
2890,
16,
15418,
16,
25427,
4672,
4234,
803,
273,
5252,
67,
803,
12,
538,
18,
803,
18,
5701,
12,
2890,
18,
2972,
67,
1214,
16,
296,
10218,
10245,
26112,
309... |
self.obj.startElement(self.new_tag, tag) | self.obj.startElement(self.new_tag, attrs) | def __call__(self, tag, attrs): self.obj.startElement(self.new_tag, tag) | 6da746bdbdf65eebfa0cea917371b16bb0f0a403 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/6da746bdbdf65eebfa0cea917371b16bb0f0a403/Dispatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1047,
16,
3422,
4672,
365,
18,
2603,
18,
1937,
1046,
12,
2890,
18,
2704,
67,
2692,
16,
1047,
13,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1047,
16,
3422,
4672,
365,
18,
2603,
18,
1937,
1046,
12,
2890,
18,
2704,
67,
2692,
16,
1047,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
p=file() | p=file(1) | def persistent_id(object,self=self,stackup=stackup): if (not hasattr(object, '_p_oid') or type(object) is ClassType): return None | 0a526e552373759f61c9dd56a8fc95ae4da8c961 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0a526e552373759f61c9dd56a8fc95ae4da8c961/Connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9195,
67,
350,
12,
1612,
16,
2890,
33,
2890,
16,
3772,
416,
33,
3772,
416,
4672,
309,
261,
902,
3859,
12,
1612,
16,
2070,
84,
67,
839,
6134,
578,
618,
12,
1612,
13,
353,
1659,
559,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9195,
67,
350,
12,
1612,
16,
2890,
33,
2890,
16,
3772,
416,
33,
3772,
416,
4672,
309,
261,
902,
3859,
12,
1612,
16,
2070,
84,
67,
839,
6134,
578,
618,
12,
1612,
13,
353,
1659,
559,
... |
conduit = WebDAVConduit(view=view, shareName=shareName, account=account) | def newInboundShare(view, url): """ Create a new Share item for a URL this client is subscribing to. Finds a WebDAV account which matches this URL; if none match then prompt the user for username/password for that URL. If either of these result in finding/creating an account, then create a Share item and return it. @param view: The repository view object @type view: L{repository.persistence.RepositoryView} @param url: The url which points to a collection to import @type url: String @return: A Share item, or None if no WebDAV account could be found. """ (useSSL, host, port, path, query, fragment) = splitUrl(url) parent = view.findPath("//userdata") account = findMatchingWebDAVAccount(view, url) if account is None: # Prompt user for account information then create an account # Get the parent directory of the given path: # '/dev1/foo/bar' becomes ['dev1', 'foo'] parentPath = path.strip('/').split('/')[:-1] # ['dev1', 'foo'] becomes "dev1/foo" parentPath = "/".join(parentPath) # Examine the URL for scheme, host, port, path info = AccountInfoPrompt.PromptForNewAccountInfo(wx.GetApp().mainFrame, host=host, path=parentPath) if info is not None: (description, username, password) = info kindPath = "//parcels/osaf/framework/sharing/WebDAVAccount" webDAVAccountKind = view.findPath(kindPath) account = webDAVAccountKind.newItem(name=None, parent=parent) account.displayName = description account.host = host account.path = parentPath account.username = username account.password = password account.useSSL = useSSL account.port = port share = None if account is not None: shareName = path.strip("/").split("/")[-1] conduit = WebDAVConduit(view=view, shareName=shareName, account=account) mode = "both" if url.endswith(".ics"): import ICalendar format = ICalendar.ICalendarFormat(view=view) mode = "get" else: format = CloudXMLFormat(view=view) share = Share(view=view, conduit=conduit, format=format) share.hidden = False share.mode = mode return share | d17caedfb29644494e2b959b725a4e8f38c041a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/d17caedfb29644494e2b959b725a4e8f38c041a9/Sharing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
20571,
9535,
12,
1945,
16,
880,
4672,
3536,
1788,
279,
394,
25805,
761,
364,
279,
1976,
333,
1004,
353,
10189,
310,
358,
18,
225,
4163,
87,
279,
2999,
17735,
2236,
1492,
1885,
333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
394,
20571,
9535,
12,
1945,
16,
880,
4672,
3536,
1788,
279,
394,
25805,
761,
364,
279,
1976,
333,
1004,
353,
10189,
310,
358,
18,
225,
4163,
87,
279,
2999,
17735,
2236,
1492,
1885,
333,
... | |
def request(self, operation, url, data=None, headers=None): | def request(self, operation, url, data=None, headers=None): | def request(self, operation, url, data=None, headers=None): """Performs an HTTP call to the server, supports GET, POST, PUT, and DELETE. | 161d898f960faff2165a60f9243de57b7f85bc88 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5609/161d898f960faff2165a60f9243de57b7f85bc88/urlfetch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
2890,
16,
1674,
16,
880,
16,
501,
33,
7036,
16,
1607,
33,
7036,
4672,
3536,
9409,
392,
2239,
745,
358,
326,
1438,
16,
6146,
4978,
16,
5485,
16,
11443,
16,
471,
8568,
18,
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,
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,
590,
12,
2890,
16,
1674,
16,
880,
16,
501,
33,
7036,
16,
1607,
33,
7036,
4672,
3536,
9409,
392,
2239,
745,
358,
326,
1438,
16,
6146,
4978,
16,
5485,
16,
11443,
16,
471,
8568,
18,
2,
... |
elif request.form['do'][0] == 'view': | elif do == 'view': | def execute(pagename, request): """ Main dispatcher for the 'AttachFile' action. """ _ = request.getText msg = None if action_name in request.cfg.actions_excluded: msg = _('File attachments are not allowed in this wiki!') elif 'do' not in request.form: upload_form(pagename, request) elif request.form['do'][0] == 'savedrawing': if request.user.may.write(pagename): save_drawing(pagename, request) request.emit_http_headers() request.write("OK") else: msg = _('You are not allowed to save a drawing on this page.') elif request.form['do'][0] == 'upload': if request.user.may.write(pagename): if 'file' in request.form: do_upload(pagename, request) else: # This might happen when trying to upload file names # with non-ascii characters on Safari. msg = _("No file content. Delete non ASCII characters from the file name and try again.") else: msg = _('You are not allowed to attach a file to this page.') elif request.form['do'][0] == 'del': if request.user.may.delete(pagename): del_file(pagename, request) else: msg = _('You are not allowed to delete attachments on this page.') elif request.form['do'][0] == 'move': if request.user.may.delete(pagename): send_moveform(pagename, request) else: msg = _('You are not allowed to move attachments from this page.') elif request.form['do'][0] == 'attachment_move': if 'cancel' in request.form: msg = _('Move aborted!') error_msg(pagename, request, msg) return if not wikiutil.checkTicket(request, request.form['ticket'][0]): msg = _('Please use the interactive user interface to move attachments!') error_msg(pagename, request, msg) return if request.user.may.delete(pagename): attachment_move(pagename, request) else: msg = _('You are not allowed to move attachments from this page.') elif request.form['do'][0] == 'get': if request.user.may.read(pagename): get_file(pagename, request) else: msg = _('You are not allowed to get attachments from this page.') elif request.form['do'][0] == 'unzip': if request.user.may.delete(pagename) and request.user.may.read(pagename) and request.user.may.write(pagename): unzip_file(pagename, request) else: msg = _('You are not allowed to unzip attachments of this page.') elif request.form['do'][0] == 'install': if request.user.isSuperUser(): install_package(pagename, request) else: msg = _('You are not allowed to install files.') elif request.form['do'][0] == 'view': if request.user.may.read(pagename): view_file(pagename, request) else: msg = _('You are not allowed to view attachments of this page.') else: msg = _('Unsupported upload action: %s') % (request.form['do'][0],) if msg: error_msg(pagename, request, msg) | 0b374a0e7f09a6bc8083ad52cb15f4654fa1108a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/0b374a0e7f09a6bc8083ad52cb15f4654fa1108a/AttachFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
9095,
1069,
16,
590,
4672,
3536,
12740,
7393,
364,
326,
296,
4761,
812,
11,
1301,
18,
3536,
389,
273,
590,
18,
588,
1528,
225,
1234,
273,
599,
309,
1301,
67,
529,
316,
590,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1836,
12,
9095,
1069,
16,
590,
4672,
3536,
12740,
7393,
364,
326,
296,
4761,
812,
11,
1301,
18,
3536,
389,
273,
590,
18,
588,
1528,
225,
1234,
273,
599,
309,
1301,
67,
529,
316,
590,
... |
def _rescale(self, exp, rounding = None, context=None, watchexp = 1): | def _rescale(self, exp, rounding=None, context=None, watchexp=1): | def _rescale(self, exp, rounding = None, context=None, watchexp = 1): """Rescales so that the exponent is exp. | b277e15abb88b70aabae5a4859ba6920ae8be40f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b277e15abb88b70aabae5a4859ba6920ae8be40f/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
455,
1869,
12,
2890,
16,
1329,
16,
13885,
33,
7036,
16,
819,
33,
7036,
16,
4267,
2749,
33,
21,
4672,
3536,
607,
21177,
1427,
716,
326,
9100,
353,
1329,
18,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
455,
1869,
12,
2890,
16,
1329,
16,
13885,
33,
7036,
16,
819,
33,
7036,
16,
4267,
2749,
33,
21,
4672,
3536,
607,
21177,
1427,
716,
326,
9100,
353,
1329,
18,
2,
-100,
-100,
-100,
... |
Asynchronous equivalent of `map()` builtin | Asynchronous version of `map()` method. | def map_async(self, func, iterable, chunksize=None, callback=None): ''' Asynchronous equivalent of `map()` builtin ''' assert self._state == RUN if not hasattr(iterable, '__len__'): iterable = list(iterable) | 23478d66d4bf866c58133c3f524f00d12c91be75 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/23478d66d4bf866c58133c3f524f00d12c91be75/pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
852,
67,
3810,
12,
2890,
16,
1326,
16,
6087,
16,
23256,
33,
7036,
16,
1348,
33,
7036,
4672,
9163,
2970,
7121,
1177,
434,
1375,
1458,
20338,
707,
18,
9163,
1815,
365,
6315,
2019,
422,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
852,
67,
3810,
12,
2890,
16,
1326,
16,
6087,
16,
23256,
33,
7036,
16,
1348,
33,
7036,
4672,
9163,
2970,
7121,
1177,
434,
1375,
1458,
20338,
707,
18,
9163,
1815,
365,
6315,
2019,
422,
1... |
if len(contents) > self.sectionLimit: contents = contents[:self.sectionLimit] + ['(%d others)' % (len(contents) - self.sectionLimit)] | if len(rows) > self.sectionLimit: rows = rows[:self.sectionLimit] footer = tag('div', _class='relatedFooter')[ '(%d others)' % (len(rows) - self.sectionLimit) ] else: footer = () | def render_section(self, section, contents): """Given a heading renderable and a list of contents for that heading, render one section of the 'related' box. """ # Truncate the contents if we need to if len(contents) > self.sectionLimit: contents = contents[:self.sectionLimit] + ['(%d others)' % (len(contents) - self.sectionLimit)] | cd9a81cd038351bbbba26bca56435ca3013bc197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/cd9a81cd038351bbbba26bca56435ca3013bc197/Graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3464,
12,
2890,
16,
2442,
16,
2939,
4672,
3536,
6083,
279,
11053,
25875,
471,
279,
666,
434,
2939,
364,
716,
11053,
16,
1743,
1245,
2442,
434,
326,
296,
9243,
11,
3919,
18,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3464,
12,
2890,
16,
2442,
16,
2939,
4672,
3536,
6083,
279,
11053,
25875,
471,
279,
666,
434,
2939,
364,
716,
11053,
16,
1743,
1245,
2442,
434,
326,
296,
9243,
11,
3919,
18,
3... |
if linkto[:n] == pattern: | if prog.search(linkto) >= 0: | def visit(pattern, dirname, names): if os.path.islink(dirname): names[:] = [] return if os.path.ismount(dirname): print 'descend into', dirname n = len(pattern) for name in names: name = os.path.join(dirname, name) try: linkto = os.readlink(name) if linkto[:n] == pattern: print name, '->', linkto except os.error: pass | e6bcbf83506025a2e03127d7da8278f63d937b91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e6bcbf83506025a2e03127d7da8278f63d937b91/findlinksto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
12,
4951,
16,
4283,
16,
1257,
4672,
309,
1140,
18,
803,
18,
291,
1232,
12,
12287,
4672,
1257,
10531,
65,
273,
5378,
327,
309,
1140,
18,
803,
18,
291,
4778,
12,
12287,
4672,
1172,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
4951,
16,
4283,
16,
1257,
4672,
309,
1140,
18,
803,
18,
291,
1232,
12,
12287,
4672,
1257,
10531,
65,
273,
5378,
327,
309,
1140,
18,
803,
18,
291,
4778,
12,
12287,
4672,
1172,... |
c.RegisterDisconnectHandler(self._xmpp_disconnect_handler(c)) | c.RegisterDisconnectHandler(self.__class__._xmpp_disconnect_handler) | def get_xmpp_connection(self, nickname): if self.xmpp_connections.has_key(nickname): c = self.xmpp_connections[nickname] c.used_by += 1 self.error('===> Debug: using existing XMPP connection for "'+nickname+'", now used by '+str(c.used_by)+' bridges', debug=True) return c self.error('===> Debug: opening new XMPP connection for "'+nickname+'"', debug=True) c = xmpp.client.Client(self.bare_jid.getDomain(), debug=[]) c.lock = threading.Lock() c.lock.acquire() self.xmpp_connections[nickname] = c c.used_by = 1 c.nickname = nickname c.connect() c.auth(self.bare_jid.getNode(), self.password) c.RegisterHandler('presence', self._xmpp_presence_handler) c.RegisterHandler('iq', self._xmpp_iq_handler) c.RegisterHandler('message', self._xmpp_message_handler) c.RegisterDisconnectHandler(self._xmpp_disconnect_handler(c)) c.sendInitPresence() c.lock.release() return c | f94595d8b89a36ac97003ddc4cd1c471cabf5f4f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9915/f94595d8b89a36ac97003ddc4cd1c471cabf5f4f/bot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
92,
24109,
67,
4071,
12,
2890,
16,
19570,
4672,
309,
365,
18,
92,
24109,
67,
13313,
18,
5332,
67,
856,
12,
17091,
529,
4672,
276,
273,
365,
18,
92,
24109,
67,
13313,
63,
170... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
92,
24109,
67,
4071,
12,
2890,
16,
19570,
4672,
309,
365,
18,
92,
24109,
67,
13313,
18,
5332,
67,
856,
12,
17091,
529,
4672,
276,
273,
365,
18,
92,
24109,
67,
13313,
63,
170... |
''' % (root, get_local_site_pkgs(root=''), dpath)) | ''' % (rsfroot, get_local_site_pkgs(root=''), dpath)) | def mk_sh_script(script_nm): 'Write the (ba)sh environment setup script' global dpath bsh = open(script_nm, 'w') bsh.write('''#!/bin/sh | 6f411a9c2ac1ce299e662eba6482fb564978eb19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3143/6f411a9c2ac1ce299e662eba6482fb564978eb19/setenv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
67,
674,
67,
4263,
12,
4263,
67,
15094,
4672,
296,
3067,
326,
261,
12124,
13,
674,
3330,
3875,
2728,
11,
225,
2552,
302,
803,
225,
324,
674,
273,
1696,
12,
4263,
67,
15094,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
67,
674,
67,
4263,
12,
4263,
67,
15094,
4672,
296,
3067,
326,
261,
12124,
13,
674,
3330,
3875,
2728,
11,
225,
2552,
302,
803,
225,
324,
674,
273,
1696,
12,
4263,
67,
15094,
16,
... |
sharesfile = bz2.BZ2File(self.encode(os.path.join(sharesdir, self.user)), 'w' ) | sharesfile = bz2.BZ2File(os.path.join(sharesdir, self.encode(self.user)), 'w' ) | def OnSave(self, widget): configdir, config = os.path.split(self.frame.np.config.filename) sharesdir = os.path.abspath(configdir+os.sep+"usershares"+os.sep) try: if not os.path.exists(sharesdir): os.mkdir(sharesdir) except Exception, msg: error = _("Can't create directory '%s', reported error: %s" % (sharesdir, msg)) print error self.frame.logMessage(error) try: import pickle import bz2 sharesfile = bz2.BZ2File(self.encode(os.path.join(sharesdir, self.user)), 'w' ) pickle.dump(self.list, sharesfile) sharesfile.close() except Exception, msg: error = _("Can't save shares, '%s', reported error: %s" % (self.user, msg) ) print error self.frame.logMessage(error) | 20999eb12ba37a828fbc55a60f0cd69a0cf3eb77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8738/20999eb12ba37a828fbc55a60f0cd69a0cf3eb77/userbrowse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4755,
12,
2890,
16,
3604,
4672,
642,
1214,
16,
642,
273,
1140,
18,
803,
18,
4939,
12,
2890,
18,
3789,
18,
6782,
18,
1425,
18,
3459,
13,
24123,
1214,
273,
1140,
18,
803,
18,
511... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4755,
12,
2890,
16,
3604,
4672,
642,
1214,
16,
642,
273,
1140,
18,
803,
18,
4939,
12,
2890,
18,
3789,
18,
6782,
18,
1425,
18,
3459,
13,
24123,
1214,
273,
1140,
18,
803,
18,
511... |
return False | t = [int(x) for x in t.split(':')] remoteTuple = (yr, mon, day, t[0], t[1], t[2]) localTuple = (ltime[0], ltime[1], ltime[2], ltime[3], ltime[4], ltime[5]) return remoteTuple > localTuple | def is_outdated(self, remoteHeader, localFile): """Checks whether local file is up-to-date.""" # TODO: There's gotta be a time method for this. mod = remoteHeader.split() day = int(mod[1]) mon = int(self.cal[mod[2]]) yr = int(mod[3]) t = mod[4] ltime = time.gmtime(os.path.getmtime(localFile)) if ltime[0] < yr: return True if ltime[1] < mon: return True if ltime[2] < day: return True t = t.split(':') if ltime[3] < int(t[0]): return True if ltime[4] < int(t[1]): return True if ltime[5] < int(t[2]): return True | 045f8844baeb8b139f3d91f4f2ba0259c7cd1b50 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/045f8844baeb8b139f3d91f4f2ba0259c7cd1b50/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
659,
12563,
12,
2890,
16,
2632,
1864,
16,
30649,
4672,
3536,
4081,
2856,
1191,
585,
353,
731,
17,
869,
17,
712,
12123,
468,
2660,
30,
6149,
1807,
2363,
2351,
506,
279,
813,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
67,
659,
12563,
12,
2890,
16,
2632,
1864,
16,
30649,
4672,
3536,
4081,
2856,
1191,
585,
353,
731,
17,
869,
17,
712,
12123,
468,
2660,
30,
6149,
1807,
2363,
2351,
506,
279,
813,
70... |
rec = open(settings['record'], 'w+') | rec = open("%s.%s" % (settings['record'], settings['handler_id']), 'w+') | def proxy_handler(client): global target_host, target_port, options, rec if settings['record']: handler_msg("opening record file: %s" % settings['record']) rec = open(settings['record'], 'w+') rec.write("var VNC_frame_data = [\n") handler_msg("connecting to: %s:%s" % (target_host, target_port)) tsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tsock.connect((target_host, target_port)) if settings['verbose'] and not settings['daemon']: print traffic_legend try: do_proxy(client, tsock) except: if tsock: tsock.close() if rec: rec.write("'EOF']\n") rec.close() raise | 005d9ee999b19e6a079625aeb5efcf9f2636c2a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13207/005d9ee999b19e6a079625aeb5efcf9f2636c2a7/wsproxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2889,
67,
4176,
12,
2625,
4672,
2552,
1018,
67,
2564,
16,
1018,
67,
655,
16,
702,
16,
1950,
225,
309,
1947,
3292,
3366,
3546,
30,
1838,
67,
3576,
2932,
3190,
310,
1409,
585,
30,
738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4176,
12,
2625,
4672,
2552,
1018,
67,
2564,
16,
1018,
67,
655,
16,
702,
16,
1950,
225,
309,
1947,
3292,
3366,
3546,
30,
1838,
67,
3576,
2932,
3190,
310,
1409,
585,
30,
738,
... |
if course.final.i < 0: course.final.i = -course.final.i | if icourse.final.i < 0: icourse.final.i = -icourse.final.i | def newquadrant(noattack): # Leaving quadrant -- allow final enemy attack # Don't do it if being pushed by Nova if len(game.enemies) != 0 and not noattack: newcnd() for enemy in game.enemies: finald = (w - enemy.location).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) # Stas Sergeev added the condition # that attacks only happen if Klingons # are present and your skill is good. if game.skill > SKILL_GOOD and game.klhere > 0 and not game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova: attack(torps_ok=False) if game.alldone: return # check for edge of galaxy kinks = 0 while True: kink = False if course.final.i < 0: course.final.i = -course.final.i kink = True if course.final.j < 0: course.final.j = -course.final.j kink = True if course.final.i >= GALSIZE*QUADSIZE: course.final.i = (GALSIZE*QUADSIZE*2) - course.final.i kink = True if course.final.j >= GALSIZE*QUADSIZE: course.final.j = (GALSIZE*QUADSIZE*2) - course.final.j kink = True if kink: kinks += 1 else: break if kinks: game.nkinks += 1 if game.nkinks == 3: # Three strikes -- you're out! finish(FNEG3) return skip(1) prout(_("YOU HAVE ATTEMPTED TO CROSS THE NEGATIVE ENERGY BARRIER")) prout(_("AT THE EDGE OF THE GALAXY. THE THIRD TIME YOU TRY THIS,")) prout(_("YOU WILL BE DESTROYED.")) # Compute final position in new quadrant if trbeam: # Don't bother if we are to be beamed return game.quadrant = course.final.quadrant() game.sector = course.final.sector() skip(1) prout(_("Entering Quadrant %s.") % game.quadrant) game.quad[game.sector.i][game.sector.j] = game.ship newqad() if game.skill>SKILL_NOVICE: attack(torps_ok=False) | b8ffe91a83c83c29cc1a574e3fc2d857d582df33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/b8ffe91a83c83c29cc1a574e3fc2d857d582df33/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
21733,
6890,
12,
2135,
4558,
484,
4672,
468,
3519,
5339,
9474,
6890,
1493,
1699,
727,
570,
351,
93,
13843,
468,
7615,
1404,
741,
518,
309,
3832,
18543,
635,
423,
16739,
309,
562,
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,
394,
21733,
6890,
12,
2135,
4558,
484,
4672,
468,
3519,
5339,
9474,
6890,
1493,
1699,
727,
570,
351,
93,
13843,
468,
7615,
1404,
741,
518,
309,
3832,
18543,
635,
423,
16739,
309,
562,
12... |
for j in binaries[arch][0][binary]['rconflicts']: key = (j, arch) | for j in binaries[parch][0][binary]['rconflicts']: key = (j, parch) | def doop_source(self, pkg): """Apply a change to the testing distribution as requested by `pkg` | b8d4deefd1e15dc48987f2d10c01b6f060204f30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/b8d4deefd1e15dc48987f2d10c01b6f060204f30/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
556,
67,
3168,
12,
2890,
16,
3475,
4672,
3536,
7001,
279,
2549,
358,
326,
7769,
7006,
487,
3764,
635,
1375,
10657,
68,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
741,
556,
67,
3168,
12,
2890,
16,
3475,
4672,
3536,
7001,
279,
2549,
358,
326,
7769,
7006,
487,
3764,
635,
1375,
10657,
68,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
elif (len(lin.strip()) == 0): pasar = True | def parse (self): lin = self.f.readline() lin_ant = "" cont = 0 f = None | ef7d8ec3e66288ffb7709691d32ff597c944e197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2586/ef7d8ec3e66288ffb7709691d32ff597c944e197/jack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
261,
2890,
4672,
4739,
273,
365,
18,
74,
18,
896,
1369,
1435,
4739,
67,
970,
273,
1408,
466,
273,
374,
284,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
261,
2890,
4672,
4739,
273,
365,
18,
74,
18,
896,
1369,
1435,
4739,
67,
970,
273,
1408,
466,
273,
374,
284,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
res = debug_pref("Drag reshapes selected atoms when bonded to unselected atoms?", | res = debug_pref("Drag reshapes selected atoms?", | def get_smooth_reshaping_drag(self): #bruce 070412; implement "smooth-reshaping drag" feature res = debug_pref("Drag reshapes selected atoms when bonded to unselected atoms?", Choice_boolean_False, prefs_key = True, non_debug = True ) return res | 1f1746506c83751923d2abedf94746d8571711f5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/1f1746506c83751923d2abedf94746d8571711f5/selectMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26647,
67,
1955,
24447,
67,
15997,
12,
2890,
4672,
468,
2848,
3965,
10934,
3028,
2138,
31,
2348,
315,
26647,
17,
1955,
24447,
8823,
6,
2572,
400,
273,
1198,
67,
25724,
2932,
117... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26647,
67,
1955,
24447,
67,
15997,
12,
2890,
4672,
468,
2848,
3965,
10934,
3028,
2138,
31,
2348,
315,
26647,
17,
1955,
24447,
8823,
6,
2572,
400,
273,
1198,
67,
25724,
2932,
117... |
transport = Explorer.openEx(contents) | def __init__(self, data, name, editor, saved): EditorModels.SourceModel.__init__(self, data, name, editor, saved) | d32ffcf225a926ed7d3ca90276a5d24ab6ad3abc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/d32ffcf225a926ed7d3ca90276a5d24ab6ad3abc/HelpBook.plug-in.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
508,
16,
4858,
16,
5198,
4672,
18451,
8430,
18,
1830,
1488,
16186,
2738,
972,
12,
2890,
16,
501,
16,
508,
16,
4858,
16,
5198,
13,
2,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
508,
16,
4858,
16,
5198,
4672,
18451,
8430,
18,
1830,
1488,
16186,
2738,
972,
12,
2890,
16,
501,
16,
508,
16,
4858,
16,
5198,
13,
2,
-100,
-10... | |
else: | if blank or not(top) or im.getbbox()[1] == 0: | def _stripBaseline(self, im, padbaseline=0): """ Find the baseline register mark and crop it out | d56abd93d82c4d0040f248da1a3486553c69e48f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7864/d56abd93d82c4d0040f248da1a3486553c69e48f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6406,
16635,
12,
2890,
16,
709,
16,
4627,
27818,
33,
20,
4672,
3536,
4163,
326,
14243,
1744,
2267,
471,
7987,
518,
596,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
6406,
16635,
12,
2890,
16,
709,
16,
4627,
27818,
33,
20,
4672,
3536,
4163,
326,
14243,
1744,
2267,
471,
7987,
518,
596,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'filters':{'owner': True, 'u':username, 'eol': False, 'morelink': False} | 'filters':{'owner': True, 'username':username, 'eol': False}, 'more_link': more_link | def _user_packages_view(self, username, owner=5, maintainer=3, watcher=False, owner_label='Owned', maintainer_label='Maintained', watcher_label='Watched', rows_per_page=5, morelink=None, view="home"): if view=="home": categories = [] if owner: owner = int(owner) cat = {'label': owner_label, 'rows_per_page': owner, 'filters':{'owner': True, 'u':username, 'eol': False, 'morelink': False} } categories.append(cat) | 215a19e4c9139edef9310011a8f07fcf4a7b4296 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12732/215a19e4c9139edef9310011a8f07fcf4a7b4296/root.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1355,
67,
10308,
67,
1945,
12,
2890,
16,
2718,
16,
3410,
33,
25,
16,
11566,
1521,
33,
23,
16,
9527,
33,
8381,
16,
3410,
67,
1925,
2218,
5460,
329,
2187,
11566,
1521,
67,
1925,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1355,
67,
10308,
67,
1945,
12,
2890,
16,
2718,
16,
3410,
33,
25,
16,
11566,
1521,
33,
23,
16,
9527,
33,
8381,
16,
3410,
67,
1925,
2218,
5460,
329,
2187,
11566,
1521,
67,
1925,
2... |
],'Amount Type', select=True), | ],'Amount Type', select=True, required=True), | def onchange_amount(self, cr, uid, ids, amount, typ): amt = amount if typ and typ == 'per': if int(amt) > 0: amt = amt / 100 return {'value':{'amount':amt}} | 52462287f3027f98bcfae6ee920c037e9c3d1c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52462287f3027f98bcfae6ee920c037e9c3d1c34/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
8949,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
3844,
16,
3815,
4672,
25123,
273,
3844,
309,
3815,
471,
3815,
422,
296,
457,
4278,
309,
509,
12,
301,
88,
13,
405,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
8949,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
3844,
16,
3815,
4672,
25123,
273,
3844,
309,
3815,
471,
3815,
422,
296,
457,
4278,
309,
509,
12,
301,
88,
13,
405,
37... |
tests.remove("test_file") tests.insert(tests.index("test_optparse"), "test_file") | def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False, exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, use_resources, trace and coverdir) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:TD:NLR:wM:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'verbose2', 'memlimit=', ]) except getopt.error, msg: usage(2, msg) # Defaults if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-w', '--verbose2'): verbose2 = True elif o in ('-q', '--quiet'): quiet = True; verbose = 0 elif o in ('-g', '--generate'): generate = True elif o in ('-x', '--exclude'): exclude = True elif o in ('-s', '--single'): single = True elif o in ('-r', '--randomize'): randomize = True elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = True elif o in ('-L', '--runleaks'): runleaks = True elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-T', '--coverage'): trace = True elif o in ('-D', '--coverdir'): coverdir = os.path.join(os.getcwd(), a) elif o in ('-N', '--nocoverdir'): coverdir = None elif o in ('-R', '--huntrleaks'): huntrleaks = a.split(':') if len(huntrleaks) != 3: print a, huntrleaks usage(2, '-R takes three colon-separated arguments') if len(huntrleaks[0]) == 0: huntrleaks[0] = 5 else: huntrleaks[0] = int(huntrleaks[0]) if len(huntrleaks[1]) == 0: huntrleaks[1] = 4 else: huntrleaks[1] = int(huntrleaks[1]) if len(huntrleaks[2]) == 0: huntrleaks[2] = "reflog.txt" elif o in ('-M', '--memlimit'): test_support.set_memlimit(a) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) if generate and verbose: usage(2, "-g and -v don't go together!") if single and fromfile: usage(2, "-s and -f don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = False else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) # XXX Temporary hack to force test_optparse to run immediately # XXX after test_file. This should go away as soon as we fix # XXX whatever it is that's causing that to fail. tests.remove("test_file") tests.insert(tests.index("test_optparse"), "test_file") if trace: import trace tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], trace=False, count=True) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test sys.stdout.flush() if trace: # If we're tracing code coverage, then we don't exit with status # if on a false return value from main. tracer.runctx('runtest(test, generate, verbose, quiet, testdir)', globals=globals(), locals=vars()) else: try: ok = runtest(test, generate, verbose, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) if ok == -2: resource_denieds.append(test) if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if verbose: print "CAUTION: stdout isn't compared in verbose mode:" print "a test that passes in verbose mode may fail without it." if bad: print count(len(bad), "test"), "failed:" printlist(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if verbose2 and bad: print "Re-running failed tests in verbose mode" for test in bad: print "Re-running test %r in verbose mode" % test sys.stdout.flush() try: test_support.verbose = 1 ok = runtest(test, generate, 1, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C print break except: raise if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) if trace: r = tracer.results() r.write_results(show_missing=True, summary=True, coverdir=coverdir) if runleaks: os.system("leaks %d" % os.getpid()) sys.exit(len(bad) > 0) | a2b6d492bf0e6d3eab8aa463483aba5bdb134af3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a2b6d492bf0e6d3eab8aa463483aba5bdb134af3/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
8381,
16,
2103,
33,
8381,
16,
4433,
33,
8381,
16,
2202,
33,
8381,
16,
2744,
554,
33,
8381,
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,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
8381,
16,
2103,
33,
8381,
16,
4433,
33,
8381,
16,
2202,
33,
8381,
16,
2744,
554,
33,
8381,
16,
... | |
if os.path.isfile( "test/particleShape1.250.bin" ) : os.remove( "test/particleShape1.250.bin" ) | if os.path.isfile( "test/particleMesh.bin" ) : os.remove( "test/particleMesh.bin" ) | def tearDown( self ) : | 2ad3a6eaa8da50f721551ebe2d300073d0b25359 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9042/2ad3a6eaa8da50f721551ebe2d300073d0b25359/BINParticleWriterTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
365,
262,
294,
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,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
365,
262,
294,
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,... |
dbg ('update_url_matches: Trying GNU URL regexps') | dbg ('Terminal::update_url_matches: Trying GNU URL regexps') | def update_url_matches(self, posix = True): """Update the regexps used to match URLs""" userchars = "-A-Za-z0-9" passchars = "-A-Za-z0-9,?;.:/!%$^*&~\"#'" hostchars = "-A-Za-z0-9" pathchars = "-A-Za-z0-9_$.+!*(),;:@&=?/~#%'\"" schemes = "(news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:)" user = "[" + userchars + "]+(:[" + passchars + "]+)?" urlpath = "/[" + pathchars + "]*[^]'.}>) \t\r\n,\\\"]" | f803ff98c0270b301f534c32cac5f800505b7f86 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1032/f803ff98c0270b301f534c32cac5f800505b7f86/terminal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
718,
67,
8436,
12,
2890,
16,
16366,
273,
1053,
4672,
3536,
1891,
326,
3936,
1121,
1399,
358,
845,
10414,
8395,
729,
7549,
273,
3701,
37,
17,
15948,
17,
94,
20,
17,
29,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
718,
67,
8436,
12,
2890,
16,
16366,
273,
1053,
4672,
3536,
1891,
326,
3936,
1121,
1399,
358,
845,
10414,
8395,
729,
7549,
273,
3701,
37,
17,
15948,
17,
94,
20,
17,
29,
6,
1... |
if verbose: print 'unpack single tuple/list' st = (99,) sl = [100] a, = st if a != 99: raise TestFailed b, = sl if b != 100: raise TestFailed | Unpack generic sequence | def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError | 3981511070311e958bd2cd48b1ab16b24f8b350e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3981511070311e958bd2cd48b1ab16b24f8b350e/test_unpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
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,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.__node.setEventCapture() self.__node.setEventHandler(avg.CURSORUP, avg.MOUSE, self.__onUp) | self.__node.setEventCapture(event.cursorid) if event.source == avg.MOUSE: self.__node.setEventHandler(avg.CURSORUP, avg.MOUSE, self.__onUp) else: self.__node.setEventHandler(avg.CURSORUP, avg.TOUCH, self.__onUp) | def __onDown(self, event): if self.__isDisabled: return self.__node.setEventCapture() self.__node.setEventHandler(avg.CURSORUP, avg.MOUSE, self.__onUp) self.__isClicking = True self.__setMode(1) | 364566e8dd7c2c1668379eebcfc3abf6663c61f7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7300/364566e8dd7c2c1668379eebcfc3abf6663c61f7/button.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
265,
4164,
12,
2890,
16,
871,
4672,
309,
365,
16186,
291,
8853,
30,
327,
365,
16186,
2159,
18,
542,
1133,
12372,
12,
2575,
18,
9216,
350,
13,
309,
871,
18,
3168,
422,
11152,
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,
265,
4164,
12,
2890,
16,
871,
4672,
309,
365,
16186,
291,
8853,
30,
327,
365,
16186,
2159,
18,
542,
1133,
12372,
12,
2575,
18,
9216,
350,
13,
309,
871,
18,
3168,
422,
11152,
18,
... |
pypungi._doRunCommand(['/usr/bin/sha1sum', isoname], self.logger, rundir=self.isodir, output=sha1file) | pypungi.util._doRunCommand(['/usr/bin/sha1sum', isoname], self.logger, rundir=self.isodir, output=sha1file) | def doCreateIsos(self, split=True): """Create isos of the tree, optionally splitting the tree for split media.""" | a81ead6181e277e8003cb6c9095b415a7d60d493 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8489/a81ead6181e277e8003cb6c9095b415a7d60d493/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
1684,
2520,
538,
12,
2890,
16,
1416,
33,
5510,
4672,
3536,
1684,
353,
538,
434,
326,
2151,
16,
8771,
20347,
326,
2151,
364,
1416,
3539,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
741,
1684,
2520,
538,
12,
2890,
16,
1416,
33,
5510,
4672,
3536,
1684,
353,
538,
434,
326,
2151,
16,
8771,
20347,
326,
2151,
364,
1416,
3539,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
marshal.load(file(test_support.TESTFN, "rb")) | new = marshal.load(file(test_support.TESTFN, "rb")) | def test_list(self): lst = self.d.items() new = marshal.loads(marshal.dumps(lst)) self.assertEqual(lst, new) marshal.dump(lst, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(lst, new) os.unlink(test_support.TESTFN) | 61aa630d0169c4aecb40cf937adcf9250f23529d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61aa630d0169c4aecb40cf937adcf9250f23529d/test_marshal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1098,
12,
2890,
4672,
9441,
273,
365,
18,
72,
18,
3319,
1435,
394,
273,
10893,
18,
17135,
12,
3108,
18,
13302,
1121,
12,
16923,
3719,
365,
18,
11231,
5812,
12,
16923,
16,
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,
1842,
67,
1098,
12,
2890,
4672,
9441,
273,
365,
18,
72,
18,
3319,
1435,
394,
273,
10893,
18,
17135,
12,
3108,
18,
13302,
1121,
12,
16923,
3719,
365,
18,
11231,
5812,
12,
16923,
16,
394... |
if config["replicas"] > len(config["nodes"]): print "replicas must be less than equal"\ "to the number of nodes." | if len(config["nodes"]) % config["replicas"]: print "Number of nodes must be divisible by nreplicas." | def check_config(config, replicas = True): REQ = ["nodes", "volumes", "master", "config_dir"] if replicas: REQ.append("replicas") if config["replicas"] > len(config["nodes"]): print "replicas must be less than equal"\ "to the number of nodes." print "Check the config file." sys.exit(1) for k in REQ: if k not in config: print "Required field '%s' is missing." % k print "Check the config file." sys.exit(1) | f5f3d28c1a84cce9416c2f0adf89e4077a607931 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/373/f5f3d28c1a84cce9416c2f0adf89e4077a607931/gluster_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1425,
12,
1425,
16,
21545,
273,
1053,
4672,
2438,
53,
273,
8247,
4690,
3113,
315,
22886,
3113,
315,
7525,
3113,
315,
1425,
67,
1214,
11929,
309,
21545,
30,
2438,
53,
18,
6923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1425,
12,
1425,
16,
21545,
273,
1053,
4672,
2438,
53,
273,
8247,
4690,
3113,
315,
22886,
3113,
315,
7525,
3113,
315,
1425,
67,
1214,
11929,
309,
21545,
30,
2438,
53,
18,
6923,
... |
def main(): | def main(args=None): global auth_str, debug_server, connection, serving if args is None: args = sys.argv[1:] if args and '--zope' in args: from ZopeScriptDebugServer import ZopeScriptDebugServer debug_server = ZopeScriptDebugServer() else: debug_server = DebugServer() connection = DebuggerConnection(debug_server) connection.allowEnvChanges() | def main(): # Create an authentication string, always 40 characters. global auth_str auth_str = sha.new(str(whrandom.random())).hexdigest() # port is 0 to allocate any port. server = TaskingTCPServer(('', 0), DebugRequestHandler) port = int(server.socket.getsockname()[1]) # Tell the client what port to connect to and the auth string to send. sys.stdout.write('%010d %s%s' % (port, auth_str, os.linesep)) sys.stdout.flush() # Provide a hard breakpoint hook. Use it like this: # if hasattr(sys, 'breakpoint'): sys.breakpoint() sys.breakpoint = debug_server.set_trace def serve_forever(server): while 1: server.handle_request() def startDaemon(target, args=()): t = threading.Thread(target=target, args=args) t.setDaemon(1) t.start() startDaemon(serve_forever, (server,)) startDaemon(streamFlushThread) startDaemon(debug_server.servicerThread) # Serve until the stdin pipe closes. #print 'serving until stdin returns EOF' #sys.stdin.read() global serving; serving = 1 while serving: time.sleep(0.1) sys.exit(0) | 131e210448e4ddbb197908c4ebad8aa68278604b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/131e210448e4ddbb197908c4ebad8aa68278604b/ChildProcessServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
33,
7036,
4672,
2552,
1357,
67,
701,
16,
1198,
67,
3567,
16,
1459,
16,
20505,
282,
309,
833,
353,
599,
30,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
833,
471,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
33,
7036,
4672,
2552,
1357,
67,
701,
16,
1198,
67,
3567,
16,
1459,
16,
20505,
282,
309,
833,
353,
599,
30,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
833,
471,
35... |
binlib = os.path.join(exec_prefix, 'lib/python1.4/config') incldir = os.path.join(prefix, 'include/python1.4') | version = sys.version[:3] binlib = os.path.join(exec_prefix, 'lib/python%s/config' % version) incldir = os.path.join(prefix, 'include/python%s' % version) | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'e:p:P:') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-e': extensions.append(a) if o == '-p': prefix = a if o == '-P': exec_prefix = a # default exec_prefix if exec_prefix is None: exec_prefix = EXEC_PREFIX if exec_prefix is None: exec_prefix = prefix # locations derived from options binlib = os.path.join(exec_prefix, 'lib/python1.4/config') incldir = os.path.join(prefix, 'include/python1.4') config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') getpath_c = os.path.join(binlib, 'getpath.c') supp_sources = [frozenmain_c, getpath_c] makefile_in = os.path.join(binlib, 'Makefile') defines = ['-DPYTHONPATH=\\"$(PYTHONPATH)\\"'] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, exec_prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) for file in [config_c_in, makefile_in] + supp_sources: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that the script name ends in ".py" if args[0][-3:] != ".py": usage('the script name must have a .py suffix') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # Actual work starts here... dict = findmodules.findmodules(scriptfile, modules, path) names = dict.keys() names.sort() print "Modules being frozen:" for name in names: print '\t', name backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod] == '<builtin>': builtins.append(mod) elif dict[mod] == '<unknown>': unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [] for n in 'Modules', 'Python', 'Objects', 'Parser': n = 'lib%s.a' % n n = os.path.join(binlib, n) libs.append(n) makevars = parsesetup.getmakevars(makefile_in) somevars = {} for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', '$(LDFLAGS)', config_c, frozen_c] + \ supp_sources + addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! print 'Now run make to build the target:', target | e0f06b7719c1ddb50626fcd0d9e5e27e91b52eb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e0f06b7719c1ddb50626fcd0d9e5e27e91b52eb7/freeze.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
5713,
27621,
819,
1633,
273,
17154,
1082,
202,
7,
444,
2121,
598,
300,
84,
1456,
1196,
67,
3239,
273,
599,
202,
202,
7,
444,
2121,
598,
300,
52,
1456,
4418,
273,
5378... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
5713,
27621,
819,
1633,
273,
17154,
1082,
202,
7,
444,
2121,
598,
300,
84,
1456,
1196,
67,
3239,
273,
599,
202,
202,
7,
444,
2121,
598,
300,
52,
1456,
4418,
273,
5378... |
cross_compile = os.path.join(autodir, 'sources/x86_64-cross/bin') | cross_compile = os.path.join(self.autodir, 'sources/x86_64-cross/bin') | def set_cross_cc(self, target_arch=None, cross_compile=None, build_target='bzImage'): """Set up to cross-compile. This is broken. We need to work out what the default compile produces, and if not, THEN set the cross compiler. """ | ff15233b3b72cdbc733e4d4d932d98b7f3531087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/ff15233b3b72cdbc733e4d4d932d98b7f3531087/kernel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14653,
67,
952,
12,
2890,
16,
1018,
67,
991,
33,
7036,
16,
6828,
67,
11100,
33,
7036,
16,
1361,
67,
3299,
2218,
25292,
2040,
11,
4672,
3536,
694,
731,
358,
6828,
17,
11100,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14653,
67,
952,
12,
2890,
16,
1018,
67,
991,
33,
7036,
16,
6828,
67,
11100,
33,
7036,
16,
1361,
67,
3299,
2218,
25292,
2040,
11,
4672,
3536,
694,
731,
358,
6828,
17,
11100,
... |
This computes `H^4(S_3,ZZ)`, `H^4(S_3,ZZ/2ZZ)`, resp. | This computes `H^4(S_3, \mathbb{Z})` and `H^4(S_3, \mathbb{Z} / 2 \mathbb{Z})`, respectively. | def cohomology(self, n, p = 0): r""" Computes the group cohomology H_n(G, F), where F = Z if p=0 and F = Z/pZ if p 0 is a prime. Wraps HAP's GroupHomology function, written by Graham Ellis. REQUIRES: GAP package HAP (in gap_packages-\*.spkg). EXAMPLES:: sage: G = SymmetricGroup(4) sage: G.cohomology(1,2) # optional - gap_packages Multiplicative Abelian Group isomorphic to C2 sage: G = SymmetricGroup(3) sage: G.cohomology(5) # optional - gap_packages Trivial Abelian Group sage: G.cohomology(5,2) # optional - gap_packages Multiplicative Abelian Group isomorphic to C2 sage: G.homology(5,3) # optional - gap_packages Trivial Abelian Group sage: G.homology(5,4) # optional - gap_packages Traceback (most recent call last): ... ValueError: p must be 0 or prime This computes `H^4(S_3,ZZ)`, `H^4(S_3,ZZ/2ZZ)`, resp. AUTHORS: | f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1825,
17125,
4676,
12,
2890,
16,
290,
16,
293,
273,
374,
4672,
436,
8395,
14169,
281,
326,
1041,
1825,
17125,
4676,
670,
67,
82,
12,
43,
16,
478,
3631,
1625,
478,
273,
2285,
309,
293,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1825,
17125,
4676,
12,
2890,
16,
290,
16,
293,
273,
374,
4672,
436,
8395,
14169,
281,
326,
1041,
1825,
17125,
4676,
670,
67,
82,
12,
43,
16,
478,
3631,
1625,
478,
273,
2285,
309,
293,
... |
return symmetrica.mult_schur_schur(left, right) | if left and right: return symmetrica.mult_schur_schur(left, right) else: return A._from_dict({}) | def _multiply(self, left, right): """ TESTS: sage: s = SFASchur(QQ) sage: a = s([2,1]) + 1; a s[] + s[2, 1] sage: a^2 # indirect doctest s[] + 2*s[2, 1] + s[2, 2, 1, 1] + s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[3, 3] + s[4, 1, 1] + s[4, 2] | 3d1688c6195f5db5ffab4215b3b503fcf62166d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/3d1688c6195f5db5ffab4215b3b503fcf62166d4/schur.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7027,
1283,
12,
2890,
16,
2002,
16,
2145,
4672,
3536,
22130,
55,
30,
272,
410,
30,
272,
273,
348,
2046,
55,
343,
295,
12,
53,
53,
13,
272,
410,
30,
279,
273,
272,
3816,
22,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7027,
1283,
12,
2890,
16,
2002,
16,
2145,
4672,
3536,
22130,
55,
30,
272,
410,
30,
272,
273,
348,
2046,
55,
343,
295,
12,
53,
53,
13,
272,
410,
30,
279,
273,
272,
3816,
22,
16... |
self.capabilities = tuple(dat[-1].upper().split()) | dat = str(dat[-1], "ASCII") dat = dat.upper() self.capabilities = tuple(dat.split()) | def __init__(self, host = '', port = IMAP4_PORT): self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.is_readonly = False # READ-ONLY desired state self.tagnum = 0 | f8cc01f95e32394a74728809f8153bd0770547b6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/f8cc01f95e32394a74728809f8153bd0770547b6/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
6246,
2203,
24,
67,
6354,
4672,
365,
18,
4148,
273,
4015,
365,
18,
2019,
273,
296,
4842,
5069,
11,
365,
18,
13107,
273,
599,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1479,
273,
10226,
1756,
273,
6246,
2203,
24,
67,
6354,
4672,
365,
18,
4148,
273,
4015,
365,
18,
2019,
273,
296,
4842,
5069,
11,
365,
18,
13107,
273,
599,... |
if 'photos' in fields: | if 'photos' in fields and contact.photos: | def fill_contact(self, contact, fields): if 'profile' in fields: contact = self.get_contact(contact) if 'photos' in fields: for name, photo in contact.photos.iteritems(): with self.browser: if photo.url: data = self.browser.openurl(photo.url).read() contact.set_photo(name, data=data) if photo.thumbnail_url: data = self.browser.openurl(photo.thumbnail_url).read() contact.set_photo(name, thumbnail_data=data) | 08336eeb1f37f0d869f4b89a0aed29cbe9912bb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/08336eeb1f37f0d869f4b89a0aed29cbe9912bb4/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
67,
8994,
12,
2890,
16,
5388,
16,
1466,
4672,
309,
296,
5040,
11,
316,
1466,
30,
5388,
273,
365,
18,
588,
67,
8994,
12,
8994,
13,
309,
296,
29121,
11,
316,
1466,
471,
5388,
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,
3636,
67,
8994,
12,
2890,
16,
5388,
16,
1466,
4672,
309,
296,
5040,
11,
316,
1466,
30,
5388,
273,
365,
18,
588,
67,
8994,
12,
8994,
13,
309,
296,
29121,
11,
316,
1466,
471,
5388,
18,... |
self.transport.write(line+'\r\n') self.transport.write('.\r\n') | self.sendLine(line) self.sendLine('.') | def do_RETR(self, i): resp, fp = self.getMessageFile(i) if not fp: return self.successResponse(resp) while 1: line = fp.readline() if not line: break if line[-1] == '\n': line = line[:-1] if line[:1] == '.': line = '.'+line self.transport.write(line+'\r\n') self.transport.write('.\r\n') | fd0b0ce0b465a197ffb536457183acd135f9d5e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b0ce0b465a197ffb536457183acd135f9d5e9/pop3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
862,
4349,
12,
2890,
16,
277,
4672,
1718,
16,
4253,
273,
365,
18,
24906,
812,
12,
77,
13,
309,
486,
4253,
30,
327,
365,
18,
4768,
1064,
12,
12243,
13,
1323,
404,
30,
980,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
862,
4349,
12,
2890,
16,
277,
4672,
1718,
16,
4253,
273,
365,
18,
24906,
812,
12,
77,
13,
309,
486,
4253,
30,
327,
365,
18,
4768,
1064,
12,
12243,
13,
1323,
404,
30,
980,
... |
if opts['help'] or not args: exit(msg=__doc__) | def process_arguments(args_list): argparser = utils.ArgumentParser(__doc__) try: opts, args = argparser.parse_args(args_list, pythonpath='pythonpath') except DataError, err: exit(error=str(err)) if opts['help'] or not args: exit(msg=__doc__) output = opts['output'] is not None and opts['output'] or '.' format = opts['format'] is not None and opts['format'] or 'HTML' return os.path.abspath(output), format.upper(), args[0] | 72a21c9ae39b04b73626156862cafb479ef9bcd0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/72a21c9ae39b04b73626156862cafb479ef9bcd0/libdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
7099,
12,
1968,
67,
1098,
4672,
1501,
4288,
273,
2990,
18,
1379,
2678,
12,
972,
2434,
972,
13,
775,
30,
1500,
16,
833,
273,
1501,
4288,
18,
2670,
67,
1968,
12,
1968,
67,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
7099,
12,
1968,
67,
1098,
4672,
1501,
4288,
273,
2990,
18,
1379,
2678,
12,
972,
2434,
972,
13,
775,
30,
1500,
16,
833,
273,
1501,
4288,
18,
2670,
67,
1968,
12,
1968,
67,
10... | |
del self.applied[start:end] | def getfile(f, rev, flags): t = repo.file(f).read(rev) repo.wwrite(f, t, flags) | 93dae85b9d7799ec46a38976ae52226fa8f8120c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/93dae85b9d7799ec46a38976ae52226fa8f8120c/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
768,
12,
74,
16,
5588,
16,
2943,
4672,
268,
273,
3538,
18,
768,
12,
74,
2934,
896,
12,
9083,
13,
3538,
18,
91,
2626,
12,
74,
16,
268,
16,
2943,
13,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
768,
12,
74,
16,
5588,
16,
2943,
4672,
268,
273,
3538,
18,
768,
12,
74,
2934,
896,
12,
9083,
13,
3538,
18,
91,
2626,
12,
74,
16,
268,
16,
2943,
13,
2,
-100,
-100,
-100,
-100,
... | |
unsubscribe_errors = [] | errors = [] | def ChangeOptions(mlist, category, cgi_info, document): confirmed = 0 if cgi_info.has_key('newpw'): if cgi_info.has_key('confirmpw'): if cgi_info.has_key('adminpw'): try: mlist.ConfirmAdminPassword(cgi_info['adminpw'].value) confirmed = 1 except Errors.MMBadPasswordError: m = "Error: incorrect administrator password" document.AddItem( Header(3, Italic(FontAttr(m, color="ff5060")))) confirmed = 0 if confirmed: new = cgi_info['newpw'].value confirm = cgi_info['confirmpw'].value if new == confirm: mlist.password = crypt(new, Utils.GetRandomSeed()) # Re-authenticate (to set new cookie) mlist.WebAuthenticate(password=new, cookie='admin') else: m = 'Error: Passwords did not match.' document.AddItem( Header(3, Italic(FontAttr(m, color="ff5060")))) else: m = 'Error: You must type in your new password twice.' document.AddItem( Header(3, Italic(FontAttr(m, color="ff5060")))) # # for some reason, the login page mangles important values for the list # such as .real_name so we only process these changes if the category # is not "members" and the request is not from the login page # -scott 19980515 # if category != 'members' and \ not cgi_info.has_key("request_login") and \ len(cgi_info.keys()) > 1: # then if cgi_info.has_key("subscribe_policy"): if not mm_cfg.ALLOW_OPEN_SUBSCRIBE: # # we have to add one to the value because the # page didn't present an open list as an option # page_setting = string.atoi(cgi_info["subscribe_policy"].value) cgi_info["subscribe_policy"].value = str(page_setting + 1) opt_list = GetConfigOptions(mlist, category) for item in opt_list: if len(item) < 5: continue property, kind, args, deps, desc = item[0:5] if cgi_info.has_key(property+'_upload') and \ cgi_info[property+'_upload'].value: val = cgi_info[property+'_upload'].value elif not cgi_info.has_key(property): if (kind <> mm_cfg.Text and kind <> mm_cfg.String and kind <> mm_cfg.EmailList): continue else: val = '' else: val = cgi_info[property].value value = GetValidValue(mlist, property, kind, val, deps) # # This is an ugly, ugly hack if property[0] == '_': # TBD: When turning on usenet->mail gating we want to # automatically catch up the newsgroup otherwise the mailing # list will suddently get flooded. There should be a much # better way to do this (or for the admin to specify they want # this). if property == '_mass_catchup' and value: mlist.usenet_watermark = None elif getattr(mlist, property) <> value: # TBD: Ensure that mlist.real_name differs only in letter # case. Otherwise a security hole can potentially be opened # when using an external archiver. This seems ad-hoc and # could use a more general security policy. if property == 'real_name' and \ string.lower(value) <> string.lower(mlist._internal_name): # then don't install this value. document.AddItem("""<p><b>real_name</b> attribute not changed! It must differ from the list's name by case only.<p>""") continue setattr(mlist, property, value) # # mass subscription processing for members category # if cgi_info.has_key('subscribees'): name_text = cgi_info['subscribees'].value name_text = string.replace(name_text, '\r', '') names = filter(None, map(string.strip, string.split(name_text, '\n'))) send_welcome_msg = string.atoi( cgi_info["send_welcome_msg_to_this_batch"].value) digest = 0 if not mlist.digestable: digest = 0 if not mlist.nondigestable: digest = 1 subscribe_errors = [] subscribe_success = [] result = mlist.ApprovedAddMembers(names, None, digest, send_welcome_msg) for name in result.keys(): if result[name] is None: subscribe_success.append(name) else: # `name' was not subscribed, find out why. On failures, # result[name] is set from sys.exc_info()[:2] e, v = result[name] if e is Errors.MMAlreadyAMember: subscribe_errors.append((name, 'Already a member')) elif e is Errors.MMBadEmailError: if name == '': name = '<blank line>' subscribe_errors.append( (name, "Bad/Invalid email address")) elif e is Errors.MMHostileAddress: subscribe_errors.append( (name, "Hostile Address (illegal characters)")) if subscribe_success: document.AddItem(Header(5, "Successfully Subscribed:")) document.AddItem(apply(UnorderedList, tuple((subscribe_success)))) document.AddItem("<p>") # ApprovedAddMembers will already have saved the list for us. if subscribe_errors: document.AddItem(Header(5, "Error Subscribing:")) items = map(lambda x: "%s -- %s" % (x[0], x[1]), subscribe_errors) document.AddItem(apply(UnorderedList, tuple((items)))) document.AddItem("<p>") # # do the user options for members category # if cgi_info.has_key('user'): user = cgi_info["user"] if type(user) is type([]): users = [] for ui in range(len(user)): users.append(user[ui].value) else: users = [user.value] unsubscribe_errors = [] for user in users: if not cgi_info.has_key('%s_subscribed' % (user)): try: mlist.DeleteMember(user) except Errors.MMNoSuchUserError: unsubscribe_errors.append((user, 'Not subscribed')) continue if not cgi_info.has_key("%s_digest" % (user)): if mlist.digest_members.has_key(user): del mlist.digest_members[user] if not mlist.members.has_key(user): mlist.members[user] = 0 else: if not mlist.digest_members.has_key(user): mlist.digest_members[user] = 0 if mlist.members.has_key(user): del mlist.members[user] for opt in ("hide", "nomail", "ack", "notmetoo", "plain"): opt_code = MailCommandHandler.option_info[opt] if cgi_info.has_key("%s_%s" % (user, opt)): mlist.SetUserOption(user, opt_code, 1, save_list=0) else: mlist.SetUserOption(user, opt_code, 0, save_list=0) if unsubscribe_errors: document.AddItem(Header(5, "Error Unsubscribing:")) items = map(lambda x: "%s -- %s" % (x[0], x[1]), unsubscribe_errors) document.AddItem(apply(UnorderedList, tuple((items)))) document.AddItem("<p>") | adf39770b727dd9bb8ba933c8fef8a62759decfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/adf39770b727dd9bb8ba933c8fef8a62759decfb/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7576,
1320,
12,
781,
376,
16,
3150,
16,
276,
10052,
67,
1376,
16,
1668,
4672,
19979,
273,
374,
309,
276,
10052,
67,
1376,
18,
5332,
67,
856,
2668,
2704,
14921,
11,
4672,
309,
276,
1005... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7576,
1320,
12,
781,
376,
16,
3150,
16,
276,
10052,
67,
1376,
16,
1668,
4672,
19979,
273,
374,
309,
276,
10052,
67,
1376,
18,
5332,
67,
856,
2668,
2704,
14921,
11,
4672,
309,
276,
1005... |
self.items.append({'type': 'DIRECTORY', 'path': path}) def process_link(self, path, st): | self.items.append({ 'type': 'DIRECTORY', 'path': path, 'mode': st.st_mode, 'uid': st.st_uid, 'user': uid2user(st.st_uid), 'gid': st.st_gid, 'group': gid2group(st.st_gid), 'ctime': st.st_ctime, 'mtime': st.st_mtime, }) def process_symlink(self, path, st): | def process_dir(self, path, st): path = path.lstrip('/\\:') logging.info(path) self.items.append({'type': 'DIRECTORY', 'path': path}) | afdabb623a59791b47f636e1a523011992cb3fde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3863/afdabb623a59791b47f636e1a523011992cb3fde/archive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1214,
12,
2890,
16,
589,
16,
384,
4672,
589,
273,
589,
18,
80,
6406,
2668,
19,
1695,
2497,
13,
2907,
18,
1376,
12,
803,
13,
365,
18,
3319,
18,
6923,
12590,
11,
723,
4278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1214,
12,
2890,
16,
589,
16,
384,
4672,
589,
273,
589,
18,
80,
6406,
2668,
19,
1695,
2497,
13,
2907,
18,
1376,
12,
803,
13,
365,
18,
3319,
18,
6923,
12590,
11,
723,
4278,
... |
data = self.sendCMD(['mems', 'quit']) | data = self.sendCMD(['mems']) | def getMemInfo(self): data = self.sendCMD(['mems', 'quit']) if (data == None): return None retVal = self.stripPrompt(data) # TODO: this is hardcoded for now fhandle = open("memlog.txt", 'a') fhandle.write("\n") fhandle.write(retVal) fhandle.close() | 02223128cd056cb013609966605554a83eff291d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/02223128cd056cb013609966605554a83eff291d/devicemanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16998,
966,
12,
2890,
4672,
501,
273,
365,
18,
4661,
19473,
12,
3292,
3917,
87,
19486,
309,
261,
892,
422,
599,
4672,
327,
599,
12197,
273,
365,
18,
6406,
15967,
12,
892,
13,
468,
2660... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16998,
966,
12,
2890,
4672,
501,
273,
365,
18,
4661,
19473,
12,
3292,
3917,
87,
19486,
309,
261,
892,
422,
599,
4672,
327,
599,
12197,
273,
365,
18,
6406,
15967,
12,
892,
13,
468,
2660... |
company = company_obj.browse(cursor, user, data['form']['company'], | company = company_obj.browse(cursor, user, datas['form']['company'], | def _action_open(self, cursor, user, data, context=None): if context is None: context = {} model_data_obj = self.pool.get('ir.model.data') act_window_obj = self.pool.get('ir.action.act_window') company_obj = self.pool.get('company.company') | 299f4343b67b644e4dd54e00511bcac4281d3d8a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9290/299f4343b67b644e4dd54e00511bcac4281d3d8a/account.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1128,
67,
3190,
12,
2890,
16,
3347,
16,
729,
16,
501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
18,
6011,
18,
588,
266... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1128,
67,
3190,
12,
2890,
16,
3347,
16,
729,
16,
501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
18,
6011,
18,
588,
266... |
JSON.write('{\n "jobs":\n {\n') | JSON.write('{\n') jsontmplf = os.path.join('tool','tl-tmpl.json') if os.path.exists(jsontmplf): json_tmpl = open(jsontmplf,"rU").read() JSON.write(json_tmpl) JSON.write(' "jobs":\n') JSON.write(' {\n') | def main(): c = {} if len(sys.argv)>1: c['js_target'] = sys.argv[1] source = "" build = "" scategories = {} bcategories = {} JSON = open(fJSON,"w") JSON.write('// This file is dynamically created by the generator!\n') JSON.write('{\n "jobs":\n {\n') jsontmplf = open(os.path.join('tool','tmpl.json'),"rU") json_tmpl = jsontmplf.read() for html in htmlfiles(os.path.join('source','demo')): fileH = open(html,"rU") selected = False for line in fileH: #if re.search(r'demobrowser\.demo',line): if re.search(r'src="\.\./helper.js"',line): selected = True break if not selected: print " - Skipping HTML file: %s" % html continue fileH.seek(0) # rewind category = html.split(os.sep)[2] name = (html.split(os.sep)[3]).split(".")[0] # print ">>> Processing: %s.%s..." % (category, name) # build classname clazz = "demobrowser.demo.%s.%s" % (category,name) simple = "%s.%s" % (category,name) source = source + ' "source-%s",' % simple build = build + ' "build-%s",' % simple if not category in scategories: scategories[category] = "" scategories[category] += ' "source-%s",' % (simple,) if not category in bcategories: bcategories[category] = "" bcategories[category] += ' "build-%s",' % (simple,) # copy js source file if ('js_target' in c and len(c['js_target']) > 0): try: os.makedirs(c['js_target']) except OSError: pass shutil.copyfile('source/class/%s.js' % clazz.replace('.','/'), "%s/%s.src.js" % (c['js_target'],clazz)) # concat all currcont = json_tmpl.replace('XXX',"%s.%s"%(category,name)).replace("YYY",clazz) JSON.write("%s," % currcont[:-1]) JSON.write("\n\n\n") for category in scategories: JSON.write(""" "source-%s" : { "run" : [ %s] },\n\n""" % (category, scategories[category][:-1])) JSON.write(""" "build-%s" : { "run" : [ %s] },\n\n""" % (category, bcategories[category][:-1])) JSON.write(""" "source" : { "run" : [ %s] },\n\n""" % source[:-1] ) JSON.write(""" "build" : { "run" : [ %s] }\n }\n}""" % build[:-1] ) JSON.close() | 12f80be92242e56ea8fbbd72f91a07efa7951ed4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/12f80be92242e56ea8fbbd72f91a07efa7951ed4/genjson.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
276,
273,
2618,
309,
562,
12,
9499,
18,
19485,
13,
34,
21,
30,
276,
3292,
2924,
67,
3299,
3546,
273,
2589,
18,
19485,
63,
21,
65,
225,
1084,
273,
1408,
1361,
225,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
276,
273,
2618,
309,
562,
12,
9499,
18,
19485,
13,
34,
21,
30,
276,
3292,
2924,
67,
3299,
3546,
273,
2589,
18,
19485,
63,
21,
65,
225,
1084,
273,
1408,
1361,
225,
273,
1... |
def __add__(self, s): """ Returns the sum of two streams. EXAMPLES:: sage: from sage.combinat.species.stream import Stream sage: s = Stream(ZZ) sage: ss = s + s sage: [ss[i] for i in range(10)] [0, 2, -2, 4, -4, 6, -6, 8, -8, 10] """ if not isinstance(s, Stream_class): raise TypeError, "s must be a Stream" return Stream((a+b for (a,b) in itertools.izip(self,s))) def __mul__(self, s): """ Returns the product of two streams. EXAMPLES: We can use a stream to represent the polynomial 1+x and use it to compute the coefficients of (1+x)2. :: sage: from sage.combinat.species.stream import Stream sage: s = Stream([1,1,0]) sage: ss = s*s sage: [ss[i] for i in range(5)] [1, 2, 1, 0, 0] """ if not isinstance(s, Stream_class): raise TypeError, "s must be a Stream" return Stream((self._times_naive(s, n) for n in _integers_from(0))) def _times_naive(self, s, n): """ Returns the nth entry in the product of self and s via the naive multiplication algorithm. Note that this requires that all entries for self and s in range(n+1) be computed. EXAMPLES:: sage: from sage.combinat.species.stream import Stream sage: s = Stream([1,1,0]) sage: s._times_naive(s, 0) 1 sage: s._times_naive(s, 1) 2 sage: s._times_naive(s, 2) 1 """ t = 0 for k in range(n+1): sk = self[k] if sk == 0: continue t += sk * s[n-k] return t | def __add__(self, s): """ Returns the sum of two streams. EXAMPLES:: sage: from sage.combinat.species.stream import Stream sage: s = Stream(ZZ) sage: ss = s + s sage: [ss[i] for i in range(10)] [0, 2, -2, 4, -4, 6, -6, 8, -8, 10] """ if not isinstance(s, Stream_class): raise TypeError, "s must be a Stream" return Stream((a+b for (a,b) in itertools.izip(self,s))) | 5b6581205ad5ca74ccbc158e3608e91553945246 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/5b6581205ad5ca74ccbc158e3608e91553945246/stream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
272,
4672,
3536,
2860,
326,
2142,
434,
2795,
8205,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
628,
272,
410,
18,
832,
4757,
270,
18,
22657,
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,
972,
12,
2890,
16,
272,
4672,
3536,
2860,
326,
2142,
434,
2795,
8205,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
628,
272,
410,
18,
832,
4757,
270,
18,
22657,
18,... | |
kx, ky, kz=self.beam.local_direction theta=math.atan2(kx, kz) | dot=Numeric.dot tr=Numeric.transpose deg=math.pi/180.0 kx, ky, kz = v1 = self.beam.local_direction v2 = cross(v1, (0,1,0)) v2 /= vec_mag(v2) v3 = cross(v1, v2) v3 /= vec_mag(v3) coord=Numeric.array((v1,v2,v3)) cinv=tr(coord) print "**grating**" print Numeric.array_str(coord, precision=4) theta=math.atan2(kx, math.sqrt(ky*ky+kz*kz)) | def local_transform(self): kx, ky, kz=self.beam.local_direction theta=math.atan2(kx, kz) littrow, out=self.angles(theta, self.beam.get_lambda()) #remember, outgoing angle is _not_ outgoing direction... beam has changed from incoming to outgoing, too dtheta=out+theta s,c=math.sin(dtheta), math.cos(dtheta) #this funny matrix is a rotation by dtheta, followed by a reflection in z self.beam.transform(self.globalize_transform(Numeric.array(((c,0,-s),(0,1,0),(-s,0,-c))))) | 7ad054738f0ec7df46f6a9474859623514a7d664 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6028/7ad054738f0ec7df46f6a9474859623514a7d664/general_optics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
6547,
12,
2890,
4672,
3928,
33,
9902,
18,
9811,
433,
33,
9902,
18,
2338,
4150,
5843,
33,
15949,
18,
7259,
19,
18278,
18,
20,
282,
417,
92,
16,
417,
93,
16,
417,
94,
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,
1191,
67,
6547,
12,
2890,
4672,
3928,
33,
9902,
18,
9811,
433,
33,
9902,
18,
2338,
4150,
5843,
33,
15949,
18,
7259,
19,
18278,
18,
20,
282,
417,
92,
16,
417,
93,
16,
417,
94,
273,
... |
if i1 == cn1 and i2 == cn2: if cmpstr1[i1] == '\r' or cmpstr2[i2] == '\r': pass elif cmpstr1[i1] == cmpstr2[i2]: i1 += 1 i2 += 1 else: cmpmode = 2 | cmpstr1 = cmpstr1[i1:] cmpstr2 = cmpstr2[i2:] cn1 = len( cmpstr1 ) cn2 = len( cmpstr2 ) | def __compare_node( self, node1, node2, callback ): """Compare two nodes.""" | 93b2dc695fe501f9e0252ae41d6dd540e118d8cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13212/93b2dc695fe501f9e0252ae41d6dd540e118d8cd/diff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9877,
67,
2159,
12,
365,
16,
756,
21,
16,
756,
22,
16,
1348,
262,
30,
3536,
8583,
2795,
2199,
12123,
2,
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,
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,
1001,
9877,
67,
2159,
12,
365,
16,
756,
21,
16,
756,
22,
16,
1348,
262,
30,
3536,
8583,
2795,
2199,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Construct a spherical transformation for a function ``r`` in terms of ``theta`` and ``phi``:: sage: T = Spherical('r', ['phi', 'theta']) If we construct some concrete variables, we can get a transformation:: | Construct a spherical transformation for a function for the radius in terms of the azimuth and inclination:: sage: T = Spherical('radius', ['azimuth', 'inclination']) If we construct some concrete variables, we can get a transformation in terms of those variables:: | def gen_transform(self, f=None, u=None, v=None): """ EXAMPLE:: sage: from sage.plot.plot3d.plot3d import _ArbCoordTrans sage: x, y, z = var('x y z') sage: T = _ArbCoordTrans((x + y, x - y, z), x) | 6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6a6b82f7e5f5e44ecfe79fc9e370831de7c2ec87/plot3d.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
6547,
12,
2890,
16,
284,
33,
7036,
16,
582,
33,
7036,
16,
331,
33,
7036,
4672,
3536,
5675,
21373,
2866,
225,
272,
410,
30,
628,
272,
410,
18,
4032,
18,
4032,
23,
72,
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,
3157,
67,
6547,
12,
2890,
16,
284,
33,
7036,
16,
582,
33,
7036,
16,
331,
33,
7036,
4672,
3536,
5675,
21373,
2866,
225,
272,
410,
30,
628,
272,
410,
18,
4032,
18,
4032,
23,
72,
18,
... |
if not wsc.check_user(uid): | if not wsc.check_user(uid, 'cfgwebsearch'): | def addcollectiontotree(req, colID, ln=cdslang, add_dad='', add_son='', rtype='', mtype='', callback='yes', confirm=-1): navtrail_previous_links = wsc.getnavtrail() + """> <a class=navtrail href="%s/admin/websearch/websearchadmin.py/">Edit Collection Tree</a> """ % (weburl) try: uid = getUid(req) except MySQLdb.Error, e: return error_page(req) if not wsc.check_user(uid): return page(title="Edit Collection Tree", body=wsc.perform_addcollectiontotree(colID=colID, ln=cdslang, add_dad=add_dad, add_son=add_son, rtype=rtype, callback=callback, confirm=confirm), uid=uid, language=ln, navtrail = navtrail_previous_links, urlargs=req.args, lastupdated=__lastupdated__) else: return auth_failed(uid, navtrail_previous_links) | ae002ee61a4180bf03cd4efb374fb3c6baac2e69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/ae002ee61a4180bf03cd4efb374fb3c6baac2e69/websearchadmin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
5548,
3307,
992,
12,
3658,
16,
645,
734,
16,
7211,
33,
4315,
2069,
539,
16,
527,
67,
72,
361,
2218,
2187,
527,
67,
816,
2218,
2187,
9328,
2218,
2187,
22189,
2218,
2187,
1348,
2218... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
5548,
3307,
992,
12,
3658,
16,
645,
734,
16,
7211,
33,
4315,
2069,
539,
16,
527,
67,
72,
361,
2218,
2187,
527,
67,
816,
2218,
2187,
9328,
2218,
2187,
22189,
2218,
2187,
1348,
2218... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.