rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
self.log.warn(result['Message']) | self.log.warn(resolvedSandbox['Message']) | def processJobOutputs(self,arguments): """Outputs for a job may be treated here. """ | 104cb9632bc3b5543dbcbce5a35dbc3ae6cdedfd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/104cb9632bc3b5543dbcbce5a35dbc3ae6cdedfd/JobWrapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
2278,
13856,
12,
2890,
16,
7099,
4672,
3536,
13856,
364,
279,
1719,
2026,
506,
13974,
2674,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
2278,
13856,
12,
2890,
16,
7099,
4672,
3536,
13856,
364,
279,
1719,
2026,
506,
13974,
2674,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
events = [] | events = [] | def tearDown(self): del self.engine | 5ae6a9b32bea5d1f32fc61bcb082ee8d52d88abc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5451/5ae6a9b32bea5d1f32fc61bcb082ee8d52d88abc/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
1464,
365,
18,
8944,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
1464,
365,
18,
8944,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return getattr(mod, inst)() | return getattr(mod, inst) | def get_index_dashboard(context): """ Returns the admin dashboard defined by the user or the default one. """ dashboard_cls = getattr( settings, 'ADMIN_TOOLS_INDEX_DASHBOARD', 'admin_tools.dashboard.dashboards.DefaultIndexDashboard' ) if type(dashboard_cls) is types.DictType: curr_url = context.get('request').META['PATH_INFO'] for key in dashboard_cls: admin_site_mod, admin_site_inst = key.rsplit('.', 1) admin_site_mod = import_module(admin_site_mod) admin_site = getattr(admin_site_mod, admin_site_inst) admin_url = reverse('%s:index' % admin_site.name) if curr_url.startswith(admin_url): mod, inst = dashboard_cls[key].rsplit('.', 1) mod = import_module(mod) return getattr(mod, inst)() else: mod, inst = dashboard_cls.rsplit('.', 1) mod = import_module(mod) return getattr(mod, inst)() | 4c054e990fa9567ee99c54d9fda3801c20656a26 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6707/4c054e990fa9567ee99c54d9fda3801c20656a26/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1615,
67,
13479,
12,
2472,
4672,
3536,
2860,
326,
3981,
11825,
2553,
635,
326,
729,
578,
326,
805,
1245,
18,
3536,
11825,
67,
6429,
273,
3869,
12,
1947,
16,
296,
15468,
67,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1615,
67,
13479,
12,
2472,
4672,
3536,
2860,
326,
3981,
11825,
2553,
635,
326,
729,
578,
326,
805,
1245,
18,
3536,
11825,
67,
6429,
273,
3869,
12,
1947,
16,
296,
15468,
67,
26... |
return '<a id="%s"></a>' % (id, ) | return '<span id="%s" class="anchor"></span>' % (id, ) | def anchordef(self, id): return '<a id="%s"></a>' % (id, ) # do not add a \n here, it breaks pre sections with line_anchordef | db6a05d98f954a6968e2a039ee6e36c5679eee91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/db6a05d98f954a6968e2a039ee6e36c5679eee91/text_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6984,
536,
12,
2890,
16,
612,
4672,
282,
327,
2368,
3969,
612,
11613,
87,
6,
667,
1546,
16215,
13762,
3969,
1870,
738,
261,
350,
16,
262,
468,
741,
486,
527,
279,
521,
82,
2674,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6984,
536,
12,
2890,
16,
612,
4672,
282,
327,
2368,
3969,
612,
11613,
87,
6,
667,
1546,
16215,
13762,
3969,
1870,
738,
261,
350,
16,
262,
468,
741,
486,
527,
279,
521,
82,
2674,
16,
... |
dump = serializer.dumper(output) if activity: count = len(aliases) activity.update(msg=_(u"Exporting %(total)d records") % {'total':count}, totalWork=count) i = 0 for alias in aliases: uuid = trans.getUUIDForAlias(alias) item = rv.findUUID(uuid) for record in trans.exportItem(item): | try: dump = serializer.dumper(output) if activity: count = len(aliases) activity.update(msg=_(u"Exporting %(total)d records") % {'total':count}, totalWork=count) i = 0 for alias in aliases: uuid = trans.getUUIDForAlias(alias) item = rv.findUUID(uuid) for record in trans.exportItem(item): dump(record) i += 1 if activity: activity.update(msg=_(u"Exported %(number)d of %(total)d items") % \ {'number':i, 'total':count}, work=1) if activity: activity.update(totalWork=None) for record in trans.finishExport(): if activity: count += 1 activity.update(msg=_(u"Exporting additional record")) | def dump(rv, filename, uuids=None, serializer=PickleSerializer, activity=None, obfuscate=False): """ Dumps EIM records to a file, file permissions 0600. """ translator = getTranslator() trans = translator(rv) trans.obfuscation = obfuscate aliases = list() if uuids: for uuid in uuids: aliases.append(trans.getAliasForItem(rv.findUUID(uuid))) else: for item in schema.Item.iterItems(rv): if not str(item.itsPath).startswith("//parcels"): aliases.append(trans.getAliasForItem(item)) # Sort on alias so masters are dumped before occurrences aliases.sort() trans.startExport() try: flags = os.O_EXCL | os.O_CREAT | os.O_WRONLY | os.O_BINARY except AttributeError: flags = os.O_EXCL | os.O_CREAT | os.O_WRONLY try: # Need to remove the file, otherwise we'll use existing permissions os.remove(filename) except OSError: pass # XXX This will fail if someone created the file after the remove but # XXX before we got here, so the caller should be prepared to handle that. output = os.fdopen(os.open(filename, flags, 0600), 'wb') try: dump = serializer.dumper(output) if activity: count = len(aliases) activity.update(msg=_(u"Exporting %(total)d records") % {'total':count}, totalWork=count) i = 0 for alias in aliases: uuid = trans.getUUIDForAlias(alias) item = rv.findUUID(uuid) for record in trans.exportItem(item): dump(record) i += 1 if activity: activity.update(msg=_(u"Exported %(number)d of %(total)d items") % \ {'number':i, 'total':count}, work=1) if activity: activity.update(totalWork=None) # we don't know upcoming total work for record in trans.finishExport(): if activity: count += 1 activity.update(msg=_(u"Exporting additional record")) dump(record) dump(None) del dump except ActivityAborted: os.remove(filename) finally: output.close() if activity: activity.update(msg=_(u"Exported %(total)d records") % {'total':count}) | 60d7106846cbd1b3995e18bbd2c65098a0713462 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/60d7106846cbd1b3995e18bbd2c65098a0713462/dumpreload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
12,
4962,
16,
1544,
16,
26938,
33,
7036,
16,
6340,
33,
17968,
298,
6306,
16,
5728,
33,
7036,
16,
29004,
340,
33,
8381,
4672,
3536,
21250,
1121,
512,
3445,
3853,
358,
279,
585,
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,
4657,
12,
4962,
16,
1544,
16,
26938,
33,
7036,
16,
6340,
33,
17968,
298,
6306,
16,
5728,
33,
7036,
16,
29004,
340,
33,
8381,
4672,
3536,
21250,
1121,
512,
3445,
3853,
358,
279,
585,
16... |
for article in item['items']: | for article in item.get('items', []): | def getItems(self): items = [] for item in self.items: if item['type'] == 'article': items.append(item) elif item['type'] == 'chapter': items.append(item) for article in item['items']: items.append(article) return items | 38f864d553b695cc4116e4da79097e647401a16d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/38f864d553b695cc4116e4da79097e647401a16d/metabook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15515,
12,
2890,
4672,
1516,
273,
5378,
364,
761,
316,
365,
18,
3319,
30,
309,
761,
3292,
723,
3546,
422,
296,
11480,
4278,
1516,
18,
6923,
12,
1726,
13,
1327,
761,
3292,
723,
3546,
42... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15515,
12,
2890,
4672,
1516,
273,
5378,
364,
761,
316,
365,
18,
3319,
30,
309,
761,
3292,
723,
3546,
422,
296,
11480,
4278,
1516,
18,
6923,
12,
1726,
13,
1327,
761,
3292,
723,
3546,
42... |
os.system(cmd) | failure = os.system(cmd) if failure: raise FortranBuildError,\ 'failure during build (exit status = %s)'%failure | def create_static_lib(self, object_files, library_name, output_dir='', debug=None): lib_file = os.path.join(output_dir, self.lib_prefix+library_name+self.lib_suffix) objects = string.join(object_files) if objects: cmd = '%s%s %s' % (self.lib_ar,lib_file,objects) print yellow_text(cmd) os.system(cmd) if self.lib_ranlib: # Digital compiler does not have ranlib (?). cmd = '%s %s' %(self.lib_ranlib,lib_file) print yellow_text(cmd) os.system(cmd) | efb1608fe16ebd999c51b4509f4072366caff768 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/efb1608fe16ebd999c51b4509f4072366caff768/build_flib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3845,
67,
2941,
12,
2890,
16,
733,
67,
2354,
16,
5313,
67,
529,
16,
876,
67,
1214,
2218,
2187,
1198,
33,
7036,
4672,
2561,
67,
768,
273,
1140,
18,
803,
18,
5701,
12,
2844,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3845,
67,
2941,
12,
2890,
16,
733,
67,
2354,
16,
5313,
67,
529,
16,
876,
67,
1214,
2218,
2187,
1198,
33,
7036,
4672,
2561,
67,
768,
273,
1140,
18,
803,
18,
5701,
12,
2844,
... |
options.compiler = 'msvc' | if which('cl.exe') is not None: options.compiler = 'msvc' elif which('g++.exe') is not None: options.compiler = 'gcc' else: options.compiler = 'msvc' | def log_level(): if options.verbose: return logging.DEBUG if options.quiet: return logging.WARNING return logging.INFO | 2f16053e01758662c814d96876feaf670fa7eb97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9556/2f16053e01758662c814d96876feaf670fa7eb97/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
67,
2815,
13332,
309,
702,
18,
11369,
30,
327,
2907,
18,
9394,
309,
702,
18,
20380,
30,
327,
2907,
18,
9511,
327,
2907,
18,
5923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
67,
2815,
13332,
309,
702,
18,
11369,
30,
327,
2907,
18,
9394,
309,
702,
18,
20380,
30,
327,
2907,
18,
9511,
327,
2907,
18,
5923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import IRC prefix = IRC.format("%s:" % message.xml.source.project, 'bold') + " " | from IRC.Formatting import format prefix = format("%s:" % message.xml.source.project, 'bold') + " " | def format(self, message, input): if not input: return if message.xml.source and message.xml.source.project: import IRC prefix = IRC.format("%s:" % message.xml.source.project, 'bold') + " " return "\n".join([prefix + line for line in input.split("\n")]) else: return input | d830e60292e5b3177afd7169fb02bbe99a80d291 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9478/d830e60292e5b3177afd7169fb02bbe99a80d291/Formatters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
883,
16,
810,
4672,
309,
486,
810,
30,
327,
309,
883,
18,
2902,
18,
3168,
471,
883,
18,
2902,
18,
3168,
18,
4406,
30,
628,
467,
11529,
18,
23974,
1930,
740,
1633,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
740,
12,
2890,
16,
883,
16,
810,
4672,
309,
486,
810,
30,
327,
309,
883,
18,
2902,
18,
3168,
471,
883,
18,
2902,
18,
3168,
18,
4406,
30,
628,
467,
11529,
18,
23974,
1930,
740,
1633,
... |
def update(self, index, left_score, rigt_score, valid) : count += 1 | def update(self, index, left_score, rigt_score, valid): global g_max_sub self.count += 1 | def update(self, index, left_score, rigt_score, valid) : count += 1 | ab984dfcf4152172bb5c41c3da2fe1f6a428492f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/ab984dfcf4152172bb5c41c3da2fe1f6a428492f/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
770,
16,
2002,
67,
6355,
16,
436,
360,
88,
67,
6355,
16,
923,
13,
294,
1056,
1011,
404,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
770,
16,
2002,
67,
6355,
16,
436,
360,
88,
67,
6355,
16,
923,
13,
294,
1056,
1011,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
b3.events.EVT_UNKOWN, | b3.events.EVT_UNKNOWN, | def parseLine(self, line): """Parse a single line from the log file""" m = re.match(self._lineFormat, line) if m: self.queueEvent(b3.events.Event( b3.events.EVT_UNKOWN, m.group(2)[:1] )) | 2cceca8e0c8d8782ff525b7fbaee6667fa2c772f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12909/2cceca8e0c8d8782ff525b7fbaee6667fa2c772f/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1670,
12,
2890,
16,
980,
4672,
3536,
3201,
279,
2202,
980,
628,
326,
613,
585,
8395,
312,
273,
283,
18,
1916,
12,
2890,
6315,
1369,
1630,
16,
980,
13,
309,
312,
30,
365,
18,
40... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1670,
12,
2890,
16,
980,
4672,
3536,
3201,
279,
2202,
980,
628,
326,
613,
585,
8395,
312,
273,
283,
18,
1916,
12,
2890,
6315,
1369,
1630,
16,
980,
13,
309,
312,
30,
365,
18,
40... |
sections respectively. | sections respectively. | def __calculate_ratio(conf, ctib, t=None): """ This function runs amorphous_reduction_sqe and calculates the ratio for the given time-independent background constant. @param conf: Object containing the data reduction configuration information. @type conf: L{hlr_utils.Configure} @param ctib: Value of the time-independent background to run reduction with @type ctib: C{float} @param t: (OPTIONAL) Object that will allow the method to perform timing evaluations. @type t: C{sns_time.DiffTime} @return: The values of the integration in the positive and negative sections respectively. @rtype: C{tuple} """ import copy import amorphous_reduction_sqe import dr_lib amr_config = copy.deepcopy(conf) amr_config.verbose = conf.amr_verbose amr_config.tib_data_const = hlr_utils.DrParameter(ctib, 0.0) if t is not None: t.getTime(False) if conf.verbose: print "Running amorphous_reduction_sqe" som = amorphous_reduction_sqe.run(amr_config) if t is not None: t.getTime(msg="After running amorphous_reduction_sqe ") pos_int = dr_lib.integrate_spectra(som, start=conf.et_pos_range[0], end=conf.et_pos_range[1], axis_pos=1) neg_int = dr_lib.integrate_spectra(som, start=conf.et_neg_range[0], end=conf.et_neg_range[1], axis_pos=1) if conf.verbose: print "Ratio: %e / %e, %f" % (pos_int[0].y, neg_int[0].y, __make_ratio((pos_int[0].y, neg_int[0].y))) return (pos_int[0].y, neg_int[0].y) | 36badd65c251eeb079d3bfab833aabc1dc8ebc9b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/763/36badd65c251eeb079d3bfab833aabc1dc8ebc9b/find_ldb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11162,
67,
9847,
12,
3923,
16,
5691,
495,
16,
268,
33,
7036,
4672,
3536,
1220,
445,
7597,
2125,
7657,
1481,
67,
1118,
4062,
67,
11410,
73,
471,
17264,
326,
7169,
364,
326,
864,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11162,
67,
9847,
12,
3923,
16,
5691,
495,
16,
268,
33,
7036,
4672,
3536,
1220,
445,
7597,
2125,
7657,
1481,
67,
1118,
4062,
67,
11410,
73,
471,
17264,
326,
7169,
364,
326,
864,
8... |
if key in self.names: | member = 0 if key in self._files: member = 1 elif key in self.files: member = 1 key += '.npy' if member: | def __getitem__(self, key): # FIXME: This seems like it will copy strings around # more than is strictly necessary. The zipfile # will read the string and then # the format.read_array will copy the string # to another place in memory. # It would be better if the zipfile could read # (or at least uncompress) the data # directly into the array memory. if key in self.names: bytes = self.zip.read(key) if bytes.startswith(format.MAGIC_PREFIX): value = cStringIO.StringIO(bytes) return format.read_array(value) else: return bytes else: raise KeyError, "%s is not a file in the archive" % key | 89d0310a07059f4b75aaaf6764326c97afdd1014 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/89d0310a07059f4b75aaaf6764326c97afdd1014/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
4672,
468,
9852,
30,
1220,
12001,
3007,
518,
903,
1610,
2064,
6740,
468,
282,
1898,
2353,
353,
23457,
4573,
18,
225,
1021,
18823,
468,
282,
903,
855,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31571,
972,
12,
2890,
16,
498,
4672,
468,
9852,
30,
1220,
12001,
3007,
518,
903,
1610,
2064,
6740,
468,
282,
1898,
2353,
353,
23457,
4573,
18,
225,
1021,
18823,
468,
282,
903,
855,... |
proxy_user=None, proxy_pass=None, debug=2, | proxy_user=None, proxy_pass=None, debug=0, | def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, host=None, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, debug=2, https_connection_factory=None, region=None, path='/'): """ Init method to create a new connection to EC2. | dadfdf504a45fdd7e42ef36a2075492226de0604 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1098/dadfdf504a45fdd7e42ef36a2075492226de0604/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2287,
67,
3860,
67,
856,
67,
350,
33,
7036,
16,
2287,
67,
5875,
67,
3860,
67,
856,
33,
7036,
16,
353,
67,
8869,
33,
5510,
16,
1479,
33,
7036,
16,
175... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2287,
67,
3860,
67,
856,
67,
350,
33,
7036,
16,
2287,
67,
5875,
67,
3860,
67,
856,
33,
7036,
16,
353,
67,
8869,
33,
5510,
16,
1479,
33,
7036,
16,
175... |
return value | return b''.join(value) | def _read_chunked(self, amt): assert self.chunked != _UNKNOWN chunk_left = self.chunk_left value = b"" | 9c33cbfbef5858e83a0079e89d81ae6fb15fc360 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/9c33cbfbef5858e83a0079e89d81ae6fb15fc360/client.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,
324,
3660,
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,
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,
324,
3660,
2,
-100,
-100,
-100,
... |
lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False): | lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False): | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False): res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, qty_uos, uos, name, partner_id, lang, update_tax,date_order,fiscal_position=fiscal_position) | 09263c29730891dba703fcb1a2bfb60b2db55bf7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/09263c29730891dba703fcb1a2bfb60b2db55bf7/product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... |
parser.add_option("--configure-WxStation", action="store_true", dest="configure_VP", help="To configure a WxStation weather station") | parser.add_option("--configure-VantagePro", action="store_true", dest="configure_VP", help="To configure a VantagePro weather station") | def main(): parser = OptionParser(usage=usagestr) parser.add_option("--create-database", action="store_true", dest="create_database", help="To create the SQL database wview-archive.sdb") parser.add_option("--create-stats", action="store_true", dest="create_stats", help="To create the statistical statistical database stats.sdb") parser.add_option("--backfill-stats", action="store_true", dest="backfill_stats", help="To backfill the statistical database from the main database") parser.add_option("--configure-WxStation", action="store_true", dest="configure_VP", help="To configure a WxStation weather station") (options, args) = parser.parse_args() if len(args) < 1: print "Missing argument(s)." print parser.parse_args(["--help"]) exit() config_path = args[0] # Set defaults for the system logger: syslog.openlog('configure', syslog.LOG_PID|syslog.LOG_CONS) # Try to open up the given configuration file. Declare an error if unable to. try : config_dict = configobj.ConfigObj(config_path, file_error=True) except IOError: print "Unable to open configuration file ", config_path syslog.syslog(syslog.LOG_CRIT, "main: Unable to open configuration file %s" % config_path) exit() if options.create_database: createMainDatabase(config_dict) if options.create_stats: createStatsDatabase(config_dict) if options.backfill_stats: backfillStatsDatabase(config_dict) if options.configure_VP: configureVP(config_dict) | e46ea6899da7d1018d94aa20624c1cfd4f6c9f31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6433/e46ea6899da7d1018d94aa20624c1cfd4f6c9f31/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2082,
273,
18862,
12,
9167,
33,
407,
1023,
313,
13,
2082,
18,
1289,
67,
3482,
2932,
413,
2640,
17,
6231,
3113,
1301,
1546,
2233,
67,
3767,
3113,
1570,
1546,
2640,
67,
6231,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2082,
273,
18862,
12,
9167,
33,
407,
1023,
313,
13,
2082,
18,
1289,
67,
3482,
2932,
413,
2640,
17,
6231,
3113,
1301,
1546,
2233,
67,
3767,
3113,
1570,
1546,
2640,
67,
6231,
... |
self.setPosition(len(self.covers)-1) | self.setPosition(len(self.coverData)-1) | def _handleCustomCoverButton(self): fileName = QtGui.QFileDialog.getOpenFileName(self,"Cover öffnen",os.path.expanduser("~"), "Bilddateien (*.png *.jpg *.bmp);;Alle Dateien (*)"); if fileName == "": # user cancelled the dialog return image = QtGui.QPixmap(fileName) if image.isNull(): QtGui.QMessageBox(QtGui.QMessageBox.Warning,"Fehler beim Öffnen der Datei", "Die Datei konnte nicht geöffnet werden.",QtGui.QMessageBox.Ok,self).exec_() else: self.addImage(image,fileName) self.setPosition(len(self.covers)-1) | 23314926f1305b4dffda643018bbddea06f6e317 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5948/23314926f1305b4dffda643018bbddea06f6e317/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
3802,
8084,
3616,
12,
2890,
4672,
3968,
273,
23425,
18,
53,
812,
6353,
18,
588,
3678,
4771,
12,
2890,
10837,
8084,
225,
132,
119,
1403,
82,
275,
3113,
538,
18,
803,
18,
1232... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3802,
8084,
3616,
12,
2890,
4672,
3968,
273,
23425,
18,
53,
812,
6353,
18,
588,
3678,
4771,
12,
2890,
10837,
8084,
225,
132,
119,
1403,
82,
275,
3113,
538,
18,
803,
18,
1232... |
if self.distribution.has_ext_modules(): | if not self.skip_build and self.distribution.has_ext_modules(): | def finalize_options (self): if self.bdist_dir is None: bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'wininst') if not self.target_version: self.target_version = "" if self.distribution.has_ext_modules(): short_version = get_python_version() if self.target_version and self.target_version != short_version: raise DistutilsOptionError, \ "target version can only be" + short_version self.target_version = short_version | f9ba0caf6fda157ad4d46363371dba1a10f802f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f9ba0caf6fda157ad4d46363371dba1a10f802f7/bdist_wininst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
309,
365,
18,
70,
4413,
67,
1214,
353,
599,
30,
324,
4413,
67,
1969,
273,
365,
18,
588,
67,
6385,
1235,
67,
3076,
2668,
70,
4413,
16063,
70,
4413,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
309,
365,
18,
70,
4413,
67,
1214,
353,
599,
30,
324,
4413,
67,
1969,
273,
365,
18,
588,
67,
6385,
1235,
67,
3076,
2668,
70,
4413,
16063,
70,
4413,
6... |
f = self.create_function(0) | f = self.create_function([]) | def generate(self, opts, args_num, globals): fon = self.generate_globalon() foff = self.generate_globaloff() | a53ae9ad63b9112b4f06f0d7b4e2b61e3da9e1a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9463/a53ae9ad63b9112b4f06f0d7b4e2b61e3da9e1a2/globalsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
16,
1500,
16,
833,
67,
2107,
16,
10941,
4672,
284,
265,
273,
365,
18,
7163,
67,
6347,
265,
1435,
284,
3674,
273,
365,
18,
7163,
67,
6347,
3674,
1435,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
16,
1500,
16,
833,
67,
2107,
16,
10941,
4672,
284,
265,
273,
365,
18,
7163,
67,
6347,
265,
1435,
284,
3674,
273,
365,
18,
7163,
67,
6347,
3674,
1435,
2,
-100,
-100,
-... |
elif stdout == PIPE: | if c2pwrite is not None: pass elif stdout is None or stdout == PIPE: | def _get_handles(self, stdin, stdout, stderr): """Construct and return tupel with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite """ if stdin is None and stdout is None and stderr is None: return (None, None, None, None, None, None) | 0e57c3fa251ec5f3e093e6db214906e54503bba3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/0e57c3fa251ec5f3e093e6db214906e54503bba3/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
15822,
292,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
67,
24111,
12,
2890,
16,
8801,
16,
3909,
16,
4514,
4672,
3536,
7249,
471,
327,
15822,
292,
598,
1665,
2184,
30,
293,
22,
71,
896,
16,
293,
22,
71,
2626,
16,
276,
22,
84,
... |
data = unicode(context.get_form_value('data'), 'UTF-8') self.set_data(data) | data = context.get_form_value('data') resource = memory.File(data) self.load_state(resource) | def edit(self, context): data = unicode(context.get_form_value('data'), 'UTF-8') self.set_data(data) | 1d208a8b0a263b75f6063f0f59a4a1c940068c8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1d208a8b0a263b75f6063f0f59a4a1c940068c8c/text.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
12,
2890,
16,
819,
4672,
501,
273,
5252,
12,
2472,
18,
588,
67,
687,
67,
1132,
2668,
892,
19899,
296,
5159,
17,
28,
6134,
365,
18,
542,
67,
892,
12,
892,
13,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3874,
12,
2890,
16,
819,
4672,
501,
273,
5252,
12,
2472,
18,
588,
67,
687,
67,
1132,
2668,
892,
19899,
296,
5159,
17,
28,
6134,
365,
18,
542,
67,
892,
12,
892,
13,
2,
-100,
-100,
-... |
builder['is_green'] = not re.search('fail', cell.renderContents()) | builder['is_green'] = not re.search('fail', cell.renderContents()) or \ re.search('lost', cell.renderContents()) | def _parse_last_build_cell(self, builder, cell): status_link = cell.find('a') if status_link: # Will be either a revision number or a build number revision_string = status_link.string # If revision_string has non-digits assume it's not a revision number. builder['built_revision'] = int(revision_string) \ if not re.match('\D', revision_string) \ else None builder['is_green'] = not re.search('fail', cell.renderContents()) | 8ce0f40179cb55526c5e93c4feee791163cab42a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/8ce0f40179cb55526c5e93c4feee791163cab42a/buildbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
2722,
67,
3510,
67,
3855,
12,
2890,
16,
2089,
16,
2484,
4672,
1267,
67,
1232,
273,
2484,
18,
4720,
2668,
69,
6134,
309,
1267,
67,
1232,
30,
468,
9980,
506,
3344,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2670,
67,
2722,
67,
3510,
67,
3855,
12,
2890,
16,
2089,
16,
2484,
4672,
1267,
67,
1232,
273,
2484,
18,
4720,
2668,
69,
6134,
309,
1267,
67,
1232,
30,
468,
9980,
506,
3344,
279,
... |
if aslocator: default = N.arange(vmin, vmax+1) else: format = N.empty(locs.size, dtype="|S8") | if not aslocator: format = N.empty(default.shape, dtype="|S10") | def _daily_finder(locs, freqstr, aslocator): if freqstr == 'B': periodsperyear = 261 elif freqstr == 'D': periodsperyear = 365 else: raise ValueError("unexpected frequency") locs = N.asarray(locs) (vmin, vmax) = locs[[0,-1]] span = vmax - vmin + 1 dates = date_array(start_date=Date(freqstr,vmin), end_date=Date(freqstr, vmax)) # Initialize the output if aslocator: default = N.arange(vmin, vmax+1) else: #asformatter format = N.empty(locs.size, dtype="|S8") format.flat = '' # Case 1. Less than a month if span <= (periodsperyear//12 - 2): month_start = period_break(dates,'month') if aslocator: major = default[month_start] minor = default else: year_start = period_break(dates,'year') format[:] = '%d' format[month_start] = '%d\n%b' format[year_start] = '%d\n%b\n%Y' if year_start.size == 0: if month_start.size == 0: if dates.size > 1: idx = 1 else: idx = 0 format[idx] = '%d\n%b\n%Y' else: format[month_break[0]] = '%d\n%b\n%Y' # Case 2. Less than three months elif span <= periodsperyear//4: month_start = period_break(dates,'month') if aslocator: major = default[month_start] minor = default else: week_start = (dates.day_of_week == 1) year_start = period_break(dates,'year') week_start[0] = False month_start[0] = False year_start[0] = False format[week_start] = '%d' format[month_start] = '\n\n%b' format[year_start] = '\n\n%b\n%Y' if year_start.size == 0: month_break = month_start.nonzero()[0] if month_break.size == 0: week_break = week_start.nonzero()[0] format[week_break[0]] = '\n\n%b\n%Y' else: format[month_break[0]] = '\n\n%b\n%Y' # Case 3. Less than 14 months ............... elif span <= 1.15 * periodsperyear: month_start = period_break(dates,'month') if aslocator: week_start = period_break(dates, 'week') minor_idx = (week_start | month_start) minor_idx[0] = True major = default[month_start] minor = default[minor_idx] else: year_start = period_break(dates,'year') month_start[0] = False year_start[0] = False format[month_start] = '%b' format[year_start] = '%b\n%Y' if not year_start.size: format[month_break[0]] = '%b\n%Y' # Case 4. Less than 2.5 years ............... elif span <= 2.5 * periodsperyear: year_start = period_break(dates,'year') if aslocator: month_start = period_break(dates, 'quarter') major = default[year_start] minor = default[month_start] else: quarter_start = period_break(dates, 'quarter') format[quarter_start] = '%b' format[year_start] = '%b\n%Y' # Case 4. Less than 4 years ................. elif span <= 4 * periodsperyear: year_start = period_break(dates,'year') month_start = period_break(dates, 'month') if aslocator: major = default[year_start] minor = default[month_start] else: month_break = dates[month_start].month jan_or_jul = month_start[(month_break == 1 | month_break == 7)] format[jan_or_jul] = '%b' format[year_start] = '%b\n%Y' # Case 5. Less than 11 years ................ elif span <= 11 * periodsperyear: year_start = period_break(dates,'year') if aslocator: quarter_start = period_break(dates, 'quarter') major = default[year_start] minor = default[quarter_start] else: format[year_start] = '%Y' # Case 6. More than 12 years ................ else: year_start = period_break(dates,'year') year_break = dates[year_start].years nyears = span/periodsperyear (min_anndef, maj_anndef) = _get_default_annual_spacing(nyears) major_idx = year_start[(year_break % maj_anndef == 0)] if aslocator: major = default[major_idx] minor_idx = year_start[(year_break % min_anndef == 0)] minor = default[minor_idx] else: format[major_idx] = '%Y' #............................................ if aslocator: return minor, major else: formatted = (format != '') return dict([(d,f) for (d,f) in zip(dates[formatted],format[formatted])]) | 7a3c507a500aec86f9240f3a0e8437c36eeb7238 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/7a3c507a500aec86f9240f3a0e8437c36eeb7238/mpl_timeseries_pgm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26790,
67,
15356,
12,
24323,
16,
7684,
701,
16,
487,
20048,
4672,
225,
309,
7684,
701,
422,
296,
38,
4278,
12777,
457,
6874,
273,
576,
9498,
1327,
7684,
701,
422,
296,
40,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26790,
67,
15356,
12,
24323,
16,
7684,
701,
16,
487,
20048,
4672,
225,
309,
7684,
701,
422,
296,
38,
4278,
12777,
457,
6874,
273,
576,
9498,
1327,
7684,
701,
422,
296,
40,
4278,
1... |
if _iscommand("mozilla"): register("mozilla", None, Netscape("mozilla")) if _iscommand("netscape"): register("netscape", None, Netscape("netscape")) | for browser in ("mozilla-firefox", "mozilla-firebird", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Netscape(browser)) | def open_new(self, url): self.open(url) | 31db3d373dd9924c51d98492bfe7cb0d447e94b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/31db3d373dd9924c51d98492bfe7cb0d447e94b4/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2704,
12,
2890,
16,
880,
4672,
365,
18,
3190,
12,
718,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
nim.longitudeOrientation = configElement(cname + "longitudeOrientation", configSelection, 0, (("east",_("East")), ("west", _("West")))) | nim.longitudeOrientation = configElement(cname + "longitudeOrientation", configSelection, 0, (("east", _("East")), ("west", _("West")))) | def nimPortDChanged(slotid, configElement): nimmgr.nimPortDChanged(slotid, configElement.vals[configElement.value][1]) | f503f202686fc9ff6859cf834e9a021922011b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/f503f202686fc9ff6859cf834e9a021922011b81/NimManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
381,
2617,
40,
5033,
12,
14194,
350,
16,
642,
1046,
4672,
290,
381,
13552,
18,
82,
381,
2617,
40,
5033,
12,
14194,
350,
16,
642,
1046,
18,
4524,
63,
1425,
1046,
18,
1132,
6362,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
381,
2617,
40,
5033,
12,
14194,
350,
16,
642,
1046,
4672,
290,
381,
13552,
18,
82,
381,
2617,
40,
5033,
12,
14194,
350,
16,
642,
1046,
18,
4524,
63,
1425,
1046,
18,
1132,
6362,
... |
def compile_cmd(f, m): """ Given a .pyx file f, which is a part of module m, copy the file to SITE_PACKAGES, and return a string which will call Cython on it. | def compile_command(f): """ Given a pair p, consisting of a filename f and a module m, compile the file f. Given a pair p = [f, m], with a .pyx file f which is a part the module m, call Cython on f copy the file to SITE_PACKAGES, and return a string which will call Cython on it. | def compile_cmd(f, m): """ Given a .pyx file f, which is a part of module m, copy the file to SITE_PACKAGES, and return a string which will call Cython on it. """ if f.endswith('.pyx'): # process cython file pyx_inst_file = '%s/%s'%(SITE_PACKAGES, f) retval = os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file)) # we could do this more elegantly -- load the files, use # os.path.exists to check that they exist, etc. ... but the # *vast* majority of the time, the copy just works. so this is # just specializing for the most common use case. if retval: dirname, filename = os.path.split(pyx_inst_file) if not os.path.exists(dirname): os.makedirs(dirname) retval = os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file)) if retval: raise OSError, "cannot copy %s to %s"%(f,pyx_inst_file) print "%s --> %s"%(f, pyx_inst_file) outfile = f[:-4] if m.language == 'c++': outfile += ".cpp" else: outfile += ".c" cmd = "python2.5 `which cython` --embed-positions --incref-local-binop -I%s -o %s %s"%(os.getcwd(), outfile, f) elif f.endswith(('.c','.cc','.cpp')): # process C/C++ file cmd = "touch %s"%f return cmd #"NEED TO COMPILE file " + f + " in module " + m.name | b403c4ae7ce95128471152617e3a5b4e526b43bd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/b403c4ae7ce95128471152617e3a5b4e526b43bd/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
3076,
12,
74,
4672,
3536,
16803,
279,
3082,
293,
16,
23570,
434,
279,
1544,
284,
471,
279,
1605,
312,
16,
4074,
326,
585,
284,
18,
225,
16803,
279,
3082,
293,
273,
306,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4074,
67,
3076,
12,
74,
4672,
3536,
16803,
279,
3082,
293,
16,
23570,
434,
279,
1544,
284,
471,
279,
1605,
312,
16,
4074,
326,
585,
284,
18,
225,
16803,
279,
3082,
293,
273,
306,
74,
... |
for test in self._full_test_list: if not test in self._test_list_paths: self._AddTest(test, modifiers, expectations, options) | if self._full_test_list: for test in self._full_test_list: if not test in self._test_list_paths: self._AddTest(test, modifiers, expectations, options) | def _Read(self, expectations): """For each test in an expectations iterable, generate the expectations for it. """ lineno = 0 for line in expectations: lineno += 1 | a624129450e1912bedde02a7805630838b2be73f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/a624129450e1912bedde02a7805630838b2be73f/test_expectations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1994,
12,
2890,
16,
26305,
4672,
3536,
1290,
1517,
1842,
316,
392,
26305,
6087,
16,
2103,
326,
26305,
364,
518,
18,
3536,
7586,
273,
374,
364,
980,
316,
26305,
30,
7586,
1011,
404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1994,
12,
2890,
16,
26305,
4672,
3536,
1290,
1517,
1842,
316,
392,
26305,
6087,
16,
2103,
326,
26305,
364,
518,
18,
3536,
7586,
273,
374,
364,
980,
316,
26305,
30,
7586,
1011,
404,
... |
self.error(col, row + 1, ERROR_NOT_UNICODE_OR_ASCII) | self.error(row, col, ERROR_NOT_UNICODE_OR_ASCII) | def getTextFromCell(self, sheet, row, col, default=u''): try: value = sheet.cell_value(rowx=row, colx=col) except: return '' if isinstance(value, str): try: value = unicode(value) except UnicodeError: self.error(col, row + 1, ERROR_NOT_UNICODE_OR_ASCII) return default elif not isinstance(value, unicode): self.error(col, row + 1, ERROR_NOT_UNICODE_OR_ASCII) return default return value | 57d3328c0c1a99c8d6574f10fa1d32e8fe0d442c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7127/57d3328c0c1a99c8d6574f10fa1d32e8fe0d442c/importer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6701,
1265,
4020,
12,
2890,
16,
6202,
16,
1027,
16,
645,
16,
805,
33,
89,
6309,
4672,
775,
30,
460,
273,
6202,
18,
3855,
67,
1132,
12,
492,
92,
33,
492,
16,
645,
92,
33,
1293,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6701,
1265,
4020,
12,
2890,
16,
6202,
16,
1027,
16,
645,
16,
805,
33,
89,
6309,
4672,
775,
30,
460,
273,
6202,
18,
3855,
67,
1132,
12,
492,
92,
33,
492,
16,
645,
92,
33,
1293,
13,
... |
i = p + 1 | if epoch.isdigit(): i = p + 1 else: epoch = "" | def evrSplitString(evr): """Split evr to components. Return (E, V, R). Default epoch and release to "" if not specified.""" i = 0 p = evr.find(":") # epoch if p != -1: epoch = evr[:p] i = p + 1 else: epoch = "" p = evr.find("-", i) # version if p != -1: version = evr[i:p] release = evr[p+1:] else: version = evr[i:] release = "" return (epoch, version, release) | 3d90487c8f513c091b2c04776c1278099b05913b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1143/3d90487c8f513c091b2c04776c1278099b05913b/functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2113,
86,
5521,
780,
12,
14965,
86,
4672,
3536,
5521,
2113,
86,
358,
4085,
18,
225,
2000,
261,
41,
16,
776,
16,
534,
2934,
225,
2989,
7632,
471,
3992,
358,
1408,
309,
486,
1269,
12123,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2113,
86,
5521,
780,
12,
14965,
86,
4672,
3536,
5521,
2113,
86,
358,
4085,
18,
225,
2000,
261,
41,
16,
776,
16,
534,
2934,
225,
2989,
7632,
471,
3992,
358,
1408,
309,
486,
1269,
12123,... |
print "* ",som2[0] | print "* ", som2[0] | def integrate_axis(obj, **kwargs): """ This function takes a SOM or a SO and integrates the given axis. The function assumes that the incoming data is in the histogram form. Parameters: ---------- -> obj is a SOM or a SO -> kwargs is a list of key word arguments that the function accepts: start=<index of starting bin> end=<index of ending bin> This index is made inclusive by the function. axis=<y or x> This is the axis one wishes to manipulate. If no argument is given the default value is y axis_pos=<number> This is position of the axis in the axis array. If no argument is given, the default value is 0 Returns: ------- <- A tuple containing the integration value and its associated error Exceptions: ---------- <- RuntimError is raised if a SOM or SO is not given to the function """ # import the helper functions import hlr_utils # set up for working through data o_descr=hlr_utils.get_descr(obj) if o_descr == "number" or o_descr == "list": raise RuntimeError, "Must provide a SOM of a SO to the function." # Go on else: pass # Check for starting bin try: start = kwargs["start"] except KeyError: start = 0 # Check for ending bin try: end = kwargs["end"]+1 except KeyError: end = -1 # Check for axis keyword argument try: axis = kwargs["axis"] except KeyError: axis = "y" # Check for axis_pos keyword argument try: axis_pos = kwargs["axis_pos"] except KeyError: axis_pos = 0 integration = 0 integration_error2 = 0 for i in range(hlr_utils.get_length(obj)): value = hlr_utils.get_value(obj,i,o_descr,axis,axis_pos) error = hlr_utils.get_err2(obj,i,o_descr,axis,axis_pos) if end == -1: value = value[start:] error = error[start:] else: value = value[start:end] error = error[start:end] for (val,err) in map(None, value, error): integration += val integration_error2 += err return (integration,integration_error2) | 6fe6bd8f1c3a8e6b1bc8ec8a02a774c1f6891ea9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/6fe6bd8f1c3a8e6b1bc8ec8a02a774c1f6891ea9/hlr_integrate_axis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23367,
67,
4890,
12,
2603,
16,
2826,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
578,
279,
7460,
471,
11301,
815,
326,
864,
2654,
18,
1021,
445,
13041,
716,
326,
6935,
501,
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,
23367,
67,
4890,
12,
2603,
16,
2826,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
578,
279,
7460,
471,
11301,
815,
326,
864,
2654,
18,
1021,
445,
13041,
716,
326,
6935,
501,
353,
... |
'on_reboot', 'on_crash', 'vcpus', 'vcpu_avail', 'features', 'on_xend_start', 'on_xend_stop', 'target', 'cpuid', 'cpuid_check', 'machine_address_size', 'suppress_spurious_page_faults']) | 'on_reboot', 'on_crash', 'features', 'on_xend_start', 'on_xend_stop', 'target', 'cpuid', 'cpuid_check', 'machine_address_size', 'suppress_spurious_page_faults']) vcpu_conf() | def add_conf(n): if hasattr(vals, n): v = getattr(vals, n) if v: config.append([n, v]) | 9a443e7526585d3b28c0343d0c9b0a8818a94625 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6195/9a443e7526585d3b28c0343d0c9b0a8818a94625/create.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3923,
12,
82,
4672,
309,
3859,
12,
4524,
16,
290,
4672,
331,
273,
3869,
12,
4524,
16,
290,
13,
309,
331,
30,
642,
18,
6923,
3816,
82,
16,
331,
5717,
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,
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,
527,
67,
3923,
12,
82,
4672,
309,
3859,
12,
4524,
16,
290,
4672,
331,
273,
3869,
12,
4524,
16,
290,
13,
309,
331,
30,
642,
18,
6923,
3816,
82,
16,
331,
5717,
2,
-100,
-100,
-100,
-... |
if execcheckfile != None: execlog = execcheckfile.strip('good')+'exec.out.tmp' else: execlog = execname+'.'+str(compoptsnum)+'-'+str(execoptsnum)+'.exec.out.tmp' | execlog = execname+'.'+str(compoptsnum)+'-'+str(execoptsnum)+'.exec.out.tmp' | def kill_proc(p, timeout): k = subprocess.Popen(['kill',str(p.pid)]) k.wait() now = time.time() end_time = now + timeout # give it a little time while end_time > now: if p.poll(): return now = time.time() # use the big hammer (and don't bother waiting) subprocess.Popen(['kill','-9', str(p.pid)]) return | 97dd26e665e2ca235f4c8596da4b25c90663de32 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6895/97dd26e665e2ca235f4c8596da4b25c90663de32/sub_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
9381,
12,
84,
16,
2021,
4672,
417,
273,
6652,
18,
52,
3190,
12,
3292,
16418,
2187,
701,
12,
84,
18,
6610,
13,
5717,
417,
18,
7048,
1435,
2037,
273,
813,
18,
957,
1435,
679,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8673,
67,
9381,
12,
84,
16,
2021,
4672,
417,
273,
6652,
18,
52,
3190,
12,
3292,
16418,
2187,
701,
12,
84,
18,
6610,
13,
5717,
417,
18,
7048,
1435,
2037,
273,
813,
18,
957,
1435,
679,... |
name.replace(Name(self.DECORATOR_NAME, prefix=name.get_prefix())) | name.replace(Name(self.DECORATOR_NAME, prefix=name.prefix)) | def transform(self, node, results): if 'name' in results: # This matched an import statement. Fix that up: name = results["name"] name.replace(Name(self.DECORATOR_NAME, prefix=name.get_prefix())) if 'rename' in results: # The import statement use import as self._add_pattern("'%s'" % results['rename'].value) if 'interface_rename' in results: self._add_pattern("'%s' trailer< '.' '%s' > " % ( results['interface_rename'].value, self.FUNCTION_NAME)) if 'statement' in results: # This matched a class that has an <FUNCTION_NAME>(IFoo) statement. # We must convert that statement to a class decorator # and put it before the class definition. statement = results['statement'] if not isinstance(statement, list): statement = [statement] # Make a copy for insertion before the class: statement = [x.clone() for x in statement] # Get rid of leading whitespace: statement[0].prefix = '' # Rename function to decorator: if statement[-1].children: func = statement[-1].children[-1] else: func = statement[-1] if func.value == self.FUNCTION_NAME: func.value = self.DECORATOR_NAME interface = results['interface'] if not isinstance(interface, list): interface = [interface] interface = [x.clone() for x in interface] | 864cdb407c17834f96f311325fe9c0dc8b150cf1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9750/864cdb407c17834f96f311325fe9c0dc8b150cf1/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
12,
2890,
16,
756,
16,
1686,
4672,
309,
296,
529,
11,
316,
1686,
30,
468,
1220,
4847,
392,
1930,
3021,
18,
12139,
716,
731,
30,
508,
273,
1686,
9614,
529,
11929,
508,
18,
2079,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2510,
12,
2890,
16,
756,
16,
1686,
4672,
309,
296,
529,
11,
316,
1686,
30,
468,
1220,
4847,
392,
1930,
3021,
18,
12139,
716,
731,
30,
508,
273,
1686,
9614,
529,
11929,
508,
18,
2079,
... |
messages=False | self.site().messages=False | def getEditPage(self, get_redirect=False, throttle = True, sysop = False, oldid = None, nofollow_redirects = False): """ Get the contents of the Page via the edit page. Do not use this directly, use get() instead. | e4bd616ff92c7c3c48c1e1d51e77f36de3451623 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/e4bd616ff92c7c3c48c1e1d51e77f36de3451623/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21221,
1964,
12,
2890,
16,
336,
67,
7590,
33,
8381,
16,
18304,
273,
1053,
16,
2589,
556,
273,
1083,
16,
1592,
350,
273,
599,
16,
290,
792,
2392,
67,
22715,
273,
1083,
4672,
3536,
968,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21221,
1964,
12,
2890,
16,
336,
67,
7590,
33,
8381,
16,
18304,
273,
1053,
16,
2589,
556,
273,
1083,
16,
1592,
350,
273,
599,
16,
290,
792,
2392,
67,
22715,
273,
1083,
4672,
3536,
968,
... |
if step <= 0: raise ValueError, "step (=%s) must be positive"%step | if step == 0: raise ValueError, "step size must be nonzero" | def srange(a,b=None,step=1, include_endpoint=False): """ Return list of numbers \code{a, a+step, ..., a+k*step}, where \code{a+k*step < b} and \code{a+(k+1)*step > b}. This is the best way to get an iterator over SAGE integers as opposed to Python int's. It also allows you to specify step sizes to iterate. It is potentially much slower than the Python range statement, depending on your application. INPUT: a -- number b -- number (default: None) step -- number (default: 1) OUTPUT: list If b is None, then b is set equal to a and a is set equal to the 0 in the parent of b. Unlike range, a and b can be any type of numbers, and the resulting list involves numbers of that type. NOTE: This function is called \code{srange} to distinguish it from the builtin Python \code{range} command. The s at the beginning of the name stands for ``SAGE''. SEE ALSO: xsrange -- iterator version EXAMPLES: sage: v = srange(5); v [0, 1, 2, 3, 4] sage: type(v[2]) <type 'integer.Integer'> sage: srange(1, 10) [1, 2, 3, 4, 5, 6, 7, 8, 9] sage: Q = RationalField() sage: srange(1,10,Q('1/2')) [1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5, 11/2, 6, 13/2, 7, 15/2, 8, 17/2, 9, 19/2] sage: R = RealField() sage: srange(1,5,R('0.5')) [1, 1.5000000000000000, 2.0000000000000000, 2.5000000000000000, 3.0000000000000000, 3.5000000000000000, 4.0000000000000000, 4.5000000000000000] sage: srange(0,1,R('0.4')) [0, 0.40000000000000002, 0.80000000000000004] """ if b is None: b = a try: a = b.parent()(0) except AttributeError: a = type(b)(0) if step <= 0: raise ValueError, "step (=%s) must be positive"%step num_steps = int(float((b-a)/step)) + 1 v = [a] + [a + k*step for k in range(1,num_steps)] if v[num_steps-1] >= b: if include_endpoint: return v[:-1] + [b] else: return v[:-1] else: return v | 16d466cd3656832f743210eb6d553eeed1c61c07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/16d466cd3656832f743210eb6d553eeed1c61c07/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
3676,
12,
69,
16,
70,
33,
7036,
16,
4119,
33,
21,
16,
2341,
67,
8003,
33,
8381,
4672,
3536,
2000,
666,
434,
5600,
521,
710,
95,
69,
16,
279,
15,
4119,
16,
1372,
16,
279,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
3676,
12,
69,
16,
70,
33,
7036,
16,
4119,
33,
21,
16,
2341,
67,
8003,
33,
8381,
4672,
3536,
2000,
666,
434,
5600,
521,
710,
95,
69,
16,
279,
15,
4119,
16,
1372,
16,
279,
15,
... |
for i, f in enum([f['name'] for f in fields]): | i = 0 for f in [f['name'] for f in fields if f['type'] != 'textarea']: | def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['type'] != 'textarea' and f['name'] not in ('summary', 'cc')] t = self.modtime or tkt.time_changed width = [0, 0, 0, 0] for i, f in enum([f['name'] for f in fields]): if not tkt.values.has_key(f): continue fval = tkt[f] if fval.find('\n') > -1: continue idx = 2 * (i % 2) if len(f) > width[idx]: width[idx] = len(f) if len(fval) > width[idx + 1]: width[idx + 1] = len(fval) format = ('%%%is: %%-%is | ' % (width[0], width[1]), ' %%%is: %%-%is%s' % (width[2], width[3], CRLF)) l = (width[0] + width[1] + 5) sep = l * '-' + '+' + (self.COLS - l) * '-' txt = sep + CRLF big = [f for f in tkt.fields if f['type'] == 'textarea' and f['name'] != 'description'] i = 0 for f in [f['name'] for f in fields]: if not tkt.values.has_key(f): continue fval = tkt[f] if '\n' in str(fval): big.append((f.capitalize(), CRLF.join(fval.splitlines()))) else: txt += format[i % 2] % (f.capitalize(), fval) i += 1 if not i % 2: txt += CRLF if big: txt += sep for name, value in big: txt += CRLF.join(['', name + ':', value, '', '']) txt += sep return txt | 7b38e5e2562a1b297a40077b152eab2636e37614 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/7b38e5e2562a1b297a40077b152eab2636e37614/Notify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
9693,
12,
2890,
4672,
268,
8629,
273,
365,
18,
16282,
1466,
273,
306,
74,
364,
284,
316,
268,
8629,
18,
2821,
309,
284,
3292,
723,
3546,
480,
296,
16701,
11,
471,
284,
3292,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
740,
67,
9693,
12,
2890,
4672,
268,
8629,
273,
365,
18,
16282,
1466,
273,
306,
74,
364,
284,
316,
268,
8629,
18,
2821,
309,
284,
3292,
723,
3546,
480,
296,
16701,
11,
471,
284,
3292,
... |
raise DistutilsFileError, "could not open %s: %s" % (src, errstr) | raise DistutilsFileError, \ "could not open '%s': %s" % (src, errstr) | def _copy_file_contents (src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files.""" # Stolen from shutil module in the standard library, but with # custom error-handling added. fsrc = None fdst = None try: try: fsrc = open(src, 'rb') except os.error, (errno, errstr): raise DistutilsFileError, "could not open %s: %s" % (src, errstr) try: fdst = open(dst, 'wb') except os.error, (errno, errstr): raise DistutilsFileError, "could not create %s: %s" % (dst, errstr) while 1: try: buf = fsrc.read (buffer_size) except os.error, (errno, errstr): raise DistutilsFileError, \ "could not read from %s: %s" % (src, errstr) if not buf: break try: fdst.write(buf) except os.error, (errno, errstr): raise DistutilsFileError, \ "could not write to %s: %s" % (dst, errstr) finally: if fdst: fdst.close() if fsrc: fsrc.close() | 031994d923a677aa78f425f5289409ea94321872 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/031994d923a677aa78f425f5289409ea94321872/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3530,
67,
768,
67,
3980,
261,
4816,
16,
3046,
16,
1613,
67,
1467,
33,
2313,
14,
2163,
3247,
4672,
3536,
2951,
326,
585,
296,
4816,
11,
358,
296,
11057,
13506,
3937,
1297,
506,
906... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3530,
67,
768,
67,
3980,
261,
4816,
16,
3046,
16,
1613,
67,
1467,
33,
2313,
14,
2163,
3247,
4672,
3536,
2951,
326,
585,
296,
4816,
11,
358,
296,
11057,
13506,
3937,
1297,
506,
906... |
return socket.gethostbyname(name) | try: return socket.gethostbyname(name) except socket.gaierror: raise NetworkAddressError("The name '%s' could not be resolved." % name) except TypeError: raise ArgumentError("gethostbyname() takes a string as argument.") | def gethostbyname(name): """ <Purpose> Provides information about a hostname. Calls socket.gethostbyname(). Translate a host name to IPv4 address format. The IPv4 address is returned as a string, such as '100.50.200.5'. If the host name is an IPv4 address itself it is returned unchanged. <Arguments> name: The host name to translate. <Exceptions> NetworkAddressError (descends from NetworkError) if the address cannot be resolved. <Side Effects> None. <Resource Consumption> This operation consumes network bandwidth of 4K netrecv, 1K netsend. (It's hard to tell how much was actually sent / received at this level.) <Returns> The IPv4 address as a string. """ restrictions.assertisallowed('gethostbyname',name) # charge 4K for a look up... I don't know the right number, but we should # charge something. We'll always charge to the netsend interface... nanny.tattle_quantity('netsend', 1024) nanny.tattle_quantity('netrecv', 4096) return socket.gethostbyname(name) | 6ba7a3a02514a1aaa385cf7a33ecec136b06aa93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7280/6ba7a3a02514a1aaa385cf7a33ecec136b06aa93/emulcomm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2564,
1637,
529,
12,
529,
4672,
3536,
411,
10262,
4150,
34,
28805,
1779,
2973,
279,
5199,
18,
23665,
2987,
18,
75,
546,
669,
1637,
529,
7675,
16820,
279,
1479,
508,
358,
7853,
24,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2564,
1637,
529,
12,
529,
4672,
3536,
411,
10262,
4150,
34,
28805,
1779,
2973,
279,
5199,
18,
23665,
2987,
18,
75,
546,
669,
1637,
529,
7675,
16820,
279,
1479,
508,
358,
7853,
24,
... |
PDB defined standard residues. PDB standard residues are amino | PDB defined standard residues. PDB standard residues are amino | def is_standard_residue(self): """Returns True if the Fragment/Residue object is one of the PDB defined standard residues. PDB standard residues are amino and nucleic acid residues. """ return False | a181eacbeb3c68b8f7caba918a821d3f3e6c50f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10674/a181eacbeb3c68b8f7caba918a821d3f3e6c50f6/Structure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
10005,
67,
23388,
12,
2890,
4672,
3536,
1356,
1053,
309,
326,
18009,
19,
607,
23965,
733,
353,
1245,
434,
326,
21601,
2553,
4529,
25435,
18,
21601,
4529,
25435,
854,
26117,
471,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
10005,
67,
23388,
12,
2890,
4672,
3536,
1356,
1053,
309,
326,
18009,
19,
607,
23965,
733,
353,
1245,
434,
326,
21601,
2553,
4529,
25435,
18,
21601,
4529,
25435,
854,
26117,
471,
... |
if os.name == 'nt' or ( os.uname()[0].lower().startswith('cygwin') and get_toolset() != 'gcc') : | if (os.name == 'nt' or os.uname()[0].lower().startswith('cygwin')) and get_toolset() != 'gcc': | #ifdef _WIN32 | e825755eedd13b068e03df70d37f204dbdb51f14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9981/e825755eedd13b068e03df70d37f204dbdb51f14/searched_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
389,
24572,
1578,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
389,
24572,
1578,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
marshal.load(file(test_support.TESTFN, "rb")) | new = marshal.load(file(test_support.TESTFN, "rb")) | def test_string(self): for s in ["", "Andr Previn", "abc", " "*10000]: new = marshal.loads(marshal.dumps(s)) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) marshal.dump(s, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(s, new) self.assertEqual(type(s), type(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,
1080,
12,
2890,
4672,
364,
272,
316,
8247,
3113,
315,
1876,
86,
2962,
21529,
3113,
315,
18947,
3113,
315,
15902,
23899,
14542,
394,
273,
10893,
18,
17135,
12,
3108,
18,
13302,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1080,
12,
2890,
4672,
364,
272,
316,
8247,
3113,
315,
1876,
86,
2962,
21529,
3113,
315,
18947,
3113,
315,
15902,
23899,
14542,
394,
273,
10893,
18,
17135,
12,
3108,
18,
13302,
... |
self.Widget = gtk.ColorButton() Tooltips.set_tip(self.Widget, self.Setting.LongDesc) self.Widget.set_use_alpha(True) self.Widget.connect('color-set', self.Changed) | self.Button = gtk.ColorButton() self.Button.set_size_request (100, -1) Tooltips.set_tip(self.Button, self.Setting.LongDesc) self.Button.set_use_alpha(True) self.Button.connect('color-set', self.Changed) self.Widget = gtk.Alignment (1, 0.5) self.Widget.add (self.Button) | def _Init(self): self.Widget = gtk.ColorButton() Tooltips.set_tip(self.Widget, self.Setting.LongDesc) self.Widget.set_use_alpha(True) self.Widget.connect('color-set', self.Changed) | da13cd1ea63c9d893ebf5ee6f16025f25a623512 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7183/da13cd1ea63c9d893ebf5ee6f16025f25a623512/Settings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2570,
12,
2890,
4672,
365,
18,
4609,
273,
22718,
18,
2957,
3616,
1435,
13288,
88,
7146,
18,
542,
67,
14587,
12,
2890,
18,
4609,
16,
365,
18,
5568,
18,
3708,
4217,
13,
365,
18,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2570,
12,
2890,
4672,
365,
18,
4609,
273,
22718,
18,
2957,
3616,
1435,
13288,
88,
7146,
18,
542,
67,
14587,
12,
2890,
18,
4609,
16,
365,
18,
5568,
18,
3708,
4217,
13,
365,
18,
4... |
def key_class(updates, image_strip, image_rects, is_white=True): | def key_class(updates, image_strip, image_rects, is_white_key=True): | def key_class(updates, image_strip, image_rects, is_white=True): """Return a keyboard key widget class Arguments: updates - a set into which a key instance adds itself if it needs redrawing. image_strip - The surface containing the images of all key states. image_rects - A list of Rects giving the regions within image_strip that are relevant to this key class. is_white (default True) - Set false if this is a black key. This function automates the creation of a key widget class for the three basic key types. A key has two basic states, up or down ( depressed). Corresponding up and down images are drawn for each of these two states. But to give the illusion of depth, a key may have shadows cast upon it by the adjacent keys to its right. These shadows change depending on the up/down state of the key and its neighbors. So a key may support multiple images and states depending on the shadows. A key type is determined by the length of image_rects and the value of is_white. """ # Naming convention: Variables used by the Key class as part of a # closure start with 'c_'. # State logic and shadows: # # A key may cast a shadow upon the key to its left. A black key casts a # shadow on an adjacent white key. The shadow changes depending of whether # the black or white key is depressed. A white key casts a shadow on the # white key to its left if it is up and the left key is down. Therefore # a keys state, and image it will draw, is determined entirely by its # itself and the key immediately adjacent to it on the right. A white key # is always assumed to have an adjacent white key. # # There can be up to eight key states, representing all permutations # of the three fundamental states of self up/down, adjacent white # right up/down, adjacent black up/down. # down_state_none = 0 down_state_self = 1 down_state_white = down_state_self << 1 down_state_self_white = down_state_self | down_state_white down_state_black = down_state_white << 1 down_state_self_black = down_state_self | down_state_black down_state_white_black = down_state_white | down_state_black down_state_all = down_state_self | down_state_white_black # Some values used in the class. # c_down_state_initial = down_state_none c_down_state_rect_initial = image_rects[0] c_down_state_self = down_state_self c_updates = updates c_image_strip = image_strip c_width, c_height = image_rects[0].size # A key propagates its up/down state change to the adjacent white key on # the left by calling the adjacent key's _right_black_down or # _right_white_down method. # if is_white: key_color = 'white' else: key_color = 'black' c_notify_down_method = "_right_%s_down" % key_color c_notify_up_method = "_right_%s_up" % key_color # Images: # # A black key only needs two images, for the up and down states. Its # appearance is unaffected by the adjacent keys to its right, which cast no # shadows upon it. # # A white key with a no adjacent black to its right only needs three # images, for self up, self down, and both self and adjacent white down. # # A white key with both a black and white key to its right needs six # images: self up, self up and adjacent black down, self down, self and # adjacent white down, self and adjacent black down, and all three down. # # Each 'c_event' dictionary maps the current key state to a new key state, # along with corresponding image, for the related event. If no redrawing # is required for the state change then the image rect is simply None. # c_event_down = {down_state_none: (down_state_self, image_rects[1])} c_event_up = {down_state_self: (down_state_none, image_rects[0])} c_event_right_white_down = { down_state_none: (down_state_none, None), down_state_self: (down_state_self, None)} c_event_right_white_up = c_event_right_white_down.copy() c_event_right_black_down = c_event_right_white_down.copy() c_event_right_black_up = c_event_right_white_down.copy() if len(image_rects) > 2: c_event_down[down_state_white] = ( down_state_self_white, image_rects[2]) c_event_up[down_state_self_white] = (down_state_white, image_rects[0]) c_event_right_white_down[down_state_none] = (down_state_white, None) c_event_right_white_down[down_state_self] = ( down_state_self_white, image_rects[2]) c_event_right_white_up[down_state_white] = (down_state_none, None) c_event_right_white_up[down_state_self_white] = ( down_state_self, image_rects[1]) c_event_right_black_down[down_state_white] = ( down_state_white, None) c_event_right_black_down[down_state_self_white] = ( down_state_self_white, None) c_event_right_black_up[down_state_white] = ( down_state_white, None) c_event_right_black_up[down_state_self_white] = ( down_state_self_white, None) if len(image_rects) > 3: c_event_down[down_state_black] = (down_state_self_black, image_rects[4]) c_event_down[down_state_white_black] = (down_state_all, image_rects[5]) c_event_up[down_state_self_black] = (down_state_black, image_rects[3]) c_event_up[down_state_all] = (down_state_white_black, image_rects[3]) c_event_right_white_down[down_state_black] = ( down_state_white_black, None) c_event_right_white_down[down_state_self_black] = ( down_state_all, image_rects[5]) c_event_right_white_up[down_state_white_black] = ( down_state_black, None) c_event_right_white_up[down_state_all] = ( down_state_self_black, image_rects[4]) c_event_right_black_down[down_state_none] = ( down_state_black, image_rects[3]) c_event_right_black_down[down_state_self] = ( down_state_self_black, image_rects[4]) c_event_right_black_down[down_state_white] = ( down_state_white_black, image_rects[3]) c_event_right_black_down[down_state_self_white] = ( down_state_all, image_rects[5]) c_event_right_black_up[down_state_black] = ( down_state_none, image_rects[0]) c_event_right_black_up[down_state_self_black] = ( down_state_self, image_rects[1]) c_event_right_black_up[down_state_white_black] = ( down_state_white, image_rects[0]) c_event_right_black_up[down_state_all] = ( down_state_self_white, image_rects[2]) class Key(object): """A key widget, maintains key state and draws the key's image Constructor arguments: ident - A unique key identifier. Any immutable type suitable as a key. posn - The location of the key on the display surface. key_left - Optional, the adjacent white key to the left. Changes in up and down state are propagated to that key. A key has an associated position and state. Related to state is the image drawn. State changes are managed with method calls, one method per event type. The up and down event methods are public. Other internal methods are for passing on state changes to the key_left key instance. The key will evaluate True if it is down, False otherwise. """ def __init__(self, ident, posn, key_left = None): """Return a new Key instance The initial state is up, with all adjacent keys to the right also up. """ if key_left is None: key_left = null_key rect = Rect(posn[0], posn[1], c_width, c_height) self.rect = rect self._state = c_down_state_initial self._source_rect = c_down_state_rect_initial self._ident = ident self._hash = hash(ident) self._notify_down = getattr(key_left, c_notify_down_method) self._notify_up = getattr(key_left, c_notify_up_method) self._key_left = key_left self._background_rect = Rect(rect.left, rect.bottom - 10, c_width, 10) c_updates.add(self) def down(self): """Signal that this key has been depressed (is down)""" self._state, source_rect = c_event_down[self._state] if source_rect is not None: self._source_rect = source_rect c_updates.add(self) self._notify_down() def up(self): """Signal that this key has been released (is up)""" self._state, source_rect = c_event_up[self._state] if source_rect is not None: self._source_rect = source_rect c_updates.add(self) self._notify_up() def _right_white_down(self): """Signal that the adjacent white key has been depressed This method is for internal propagation of events between key instances. """ self._state, source_rect = c_event_right_white_down[self._state] if source_rect is not None: self._source_rect = source_rect c_updates.add(self) def _right_white_up(self): """Signal that the adjacent white key has been released This method is for internal propagation of events between key instances. """ self._state, source_rect = c_event_right_white_up[self._state] if source_rect is not None: self._source_rect = source_rect c_updates.add(self) def _right_black_down(self): """Signal that the adjacent black key has been depressed This method is for internal propagation of events between key instances. """ self._state, source_rect = c_event_right_black_down[self._state] if source_rect is not None: self._source_rect = source_rect c_updates.add(self) def _right_black_up(self): """Signal that the adjacent black key has been released This method is for internal propagation of events between key instances. """ self._state, source_rect = c_event_right_black_up[self._state] if source_rect is not None: self._source_rect = source_rect c_updates.add(self) def __eq__(self, other): """True if same identifiers""" return self._ident == other._ident def __hash__(self): """Return the immutable hash value""" return self._hash def __str__(self): """Return the key's identifier and position as a string""" return ("<Key %s at (%d, %d)>" % (self._ident, self.rect.top, self.rect.left)) def __nonzero__(self): """True if the key is down""" return bool(self._state & c_down_state_self) def draw(self, surf, background, dirty_rects): """Redraw the key on the surface surf The background is redrawn. The altered region is added to the dirty_rects list. """ surf.blit(background, self._background_rect, self._background_rect) surf.blit(c_image_strip, self.rect, self._source_rect) dirty_rects.append(self.rect) return Key | 9e61bac9fc6608263eef619c47ffd88c510cb83f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1298/9e61bac9fc6608263eef619c47ffd88c510cb83f/midi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
67,
1106,
12,
14703,
16,
1316,
67,
6406,
16,
1316,
67,
2607,
87,
16,
353,
67,
14739,
67,
856,
33,
5510,
4672,
3536,
990,
279,
16263,
498,
3604,
667,
225,
13599,
30,
4533,
300,
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,
498,
67,
1106,
12,
14703,
16,
1316,
67,
6406,
16,
1316,
67,
2607,
87,
16,
353,
67,
14739,
67,
856,
33,
5510,
4672,
3536,
990,
279,
16263,
498,
3604,
667,
225,
13599,
30,
4533,
300,
2... |
option_tuple = self._parse_optional(arg_string) | option_tuple = self._parse_optional(arg_string, contiguous) | def _parse_known_args(self, arg_strings, namespace, contiguous): # replace arg strings that are file references if self.fromfile_prefix_chars is not None: arg_strings = self._read_args_from_files(arg_strings) | c59109f5a551e93851187af656e0f8ca78dcb5a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5223/c59109f5a551e93851187af656e0f8ca78dcb5a2/argparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
2994,
67,
1968,
12,
2890,
16,
1501,
67,
10219,
16,
1981,
16,
26928,
4672,
468,
1453,
1501,
2064,
716,
854,
585,
5351,
309,
365,
18,
2080,
768,
67,
3239,
67,
7549,
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,
2670,
67,
2994,
67,
1968,
12,
2890,
16,
1501,
67,
10219,
16,
1981,
16,
26928,
4672,
468,
1453,
1501,
2064,
716,
854,
585,
5351,
309,
365,
18,
2080,
768,
67,
3239,
67,
7549,
353,
... |
if type(orig_key) is types.TupleType: | if isinstance(orig_key, tuple): | def _map_and_prefix_keys(self, key_iterable, key_prefix): """Compute the mapping of server (_Host instance) -> list of keys to stuff onto that server, as well as the mapping of prefixed key -> original key. | aa973f034fdfe4801db987afda8191177edefc04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11935/aa973f034fdfe4801db987afda8191177edefc04/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1458,
67,
464,
67,
3239,
67,
2452,
12,
2890,
16,
498,
67,
15364,
16,
498,
67,
3239,
4672,
3536,
7018,
326,
2874,
434,
1438,
261,
67,
2594,
791,
13,
317,
666,
434,
1311,
358,
107... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
1458,
67,
464,
67,
3239,
67,
2452,
12,
2890,
16,
498,
67,
15364,
16,
498,
67,
3239,
4672,
3536,
7018,
326,
2874,
434,
1438,
261,
67,
2594,
791,
13,
317,
666,
434,
1311,
358,
107... |
sage: import os; os.unlink(filename) | sage: import os; os.unlink(filename) | def plot(self, *args, **kwargs): """ The R plot function. Type r.help('plot') for much more extensive documentatin about this function. See the examples below for how to use it to write output to a FILE. | 42a77e19371576e2f0fa4a64916832f43f940a8c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/42a77e19371576e2f0fa4a64916832f43f940a8c/r.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
1021,
534,
3207,
445,
18,
225,
1412,
436,
18,
5201,
2668,
4032,
6134,
364,
9816,
1898,
1110,
14315,
1668,
270,
267,
2973,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
1021,
534,
3207,
445,
18,
225,
1412,
436,
18,
5201,
2668,
4032,
6134,
364,
9816,
1898,
1110,
14315,
1668,
270,
267,
2973,
333,
... |
return os.getcwd() | return "Not implemented, for now" | def index(self, format='html'): """GET /uploads: All items in the collection""" # url('uploads') return os.getcwd() | b840397e72564d270e2a724ec5a44823ba42f79b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4401/b840397e72564d270e2a724ec5a44823ba42f79b/uploads.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
16,
740,
2218,
2620,
11,
4672,
3536,
3264,
342,
27717,
30,
4826,
1516,
316,
326,
1849,
8395,
468,
880,
2668,
27717,
6134,
327,
1140,
18,
588,
11089,
1435,
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,
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,
770,
12,
2890,
16,
740,
2218,
2620,
11,
4672,
3536,
3264,
342,
27717,
30,
4826,
1516,
316,
326,
1849,
8395,
468,
880,
2668,
27717,
6134,
327,
1140,
18,
588,
11089,
1435,
2,
-100,
-100,
... |
items = self._items lock = self.gateway._channelfactory._receivelock lock.acquire() try: _callbacks = self.gateway._channelfactory._callbacks dictvalue = (callback, endmarker) if _callbacks.setdefault(self.id, dictvalue) != dictvalue: | _callbacks = self.gateway._channelfactory._callbacks _receivelock = self.gateway._channelfactory._receivelock _receivelock.acquire() try: if self._items is None: | def setcallback(self, callback, endmarker=NO_ENDMARKER_WANTED): items = self._items lock = self.gateway._channelfactory._receivelock lock.acquire() try: _callbacks = self.gateway._channelfactory._callbacks dictvalue = (callback, endmarker) if _callbacks.setdefault(self.id, dictvalue) != dictvalue: raise IOError("%r has callback already registered" %(self,)) self._items = None while 1: try: olditem = items.get(block=False) except queue.Empty: break else: if olditem is ENDMARKER: items.put(olditem) break else: callback(olditem) if self._closed or self._receiveclosed.isSet(): # no need to keep a callback self.gateway._channelfactory._close_callback(self.id) finally: lock.release() | a5bfb8e501203c8e51497d9683602631bf98cb56 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7009/a5bfb8e501203c8e51497d9683602631bf98cb56/gateway_base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
3394,
12,
2890,
16,
1348,
16,
679,
11145,
33,
3417,
67,
4415,
25989,
67,
26499,
6404,
4672,
1377,
389,
13316,
273,
365,
18,
11127,
6315,
4327,
6848,
6315,
13316,
389,
8606,
427,
292... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3394,
12,
2890,
16,
1348,
16,
679,
11145,
33,
3417,
67,
4415,
25989,
67,
26499,
6404,
4672,
1377,
389,
13316,
273,
365,
18,
11127,
6315,
4327,
6848,
6315,
13316,
389,
8606,
427,
292... |
atoms.s.append(atoms.r - atoms.r_old) | self.s.append(self.r - self.r_old) | def step(self, f): atoms = self.atoms self.ni = atoms.nimages-2 # try: atoms.imax # except: atoms.imax=0 # if(not self.ni):atoms.imax=1 g = open('out','w') atoms.r = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.r[i-1] = atoms.images[i].get_positions() print >> g,'atoms.r',atoms.r atoms.f = npy.zeros((self.ni, atoms.natoms, self.dim), 'd') for i in range(1, atoms.nimages-1): atoms.f[i-1] = atoms.images[i].get_forces() print >> g,'atoms.f',atoms.f try: atoms.start except:atoms.start=0 if(not atoms.start): atoms.start = 1 atoms.a = npy.zeros(self.memory+1, 'd') self.ptmp = atoms self.maxstep = npy.sqrt(self.maxstep * self.ni) atoms.lbfgsinit = 0 try: atoms.lbfgsinit except:atoms.lbfgsinit=0 if(not atoms.lbfgsinit): atoms.lbfgsinit = 1 atoms.Ho = npy.ones((self.ni, atoms.natoms, self.dim), 'd') if (not self.min=='line'):atoms.Ho = atoms.Ho * self.alpha atoms.ITR = 1 atoms.s = [1.] atoms.y = [1.] atoms.rho = [1.] else: a1 = abs (npy.vdot(atoms.f, atoms.f_old)) a2 = npy.vdot(atoms.f_old, atoms.f_old) print 'a1,a2 created',a1,a2 if(self.min=='line'): if(a1<=0.5* a2 and a2!=0): reset_flag = 0 else: reset_flag = 1 else: reset_flag = 0 if(reset_flag==0): g1 = open('out1','w') g2 = open('out2','w') print >> g1,'atoms.r',atoms.r print >> g2,'atoms.r_old',atoms.r_old ITR = atoms.ITR#correctly generated if(ITR > self.memory): atoms.s.pop(1) atoms.y.pop(1) atoms.rho.pop(1) ITR=self.memory atoms.s.append(atoms.r - atoms.r_old)#!!atoms.r is not updating # boundry cond # for i in range(atoms.ni): # if(method=='min'):i=0 # try: # DBC(atoms.s[ITR][i],atoms.p[i].Box) #need to make matrix for box # except: # print "Box not found." # if(method=='min'):break atoms.y.append(-(atoms.f-atoms.f_old)) atoms.rho.append(1/npy.vdot(atoms.y[ITR],atoms.s[ITR])) atoms.ITR += 1 else: | 689ed3715e535adf898039f50971002aa6c5a5e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/689ed3715e535adf898039f50971002aa6c5a5e9/glbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2235,
12,
2890,
16,
284,
4672,
9006,
273,
365,
18,
14937,
365,
18,
15834,
273,
9006,
18,
82,
7369,
17,
22,
468,
775,
30,
9006,
18,
381,
651,
468,
1335,
30,
9006,
18,
381,
651,
33,
... |
"""Returns first index id where the field code FIELD is indexed. Returns zero in case there is no table for this index. Example: field='author', output=4.""" | """ Return index id with name corresponding to FIELD, or the first index id where the logical field code named FIELD is indexed. Return zero in case there is no index defined for this field. Example: field='author', output=4. """ | def get_index_id_from_field(field): """Returns first index id where the field code FIELD is indexed. Returns zero in case there is no table for this index. Example: field='author', output=4.""" out = 0 if field == '': field = 'anyfield' # empty string field means 'anyfield' res = run_sql("""SELECT w.id FROM idxINDEX AS w, idxINDEX_field AS wf, field AS f WHERE f.code=%s AND wf.id_field=f.id AND w.id=wf.id_idxINDEX LIMIT 1""", (field,)) if res: out = res[0][0] return out | ecba2d17f2c659fb5f546a1510c9950bb439cc75 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2139/ecba2d17f2c659fb5f546a1510c9950bb439cc75/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1615,
67,
350,
67,
2080,
67,
1518,
12,
1518,
4672,
3536,
2000,
770,
612,
598,
508,
4656,
358,
9921,
16,
578,
326,
1122,
770,
612,
1625,
326,
6374,
652,
981,
4141,
9921,
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,
336,
67,
1615,
67,
350,
67,
2080,
67,
1518,
12,
1518,
4672,
3536,
2000,
770,
612,
598,
508,
4656,
358,
9921,
16,
578,
326,
1122,
770,
612,
1625,
326,
6374,
652,
981,
4141,
9921,
353,
... |
for y in xrange(self.y, self.y + self.height, self.height/num): line = Rect(self.x, y, self.width, self.height/num) | if num == 1: yVals = [self.y] else: yVals = frange(self.y, self.y + h, h/num) for y in yVals: stripe = Rect(self.x, y, w, h/num) | def draw(self): # general widget bits group = Group() rect = Rect(self.x, self.y, self.width, self.height) rect.strokeColor = self.strokeColor rect.strokeWidth = self.strokeWidth rect.fillColor = None group.add(rect) | 2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/2a3e6fc48d80b9c6c5c11a9c8c3f597a854a27ab/grids.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
468,
7470,
3604,
4125,
1041,
273,
3756,
1435,
225,
4917,
273,
9315,
12,
2890,
18,
92,
16,
365,
18,
93,
16,
365,
18,
2819,
16,
365,
18,
4210,
13,
4917,
18,
16181... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3724,
12,
2890,
4672,
468,
7470,
3604,
4125,
1041,
273,
3756,
1435,
225,
4917,
273,
9315,
12,
2890,
18,
92,
16,
365,
18,
93,
16,
365,
18,
2819,
16,
365,
18,
4210,
13,
4917,
18,
16181... |
"""Calls calculateTangentLists with the constructor parameters and merges tangent lists when merging edges.""" | """Stores precomputed tangent lists for each edge and merges then when merging edges.""" | def calculateTangentListsGaussianReflective(map, sigma, diff=0.0): """calculateTangentListsGaussianReflective(map, sigma, diff=0.0) Add 'tangents' property to all edges, containing the result of running tangentListGaussianReflective on it with the given parameters. Note that all edges which are too small will have an empty 'tangents' list.""" result = [None] * map.maxEdgeLabel() for edge in map.edgeIter(): try: result[edge.label()] = tangentListGaussianReflective(edge, sigma, diff) except RuntimeError: sys.stderr.write("calculateTangentListsGaussianReflective: %s too short!\n" % edge) return result | 4ef96517287a1d5ca47341c77866d3cec450dc72 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/4ef96517287a1d5ca47341c77866d3cec450dc72/statistics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
56,
24255,
7432,
43,
12086,
24452,
688,
12,
1458,
16,
7299,
16,
3122,
33,
20,
18,
20,
4672,
3536,
11162,
56,
24255,
7432,
43,
12086,
24452,
688,
12,
1458,
16,
7299,
16,
3122,
33,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4604,
56,
24255,
7432,
43,
12086,
24452,
688,
12,
1458,
16,
7299,
16,
3122,
33,
20,
18,
20,
4672,
3536,
11162,
56,
24255,
7432,
43,
12086,
24452,
688,
12,
1458,
16,
7299,
16,
3122,
33,... |
yield firstline | if firstline is not None: yield firstline | def reader(fp, firstline): yield firstline for line in fp: yield line | 5636d52ec05ad9b16844c9ce646859e0ecd81642 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/5636d52ec05ad9b16844c9ce646859e0ecd81642/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2949,
12,
7944,
16,
1122,
1369,
4672,
309,
1122,
1369,
353,
486,
599,
30,
2824,
1122,
1369,
364,
980,
316,
4253,
30,
2824,
980,
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,
2949,
12,
7944,
16,
1122,
1369,
4672,
309,
1122,
1369,
353,
486,
599,
30,
2824,
1122,
1369,
364,
980,
316,
4253,
30,
2824,
980,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
EXAMPLES:: | EXAMPLES: A generator object for binary sequencences of length 3, listed:: | def search_forest_iterator(roots, childs): """ INPUT: - ``roots``: a list (or iterable) - ``childs``: a function returning a list (or iterable) Returns an iterator on the nodes of the forest having the given roots, and where ``child(x)`` returns the childs of the node ``x`` of the forest. EXAMPLES:: sage: from sage.combinat.backtrack import search_forest_iterator sage: list(search_forest_iterator([[]], lambda l: [l+[0], l+[1]] if len(l) < 3 else [])) [[], [0], [0, 0], [0, 0, 0], [0, 0, 1], [0, 1], [0, 1, 0], [0, 1, 1], [1], [1, 0], [1, 0, 0], [1, 0, 1], [1, 1], [1, 1, 0], [1, 1, 1]] """ #Invariant: stack[i] contains an iterator for the siblings of the i-th node of the current branch stack = [iter(roots)] while len(stack) > 0: # Try to get the next node at this depth try: node = stack[-1].next() except StopIteration: #If there are no more, go back up the tree # We also need to check if we've exhausted all # possibilities stack.pop() continue yield node stack.append( iter(childs(node)) ) | f267a0642a59e1808e00bcbe18399f8d154f25c0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f267a0642a59e1808e00bcbe18399f8d154f25c0/backtrack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
1405,
334,
67,
9838,
12,
22078,
16,
21619,
4672,
3536,
12943,
30,
225,
300,
12176,
22078,
10335,
30,
279,
666,
261,
280,
6087,
13,
225,
300,
12176,
3624,
87,
10335,
30,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1623,
67,
1405,
334,
67,
9838,
12,
22078,
16,
21619,
4672,
3536,
12943,
30,
225,
300,
12176,
22078,
10335,
30,
279,
666,
261,
280,
6087,
13,
225,
300,
12176,
3624,
87,
10335,
30,
279,
... |
f.write(SETUPTOOLS_PKG_INFO) f.write() | try: f.write(SETUPTOOLS_PKG_INFO) finally: f.close() args = [sys.executable] + sys.argv if is_jython: sys.exit(subprocess.Popen([sys.executable] + args).wait()) else: sys.exit(os.spawnv(os.P_WAIT, sys.executable, args)) | def fake_setuptools(): try: import pkg_resources except ImportError: # we're cool return ws = pkg_resources.working_set setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools')) if setuptools_dist is None: return # let's create a fake egg replacing setuptools one setuptools_location = setuptools_dist.location os.rename(setuptools_location, setuptools_location+'.OLD') os.mkdir(setuptools_location) os.mkdir(os.path.join(setuptools_location, 'EGG-INFO')) pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO') f = open(pkg_info, 'w') f.write(SETUPTOOLS_PKG_INFO) f.write() | 3d4f3060886dd7ef9b074df9667fbabf4760fd2a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/495/3d4f3060886dd7ef9b074df9667fbabf4760fd2a/ez_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10517,
67,
542,
30693,
13332,
775,
30,
1930,
3475,
67,
4683,
1335,
11308,
30,
468,
732,
4565,
27367,
327,
4945,
225,
273,
3475,
67,
4683,
18,
20478,
67,
542,
444,
30693,
67,
4413,
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,
10517,
67,
542,
30693,
13332,
775,
30,
1930,
3475,
67,
4683,
1335,
11308,
30,
468,
732,
4565,
27367,
327,
4945,
225,
273,
3475,
67,
4683,
18,
20478,
67,
542,
444,
30693,
67,
4413,
273,
... |
x, y = self._calc_image_position() | x, y = self._icon_position() | def _event_inside_icon(self, event): x, y = self._calc_image_position() return (x <= event.x < x + 16) and (y <= event.y < y + 16) | 006b0b1783dee80eaa3b03dcd298253d0de14390 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/006b0b1783dee80eaa3b03dcd298253d0de14390/searchentry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2575,
67,
28091,
67,
3950,
12,
2890,
16,
871,
4672,
619,
16,
677,
273,
365,
6315,
3950,
67,
3276,
1435,
327,
261,
92,
1648,
871,
18,
92,
411,
619,
397,
2872,
13,
471,
261,
93,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
2575,
67,
28091,
67,
3950,
12,
2890,
16,
871,
4672,
619,
16,
677,
273,
365,
6315,
3950,
67,
3276,
1435,
327,
261,
92,
1648,
871,
18,
92,
411,
619,
397,
2872,
13,
471,
261,
93,
... |
file.Write(" EXPECT_EQ(sizeof(cmd) + // NOLINT\n") | file.Write(" EXPECT_EQ(sizeof(cmd)\n") | def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" int8 buf[256] = { 0, };\n") file.Write(" %s& cmd = *static_cast<%s*>(static_cast<void*>(&buf));\n" % (func.name, func.name)) file.Write(" static const char* const test_str = \"test string\";\n") file.Write(" void* next_cmd = cmd.Set(\n") file.Write(" &cmd") all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: file.Write(",\n static_cast<%s>(%d)" % (arg.type, value)) value += 1 file.Write(",\n test_str);\n") value = 11 file.Write(" EXPECT_EQ(%s::kCmdId ^ cmd.header.command);\n" % func.name) file.Write(" EXPECT_EQ(sizeof(cmd) + // NOLINT\n") file.Write(" RoundSizeToMultipleOfEntries(strlen(test_str)),\n") file.Write(" cmd.header.size * 4u);\n") file.Write(" EXPECT_EQ(static_cast<char*>(next_cmd),\n") file.Write(" reinterpret_cast<char*>(&cmd) + sizeof(cmd));\n"); for arg in all_but_last_arg: file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % (arg.type, value, arg.name)) value += 1 file.Write(" // TODO(gman): check that string got copied.\n") file.Write("}\n") file.Write("\n") | 20d6af8de9f49c5a4b9a5d098840a1523ad90cb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/20d6af8de9f49c5a4b9a5d098840a1523ad90cb6/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
16961,
12,
43,
11386,
22,
1630,
4709,
16,
738,
87,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
16961,
12,
43,
11386,
22,
1630,
4709,
16,
738,
87,
13,
... |
(sys.platform.startswith('linux') and | ((sys.platform.startswith('linux') or sys.platform.startswith('gnu')) and | def finalize_options (self): from distutils import sysconfig | b432f3ee81ae7f4f466a2a31a6df3f3542e99a1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b432f3ee81ae7f4f466a2a31a6df3f3542e99a1c/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
628,
2411,
5471,
1930,
2589,
1425,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
628,
2411,
5471,
1930,
2589,
1425,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
flagdata2(vis=self.vis, selectdata=True, timerange='09:50:00~10:20:00', manualflag=True, mf_timerange='09:20:00~10:20:00') test_eq(flagdata2(vis=self.vis, summary=True, antenna='2'), 196434, 6552) | flagdata2(vis=self.vis, selectdata=True, timerange='09:50:00~10:23:00', manualflag=True, mf_timerange='09:33:00~10:43:00') test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, field='2'), 1619352, 0) test_eq(flagdata2(vis=self.vis, summary=True, selectdata=True, field='1'), 666792, 238140) | def test_timerange(self): flagdata2(vis=self.vis, selectdata=True, timerange='09:50:00~10:20:00', manualflag=True, mf_timerange='09:20:00~10:20:00') test_eq(flagdata2(vis=self.vis, summary=True, antenna='2'), 196434, 6552) | 05385c9baca107ae37130d13ada12822cc89d8d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/05385c9baca107ae37130d13ada12822cc89d8d5/test_flagdata2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12542,
726,
12,
2890,
4672,
2982,
892,
22,
12,
3516,
33,
2890,
18,
3516,
16,
2027,
892,
33,
5510,
16,
5441,
726,
2218,
5908,
30,
3361,
30,
713,
98,
2163,
30,
3462,
30,
713,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12542,
726,
12,
2890,
4672,
2982,
892,
22,
12,
3516,
33,
2890,
18,
3516,
16,
2027,
892,
33,
5510,
16,
5441,
726,
2218,
5908,
30,
3361,
30,
713,
98,
2163,
30,
3462,
30,
713,... |
use_double = True use_complex = True | use_double = 1 use_complex = 1 | def tril(a_gpu, dev, overwrite=True): """ Lower triangle of a matrix. Return the lower triangle of a square matrix. Parameters ---------- a_gpu : pycuda.gpuarray.GPUArray Input matrix of shape `(m, m)` dev : pycuda.driver.Device Device object to be used. overwrite : boolean If true (default), zero out the upper triangle of the matrix. If false, return the result in a newly allocated matrix. Returns ------- l_gpu : pycuda.gpuarray The lower triangle of the original matrix. Examples -------- >>> import pycuda.driver as drv >>> import pycuda.gpuarray as gpuarray >>> import pycuda.autoinit >>> import numpy as np >>> import linalg >>> linalg.init() >>> a = np.asarray(np.random.rand(4, 4), np.float32) >>> a_gpu = gpuarray.to_gpu(a) >>> l_gpu = tril(a_gpu, pycuda.autoinit.device, False) >>> np.allclose(np.tril(a), l_gpu.get()) True """ if len(a_gpu.shape) != 2 or a_gpu.shape[0] != a_gpu.shape[1]: raise ValueError('matrix must be square') if a_gpu.dtype == np.float32: swap_func = cublas.cublasSswap copy_func = cublas.cublasScopy use_double = False use_complex = False elif a_gpu.dtype == np.float64: swap_func = cublas.cublasDswap copy_func = cublas.cublasDcopy use_double = True use_complex = False elif a_gpu.dtype == np.complex64: swap_func = cublas.cublasCswap copy_func = cublas.cublasCcopy use_double = False use_complex = True elif a_gpu.dtype == np.complex128: swap_func = cublas.cublasZswap copy_func = cublas.cublasZcopy use_double = True use_complex = True else: raise ValueError('unrecognized type') N = a_gpu.shape[0] # Get block/grid sizes: max_threads_per_block, max_block_dim, max_grid_dim = get_dev_attrs(dev) block_dim, grid_dim = select_block_grid_sizes(dev, a_gpu.shape) max_blocks_per_grid = max(max_grid_dim) # Set this to False when debugging to make sure the compiled kernel is # not cached: cache_dir=None tril_mod = \ SourceModule(tril_mod_template.substitute(use_double=use_double, use_complex=use_complex, max_threads_per_block=max_threads_per_block, max_blocks_per_grid=max_blocks_per_grid, cols=N), cache_dir=cache_dir) tril = tril_mod.get_function("tril") if not overwrite: a_orig_gpu = gpuarray.empty(a_gpu.shape, a_gpu.dtype) copy_func(a_gpu.size, int(a_gpu.gpudata), 1, int(a_orig_gpu.gpudata), 1) tril(a_gpu.gpudata, np.uint32(a_gpu.size), block=block_dim, grid=grid_dim) if overwrite: return a_gpu else: # Restore original contents of a_gpu: swap_func(a_gpu.size, int(a_gpu.gpudata), 1, int(a_orig_gpu.gpudata), 1) return a_orig_gpu | aa4c309bc91f0d6e6804183ddb9941ea6337c203 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14753/aa4c309bc91f0d6e6804183ddb9941ea6337c203/linalg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
433,
330,
12,
69,
67,
23162,
16,
4461,
16,
6156,
33,
5510,
4672,
3536,
24804,
15002,
434,
279,
3148,
18,
225,
2000,
326,
2612,
15002,
434,
279,
8576,
3148,
18,
225,
7012,
12181,
279,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
433,
330,
12,
69,
67,
23162,
16,
4461,
16,
6156,
33,
5510,
4672,
3536,
24804,
15002,
434,
279,
3148,
18,
225,
2000,
326,
2612,
15002,
434,
279,
8576,
3148,
18,
225,
7012,
12181,
279,
6... |
class LDBDServer(SocketServer.BaseRequestHandler): | class ServerHandler(SocketServer.BaseRequestHandler): | def __init__(self, args=None): """ Initialize an instance. | fbc9803c65a4ee0294e471687c20c1853319f147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/fbc9803c65a4ee0294e471687c20c1853319f147/LDBDServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
833,
33,
7036,
4672,
3536,
9190,
392,
791,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
833,
33,
7036,
4672,
3536,
9190,
392,
791,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
gray = False | gray = True | def graph_get(self, cr, uid, id, res_model, res_id, scale, context): pool = pooler.get_pool(cr.dbname) process = pool.get('process.process').browse(cr, uid, [id])[0] current_object = pool.get(res_model).browse(cr, uid, [res_id], context)[0] current_user = pool.get('res.users').browse(cr, uid, [uid], context)[0] expr_context = Env(current_object, current_user) nodes = {} start = [] transitions = {} | 6346d5d49d3ff8dbbfe21bd28dfecc821e980825 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/6346d5d49d3ff8dbbfe21bd28dfecc821e980825/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
400,
67,
2284,
16,
400,
67,
350,
16,
3159,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
400,
67,
2284,
16,
400,
67,
350,
16,
3159,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13... |
from twisted.internet.reactor import callFromThread | def process(self): """ This is called in the 'source' thread, and just basically sucks the iterator, appending items back to the main thread. """ try: self.source.init() except: self.failure = failure.Failure() from twisted.internet.reactor import callFromThread try: while 1: val = self.source.next() if self.extend: self.buff.extend(val) else: self.buff.append(val) except StopIteration: callFromThread(self.stop) except: if not self.failure: self.failure = failure.Failure() self.source = None | 7a17965f7f9d51bb2b40aa2d87a7456676424e64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7a17965f7f9d51bb2b40aa2d87a7456676424e64/flow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2890,
4672,
3536,
1220,
353,
2566,
316,
326,
296,
3168,
11,
2650,
16,
471,
2537,
23772,
1597,
363,
87,
326,
2775,
16,
19997,
1516,
1473,
358,
326,
2774,
2650,
18,
3536,
775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
3536,
1220,
353,
2566,
316,
326,
296,
3168,
11,
2650,
16,
471,
2537,
23772,
1597,
363,
87,
326,
2775,
16,
19997,
1516,
1473,
358,
326,
2774,
2650,
18,
3536,
775,
... | |
if self.array_length_ofs == -1: self.array_length_ofs = ofs_length else: assert self.array_length_ofs == ofs_length | def arraydescrof(self, A, translate_support_code): assert translate_support_code, "required with the framework GC" basesize, itemsize, ofs_length = symbolic.get_array_token(A, True) assert rffi.sizeof(A.OF) in [1, 2, WORD] if self.array_length_ofs == -1: self.array_length_ofs = ofs_length else: assert self.array_length_ofs == ofs_length # all the same if isinstance(A.OF, lltype.Ptr) and A.OF.TO._gckind == 'gc': ptr = True else: ptr = False type_id = self.layoutbuilder.get_type_id(A) descr = ConstDescr3(basesize, itemsize, ptr) descr.type_id = type_id return descr | 8722c12efc744e8b56ff14119d58a1c9a8efbf1a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/8722c12efc744e8b56ff14119d58a1c9a8efbf1a/gc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
526,
5569,
303,
74,
12,
2890,
16,
432,
16,
4204,
67,
13261,
67,
710,
4672,
1815,
4204,
67,
13261,
67,
710,
16,
315,
4718,
598,
326,
8257,
15085,
6,
8337,
554,
16,
761,
1467,
16,
2692... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
526,
5569,
303,
74,
12,
2890,
16,
432,
16,
4204,
67,
13261,
67,
710,
4672,
1815,
4204,
67,
13261,
67,
710,
16,
315,
4718,
598,
326,
8257,
15085,
6,
8337,
554,
16,
761,
1467,
16,
2692... | |
version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") | def get_makefile_filename(): return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "Makefile") | def _init_posix(): import os import re import string import sys g = globals() version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") # load the installed config.h: define_rx = re.compile("#define ([A-Z][A-Z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n") fp = open(os.path.join(config_dir, "config.h")) while 1: line = fp.readline() if not line: break m = define_rx.match(line) if m: n, v = m.group(1, 2) try: v = string.atoi(v) except ValueError: pass g[n] = v else: m = undef_rx.match(line) if m: g[m.group(1)] = 0 # load the installed Makefile.pre.in: variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)\n") done = {} notdone = {} fp = open(os.path.join(config_dir, "Makefile")) while 1: line = fp.readline() if not line: break m = variable_rx.match(line) if m: n, v = m.group(1, 2) v = string.strip(v) if "$" in v: notdone[n] = v else: try: v = string.atoi(v) except ValueError: pass done[n] = v # do variable interpolation here findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)") findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}") while notdone: for name in notdone.keys(): value = notdone[name] m = findvar1_rx.search(value) if not m: m = findvar2_rx.search(value) if m: n = m.group(1) if done.has_key(n): after = value[m.end():] value = value[:m.start()] + done[n] + after if "$" in after: notdone[name] = value else: try: value = string.atoi(value) except ValueError: pass done[name] = string.strip(value) del notdone[name] elif notdone.has_key(n): # get it on a subsequent round pass else: done[n] = "" after = value[m.end():] value = value[:m.start()] + after if "$" in after: notdone[name] = value else: try: value = string.atoi(value) except ValueError: pass done[name] = string.strip(value) del notdone[name] else: # bogus variable reference; just drop it since we can't deal del notdone[name] # save the results in the global dictionary g.update(done) | 9f5ee39e7a9278d824ad2d987313a26f8a9d5f73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/9f5ee39e7a9278d824ad2d987313a26f8a9d5f73/sysconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
24463,
13332,
1930,
1140,
1930,
283,
1930,
533,
1930,
2589,
225,
314,
273,
10941,
1435,
225,
1652,
336,
67,
6540,
768,
67,
3459,
13332,
327,
1140,
18,
803,
18,
5701,
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,
389,
2738,
67,
24463,
13332,
1930,
1140,
1930,
283,
1930,
533,
1930,
2589,
225,
314,
273,
10941,
1435,
225,
1652,
336,
67,
6540,
768,
67,
3459,
13332,
327,
1140,
18,
803,
18,
5701,
12,
... |
tmpFile = XiboFile(self.tmpPath,self.tmpHash) | tmpFile = XiboFile(self.tmpFileName,self.tmpHash) | def downloadMedia(self): # Actually download the Media file finished = False tries = 0 | 66a075cab3d68c237f51e86004d5840adb9c1f9c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5464/66a075cab3d68c237f51e86004d5840adb9c1f9c/XiboClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
5419,
12,
2890,
4672,
468,
4603,
3452,
4224,
326,
6128,
585,
6708,
273,
1083,
9327,
273,
374,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
4224,
5419,
12,
2890,
4672,
468,
4603,
3452,
4224,
326,
6128,
585,
6708,
273,
1083,
9327,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return self._spawn('./js_interactive.py', argv) | return self._spawn(str(py.magic.autopath().dirpath().dirpath().join('js_interactive.py')), argv) | def spawn(self, argv): return self._spawn('./js_interactive.py', argv) | 4324e4abeedb4eb2ecc0b2426b2d29c71e2248cb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/4324e4abeedb4eb2ecc0b2426b2d29c71e2248cb/test_interactive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
12,
2890,
16,
5261,
4672,
327,
365,
6315,
1752,
9533,
12,
701,
12,
2074,
18,
11179,
18,
5854,
556,
421,
7675,
1214,
803,
7675,
1214,
803,
7675,
5701,
2668,
2924,
67,
24761,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
12,
2890,
16,
5261,
4672,
327,
365,
6315,
1752,
9533,
12,
701,
12,
2074,
18,
11179,
18,
5854,
556,
421,
7675,
1214,
803,
7675,
1214,
803,
7675,
5701,
2668,
2924,
67,
24761,
18,
... |
return -ENOSYS | raise NFSError(status) | def main(self): if hasattr(self,"server"): self.host, self.path = self.server.split(':',1); else: raise fuse.FuseError, "No server specified" | a6954f248eb680271ef81b78d6aeb0303c5f085b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12550/a6954f248eb680271ef81b78d6aeb0303c5f085b/nfsfuse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
309,
3859,
12,
2890,
10837,
3567,
6,
4672,
365,
18,
2564,
16,
365,
18,
803,
273,
365,
18,
3567,
18,
4939,
2668,
30,
2187,
21,
1769,
469,
30,
1002,
19552,
18,
42... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2774,
12,
2890,
4672,
309,
3859,
12,
2890,
10837,
3567,
6,
4672,
365,
18,
2564,
16,
365,
18,
803,
273,
365,
18,
3567,
18,
4939,
2668,
30,
2187,
21,
1769,
469,
30,
1002,
19552,
18,
42... |
self.xmlstream.streamError(None) | self.xmlstream.dispatch(iq, self.AUTH_FAILED_EVENT) | def _authResultEvent(self, iq): if iq["type"] == "result": self.xmlstream.dispatch(self.xmlstream, xmlstream.STREAM_AUTHD_EVENT) else: self.xmlstream.streamError(None) | a5cc51f58c35d2745538468bab42d7d27c6b31dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a5cc51f58c35d2745538468bab42d7d27c6b31dd/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1944,
1253,
1133,
12,
2890,
16,
24288,
4672,
309,
24288,
9614,
723,
11929,
422,
315,
2088,
6877,
365,
18,
2902,
3256,
18,
10739,
12,
2890,
18,
2902,
3256,
16,
2025,
3256,
18,
13693,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
1944,
1253,
1133,
12,
2890,
16,
24288,
4672,
309,
24288,
9614,
723,
11929,
422,
315,
2088,
6877,
365,
18,
2902,
3256,
18,
10739,
12,
2890,
18,
2902,
3256,
16,
2025,
3256,
18,
13693,... |
You can call connector.stopConnecting() to stop the connection attempt. | def startedConnecting(self, connector): """Called when a connection has been started. | c503658558d29642b85df33783801929be286e40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c503658558d29642b85df33783801929be286e40/protocol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5746,
30049,
12,
2890,
16,
8703,
4672,
3536,
8185,
1347,
279,
1459,
711,
2118,
5746,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
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,
5746,
30049,
12,
2890,
16,
8703,
4672,
3536,
8185,
1347,
279,
1459,
711,
2118,
5746,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
return _mod | return _mod | def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_gdal', [dirname(__file__)]) except ImportError: import _gdal return _gdal if fp is not None: try: _mod = imp.load_module('_gdal', fp, pathname, description) finally: fp.close() return _mod | fb5a095e8e24eb873fdd020ee40e8f924062ee23 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10290/fb5a095e8e24eb873fdd020ee40e8f924062ee23/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
5666,
67,
4759,
13332,
628,
1140,
18,
803,
1930,
4283,
1930,
1646,
4253,
273,
599,
775,
30,
4253,
16,
9806,
16,
2477,
273,
1646,
18,
4720,
67,
2978,
2668,
67,
19016,
287... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1352,
360,
67,
5666,
67,
4759,
13332,
628,
1140,
18,
803,
1930,
4283,
1930,
1646,
4253,
273,
599,
775,
30,
4253,
16,
9806,
16,
2477,
273,
1646,
18,
4720,
67,
2978,
2668,
67,
19016,
287... |
for o in [opt for opt in self.options.keys() if opt not in ('version','language','translate_out','translate_in','init','update')]: p.set('options', o, self.options[o]) | for opt in self.options.keys(): if opt in ('version', 'language', 'translate_out', 'translate_in', 'init', 'update'): continue if opt in ('log_level', 'assert_exit_level'): p.set('options', opt, loglevelnames.get(self.options[opt], self.options[opt])) else: p.set('options', opt, self.options[opt]) | def save(self): p = ConfigParser.ConfigParser() p.add_section('options') for o in [opt for opt in self.options.keys() if opt not in ('version','language','translate_out','translate_in','init','update')]: p.set('options', o, self.options[o]) | b7f8f65711a024887d7bc7c6a83bfc3642e345bf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/b7f8f65711a024887d7bc7c6a83bfc3642e345bf/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
293,
273,
25076,
18,
809,
2678,
1435,
293,
18,
1289,
67,
3464,
2668,
2116,
6134,
364,
320,
316,
306,
3838,
364,
2153,
316,
365,
18,
2116,
18,
2452,
1435,
309,
215... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1923,
12,
2890,
4672,
293,
273,
25076,
18,
809,
2678,
1435,
293,
18,
1289,
67,
3464,
2668,
2116,
6134,
364,
320,
316,
306,
3838,
364,
2153,
316,
365,
18,
2116,
18,
2452,
1435,
309,
215... |
>>> if self._top_page_url not in ("trees.html", "identifier-index.html", "help.html"): | >>> if self._top_page_url not in (self._trees_url, "identifier-index.html", "help.html"): | def callgraph_link(self, callgraph): if callgraph is None: return '' return ('<br /><span class="codelink"><a href="javascript: void(0);" ' 'onclick="toggleCallGraph(\'%s-div\');return false;">' 'call graph</a></span> ' % callgraph.uid) | ead96d86090e18fdeec64a06319b925d20efd2b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/ead96d86090e18fdeec64a06319b925d20efd2b2/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
4660,
67,
1232,
12,
2890,
16,
745,
4660,
4672,
309,
745,
4660,
353,
599,
30,
327,
875,
327,
7707,
32,
2848,
342,
4438,
3969,
667,
1546,
71,
1009,
754,
14050,
69,
3897,
1546,
11242... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
745,
4660,
67,
1232,
12,
2890,
16,
745,
4660,
4672,
309,
745,
4660,
353,
599,
30,
327,
875,
327,
7707,
32,
2848,
342,
4438,
3969,
667,
1546,
71,
1009,
754,
14050,
69,
3897,
1546,
11242... |
if CMP_BUG_FIXED: t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | def test_mixed_compare(self): t1 = datetime(1, 2, 3, 4, 5, 6, 7) t2 = datetime(1, 2, 3, 4, 5, 6, 7) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=None) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=FixedOffset(None, "")) self.assertEqual(t1, t2) if CMP_BUG_FIXED: t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | 68124bb771697104add6c850139684729e2e6777 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/68124bb771697104add6c850139684729e2e6777/test_datetime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
19562,
67,
9877,
12,
2890,
4672,
268,
21,
273,
3314,
12,
21,
16,
576,
16,
890,
16,
1059,
16,
1381,
16,
1666,
16,
2371,
13,
268,
22,
273,
3314,
12,
21,
16,
576,
16,
890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19562,
67,
9877,
12,
2890,
4672,
268,
21,
273,
3314,
12,
21,
16,
576,
16,
890,
16,
1059,
16,
1381,
16,
1666,
16,
2371,
13,
268,
22,
273,
3314,
12,
21,
16,
576,
16,
890,
... |
__implements__ = (z2IBaseObject, ) + Referenceable.__implements__ implements(IBaseObject, IReferenceable) | __implements__ = (IBaseObject, ) + Referenceable.__implements__ | def __call__(self, name, value): context = aq_parent(self) schema = context.Schema() if not schema.has_key(name): return 1 field = schema[name] if not isinstance(field.getStorage(), AttributeStorage): return 1 perm = field.read_permission if checkPerm(perm, context): return 1 return 0 | 460696da815e0d1149ab34005370b03bdbb656a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/460696da815e0d1149ab34005370b03bdbb656a6/BaseObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
508,
16,
460,
4672,
819,
273,
279,
85,
67,
2938,
12,
2890,
13,
1963,
273,
819,
18,
3078,
1435,
309,
486,
1963,
18,
5332,
67,
856,
12,
529,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
508,
16,
460,
4672,
819,
273,
279,
85,
67,
2938,
12,
2890,
13,
1963,
273,
819,
18,
3078,
1435,
309,
486,
1963,
18,
5332,
67,
856,
12,
529,
4672,
327,
... |
" from", self.todo[url_pair]) | " from", self.todo[url_pair]) | def dopage(self, url_pair): | f97eecccb714a71cf5a1ca9399cd9c579014a5b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f97eecccb714a71cf5a1ca9399cd9c579014a5b9/wcnew.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
556,
410,
12,
2890,
16,
880,
67,
6017,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
556,
410,
12,
2890,
16,
880,
67,
6017,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
selenium = self.layer['selenium'] | sel = self.layer['selenium'] | def test_basic_search(self): | 90cb345a031409147dbcbef6b8d6e6043f6cf197 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12249/90cb345a031409147dbcbef6b8d6e6043f6cf197/test_selenium.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
67,
3072,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
67,
3072,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
descr='test short users/groups commands' | descr='''test short users/groups commands''' | def test_short_syntax(): uname = 'user_test' gname = 'group_test' pname = 'profil_test' ScenarioTest([ ADD + [ 'user', uname, '-v' ], GET + [ 'user', uname ], ADD + [ 'group', gname, '-v' ], GET + [ 'group', gname ], ADD + [ 'user', uname, gname, '-v' ], GET + [ 'user', uname, '-l' ], ADD + [ 'group', '%s2' % gname, '-v' ], GET + [ 'group', '%s2' % gname ], ADD + [ 'group', '%s3,%s4' % (gname, gname), '-v' ], # should fail (already present) GET + [ 'group', '%s3,%s4' % (gname, gname) ], # should add user2 & user3 ADD + [ 'user', '%s2,%s3' % (uname, uname), '-v' ], GET + [ 'user', '%s2,%s3' % (uname, uname) ], # add 2 users in 3 groups each ADD + [ 'user', '%s2,%s3' % (uname, uname), '%s2,%s3,%s4' % (gname,gname,gname), '-v' ], GET + [ 'user', '%s2,%s3' % (uname, uname), '-l' ], # should add ONLY ONE user in a group and bypass empty one ADD + [ 'user', ',%s' % uname, ',%s2' % gname, '-v' ], # idem ADD + [ 'user', '%s,' % uname, '%s3,' % gname, '-v' ], GET + [ 'user', uname, '-l' ], # should delete only one user and bypass empty one DEL + [ 'user', ',%s' % uname, '-v'], # should fail (already deleted) DEL + [ 'user', '%s,' % uname, '-v'], # IDEM DEL + [ 'user', uname, '-v'], # delete 2 users at same time DEL + [ 'user', '%s2,%s3' % (uname, uname), '-v'], # delete groups, one, then two, then one (bypassing empty) DEL + [ 'group', gname, '-v'], DEL + [ 'group', '%s2,%s3' % (gname, gname), '-v'], DEL + [ 'group', ',%s4' % gname, '-v'], DEL + [ 'group', '%s4,' % gname, '-v'], DEL + [ 'group', '%s4' % gname, '-v'], ], descr='test short users/groups commands' ).Run() ScenarioTest([ ADD + [ 'group', gname, '-v' ], #should fail (the group is not a system group) ADD + [ 'privilege', gname, '-v' ], GET + [ 'privileges' ], ADD + [ 'group', '%ssys' % gname, '--system', '-v' ], ADD + [ 'privilege', '%ssys' % gname, '-v' ], GET + [ 'privileges' ], DEL + [ 'privilege', '%ssys' % gname ], GET + [ 'privileges' ], DEL + [ 'group', gname ], DEL + [ 'group', '%ssys' % gname ], ], descr='test short privileges commands' ).Run() ScenarioTest([ ADD + [ 'group', gname, '--system', '-v' ], ADD + [ 'group', '%s2' % gname, '-v' ], ADD + [ 'group', '%s3' % gname, '-v' ], # should fail (not a system group) ADD + [ 'profile', pname, '--group=%s2' % gname, '--force-existing' ], GET + [ 'profiles' ], # should be OK ADD + [ 'profile', pname, '--group=%s' % gname, '--force-existing' ], GET + [ 'profiles' ], MOD + [ 'profile', pname, '--add-groups=%s2,%s3' % (gname,gname) ], GET + [ 'profiles' ], MOD + [ 'profile', pname, '--del-groups=%s2,%s3' % (gname,gname) ], GET + [ 'profiles' ], DEL + [ 'profile', pname ], DEL + [ 'group', '%s2' % gname, '-v' ], DEL + [ 'group', '%s3' % gname, '-v' ], GET + [ 'profiles' ], ], descr='test short profiles commands' ).Run() ScenarioTest([ ADD + [ 'group', gname, '-v' ], ADD + [ 'group', '%s2' % gname, '-v' ], CHK + [ 'group', gname, '--auto-no', '-vv' ], CHK + [ 'group', gname, '--auto-yes', '-vv' ], CHK + [ 'group', gname, '-vb' ], CHK + [ 'group', '%s,%s2' % (gname,gname), '--auto-no', '-vv' ], CHK + [ 'group', '%s,%s2' % (gname,gname), '--auto-yes', '-vv' ], CHK + [ 'group', '%s,%s2' % (gname,gname), '-vb' ], DEL + [ 'group', '%s,%s2' % (gname,gname), '-v' ], CHK + [ 'config','--auto-no', '-vvae' ], CHK + [ 'config','--auto-yes', '-vvae' ], CHK + [ 'config','--batch', '-vvae' ], ADD + [ 'user', uname, '-v' ], CHK + [ 'user', uname, '--auto-no', '-v' ], CHK + [ 'user', uname, '--auto-yes', '-v' ], CHK + [ 'user', uname, '-vb' ], DEL + [ 'user', uname, '-v' ], ], descr='test short chk commands' ).Run() """ # extended check on user not implemented yet CHK + [ 'user', '%s,%s2' % (uname,uname), '--auto-no', '-vve' ], CHK + [ 'user', '%s,%s2' % (uname,uname), '--auto-yes', '-vve' ], CHK + [ 'user', '%s,%s2' % (uname,uname), '--batch', '-vve' ], DEL + [ 'user', '%s,%s2' % (uname,uname), '-v' ], # check on profile not implemented yet ADD + [ 'profile', '%s,%s2' % (pname,pname), '-v' ], CHK + [ 'profile', pname, '--auto-no', '-vve' ], CHK + [ 'profile', pname, '--auto-yes', '-vve' ], CHK + [ 'profile', pname, '--batch', '-vve' ], CHK + [ 'profile', '%s,%s2' % (pname,pname), '--auto-no', '-vve' ], CHK + [ 'profile', '%s,%s2' % (pname,pname), '--auto-yes', '-vve' ], CHK + [ 'profile', '%s,%s2' % (pname,pname), '--batch', '-vve' ], DEL + [ 'profile', '%s,%s2' % (pname,pname), '-v' ], """ | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6620,
67,
14308,
13332,
31444,
273,
296,
1355,
67,
3813,
11,
314,
529,
273,
296,
1655,
67,
3813,
11,
19952,
273,
296,
685,
7540,
67,
3813,
11,
225,
2850,
7754,
4709,
3816,
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,
1842,
67,
6620,
67,
14308,
13332,
31444,
273,
296,
1355,
67,
3813,
11,
314,
529,
273,
296,
1655,
67,
3813,
11,
19952,
273,
296,
685,
7540,
67,
3813,
11,
225,
2850,
7754,
4709,
3816,
11... |
except KeyError, e: | except KeyError: | def setFont(self, node): fname = node.get('name') if fname not in pdfmetrics.getRegisteredFontNames()\ or fname not in pdfmetrics.standardFonts: # let reportlab attempt to find it try: pdfmetrics.getFont(fname) except Exception: logging.getLogger('report.fonts').\ debug('Could not locate font %s, substituting default: %s', fname, self.canvas._fontname) fontname = self.canvas._fontname try: return self.canvas.setFont(fname, utils.unit_get(node.get('size'))) except KeyError, e: raise KeyError('Font "%s" cannot be used in the PDF engine' % fname) | 83041ccb04cdc8b7ddbd25d315a7ed32e456e8c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/83041ccb04cdc8b7ddbd25d315a7ed32e456e8c6/trml2pdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20454,
12,
2890,
16,
756,
4672,
5299,
273,
756,
18,
588,
2668,
529,
6134,
309,
5299,
486,
316,
8169,
9597,
18,
588,
10868,
5711,
1557,
1435,
64,
578,
5299,
486,
316,
8169,
9597,
18,
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,
20454,
12,
2890,
16,
756,
4672,
5299,
273,
756,
18,
588,
2668,
529,
6134,
309,
5299,
486,
316,
8169,
9597,
18,
588,
10868,
5711,
1557,
1435,
64,
578,
5299,
486,
316,
8169,
9597,
18,
10... |
via 2-descent they should alreday be 2-saturated.) | via :meth:``two_descent()`` they should already be 2-saturated.) | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be saturated, and this is used; however, if the computed bound is greater than a value set by the eclib library (currently 97) then no saturation will be attempted at primes above this. - ``odd_primes_only`` (bool, default False) -- only do saturation at odd primes. (If the points have been found via 2-descent they should alreday be 2-saturated.) | c2ebf8bfa15bcdb4318f58bfcf2982e3a69cce87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c2ebf8bfa15bcdb4318f58bfcf2982e3a69cce87/interface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5942,
295,
340,
12,
2890,
16,
943,
67,
16382,
29711,
21,
16,
14800,
67,
683,
4485,
67,
3700,
33,
8381,
4672,
436,
8395,
25793,
295,
340,
333,
720,
1655,
434,
326,
490,
517,
1165,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5942,
295,
340,
12,
2890,
16,
943,
67,
16382,
29711,
21,
16,
14800,
67,
683,
4485,
67,
3700,
33,
8381,
4672,
436,
8395,
25793,
295,
340,
333,
720,
1655,
434,
326,
490,
517,
1165,
17,
... |
def _posHprBroadcast(self, task=None): | def _posHprBroadcast(self, task=DummyTask): | def _posHprBroadcast(self, task=None): # TODO: we explicitly stagger the initial task timing in # startPosHprBroadcast; we should at least make an effort to keep # this task accurately aligned with its period and starting time. if task is None: task = DummyTask() self.d_broadcastPosHpr() task.setDelay(self.__broadcastPeriod) return Task.again | cba293317174126383de8ebf64a11bb1fad02206 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7242/cba293317174126383de8ebf64a11bb1fad02206/DistributedSmoothNodeBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
917,
44,
683,
15926,
12,
2890,
16,
1562,
33,
20094,
2174,
4672,
468,
2660,
30,
732,
8122,
384,
7594,
326,
2172,
1562,
15538,
316,
468,
16013,
44,
683,
15926,
31,
732,
1410,
622,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
917,
44,
683,
15926,
12,
2890,
16,
1562,
33,
20094,
2174,
4672,
468,
2660,
30,
732,
8122,
384,
7594,
326,
2172,
1562,
15538,
316,
468,
16013,
44,
683,
15926,
31,
732,
1410,
622,
4... |
2203319 sage: a(20) 2334414826276390013171 sage: a.list(8) [0, 1, 5, 31, 227, 1909, 18089, 190435] | 1909 sage: a(22) 98125321641110663023 sage: a.list(9) [0, 1, 5, 31, 227, 1909, 18089, 190435, 2203319] | def list(self, n): self._eval(n) # force computation return self._b[:n] | 17696bad4576e0d4a9f73f71f06b50e19587f0be /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/17696bad4576e0d4a9f73f71f06b50e19587f0be/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
290,
4672,
365,
6315,
8622,
12,
82,
13,
282,
468,
2944,
16039,
327,
365,
6315,
70,
10531,
82,
65,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
290,
4672,
365,
6315,
8622,
12,
82,
13,
282,
468,
2944,
16039,
327,
365,
6315,
70,
10531,
82,
65,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if (self._utility_registrations.get((provided, name))[:2] == (component, info)): | reg = self._utility_registrations.get((provided, name)) if reg is not None and reg[:2] == (component, info): | def registerUtility(self, component=None, provided=None, name=u'', info=u'', event=True, factory=None): if factory: if component: raise TypeError("Can't specify factory and component.") component = factory() | 6371ce1d26b96367c83db2b96959bc73a82775d2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10012/6371ce1d26b96367c83db2b96959bc73a82775d2/registry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
6497,
12,
2890,
16,
1794,
33,
7036,
16,
2112,
33,
7036,
16,
508,
33,
89,
11,
2187,
1123,
33,
89,
11,
2187,
871,
33,
5510,
16,
3272,
33,
7036,
4672,
309,
3272,
30,
309,
1794,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1744,
6497,
12,
2890,
16,
1794,
33,
7036,
16,
2112,
33,
7036,
16,
508,
33,
89,
11,
2187,
1123,
33,
89,
11,
2187,
871,
33,
5510,
16,
3272,
33,
7036,
4672,
309,
3272,
30,
309,
1794,
... |
'''Override the parent version. Specific drawing code for the object. ''' | """ Override the parent version. Specific drawing code for the object. """ | def drawSelected(self, obj): '''Override the parent version. Specific drawing code for the object. ''' if isinstance(obj, atom) and (obj.element is Singlet): obj.draw_in_abs_coords(self, env.prefs[bondpointHighlightColor_prefs_key]) | 7828cbef13f84d50298938f6ae339289db2ec006 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/7828cbef13f84d50298938f6ae339289db2ec006/ThumbView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
7416,
12,
2890,
16,
1081,
4672,
3536,
1439,
326,
982,
1177,
18,
23043,
16327,
981,
364,
326,
733,
18,
3536,
309,
1549,
12,
2603,
16,
3179,
13,
471,
261,
2603,
18,
2956,
353,
348,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3724,
7416,
12,
2890,
16,
1081,
4672,
3536,
1439,
326,
982,
1177,
18,
23043,
16327,
981,
364,
326,
733,
18,
3536,
309,
1549,
12,
2603,
16,
3179,
13,
471,
261,
2603,
18,
2956,
353,
348,... |
Abelian variety factor of dimension 1 of J0(67), Abelian variety factor of dimension 2 of J0(67), Abelian variety factor of dimension 2 of J0(67) | Simple abelian subvariety 67a(1,67) of dimension 1 of J0(67), Simple abelian subvariety 67b(1,67) of dimension 2 of J0(67), Simple abelian subvariety 67c(1,67) of dimension 2 of J0(67) | def intersection(self, other): """ Returns the intersection of self and other inside a common ambient Jacobian product. | 62147d82541f9aed0900f78cd10df5f262f228f5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/62147d82541f9aed0900f78cd10df5f262f228f5/abvar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7619,
12,
2890,
16,
1308,
4672,
3536,
2860,
326,
7619,
434,
365,
471,
1308,
4832,
279,
2975,
13232,
1979,
804,
1077,
26968,
3017,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
7619,
12,
2890,
16,
1308,
4672,
3536,
2860,
326,
7619,
434,
365,
471,
1308,
4832,
279,
2975,
13232,
1979,
804,
1077,
26968,
3017,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if 0 : buildPackage( 'libmad', | if 1 : buildPackage( 'libmad', | def buildPackage(name, uri, checkVersion, downloadUri, tarballName, buildCommand, srcdir=None, deps="", pinnedVersion = None, ) : print "Module:", name subst = dict( sandbox = sandbox, prefix = prefix, target = target, sfmirror = sfmirror, apachemirror = apachemirror, name = name, pinned = pinnedVersion if pinnedVersion else "None", ) availableVersion = output(checkVersion).strip() availableVersion or die("No online version found for the package\n Command used:\n%s" % checkVersion) print "Found version: '%s'" % availableVersion if (pinnedVersion and pinnedVersion != availableVersion) : warning("Package: Pinning to version %s, although version %s is available" % (pinnedVersion, availableVersion)) version = pinnedVersion if pinnedVersion else availableVersion subst.update ( version = version, majorversion = ".".join(version.split(".")[:1]), minorversion = ".".join(version.split(".")[:2]), ) subst.update( tarball = tarballName % subst, srcdir = ("%(sandbox)s/src/" + (srcdir or "%(name)s-%(version)s/")) % subst, ) print "srcdir:", subst['srcdir'] download(downloadUri % subst) extractSource(subst['tarball']) patches = glob.glob(scriptRelative("mingw-"+name+"*")) patches.sort() print patches for patch in patches : applyPatch(subst['srcdir'], patch, level=1) run(buildCommand % subst) | 9516624bdaf457fb48cb287da6115af5d509bbca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1456/9516624bdaf457fb48cb287da6115af5d509bbca/setup_mingw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
2261,
12,
529,
16,
2003,
16,
866,
1444,
16,
4224,
3006,
16,
29441,
461,
16,
1361,
2189,
16,
1705,
1214,
33,
7036,
16,
8740,
1546,
3113,
26193,
1444,
273,
599,
16,
262,
294,
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,
1361,
2261,
12,
529,
16,
2003,
16,
866,
1444,
16,
4224,
3006,
16,
29441,
461,
16,
1361,
2189,
16,
1705,
1214,
33,
7036,
16,
8740,
1546,
3113,
26193,
1444,
273,
599,
16,
262,
294,
1172,... |
e = hasattr(m.email, 'val') and m.email.val or m.email if e is not None: | e = (m.email, m.email.val)[isinstance(m.email, omero.RString)] if e is not None and e!="": | def prepareRecipients(self, recipients): recps = list() for m in recipients: try: e = hasattr(m.email, 'val') and m.email.val or m.email if e is not None: recps.append(e) except: logger.error(traceback.format_exc()) logger.info(recps) if len(recps) == 0: raise AttributeError("Recipients list is empty") return recps | 82078b206d271270dcc354ed0ad781a98d100872 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/82078b206d271270dcc354ed0ad781a98d100872/gateway.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
22740,
12,
2890,
16,
12045,
4672,
1950,
1121,
273,
666,
1435,
364,
312,
316,
12045,
30,
775,
30,
425,
273,
261,
81,
18,
3652,
16,
312,
18,
3652,
18,
1125,
25146,
291,
1336,
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,
2911,
22740,
12,
2890,
16,
12045,
4672,
1950,
1121,
273,
666,
1435,
364,
312,
316,
12045,
30,
775,
30,
425,
273,
261,
81,
18,
3652,
16,
312,
18,
3652,
18,
1125,
25146,
291,
1336,
12,
... |
stats['years'][year]['dist_scaled'] = int(240*stats['years'][year]['distance']/top_year_dist) | if not statyear: stats['years'][year]['dist_scaled'] = int(240*stats['years'][year]['distance']/top_year_dist) | def build_stats(trip_list, type, statyear=False): # TODO break this apart and/or do similar things in subroutines # TODO build more year metadata # TODO don't do as much work for front page # TODO cache? stats = {'countries': {}, 'cities': {}, 'years': {}, 'months': {}, 'home': { 'trips': 0, 'duration':0, }, 'away': { 'trips': 0, 'duration':0, }, 'future': 0, 'types': {}, 'ordered': {}, 'trips': 0, } if not trip_list: return stats for trip in trip_list: # skip if not a past trip if trip['status'] != "Past": if trip['status'] == "Ongoing": stats['current'] = trip['city']['name'] else: stats['future'] += 1 continue if statyear and trip['startdate'].year != int(statyear): stats['years'][trip['startdate'].year] = { 'duration': 0, 'trips': 0, 'away':{}, 'home':{}, } continue # else: # logging.info(" + count this trip") stats['trips'] += 1 # how long (simple version...) # TODO never double count date duration = trip['finishdate'] - trip['startdate'] trip['duration'] = duration.days # build country data country = trip['city']['country'] display = country inline = country # special casing! if not country.find("United"): # TODO there's something wrong here... inline = "the "+country # TODO and this should be a hash anyway if not country.find("Hong Kong"): display = "Hong Kong" inline = "Hong Kong" # stuff info into the data structure if not country in stats['countries']: stats['countries'][country] = { 'duration': 0, 'trips': 0, 'display':display, 'inline':inline, 'code':trip['city']['country_code'], 'rgb':md5.new(country).hexdigest()[0:6]} stats['countries'][country]['duration'] += duration.days stats['countries'][country]['trips'] += 1 if type != "front": if trip.has_key('return_transport_type'): # TODO remove if not trip['return_transport_type'] in stats['types']: stats['types'][trip['return_transport_type']] = {'trips':0, 'journeys':0, } stats['types'][trip['return_transport_type']]['trips'] += 0.5 if trip.has_key('return_transport_type'): # TODO remove if not trip['outgoing_transport_type'] in stats['types']: stats['types'][trip['outgoing_transport_type']] = {'trips':0, 'journeys':0, } stats['types'][trip['outgoing_transport_type']]['trips'] += 0.5 # if (country == home_country): # stats['home']['trips'] += 1; # stats['home']['duration'] += duration.days # else: # stats['away']['trips'] += 1; # stats['away']['duration'] += duration.days # build city data city = trip['city']['name'] rgb = trip['city']['rgb'] if not city in stats['cities']: stats['cities'][city] = { 'duration': 0, 'trips': 0, 'dist_to':0, 'dist_from':0, 'rgb':rgb, 'country':country, 'id':trip['city']['woeid'], 'trip_list': [], 'code':trip['city']['country_code'] } stats['cities'][city]['duration'] += duration.days stats['cities'][city]['trips'] += 1 if type != "front": stats['cities'][city]['trip_list'].append(trip) # build year data year = trip['startdate'].year # initialise data structure's if not year in stats['years']: stats['years'][year] = { 'duration': 0, 'trips': 0, 'away':{}, 'home':{}, 'distance': 0, } if year == trip['finishdate'].year: stats['years'][year]['duration'] += duration.days stats['years'][year]['trips'] += 1 if type == "detail": stats['years'][year]['distance'] += (trip['distance']['out']+trip['distance']['return']) else: if trip['finishdate'].year - year == 1: # spans a single year boundary, and is therefore Sane # if there's *anyone* who has a trip spanning two, they can bloody # well write this themselves. Otherwise, assume they mean they're # living there now. Onwards... year_end = datetime(year, 12, 31) stats['years'][year]['duration'] += (year_end-trip['startdate']).days stats['years'][year]['trips'] += 1 if type == "detail": stats['years'][year]['distance'] += trip['distance']['out'] # redefine year from year-start to year-end year = trip['finishdate'].year year_start = datetime(year, 1, 1) if not year in stats['years']: stats['years'][year] = { 'duration': 0, 'trips': 0, 'away':{}, 'home':{}, 'distance': 0, } # for now we don't count trips in both years. change? # we do count trip days and distance in the end year stats['years'][year]['duration'] += (trip['finishdate']-year_start).days if type == "detail": stats['years'][year]['distance'] += trip['distance']['return'] if type != "front": # do we care about finish months? month = trip['startdate'].month if not stats['months'].has_key(month): stats['months'][month] = {'trips':0, 'duration':0, 'cities':[]} stats['months'][month]['trips'] += 1 stats['months'][month]['duration'] += duration.days stats['months'][month]['cities'].append(trip) # do we want to supply full-blown cross-cut stats? maybe later... # END TRIP LOOP # reorder final stats stats['ordered']['years'] = sorted(stats['years']) stats['ordered']['years'].reverse() stats['ordered']['types'] = sorted(stats['types'], lambda x, y: (int(stats['types'][y]['trips']))-(int(stats['types'][x]['trips']))) stats['ordered']['years_by_trip'] = sorted(stats['years'], lambda x, y: (stats['years'][y]['trips'])-(stats['years'][x]['trips'])) stats['ordered']['years_by_days'] = sorted(stats['years'], lambda x, y: (stats['years'][y]['duration'])-(stats['years'][x]['duration'])) stats['ordered']['years_by_dist'] = sorted(stats['years'], lambda x, y: (stats['years'][y]['distance'])-(stats['years'][x]['distance'])) stats['ordered']['countries'] = sorted(stats['countries'], lambda x, y: (stats['countries'][y]['duration'])-(stats['countries'][x]['duration'])) stats['ordered']['cities'] = sorted(stats['cities'], lambda x, y: (stats['cities'][y]['duration'])-(stats['cities'][x]['duration'])) if (statyear and not int(statyear) in stats['ordered']['years']): logging.info("no entries for year '%'" % statyear) return False; # colours if type != "front": rgb = stats['countries'][stats['ordered']['countries'][0]]['rgb'] raw = colors.hex('#'+rgb) saturated = raw.saturate(1); lightened = saturated.lighten(0.5); desaturated = lightened.desaturate(0.8); stats['rgb'] = hex_from(lightened) stats['rgb_start'] = hex_from(desaturated) # scale country stats for map (including colours) top_country = stats['ordered']['countries'][0] top_duration = stats['countries'][top_country]['duration'] r = stats['rgb'][0:2]; g = stats['rgb'][2:4]; b = stats['rgb'][4:6] for country in stats['countries'].keys(): scaled = 100*stats['countries'][country]['duration']/top_duration satscale = (float(100-scaled)/100)*0.8 satcolor = lightened.desaturate(satscale) # ligscale = (float(100-scaled)/100)*0.9 # ligcolor = saturated.lighten(ligscale) stats['countries'][country]['scaled'] = scaled stats['countries'][country]['rgb_scaled'] = hex_from(satcolor) # scale transport types if len(stats['types'].keys()): # TODO remove top_type = stats['ordered']['types'][0] top_trip = int(stats['types'][top_type]['trips']) for type in stats['types'].keys(): stats['types'][type]['scaled'] = 240*int(stats['types'][type]['trips'])/top_trip stats['types'][type]['journeys'] = int((stats['types'][type]['trips']*2)) # scale years top_year_by_days = stats['ordered']['years_by_days'][0] top_year_days = stats['years'][top_year_by_days]['duration'] top_year_by_dist = stats['ordered']['years_by_dist'][0] top_year_dist = stats['years'][top_year_by_dist]['distance'] # scale years (for front page too) top_year_by_trip = stats['ordered']['years_by_trip'][0] top_year_trips = stats['years'][top_year_by_trip]['trips'] if type != "front": # width per trip scaling for years trips_per_block = 1 while 90*trips_per_block/top_year_trips < 10: trips_per_block += 1 stats['top_year_trips'] = top_year_trips stats['trips_per_block'] = trips_per_block stats['block_width'] = 90*trips_per_block/top_year_trips for year in stats['years']: if year == top_year_by_days: # TODO do this in template (the data's there...) stats['away']['days'] = (stats['years'][top_year_by_days]['duration'])/3.66 stats['home']['days'] = (366-stats['years'][top_year_by_days]['duration'])/3.66 stats['years'][year]['away']['days'] = (stats['years'][top_year_by_days]['duration'])/3.66 stats['years'][year]['home']['days'] = (366-stats['years'][top_year_by_days]['duration'])/3.66 # raw scaling stats['years'][year]['duration_scaled'] = int(240*stats['years'][year]['duration']/top_year_days) stats['years'][year]['trips_scaled'] = int(240*stats['years'][year]['trips']/top_year_trips) stats['years'][year]['dist_scaled'] = int(240*stats['years'][year]['distance']/top_year_dist) # block scaling stats['years'][year]['trips_blocks'] = float(stats['years'][year]['trips'])/stats['trips_per_block'] stats['years'][year]['trips_blocks_l'] = [True] * (stats['years'][year]['trips']/stats['trips_per_block']) stats['years'][year]['trips_blocks_r'] = int((stats['years'][year]['trips_blocks']-len(stats['years'][year]['trips_blocks_l']))*stats['block_width']) return stats | d9ec1df773d8b8e13ee86486a89e6cfa3129798f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11110/d9ec1df773d8b8e13ee86486a89e6cfa3129798f/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
5296,
12,
25125,
67,
1098,
16,
618,
16,
610,
6874,
33,
8381,
4672,
468,
2660,
898,
333,
513,
485,
471,
19,
280,
741,
7281,
9198,
316,
720,
7028,
1465,
468,
2660,
1361,
1898,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
5296,
12,
25125,
67,
1098,
16,
618,
16,
610,
6874,
33,
8381,
4672,
468,
2660,
898,
333,
513,
485,
471,
19,
280,
741,
7281,
9198,
316,
720,
7028,
1465,
468,
2660,
1361,
1898,
... |
return len(preferenceList), flavorList | curScore = len(preferenceList) if curScore <= scoreToMatch: return len(preferenceList), flavorList return None, [] | def _filterByPreferences(self, flavorList, scoreToMatch): preferenceList = self._flavorPreferences if not preferenceList: return 0, flavorList strongList = [ (x.toStrongFlavor(), x) for x in flavorList ] indexedList = enumerate(preferenceList[:scoreToMatch + 1]) for prefScore, preferenceFlavor in indexedList: matchingFlavors = [ x[1] for x in strongList if x[0].satisfies(preferenceFlavor) ] if matchingFlavors: return prefScore, matchingFlavors return len(preferenceList), flavorList | 20b14777b4372607b724f0538866e5c6e135c2cf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/20b14777b4372607b724f0538866e5c6e135c2cf/trovesource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
858,
12377,
12,
2890,
16,
19496,
682,
16,
4462,
26726,
4672,
11555,
682,
273,
365,
6315,
2242,
9444,
12377,
309,
486,
11555,
682,
30,
327,
374,
16,
19496,
682,
11773,
682,
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,
389,
2188,
858,
12377,
12,
2890,
16,
19496,
682,
16,
4462,
26726,
4672,
11555,
682,
273,
365,
6315,
2242,
9444,
12377,
309,
486,
11555,
682,
30,
327,
374,
16,
19496,
682,
11773,
682,
273... |
exitPolicy = [str(policyLine) for policyLine in descInfo[nsEntry.idhex][1]] | if nsEntry.idhex in descInfo: bwLabel = getSizeLabel(descInfo[nsEntry.idhex][0], 2) exitPolicyLabel = ", ".join([str(policyLine) for policyLine in descInfo[nsEntry.idhex][1]]) else: bwLabel = getSizeLabel(nsEntry.bandwidth, 2) exitPolicyLabel = "Unknown" | def monitorConsensus(): gmailAccount, gmailPassword = DEFAULT_GMAIL_ACCOUNT, "" toAddress = DEFAULT_TO_ADDRESS seenFingerprintsPath = DEFAULT_FINGERPRINTS nsOutputPath = DEFAULT_NS_OUTPUT isQuiet = False # parses user input, noting any issues try: opts, args = getopt.getopt(sys.argv[1:], OPT, OPT_EXPANDED) except getopt.GetoptError, exc: print str(exc) + " (for usage provide --help)" sys.exit() for opt, arg in opts: if opt in ("-g", "--gmail"): gmailAccount = arg elif opt in ("-t", "--to"): toAddress = arg elif opt in ("-f", "--fingerprints"): seenFingerprintsPath = arg elif opt in ("-n", "--nsOutput"): nsOutputPath = arg elif opt in ("-q", "--quiet"): isQuiet = True elif opt in ("-h", "--help"): # notes default values if they exist gmailAcctLabel = " (%s)" % gmailAccount if gmailAccount else "" toAddrLabel = " (%s)" % toAddress if toAddress else "" seenFpLabel = " (%s)" % seenFingerprintsPath if seenFingerprintsPath else "" nsOutputLabel = " (%s)" % nsOutputPath if nsOutputPath else "" print HELP_MSG % (gmailAcctLabel, toAddrLabel, seenFpLabel, nsOutputLabel) sys.exit() # ns output path is a directory, and later expected to end with a slash if nsOutputPath and not nsOutputPath.endswith("/"): nsOutputPath += "/" # fetches gmail password if we're sending email alerts isEmailUsed = gmailAccount and toAddress if isEmailUsed: gmailPassword = getpass.getpass("GMail Password: ") if not gmailAccount or not gmailPassword or not toAddress: print "Email notifications disabled" # get a control port connection conn = util.torTools.connect() if conn == None: print "Unable to connect to control port" sys.exit(1) # prepopulate seenFingerprints with past entries if available seenFingerprints = set() if seenFingerprintsPath and os.path.exists(seenFingerprintsPath): try: seenFingerprintsFile = open(seenFingerprintsPath, "r") for entry in seenFingerprintsFile: seenFingerprints.add(entry.upper().strip()) seenFingerprintsFile.close() except IOError: print "Unable to prepopulate fingerprints from %s" % seenFingerprintsPath seenFingerprintsFile = None if seenFingerprintsPath: try: seenFingerprintsFile = open(seenFingerprintsPath, "a") except IOError: print FP_WRITE_FAIL_MSG % seenFingerprintsPath tick = 0 # number of consensuses processed samplings = [] validAfterDate = None # the 'valid-after' time of the last consensus we've processed # fingerprint => (observedBandwidth, exitPolicy) for all relays descInfo = {} for nsEntry in conn.get_network_status(): try: descLookupCmd = "desc/id/%s" % nsEntry.idhex router = TorCtl.Router.build_from_desc(conn.get_info(descLookupCmd)[descLookupCmd].split("\n"), nsEntry) descInfo[router.idhex] = (router.desc_bw, router.exitpolicy) except TorCtl.ErrorReply: descInfo[nsEntry.idhex] = (0, "") except TorCtl.TorCtlClosed: print "Connection to tor is closed" sys.exit() while True: tick += 1 # fetches the consensus, blocking until a new one's available newConsensus, validAfterDate = getNextConsensus(conn, validAfterDate) nsEntries = TorCtl.parse_ns_body(newConsensus) # determines which entries are new newEntries = [] for nsEntry in nsEntries: # adds entry to descInfo hash if not nsEntry.idhex in descInfo: try: descLookupCmd = "desc/id/%s" % nsEntry.idhex router = TorCtl.Router.build_from_desc(conn.get_info(descLookupCmd)[descLookupCmd].split("\n"), nsEntry) descInfo[router.idhex] = (router.desc_bw, router.exitpolicy) except TorCtl.ErrorReply: descInfo[nsEntry.idhex] = (0, "") except TorCtl.TorCtlClosed: print "Connection to tor is closed" sys.exit() if not nsEntry.idhex in seenFingerprints: newEntries.append(nsEntry) seenFingerprints.add(nsEntry.idhex) # records the seen fingerprint if seenFingerprintsFile: try: seenFingerprintsFile.write(nsEntry.idhex + "\n") except IOError: print FP_WRITE_FAIL_MSG % seenFingerprintsPath seenFingerprintsFile = None newSampling = Sampling(conn, validAfterDate, nsEntries, newEntries) # check if we broke any thresholds (currently just checking hourly exit stats) countAlert = newSampling.getCount(RELAY_EXIT, True) > HOURLY_COUNT_THRESHOLD bwAlert = newSampling.getBandwidth(descInfo, RELAY_EXIT, True) > HOURLY_BW_THRESHOLD samplings.insert(0, newSampling) if len(samplings) > 168: # only remove entries if we have a full day's worth of data to discard lastDate = samplings[-1].getValidAfter().split(" ")[0] earlierDate = samplings[-25].getValidAfter().split(" ")[0] if lastDate == earlierDate: samplings = samplings[:-25] # writes new ns entries if nsOutputPath: nsContents = "" entryDir = nsOutputPath + newSampling.getValidAfter().split(" ")[0] + "/" entryFilename = newSampling.getValidAfter().split(" ")[1] + ".txt" for label, relayType in (("Exits:", RELAY_EXIT), ("Middle:", RELAY_MIDDLE), ("Guards:", RELAY_GUARD)): nsContents += label + "\n" nsContents += "-" * 40 + "\n" for nsEntry in newSampling.newRelays[relayType]: # TODO: the str call of the following produces a deprecation warning, as discussed on: # https://trac.torproject.org/projects/tor/ticket/1777 exitPolicy = [str(policyLine) for policyLine in descInfo[nsEntry.idhex][1]] nsContents += "%s (%s:%s)\n" % (nsEntry.idhex, nsEntry.ip, nsEntry.orport) nsContents += " nickname: %s\n" % nsEntry.nickname nsContents += " bandwidth: %s\n" % getSizeLabel(descInfo[nsEntry.idhex][0], 2) nsContents += " flags: %s\n" % ", ".join(nsEntry.flags) nsContents += " exit policy: %s\n\n" % ", ".join(exitPolicy) try: # make ns entries directory if it doesn't already exist if not os.path.exists(entryDir): os.makedirs(entryDir) # creates subdirectory for each date, then file named after the time nsFile = open(entryDir + entryFilename, "w") nsFile.write(nsContents) nsFile.close() except IOError: print "Unable to access '%s', network status summaries won't be persisted" % (entryDir + entryFilename) nsOutputPath = None # prints results to terminal, ex: # 7. 2010-07-18 10:00:00 - 941/1732/821 relays (8/12/4 are new, 153 MB / 215 MB / 48 MB added bandwidth) if not isQuiet: print "%i. %s" % (tick, newSampling.getSummary(descInfo)) if countAlert: print " *count threshold broken*" if bwAlert: print " *bandwidth threshold broken*" if countAlert or bwAlert or (tick % 24 == 0): currentTime = time.strftime("%H:%M", time.localtime(time.time())) currentDate = time.strftime("%m/%d/%Y", time.localtime(time.time())) if countAlert: subject = "Alert: Relay Count Threshold Broken" noticeBody = "The relay count threshold was broken today at %s (%s) with the addition of %i new exits (the current threshold is set at %i)." noticeMsg = noticeBody % (currentTime, currentDate, newSampling.getCount(RELAY_EXIT), HOURLY_COUNT_THRESHOLD) elif bwAlert: subject = "Alert: Relay Bandwidth Threshold Broken" noticeBody = "The relay bandwidth threshold was broken today at %s (%s) with the addition of %s of new exit capacity (the current threshold is set at %i)." noticeMsg = noticeBody % (currentTime, currentDate, getSizeLabel(newSampling.getBandwidth(descInfo, RELAY_EXIT)), getSizeLabel(HOURLY_BW_THRESHOLD)) else: subject = "Daily Consensus Report for %s" % currentDate noticeMsg = "At present there's no breaches to report. See below for a summary of consensus additions." greetingMsg = "Greetings from your friendly consensus monitoring daemon. %s" % noticeMsg # constructs the plain text message msgText = greetingMsg + "\n" msgText += "-" * 80 + "\n\n" for sampling in samplings: msgText += sampling.getSummary(descInfo) + "\n" # constructs the html message msgHtml = """<html> <head></head> <body> <p>%s</p> <hr /> <table style="border-collapse:collapse;"> <tr> <td></td> <td colspan="3" bgcolor="green"><b> Guards</b></td> <td colspan="3" bgcolor="yellow"><b> Middle</b></td> <td colspan="3" bgcolor="red"><b> Exits</b></td> <td bgcolor="blue"><b> Total</b></td> </tr> <tr> <td bgcolor="#444444"><b> Date:</b></td> <td bgcolor="green"><b> Count: </b></td> <td bgcolor="green"><b>New: </b></td> <td bgcolor="green"><b>Bandwidth: </b></td> <td bgcolor="yellow"><b> Count: </b></td> <td bgcolor="yellow"><b>New: </b></td> <td bgcolor="yellow"><b>Bandwidth: </b></td> <td bgcolor="red"><b> Count: </b></td> <td bgcolor="red"><b>New: </b></td> <td bgcolor="red"><b>Bandwidth: </b></td> <td bgcolor="blue"><b> Bandwidth: </b></td> </tr> | 22da42af41f7b69227eb4a16ec1028b853c9b023 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13459/22da42af41f7b69227eb4a16ec1028b853c9b023/consensusTracker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6438,
9054,
9781,
13332,
314,
4408,
3032,
16,
314,
4408,
3913,
273,
3331,
67,
43,
18191,
67,
21690,
16,
1408,
358,
1887,
273,
3331,
67,
4296,
67,
15140,
5881,
17678,
87,
743,
273,
3331,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6438,
9054,
9781,
13332,
314,
4408,
3032,
16,
314,
4408,
3913,
273,
3331,
67,
43,
18191,
67,
21690,
16,
1408,
358,
1887,
273,
3331,
67,
4296,
67,
15140,
5881,
17678,
87,
743,
273,
3331,
... |
inpop = self.pop.individual(ind.info('oldindex')) | inpop = self.pop.individual(int(ind.oldindex)) | def testRandomSample(self): 'Testing random sampling (imcomplete)' (s,) = RandomSample(self.pop, 10) self.assertEqual(s.popSize(), 10) for ind in s.individuals(): inpop = self.pop.individual(ind.info('oldindex')) self.assertEqual(ind, inpop) # (s,) = RandomSample(self.pop, [2, 8]) self.assertEqual(s.subPopSize(0), 2) self.assertEqual(s.subPopSize(1), 8) # for ind in s.individuals(): inpop = self.pop.individual(ind.info('oldindex')) self.assertEqual(ind, inpop) | 78c7ea1285035525823b8c7293256c6bd2a72438 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/401/78c7ea1285035525823b8c7293256c6bd2a72438/test_16_asertainment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
8529,
8504,
12,
2890,
4672,
296,
22218,
2744,
11558,
261,
381,
6226,
2506,
261,
87,
16,
13,
273,
8072,
8504,
12,
2890,
18,
5120,
16,
1728,
13,
365,
18,
11231,
5812,
12,
87,
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,
1842,
8529,
8504,
12,
2890,
4672,
296,
22218,
2744,
11558,
261,
381,
6226,
2506,
261,
87,
16,
13,
273,
8072,
8504,
12,
2890,
18,
5120,
16,
1728,
13,
365,
18,
11231,
5812,
12,
87,
18,
... |
'help': line[helpstring_offset:]}) | 'help': line[helpstring_offset:] + ' '}) | def help2optparse(self): """convert from help strings to optparse.OptionParser object.""" helpstring_offset = self._get_helpoffset() option_cnt = -1 option_list = [] ## 1 == 'Options' line for line in self.parselines[1:]: if '--help' in line: continue tmp = line.split() metavar = None if tmp[0][:2] == '--': ## only long option longopt = tmp[0] if '=' in longopt: longtmp = longopt.split("=") longopt = longtmp[0] metavar = longtmp[1] option_list.append({'short': None, 'long': longopt, 'metavar': metavar, 'help': line[helpstring_offset:]}) option_cnt += 1 elif tmp[0][0] == '-': ## short option shortopt = tmp[0][:2] longopt = None if tmp[1][:2] == '--': longopt = tmp[1] if '=' in longopt: longtmp = longopt.split("=") longopt = longtmp[0] metavar = longtmp[1] option_list.append({'short': shortopt, 'long': longopt, 'metavar': None, 'help': line[helpstring_offset:]}) option_cnt += 1 else: ## only help-strings line option_list[option_cnt]['help'] += " " option_list[option_cnt]['help'] += line[helpstring_offset:] if '--version' in self.parselines[0]: parser = OptionParser(version="dummy") else: parser = OptionParser() for opt in option_list: if opt['short']: parser.add_option(opt['short'], opt['long'], metavar=opt['metavar'], help=opt['help']) else: parser.add_option(opt['long'], metavar=opt['metavar'], help=opt['help']) return parser | 44b92c0383af6b5d59540979b51575856d2afab8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/605/44b92c0383af6b5d59540979b51575856d2afab8/genzshcomp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
22,
3838,
2670,
12,
2890,
4672,
3536,
6283,
628,
2809,
2064,
358,
2153,
2670,
18,
1895,
2678,
733,
12123,
2809,
1080,
67,
3348,
273,
365,
6315,
588,
67,
5201,
3348,
1435,
1456,
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,
2809,
22,
3838,
2670,
12,
2890,
4672,
3536,
6283,
628,
2809,
2064,
358,
2153,
2670,
18,
1895,
2678,
733,
12123,
2809,
1080,
67,
3348,
273,
365,
6315,
588,
67,
5201,
3348,
1435,
1456,
67,... |
bin = gst.parse_launch ("decodebin name=am_decodebin ! \ | bin = gst.parse_launch("decodebin name=am_decodebin ! \ | def __init__ (self, source): super (AudioMetadata, self).__init__ () # setup the metadata extracting pipeline bin = gst.parse_launch ("decodebin name=am_decodebin ! \ fakesink name=am_fakesink") self.__oper = GstOperation(pipeline = bin) # link source with decodebin bin.add (source) source.link (bin.get_by_name ("am_decodebin")) # set fakesink as the query_element self._fakesink = bin.get_by_name ("am_fakesink") self._fakesink.set_property ("signal-handoffs", True) self._fakesink.connect ("handoff", self.on_handoff) self.__oper.query_element = self._fakesink self.__oper.listeners.append (self) self.__metadata = {} self.__element = None | 016aec4a85d3438c0d49f1f8b2012e23eb7805ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2207/016aec4a85d3438c0d49f1f8b2012e23eb7805ec/audio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
1084,
4672,
2240,
261,
12719,
2277,
16,
365,
2934,
972,
2738,
972,
1832,
225,
468,
3875,
326,
1982,
27117,
5873,
4158,
273,
314,
334,
18,
2670,
67,
20738,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2890,
16,
1084,
4672,
2240,
261,
12719,
2277,
16,
365,
2934,
972,
2738,
972,
1832,
225,
468,
3875,
326,
1982,
27117,
5873,
4158,
273,
314,
334,
18,
2670,
67,
20738,... |
if len(className) == 0: | if len(classMap) == 0: | def findVariables(rootNode): variables = [] for node in treeutil.nodeIterator(rootNode, ["assignment", "call"]): if node.type == "assignment": variables.append(node.getChild("left")) elif node.type == "call": variables.append(node.getChild("operand")) return variables | 7305e5fd7d70ec8e8ab267637f24ae9c34e56f85 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/7305e5fd7d70ec8e8ab267637f24ae9c34e56f85/ecmalint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
6158,
12,
3085,
907,
4672,
3152,
273,
5378,
364,
756,
316,
2151,
1367,
18,
2159,
3198,
12,
3085,
907,
16,
8247,
12960,
3113,
315,
1991,
11929,
4672,
309,
756,
18,
723,
422,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
6158,
12,
3085,
907,
4672,
3152,
273,
5378,
364,
756,
316,
2151,
1367,
18,
2159,
3198,
12,
3085,
907,
16,
8247,
12960,
3113,
315,
1991,
11929,
4672,
309,
756,
18,
723,
422,
315,
... |
attrs.append('%s: %s' % (key, value)) | attrs.append(u'%s: %s' % (key, value)) | def structure_to_str(structure, level=0, overline=False): structure.sort() text = [] for name, attributes, sub_struct in structure: # Don't show the empty elements if not sub_struct and not attributes: return None name = translations[name] # Underline and Overline the name if level < len(underline_lvl): underline = underline_lvl[level] * len(name) if overline: text.append(underline) text.append(name) text.append(underline) # Add a separation between name and attributes text[-1] += '\n' attrs = [] # Attributes for key, value in attributes.iteritems(): attrs.append('%s: %s' % (key, value)) if attrs: attrs.sort() # Add a separation between attributes and children attrs[-1] += '\n' text.extend(attrs) # Children sub_struct_text = structure_to_str(sub_struct, level + 1) if sub_struct_text: text.append(sub_struct_text) return u'\n'.join(text) | 26dac8ed27632acf387500a93fe9bc60dc7d55fa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10612/26dac8ed27632acf387500a93fe9bc60dc7d55fa/lpod-style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3695,
67,
869,
67,
701,
12,
7627,
16,
1801,
33,
20,
16,
1879,
1369,
33,
8381,
4672,
3695,
18,
3804,
1435,
977,
273,
5378,
364,
508,
16,
1677,
16,
720,
67,
1697,
316,
3695,
30,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3695,
67,
869,
67,
701,
12,
7627,
16,
1801,
33,
20,
16,
1879,
1369,
33,
8381,
4672,
3695,
18,
3804,
1435,
977,
273,
5378,
364,
508,
16,
1677,
16,
720,
67,
1697,
316,
3695,
30,
468,
... |
18 + 18*19 + 18*19^2 + 18*19^3 + 18*19^4 + O(19^Infinity) | 18 + 18*19 + 18*19^2 + 18*19^3 + 18*19^4 + O(19^5) | def __pow__(self, right): """ EXAMPLES: sage: K = Qp(19) sage: K.prec(5) sage: a = K(-1); a 18 + 18*19 + 18*19^2 + 18*19^3 + 18*19^4 + O(19^Infinity) sage: a^2 1 sage: a^3 18 + 18*19 + 18*19^2 + 18*19^3 + 18*19^4 + O(19^Infinity) sage: K(5)^30 11 + 14*19 + 19^2 + 7*19^3 + O(19^Infinity) """ right = integer.Integer(right) if self == 0: if right == 0: raise ValueError, "0^0 not defined" return 0 if right < 0: inv = 1/self return inv**(-right) if right == 0: return pAdic(self.__parent, 1) ordp = right * self.__ordp if self.__prec == infinity: z = pAdic(self.__parent, self.__unit**right) z.__ordp = ordp return z else: prec = self.__prec unit = arith.power_mod(self.__unit, right, self.__p**prec) return pAdic(self.__parent, unit, prec + ordp, ordp) | 0d96c2fdcec1f6e0880d2e9dd2ff28f4fa764306 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/0d96c2fdcec1f6e0880d2e9dd2ff28f4fa764306/padic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
23509,
972,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
1475,
273,
2238,
84,
12,
3657,
13,
272,
410,
30,
1475,
18,
4036,
12,
25,
13,
272,
410,
30,
279,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23509,
972,
12,
2890,
16,
2145,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
1475,
273,
2238,
84,
12,
3657,
13,
272,
410,
30,
1475,
18,
4036,
12,
25,
13,
272,
410,
30,
279,... |
self.popContent('summary') | if self._summaryKey == 'content': self._end_content() else: self.popContent(self._summaryKey or 'summary') self._summaryKey = None | def _end_summary(self): self.popContent('summary') | 50cbe5fb44dbff087e8cca95d332bb7b7cc15747 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10695/50cbe5fb44dbff087e8cca95d332bb7b7cc15747/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
409,
67,
7687,
12,
2890,
4672,
365,
18,
5120,
1350,
2668,
7687,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
409,
67,
7687,
12,
2890,
4672,
365,
18,
5120,
1350,
2668,
7687,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'subarches': SchemaItemList(), | def __call__(self, i): i = i.strip() if not i: return [] return [j.strip() for j in re.split(self.type, i)] | 4fce5d1f110fa164dbdea466ff857ee6aec6f31a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5794/4fce5d1f110fa164dbdea466ff857ee6aec6f31a/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
277,
4672,
277,
273,
277,
18,
6406,
1435,
309,
486,
277,
30,
327,
5378,
327,
306,
78,
18,
6406,
1435,
364,
525,
316,
283,
18,
4939,
12,
2890,
18,
723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
1991,
972,
12,
2890,
16,
277,
4672,
277,
273,
277,
18,
6406,
1435,
309,
486,
277,
30,
327,
5378,
327,
306,
78,
18,
6406,
1435,
364,
525,
316,
283,
18,
4939,
12,
2890,
18,
723,
... | |
if self.__subpartDict.keys(): partName = self.__subpartDict.keys()[0] else: partName = 'modelRoot' | partName = 'modelRoot' | def getAnimControl(self, animName, partName=None, lodName=None): """ getAnimControl(self, string, string, string="lodRoot") Search the animControl dictionary indicated by lodName for a given anim and part. If none specified, try the first part and lod. Return the animControl if present, or None otherwise """ if not partName: if self.__subpartDict.keys(): partName = self.__subpartDict.keys()[0] else: partName = 'modelRoot' | 7ee602f9339dcb42047a2daf78a722cc99582eb3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/7ee602f9339dcb42047a2daf78a722cc99582eb3/Actor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
20892,
3367,
12,
2890,
16,
10536,
461,
16,
1087,
461,
33,
7036,
16,
328,
369,
461,
33,
7036,
4672,
3536,
336,
20892,
3367,
12,
2890,
16,
533,
16,
533,
16,
533,
1546,
80,
369,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20892,
3367,
12,
2890,
16,
10536,
461,
16,
1087,
461,
33,
7036,
16,
328,
369,
461,
33,
7036,
4672,
3536,
336,
20892,
3367,
12,
2890,
16,
533,
16,
533,
16,
533,
1546,
80,
369,
23... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.