rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
("input", self.startTagInput),
def __init__(self, parser, tree): Phase.__init__(self, parser, tree)
b844e11a4f8d18b80cac200322d0531ae650b498 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4487/b844e11a4f8d18b80cac200322d0531ae650b498/html5parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2082, 16, 2151, 4672, 19459, 16186, 2738, 972, 12, 2890, 16, 2082, 16, 2151, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2082, 16, 2151, 4672, 19459, 16186, 2738, 972, 12, 2890, 16, 2082, 16, 2151, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self.obj=weakref.proxy(obj) if type(obj)!=weakref.ProxyType else obj
self._obj=weakref.ref(obj) if type(obj)!=weakref.ProxyType else obj
def __init__(self,obj,position): """
28da1401f53aa189b0e111696c7e47e1d8cde6df /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/28da1401f53aa189b0e111696c7e47e1d8cde6df/textHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2603, 16, 3276, 4672, 3536, 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, 1001, 2738, 972, 12, 2890, 16, 2603, 16, 3276, 4672, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if USE_ZIPIMPORT: ZIP_ARCHIVE = "Modules.zip" SITE_PY += "sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE def getPycData(fullname, code, ispkg): if ispkg: fullname += ".__init__" path = fullname.replace(".", os.sep) + PYC_EXT return path, MAGIC + '\0\0\0\0' + marshal.dumps(code)
ZIP_ARCHIVE = "Modules.zip" SITE_PY_ZIP = SITE_PY + ("sys.path.append(sys.path[0] + '/%s')\n" % ZIP_ARCHIVE) def getPycData(fullname, code, ispkg): if ispkg: fullname += ".__init__" path = fullname.replace(".", os.sep) + PYC_EXT return path, MAGIC + '\0\0\0\0' + marshal.dumps(code)
def report(self): # XXX something decent pass
f2981883368f2180079a9b80dcff260cd5ab0ab8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/f2981883368f2180079a9b80dcff260cd5ab0ab8/bundlebuilder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2605, 12, 2890, 4672, 468, 11329, 5943, 2109, 319, 1342, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2605, 12, 2890, 4672, 468, 11329, 5943, 2109, 319, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
out = self.do_convert_real([request, repeat])
out = self.do_convert_real([request, page.page_name, repeat])
def do(self, text, output): text = text.lstrip('\n') output = output.strip('\n') output = "<p>%s </p>" % output request = MinimalRequest() formatter = MoinMoin.formatter.text_gedit.Formatter(request) formatter.setPage(MinimalPage()) MoinMoin.parser.wiki.Parser(text, request).format(formatter) repeat = ''.join(request.result).strip('\n') self.failUnlessEqual(repeat, output) out = self.do_convert_real([request, repeat]) out = out.rstrip('\n') self.failUnlessEqual(text, out)
ba2b39fcd04c590a84d41429669714ca936397e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/ba2b39fcd04c590a84d41429669714ca936397e8/test_converter_text_html_text_x_moin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 12, 2890, 16, 977, 16, 876, 4672, 977, 273, 977, 18, 80, 6406, 2668, 64, 82, 6134, 876, 273, 876, 18, 6406, 2668, 64, 82, 6134, 876, 273, 3532, 84, 9822, 87, 7765, 84, 2984, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 12, 2890, 16, 977, 16, 876, 4672, 977, 273, 977, 18, 80, 6406, 2668, 64, 82, 6134, 876, 273, 876, 18, 6406, 2668, 64, 82, 6134, 876, 273, 3532, 84, 9822, 87, 7765, 84, 2984, 7...
file = req.get_selector() localfile = url2pathname(file)
filename = req.get_selector() localfile = url2pathname(filename)
def open_local_file(self, req): import email.utils import mimetypes host = req.get_host() file = req.get_selector() localfile = url2pathname(file) try: stats = os.stat(localfile) size = stats.st_size modified = email.utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(file)[0] headers = mimetools.Message(StringIO( 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) if not host or \ (not port and socket.gethostbyname(host) in self.get_names()): return addinfourl(open(localfile, 'rb'), headers, 'file://'+ host + file) except OSError, msg: # urllib2 users shouldn't expect OSErrors coming from urlopen() raise URLError(msg) raise URLError('file not on local host')
029f94673322ff63af99b756add6b213d174f2aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/029f94673322ff63af99b756add6b213d174f2aa/urllib2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3729, 67, 768, 12, 2890, 16, 1111, 4672, 1930, 2699, 18, 5471, 1930, 20369, 15180, 1479, 273, 1111, 18, 588, 67, 2564, 1435, 1544, 273, 1111, 18, 588, 67, 9663, 1435, 1191, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3729, 67, 768, 12, 2890, 16, 1111, 4672, 1930, 2699, 18, 5471, 1930, 20369, 15180, 1479, 273, 1111, 18, 588, 67, 2564, 1435, 1544, 273, 1111, 18, 588, 67, 9663, 1435, 1191, 7...
os.remove(tmp_file[:-4] + '.s')
if os.path.exists(tmp_file[:-4] + '.s'): os.remove(tmp_file[:-4] + '.s')
def func(extension, build_dir):
3a4d030457e6964452a3089427b7d6f482ab0b42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/3a4d030457e6964452a3089427b7d6f482ab0b42/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 12, 6447, 16, 1361, 67, 1214, 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, 1326, 12, 6447, 16, 1361, 67, 1214, 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,...
elif id==1003:
elif id in (1003, 1004, 1005):
def OnCommand(self, hwnd, msg, wparam, lparam): id = LOWORD(wparam) if id == 1000: print "Goodbye" DestroyWindow(self.hwnd) elif id==1003: # Our 'checkbox' item state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND) if state==-1: raise RuntimeError, "No item found" if state & win32con.MF_CHECKED: check_flags = win32con.MF_UNCHECKED print "Menu was checked - unchecking" elif state & win32con.MF_UNCHECKED: check_flags = win32con.MF_CHECKED print "Menu was unchecked - checking" else: raise RuntimeError, "Menu is neither checked nor unchecked!"
41e8eeb162c4f73270469cdfeefb1acffafa48d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/41e8eeb162c4f73270469cdfeefb1acffafa48d3/win32gui_menu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 2189, 12, 2890, 16, 16139, 4880, 16, 1234, 16, 341, 891, 16, 328, 891, 4672, 612, 273, 1806, 7952, 12, 91, 891, 13, 309, 612, 422, 4336, 30, 1172, 315, 18195, 1637, 73, 6, 1570...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 2189, 12, 2890, 16, 16139, 4880, 16, 1234, 16, 341, 891, 16, 328, 891, 4672, 612, 273, 1806, 7952, 12, 91, 891, 13, 309, 612, 422, 4336, 30, 1172, 315, 18195, 1637, 73, 6, 1570...
pp_opts = _gen_preprocess_options (self.macros + macros, self.include_dirs + includes)
pp_opts = gen_preprocess_options (self.macros + macros, self.include_dirs + includes)
def compile (self, sources, macros=None, includes=None):
c294113f180cd0deb66857432463f21ead92392a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c294113f180cd0deb66857432463f21ead92392a/unixccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 261, 2890, 16, 5550, 16, 24302, 33, 7036, 16, 6104, 33, 7036, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 4074, 261, 2890, 16, 5550, 16, 24302, 33, 7036, 16, 6104, 33, 7036, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
options.spine = [i.href for i in opf.spine.items()]
options.spine = [i.href for i in opf.spine.items()]
def try_opf(path, options, logger): try: opf = glob.glob(os.path.join(os.path.dirname(path),'*.opf'))[0] except IndexError: return opf = OPFReader(open(opf, 'rb'), os.path.dirname(os.path.abspath(opf))) try: title = opf.title if title and not options.title: options.title = title if options.author == 'Unknown': if opf.authors: options.author = ', '.join(opf.authors) if opf.author_sort: options.author_sort = opf.author_sort if options.publisher == 'Unknown': publisher = opf.publisher if publisher: options.publisher = publisher if not options.category: category = opf.category if category: options.category = category if not options.cover: cover = opf.cover if cover: cover = os.path.join(os.path.dirname(path), cover) if os.access(cover, os.R_OK): try: PILImage.open(cover) options.cover = cover except: pass if not options.cover: for prefix in opf.possible_cover_prefixes(): if options.cover: break for suffix in ['.jpg', '.jpeg', '.gif', '.png', '.bmp']: cpath = os.path.join(os.path.dirname(path), prefix+suffix) try: PILImage.open(cpath) options.cover = cpath break except: continue options.spine = [i.href for i in opf.spine.items()] options.toc = opf.toc except Exception: logger.exception('Failed to process opf file')
2e52d6dfe34d581cf37a65a4b03909a18d938c95 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9125/2e52d6dfe34d581cf37a65a4b03909a18d938c95/convert_from.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 775, 67, 556, 74, 12, 803, 16, 702, 16, 1194, 4672, 775, 30, 1061, 74, 273, 4715, 18, 10581, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 803, 3631, 11, 11146, 556,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 775, 67, 556, 74, 12, 803, 16, 702, 16, 1194, 4672, 775, 30, 1061, 74, 273, 4715, 18, 10581, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 803, 3631, 11, 11146, 556,...
consumer = self.cp.getConsumer(self.options.consumerid, self.options.username, self.options.password)
admin_cp = connection.UEPConnection(username=self.options.username, password=self.options.password) consumer = admin_cp.getConsumer(self.options.consumerid, self.options.username, self.options.password)
def _do_command(self):
8585edd8a956d681584779a043d9665531d25104 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11137/8585edd8a956d681584779a043d9665531d25104/managercli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 3076, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 3076, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
return "\n".join(newval)
return "".join(newval)
def edit_str(self,string): """ Launches a text editor on a tempory file conatinaing string. Returns the contents of the file when the editor is closed. """ #NamedTemporary file works really well on Unix but # is a complete blowout under windows - where there # is no way to unlock the file and *not* delete it fd, fname = tempfile.mkstemp(suffix=".attribute") f = os.fdopen(fd,"w+") f.write(string) f.close() self.launch_edit(fname) f = open(fname,"r") newval = f.readlines() f.close() try: os.remove(fname) except (WindowsError,OSError), e: self.logger.warn(str(e)) pass return "\n".join(newval)
b8615717dbd623ed68962aa2478a6198a57089b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11984/b8615717dbd623ed68962aa2478a6198a57089b7/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 67, 701, 12, 2890, 16, 1080, 4672, 3536, 14643, 281, 279, 977, 4858, 603, 279, 1906, 630, 585, 356, 270, 15314, 310, 533, 18, 2860, 326, 2939, 434, 326, 585, 1347, 326, 4858, 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, 3874, 67, 701, 12, 2890, 16, 1080, 4672, 3536, 14643, 281, 279, 977, 4858, 603, 279, 1906, 630, 585, 356, 270, 15314, 310, 533, 18, 2860, 326, 2939, 434, 326, 585, 1347, 326, 4858, 353...
replaces_to_perform = [[' ', '_'], ['(', '\('], [')', '\)'], ['.', '\.'], ['[', '\['], [']', '\]']
replaces_to_perform = [[' ', '_'], ['(', '\('], [')', '\)'], ['.', '\.'], ['[', '\['], [']', '\]'],
def checkImageDuplicated(self, duplicates_rollback): """ Function to check the duplicated images. """ # {{Dupe|Image:Blanche_Montel.jpg}} # Skip the stub images #if 'stub' in self.image.lower() and self.project == 'wikipedia' and self.site.lang == 'it': # return True # Skip the stub, ok dupText = wikipedia.translate(self.site, duplicatesText) dupRegex = wikipedia.translate(self.site, duplicatesRegex) dupTalkHead = wikipedia.translate(self.site, duplicate_user_talk_head) dupTalkText = wikipedia.translate(self.site, duplicates_user_talk_text) dupComment_talk = wikipedia.translate(self.site, duplicates_comment_talk) dupComment_image = wikipedia.translate(self.site, duplicates_comment_image) duplicateRegex = r'\n\*(?:\[\[:Image:%s\]\] has the following duplicates:|\*\[\[:Image:%s\]\])$' % (self.convert_to_url(self.image), self.convert_to_url(self.image)) imagePage = wikipedia.ImagePage(self.site, 'Image:%s' % self.image) hash_found = imagePage.getHash() duplicates = self.site.getImagesFromAnHash(hash_found) if duplicates == None: return False # Error, image deleted, no hash found. Skip the image. if len(duplicates) > 1: if len(duplicates) == 2: wikipedia.output(u'%s has a duplicate! Reporting it...' % self.image) else: wikipedia.output(u'%s has %s duplicates! Reporting them...' % (self.image, len(duplicates) - 1)) if not dupText == None and not dupRegex == None: time_image_list = list() time_list = list() for duplicate in duplicates: DupePage = wikipedia.ImagePage(self.site, u'Image:%s' % duplicate) imagedata = DupePage.getLatestUploader()[1] # '2008-06-18T08:04:29Z' data = time.strptime(imagedata, "%Y-%m-%dT%H:%M:%SZ") data_seconds = time.mktime(data) time_image_list.append([data_seconds, duplicate]) time_list.append(data_seconds) older_image = self.returnOlderTime(time_image_list, time_list) # And if the images are more than two? Page_oder_image = wikipedia.ImagePage(self.site, u'Image:%s' % older_image) string = '' images_to_tag_list = [] for duplicate in duplicates: if wikipedia.ImagePage(self.site, u'%s:%s' % (self.image_namespace, duplicate)) == \ wikipedia.ImagePage(self.site, u'%s:%s' % (self.image_namespace, older_image)): continue # the older image, not report also this as duplicate DupePage = wikipedia.ImagePage(self.site, u'Image:%s' % duplicate) try: DupPageText = DupePage.get() older_page_text = Page_oder_image.get() except wikipedia.NoPage: continue # The page doesn't exists if re.findall(dupRegex, DupPageText) == [] and re.findall(dupRegex, older_page_text) == []: wikipedia.output(u'%s is a duplicate and has to be tagged...' % duplicate) images_to_tag_list.append(duplicate) #if duplicate != duplicates[-1]: string += "*[[:%s%s]]\n" % (self.image_namespace, duplicate) #else: # string += "*[[:%s%s]]" % (self.image_namespace, duplicate) else: wikipedia.output(u"Already put the dupe-template in the image's page or in the dupe's page. Skip.") return True # Ok - No problem. Let's continue the checking phase older_image_ns = '%s%s' % (self.image_namespace, older_image) # adding the namespace only_report = False # true if the image are not to be tagged as dupes
8d27b2a518c167f9e7e1e6c9563bde869aab55ce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/8d27b2a518c167f9e7e1e6c9563bde869aab55ce/checkimages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 2040, 19682, 690, 12, 2890, 16, 11211, 67, 20050, 4672, 3536, 4284, 358, 866, 326, 16975, 4602, 18, 3536, 468, 10179, 40, 89, 347, 96, 2040, 30, 4802, 304, 18706, 67, 49, 1580, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 2040, 19682, 690, 12, 2890, 16, 11211, 67, 20050, 4672, 3536, 4284, 358, 866, 326, 16975, 4602, 18, 3536, 468, 10179, 40, 89, 347, 96, 2040, 30, 4802, 304, 18706, 67, 49, 1580, 29...
sys.path.insert(0, "/usr/share/pygtk/2.0/codegen")
sys.path.insert(0, sys.argv[1])
def get_python_name(c_name): py_name = c_name.capitalize() letters = list(re.findall("_[a-z]", c_name)) for match in letters: py_name = py_name.replace(match, match.upper()[1]) return py_name.replace("_", "")
fff11cd76a7dbb00b3284ae5b24cfb62d102bf53 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6176/fff11cd76a7dbb00b3284ae5b24cfb62d102bf53/pygwy-fix-defs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8103, 67, 529, 12, 71, 67, 529, 4672, 2395, 67, 529, 273, 276, 67, 529, 18, 5909, 7053, 554, 1435, 13768, 273, 666, 12, 266, 18, 4720, 454, 2932, 67, 63, 69, 17, 94, 65, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8103, 67, 529, 12, 71, 67, 529, 4672, 2395, 67, 529, 273, 276, 67, 529, 18, 5909, 7053, 554, 1435, 13768, 273, 666, 12, 266, 18, 4720, 454, 2932, 67, 63, 69, 17, 94, 65, ...
def update_completion_and_select(self, word, lang): self.update_completion(word, select_if_one = False)
def update_completion_and_select(self, completion_word, word, lang): self.update_completion(completion_word, select_if_one = False)
def update_completion_and_select(self, word, lang): self.update_completion(word, select_if_one = False) self.select_word(word, lang) return False
959531726c990fd64610de9a89159e12eb94a90b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14305/959531726c990fd64610de9a89159e12eb94a90b/pysdic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 11469, 67, 464, 67, 4025, 12, 2890, 16, 8364, 67, 1095, 16, 2076, 16, 3303, 4672, 365, 18, 2725, 67, 11469, 12, 11469, 67, 1095, 16, 2027, 67, 430, 67, 476, 273, 1083, 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, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 11469, 67, 464, 67, 4025, 12, 2890, 16, 8364, 67, 1095, 16, 2076, 16, 3303, 4672, 365, 18, 2725, 67, 11469, 12, 11469, 67, 1095, 16, 2027, 67, 430, 67, 476, 273, 1083, 13, ...
if o.object_type == 'atom': to_redraw |= Set( [b for b in o.neighbor_edges if b not in deleted]) elif o.object_type == 'bond': to_redraw |= Set( [a for a in o.get_atoms() if a.show and not a in deleted]) elif o.object_type == 'point': to_redraw.add( o) to_redraw.add( o.parent)
if o.object_type == 'atom': to_redraw |= Set( [b for b in o.neighbor_edges if b not in deleted]) elif o.object_type == 'bond': to_redraw |= Set( [a for a in o.get_atoms() if a.show and not a in deleted]) elif o.object_type == 'point': to_redraw.add( o) to_redraw.add( o.parent)
def set_state( self, previous): """sets the system to the recorded state (update is done only where necessary, not changed values are not touched).""" # we need to know about deleted bonds before we try to redraw them (when updating atom) deleted = misc.difference( self.objects, previous.objects) to_redraw = Set() ## CHANGED OBJECTS i = 0 for o in self.objects: changed = 0 for a in o.meta__undo_fake: # fakes serve only to force redraw in some cases however do not perform any undo if self.records[i][a] != getattr( o, a): changed = 1 for a in o.meta__undo_simple: if self.records[i][a] != o.__dict__[a]: o.__dict__[a] = self.records[i][a] if a != 'molecule': # this jumps a little from the clean, meta-driven design, however saves much time changed = 1 for a in o.meta__undo_copy: if self.records[i][a] != o.__dict__[a]: o.__dict__[a] = copy.copy( self.records[i][a]) changed = 1 # this part is not meta driven, I have to rewrite it one day if a == 'bonds': o.edges = o.bonds elif a == 'atoms': o.vertices = o.atoms # / end of the shitty patch for a in o.meta__undo_properties: if hasattr( o, a): if self.records[i][a] != getattr( o, a): setattr( o, a, self.records[i][a]) changed = 1
969819c6177c6f1deb1ab4a99a1ca2f225bae494 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4298/969819c6177c6f1deb1ab4a99a1ca2f225bae494/undo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 2019, 12, 365, 16, 2416, 4672, 3536, 4424, 326, 2619, 358, 326, 16421, 919, 261, 2725, 353, 2731, 1338, 1625, 4573, 16, 486, 3550, 924, 854, 486, 358, 19370, 13, 12123, 468, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 2019, 12, 365, 16, 2416, 4672, 3536, 4424, 326, 2619, 358, 326, 16421, 919, 261, 2725, 353, 2731, 1338, 1625, 4573, 16, 486, 3550, 924, 854, 486, 358, 19370, 13, 12123, 468, 7...
ps.dumpAsDot("turn%d.dot" % turn)
def testPredictSplits7(self): print "\ntest 7 begins" ps = PredictSplits("Gr", "Gr08", ['Titan', 'Angel', 'Gargoyle', 'Gargoyle', 'Centaur', 'Centaur', 'Ogre', 'Ogre']) ps.printLeaves()
29f105858f8a8c5d94f98471fb58ccd85ebaa865 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3755/29f105858f8a8c5d94f98471fb58ccd85ebaa865/test_predictsplits.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 21362, 16582, 27, 12, 2890, 4672, 1172, 1548, 496, 395, 2371, 17874, 6, 4250, 273, 19166, 933, 16582, 2932, 20799, 3113, 315, 20799, 6840, 3113, 10228, 56, 305, 304, 2187, 296, 22757...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21362, 16582, 27, 12, 2890, 4672, 1172, 1548, 496, 395, 2371, 17874, 6, 4250, 273, 19166, 933, 16582, 2932, 20799, 3113, 315, 20799, 6840, 3113, 10228, 56, 305, 304, 2187, 296, 22757...
if mode==0: self.recv=self.read=self._read_nbio self.send=self.write=self._write_nbio else: self.recv=self.read=self._read_bio self.send=self.write=self._write_bio
def setblocking(self, mode): self.socket.setblocking(mode) if mode==0: self.recv=self.read=self._read_nbio self.send=self.write=self._write_nbio else: self.recv=self.read=self._read_bio self.send=self.write=self._write_bio
68eec3f8b360f3b2273e926c78910c19fb337641 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10522/68eec3f8b360f3b2273e926c78910c19fb337641/Connection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 18926, 12, 2890, 16, 1965, 4672, 365, 18, 7814, 18, 542, 18926, 12, 3188, 13, 309, 1965, 631, 20, 30, 365, 18, 18334, 33, 2890, 18, 896, 33, 2890, 6315, 896, 67, 6423, 1594, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 18926, 12, 2890, 16, 1965, 4672, 365, 18, 7814, 18, 542, 18926, 12, 3188, 13, 309, 1965, 631, 20, 30, 365, 18, 18334, 33, 2890, 18, 896, 33, 2890, 6315, 896, 67, 6423, 1594, 365...
client._request('REPORT', '%s/%s' % (PRINCIPAL_DAV_PATH, CALENDAR), body=body, headers={ 'Depth': '1' })
client._request('REPORT', '%s/%s' % (PRINCIPAL_DAV_PATH, CALENDAR), body=body, headers={ 'Content-Type':'text/xml', 'Depth': '1' })
def test_timerangequery_02(): body = open(FILES_DIR+'reports/timerangequery/timerange_02.xml').read() client._request('REPORT', '%s/%s' % (PRINCIPAL_DAV_PATH, CALENDAR), body=body, headers={ 'Depth': '1' }) assert client.response.status == 207
0eb233b34e19f3cc4572957bdd4dfc9d1e2048e1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9939/0eb233b34e19f3cc4572957bdd4dfc9d1e2048e1/test_reports_with_float.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 12542, 726, 2271, 67, 3103, 13332, 1417, 273, 1696, 12, 12669, 67, 4537, 6797, 20195, 19, 12542, 726, 2271, 19, 12542, 726, 67, 3103, 18, 2902, 16063, 896, 1435, 1004, 6315, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 12542, 726, 2271, 67, 3103, 13332, 1417, 273, 1696, 12, 12669, 67, 4537, 6797, 20195, 19, 12542, 726, 2271, 19, 12542, 726, 67, 3103, 18, 2902, 16063, 896, 1435, 1004, 6315, 22...
yield AnnotationLinkWrapper(self, e)''' q = self.getQueryService() sql = "select link from ProjectAnnotationLink as link left outer join fetch link.parent as parent left outer join fetch link.child as child join fetch link.details.creationEvent as creation join fetch creation.logs as logs join fetch child.details.creationEvent as childcreation join fetch childcreation.logs as childlogs where childlogs.entityType = :kls order by creation.id desc " sql2 = "select link from DatasetAnnotationLink as link left outer join fetch link.parent as parent left outer join fetch link.child as child join fetch link.details.creationEvent as creation join fetch creation.logs as logs join fetch child.details.creationEvent as childcreation join fetch childcreation.logs as childlogs where childlogs.entityType = :kls order by creation.id desc " sql3 = "select link from ImageAnnotationLink as link left outer join fetch link.parent as parent left outer join fetch link.child as child join fetch link.details.creationEvent as creation join fetch creation.logs as logs join fetch child.details.creationEvent as childcreation join fetch childcreation.logs as childlogs where childlogs.entityType = :kls order by creation.id desc " p = omero.sys.Parameters() p.map = {} p.map["id"] = rlong(self.getEventContext().userId) p.map["gid"] = rlong(self.getEventContext().groupId) p.map["kls"] = rstring('ome.model.annotations.TagAnnotation') f = omero.sys.Filter() f.limit = rint(20) p.theFilter = f res = list() res = q.findAllByQuery(sql, p) res.extend(q.findAllByQuery(sql2, p)) res.extend(q.findAllByQuery(sql3, p)) for e in res:
def getMostRecentTagLinks (self): # TODO: #1175 '''tm = self.getTimelineService() p = omero.sys.Parameters() p.map = {} #p.map["id"] = rlong(self.getEventContext().userId) f = omero.sys.Filter() f.limit = rint(20) p.theFilter = f for e in tm.getMostRecentAnnotationLinks(None, ['TagAnnotation'], None, p): yield AnnotationLinkWrapper(self, e)''' q = self.getQueryService() sql = "select link from ProjectAnnotationLink as link left outer join fetch link.parent as parent left outer join fetch link.child as child join fetch link.details.creationEvent as creation join fetch creation.logs as logs join fetch child.details.creationEvent as childcreation join fetch childcreation.logs as childlogs where childlogs.entityType = :kls order by creation.id desc " sql2 = "select link from DatasetAnnotationLink as link left outer join fetch link.parent as parent left outer join fetch link.child as child join fetch link.details.creationEvent as creation join fetch creation.logs as logs join fetch child.details.creationEvent as childcreation join fetch childcreation.logs as childlogs where childlogs.entityType = :kls order by creation.id desc " sql3 = "select link from ImageAnnotationLink as link left outer join fetch link.parent as parent left outer join fetch link.child as child join fetch link.details.creationEvent as creation join fetch creation.logs as logs join fetch child.details.creationEvent as childcreation join fetch childcreation.logs as childlogs where childlogs.entityType = :kls order by creation.id desc " p = omero.sys.Parameters() p.map = {} p.map["id"] = rlong(self.getEventContext().userId) p.map["gid"] = rlong(self.getEventContext().groupId) p.map["kls"] = rstring('ome.model.annotations.TagAnnotation') f = omero.sys.Filter() f.limit = rint(20) p.theFilter = f res = list() res = q.findAllByQuery(sql, p) res.extend(q.findAllByQuery(sql2, p)) res.extend(q.findAllByQuery(sql3, p)) for e in res: yield AnnotationLinkWrapper(self, e)
17860cb0fe7d803ae3d9575118f417877258befd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/17860cb0fe7d803ae3d9575118f417877258befd/gateway.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2108, 669, 17076, 1805, 7100, 261, 2890, 4672, 468, 2660, 30, 468, 2499, 5877, 9163, 16925, 273, 365, 18, 588, 31914, 1179, 1435, 293, 273, 8068, 2439, 18, 9499, 18, 2402, 1435, 293, 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, 2108, 669, 17076, 1805, 7100, 261, 2890, 4672, 468, 2660, 30, 468, 2499, 5877, 9163, 16925, 273, 365, 18, 588, 31914, 1179, 1435, 293, 273, 8068, 2439, 18, 9499, 18, 2402, 1435, 293, 18,...
allcoord = N.array(self.Coord.values())
allcoord = self.getAllCoordinatesAsArray()
def findClosestNode(self, coord, recalc=True): """Find the name of the node closest to |coord|. the key of the node-dictionary is returned """ allcoord = N.array(self.Coord.values()) idx = N.sum((allcoord - coord)**2, axis=1).argmin() return self.Coord.keys()[idx]
7d8f9cb4320fdd8fc9b604d50de630c5126d68f5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7248/7d8f9cb4320fdd8fc9b604d50de630c5126d68f5/FEval.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 4082, 7781, 907, 12, 2890, 16, 2745, 16, 283, 12448, 33, 5510, 4672, 3536, 3125, 326, 508, 434, 326, 756, 9219, 358, 571, 5732, 96, 18, 326, 498, 434, 326, 756, 17, 15556, 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, 1104, 4082, 7781, 907, 12, 2890, 16, 2745, 16, 283, 12448, 33, 5510, 4672, 3536, 3125, 326, 508, 434, 326, 756, 9219, 358, 571, 5732, 96, 18, 326, 498, 434, 326, 756, 17, 15556, 353, ...
if mode != "quiet": return 0,G([()]) else: return 0
res = 0 g = self.group()([()]) if mode != 'quiet': return res, g
def legal(self,state,mode="quiet"): r""" Returns 1 (true) if the dictionary \code{state} (in the same format as returned by the faces method) represents a legal position (or state) of the Rubik's cube. Returns 0 (false) otherwise.
b51bcae1e93724dd78085104a1c7a275916a0c9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b51bcae1e93724dd78085104a1c7a275916a0c9b/cubegroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19286, 12, 2890, 16, 2019, 16, 3188, 1546, 20380, 6, 4672, 436, 8395, 2860, 404, 261, 3767, 13, 309, 326, 3880, 521, 710, 95, 2019, 97, 261, 267, 326, 1967, 740, 487, 2106, 635, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19286, 12, 2890, 16, 2019, 16, 3188, 1546, 20380, 6, 4672, 436, 8395, 2860, 404, 261, 3767, 13, 309, 326, 3880, 521, 710, 95, 2019, 97, 261, 267, 326, 1967, 740, 487, 2106, 635, 326, ...
[Fractional ideal (w)]
[Fractional ideal (-w)]
def prime_factors(self): """ Return a list of the prime ideal factors of self
291544b8d9fdcb8c3366f1d7e82eadb48abde9d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/291544b8d9fdcb8c3366f1d7e82eadb48abde9d4/number_field_ideal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17014, 67, 22108, 12, 2890, 4672, 3536, 2000, 279, 666, 434, 326, 17014, 23349, 14490, 434, 365, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17014, 67, 22108, 12, 2890, 4672, 3536, 2000, 279, 666, 434, 326, 17014, 23349, 14490, 434, 365, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
translations = mapper(found)
translations = mapper(found, other_bound)
def search(node, found=None, register=False, level=0): if found == None: found = [] if node.type == "function": if register: name = node.get("name", False) if respect(name, found): found.append(name) openedAt = len(found) register = True # e.g. func(name1, name2); elif register and node.type == "variable" and node.hasChildren() and len(node.children) == 1: if node.parent.type == "params" and node.parent.parent.type != "call": first = node.getFirstChild() if first.type == "identifier": name = first.get("name") if respect(name, found): found.append(name) # e.g. var name1, name2 = "foo"; elif register and node.type == "definition": name = node.get("identifier", False) if respect(name, found): found.append(name) # Iterate over children if node.hasChildren(): if node.type == "function": for child in node.children: search(child, found, register, level+1) else: for child in node.children: search(child, found, register, level) # Function closed if node.type == "function": if level==0: # Generate translation list translations = mapper(found) # Start replacement when get back to first level update(node, translations) # Afterwards the function is closed and we can clean- # up the found variables del found[openedAt:]
c966e9351d91734883c66b2ccf1e37035052eb13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/c966e9351d91734883c66b2ccf1e37035052eb13/variableoptimizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2159, 16, 1392, 33, 7036, 16, 1744, 33, 8381, 16, 1801, 33, 20, 4672, 309, 1392, 422, 599, 30, 1392, 273, 5378, 225, 309, 756, 18, 723, 422, 315, 915, 6877, 309, 1744, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2159, 16, 1392, 33, 7036, 16, 1744, 33, 8381, 16, 1801, 33, 20, 4672, 309, 1392, 422, 599, 30, 1392, 273, 5378, 225, 309, 756, 18, 723, 422, 315, 915, 6877, 309, 1744, 30, ...
OWGUI.button(self.controlArea, self, "Save As", callback=self.saveGraph)
OWGUI.button(self.controlArea, self, "Save As", callback=self.saveGraph, debuggingEnabled = 0)
def __init__(self, parent=None, signalManager = None, name='ClassificationTreeViewer2D'): OWTreeViewer2D.__init__(self, parent, signalManager, name) self.settingsList=self.settingsList+["ShowPies","TargetClassIndex"] self.inputs = [("Classification Tree", orange.TreeClassifier, self.ctree)] self.outputs = [("Examples", ExampleTable), ("Classified Examples", ExampleTableWithClass)] self.ShowPies=1 self.TargetClassIndex=0 self.canvas=TreeCanvas(self) self.canvasView=TreeCanvasView(self, self.canvas, self.mainArea, "CView") layout=QVBoxLayout(self.mainArea) layout.addWidget(self.canvasView) self.canvas.resize(800,800) self.canvasView.bubbleConstructor=self.classificationBubbleConstructor self.navWidget=QWidget(None, "Navigator") self.navWidget.lay=QVBoxLayout(self.navWidget) canvas=TreeCanvas(self.navWidget) self.treeNav=TreeNavigator(self.canvasView,self,canvas,self.navWidget, "Nav") self.treeNav.setCanvas(canvas) self.navWidget.lay.addWidget(self.treeNav) self.canvasView.setNavigator(self.treeNav) self.navWidget.resize(400,400) self.navWidget.setCaption("Navigator") # OWGUI.button(self.TreeTab,self,"Navigator",self.toggleNavigator) self.setMouseTracking(True)
5612ccb210d9d7aed6a7b7a38e8c11d3e26fdc98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/5612ccb210d9d7aed6a7b7a38e8c11d3e26fdc98/OWClassificationTreeViewer2D.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 33, 7036, 16, 4277, 1318, 273, 599, 16, 508, 2218, 19168, 2471, 18415, 22, 40, 11, 4672, 18233, 2471, 18415, 22, 40, 16186, 2738, 972, 12, 2890, 16,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 33, 7036, 16, 4277, 1318, 273, 599, 16, 508, 2218, 19168, 2471, 18415, 22, 40, 11, 4672, 18233, 2471, 18415, 22, 40, 16186, 2738, 972, 12, 2890, 16,...
return (self.order() % 2 == 1) and \ (2*self.size() > max(self.degree())*(self.order()-1))
return (self.order() % 2 == 1) and ( 2 * self.size() > max(self.degree()) * (self.order() - 1))
def is_overfull(self): r""" Tests whether the current graph is overfull.
a9b829f661d7bc42123ff69ff5975a9a0a8b87de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a9b829f661d7bc42123ff69ff5975a9a0a8b87de/generic_graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 1643, 2854, 12, 2890, 4672, 436, 8395, 7766, 87, 2856, 326, 783, 2667, 353, 1879, 2854, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 1643, 2854, 12, 2890, 4672, 436, 8395, 7766, 87, 2856, 326, 783, 2667, 353, 1879, 2854, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
print "Error: Got less than 2 P-S Pairs."
err = "Error: Less than 2 P-S Pairs!" appendTextview(self.textviewStdErr, err)
def showWadati(self): """ Shows a Wadati diagram plotting P time in (truncated) Julian seconds against S-P time for every station and doing a linear regression using rpy. An estimate of Vp/Vs is given by the slope + 1. """ import rpy pTimes = [] spTimes = [] stations = [] for i in range(len(self.dicts)): if self.dicts[i].has_key('P') and self.dicts[i].has_key('S'): p = self.streams[i][0].stats.starttime p += self.dicts[i]['P'] p = "%.3f" % p.getTimeStamp() p = float(p[-7:]) pTimes.append(p) sp = self.dicts[i]['S'] - self.dicts[i]['P'] spTimes.append(sp) stations.append(self.dicts[i]['Station']) else: continue if len(pTimes) < 2: print "Error: Got less than 2 P-S Pairs." return my_lsfit = rpy.r.lsfit(pTimes, spTimes) gradient = my_lsfit['coefficients']['X'] intercept = my_lsfit['coefficients']['Intercept'] vpvs = gradient + 1. ressqrsum = 0. for res in my_lsfit['residuals']: ressqrsum += (res ** 2) y0 = 0. x0 = - (intercept / gradient) x1 = max(pTimes) y1 = (gradient * float(x1)) + intercept fig = plt.figure(1001) fig.canvas.set_window_title("Wadati Diagram") ax = fig.add_subplot(111) ax.scatter(pTimes, spTimes) for i in range(len(stations)): ax.text(pTimes[i], spTimes[i], stations[i], va = "top") ax.plot([x0, x1], [y0, y1]) ax.axhline(0, color = "blue", ls = ":") # origin time estimated by wadati plot ax.axvline(x0, color = "blue", ls = ":", label = "origin time from wadati diagram") # origin time from event location if self.dictOrigin.has_key('Time'): otime = "%.3f" % self.dictOrigin['Time'].getTimeStamp() otime = float(otime[-7:]) ax.axvline(otime, color = "red", ls = ":", label = "origin time from event location") ax.text(0.1, 0.7, "Vp/Vs: %.2f\nSum of squared residuals: %.3f" % (vpvs, ressqrsum), transform = ax.transAxes) ax.text(0.1, 0.1, "Origin time from event location", color = "red", transform = ax.transAxes) #ax.axis("auto") ax.set_xlim(min(x0 - 1, otime - 1), max(pTimes) + 1) ax.set_ylim(-1, max(spTimes) + 1) ax.set_xlabel("absolute P times (julian seconds, truncated)") ax.set_xlabel("P-S times (seconds)") fig.canvas.draw() plt.show()
4e8f536428831ce605c623aa5fc17a6b33b5b712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/4e8f536428831ce605c623aa5fc17a6b33b5b712/obspyck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 59, 361, 270, 77, 12, 2890, 4672, 3536, 9674, 87, 279, 678, 361, 270, 77, 19750, 20947, 453, 813, 316, 261, 23558, 690, 13, 30294, 3974, 5314, 348, 17, 52, 813, 364, 3614, 13282,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 59, 361, 270, 77, 12, 2890, 4672, 3536, 9674, 87, 279, 678, 361, 270, 77, 19750, 20947, 453, 813, 316, 261, 23558, 690, 13, 30294, 3974, 5314, 348, 17, 52, 813, 364, 3614, 13282,...
if self.encoding: return self.encoding
def GetEncoding(self): """ Return the dicom encoding DICOM standard tag (0x0008, 0x0005) was used. """ if self.encoding: return self.encoding tag = gdcm.Tag(0x0008, 0x0005) ds = self.gdcm_reader.GetFile().GetDataSet() if ds.FindDataElement(tag): self.encoding = str(ds.GetDataElement(tag).GetValue()) return self.encoding
d160d17fc03911711195e5db4735d3cb4cbe5309 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/d160d17fc03911711195e5db4735d3cb4cbe5309/dicom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 4705, 12, 2890, 4672, 3536, 2000, 326, 29357, 2688, 30530, 4529, 1047, 261, 20, 92, 3784, 28, 16, 374, 92, 3784, 25, 13, 1703, 1399, 18, 3536, 1047, 273, 314, 7201, 81, 18, 1805, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 4705, 12, 2890, 4672, 3536, 2000, 326, 29357, 2688, 30530, 4529, 1047, 261, 20, 92, 3784, 28, 16, 374, 92, 3784, 25, 13, 1703, 1399, 18, 3536, 1047, 273, 314, 7201, 81, 18, 1805, ...
if full_messages: params['full_messages'] = full_messages
if verbose: params['verbose'] = verbose
def make_log_href(path, **args): params = { 'rev': rev, 'log_mode': log_mode, 'limit': limit, } params.update(args) if full_messages: params['full_messages'] = full_messages return self.env.href.log(path, **params)
a0a74ae92f8d532c5f932ab2e585efdaf2398af2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/a0a74ae92f8d532c5f932ab2e585efdaf2398af2/Browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 1330, 67, 7547, 12, 803, 16, 2826, 1968, 4672, 859, 273, 288, 296, 9083, 4278, 5588, 16, 296, 1330, 67, 3188, 4278, 613, 67, 3188, 16, 296, 3595, 4278, 1800, 16, 289, 859, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 1330, 67, 7547, 12, 803, 16, 2826, 1968, 4672, 859, 273, 288, 296, 9083, 4278, 5588, 16, 296, 1330, 67, 3188, 4278, 613, 67, 3188, 16, 296, 3595, 4278, 1800, 16, 289, 859, ...
list, tuple, or vector
list, tuple, or vector.
def ruler_frame(lower_left, upper_right, ticks=4, sub_ticks=4, **kwds): """ Draw a frame made of 3D rulers, with major and minor ticks. INPUT: - ``lower_left`` - the lower left corner of the frame, as a list, tuple, or vector - ``upper_right`` - the upper right corner of the frame, as a list, tuple, or vector - ``ticks`` - (default: 4) the number of major ticks shown on each ruler - ``sub_ticks`` - (default: 4) the number of shown subdivisions between each major tick Type ``line3d.options`` for a dictionary of the default options for lines which are also available. EXAMPLES: A ruler frame:: sage: from sage.plot.plot3d.shapes2 import ruler_frame sage: F = ruler_frame([1,2,3],vector([2,3,4])); F A ruler frame with some options:: sage: F = ruler_frame([1,2,3],vector([2,3,4]),ticks=6, sub_ticks=2, color='red'); F """ return ruler(lower_left, (upper_right[0], lower_left[1], lower_left[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) \ + ruler(lower_left, (lower_left[0], upper_right[1], lower_left[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) \ + ruler(lower_left, (lower_left[0], lower_left[1], upper_right[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds)
25144c93b092a09ccf947d595af3b9e9d463ccf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/25144c93b092a09ccf947d595af3b9e9d463ccf2/shapes2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 17040, 67, 3789, 12, 8167, 67, 4482, 16, 3854, 67, 4083, 16, 13003, 33, 24, 16, 720, 67, 11767, 33, 24, 16, 2826, 25577, 4672, 3536, 10184, 279, 2623, 7165, 434, 890, 40, 436, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 17040, 67, 3789, 12, 8167, 67, 4482, 16, 3854, 67, 4083, 16, 13003, 33, 24, 16, 720, 67, 11767, 33, 24, 16, 2826, 25577, 4672, 3536, 10184, 279, 2623, 7165, 434, 890, 40, 436, 3...
if entries is None: entries = self.phonebook
def print_long_list(self, entries=None): """Prints every single entry in `entries` in full detail. If `entries` is None, all entries are printed""" if entries is None: entries = self.phonebook for entry in entries: print str(entry) print '-'*20
500a390f053c916fbb5e449916c39bcc41901f78 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2215/500a390f053c916fbb5e449916c39bcc41901f78/tel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 5748, 67, 1098, 12, 2890, 16, 3222, 33, 7036, 4672, 3536, 15402, 3614, 2202, 1241, 316, 1375, 8219, 68, 316, 1983, 7664, 18, 971, 1375, 8219, 68, 353, 599, 16, 777, 3222, 854...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 5748, 67, 1098, 12, 2890, 16, 3222, 33, 7036, 4672, 3536, 15402, 3614, 2202, 1241, 316, 1375, 8219, 68, 316, 1983, 7664, 18, 971, 1375, 8219, 68, 353, 599, 16, 777, 3222, 854...
self.pwhashmod = sha
self.pwhashmod = _sha
def __init__(self, credentials, host, request_uri, headers, response, content, http): Authentication.__init__(self, credentials, host, request_uri, headers, response, content, http) challenge = _parse_www_authenticate(response, 'www-authenticate') self.challenge = challenge['hmacdigest'] # TODO: self.challenge['domain'] self.challenge['reason'] = self.challenge.get('reason', 'unauthorized') if self.challenge['reason'] not in ['unauthorized', 'integrity']: self.challenge['reason'] = 'unauthorized' self.challenge['salt'] = self.challenge.get('salt', '') if not self.challenge.get('snonce'): raise UnimplementedHmacDigestAuthOptionError( _("The challenge doesn't contain a server nonce, or this one is empty.")) self.challenge['algorithm'] = self.challenge.get('algorithm', 'HMAC-SHA-1') if self.challenge['algorithm'] not in ['HMAC-SHA-1', 'HMAC-MD5']: raise UnimplementedHmacDigestAuthOptionError( _("Unsupported value for algorithm: %s." % self.challenge['algorithm'])) self.challenge['pw-algorithm'] = self.challenge.get('pw-algorithm', 'SHA-1') if self.challenge['pw-algorithm'] not in ['SHA-1', 'MD5']: raise UnimplementedHmacDigestAuthOptionError( _("Unsupported value for pw-algorithm: %s." % self.challenge['pw-algorithm'])) if self.challenge['algorithm'] == 'HMAC-MD5': self.hashmod = md5 else: self.hashmod = sha if self.challenge['pw-algorithm'] == 'MD5': self.pwhashmod = md5 else: self.pwhashmod = sha self.key = "".join([self.credentials[0], ":", self.pwhashmod.new("".join([self.credentials[1], self.challenge['salt']])).hexdigest().lower(), ":", self.challenge['realm'] ]) self.key = self.pwhashmod.new(self.key).hexdigest().lower()
0bb9ecff53d99f9937cdf070dadbfb564adb2683 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13138/0bb9ecff53d99f9937cdf070dadbfb564adb2683/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4448, 16, 1479, 16, 590, 67, 1650, 16, 1607, 16, 766, 16, 913, 16, 1062, 4672, 8665, 16186, 2738, 972, 12, 2890, 16, 4448, 16, 1479, 16, 590, 67, 1650,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4448, 16, 1479, 16, 590, 67, 1650, 16, 1607, 16, 766, 16, 913, 16, 1062, 4672, 8665, 16186, 2738, 972, 12, 2890, 16, 4448, 16, 1479, 16, 590, 67, 1650,...
S = Set([s*q**i%n for i in range(n)])
S = Set([s*q**i%n for i in srange(n)])
def cyclotomic_cosets(q, n, t = None): r""" INPUT: q,n,t positive integers (or t=None) Some type-checking of inputs is performed. OUTPUT: q-cyclotomic cosets mod n (or, if t<>None, the q-cyclotomic coset mod n containing t) Let q, n be relatively print positive integers and let $A = q^{ZZ}$. The group A acts on ZZ/nZZ by multiplication. The orbits of this action are "cyclotomic cosets", or more precisely "q-cyclotomic cosets mod n". Sometimes the smallest element of the coset is called the "coset leader". The algorithm will always return the cosets as sorted lists of lists, so the coset leader will always be the first element in the list. These cosets arise in the theory of duadic codes and minimal polynomials of finite fields. Fix a primitive element $z$ of $GF(q^k)$. The minimal polynomial of $z^s$ over $GF(q)$ is given by \[ M_s(x) = \prod_{i \in C_s} (x-z^i), \] where $C_s$ is the q-cyclotomic coset mod n containing s, $n = q^k - 1$. EXAMPLES: sage: cyclotomic_cosets(2,11) [[0], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]] sage: cyclotomic_cosets(2,15) [[0], [1, 2, 4, 8], [3, 6, 9, 12], [5, 10], [7, 11, 13, 14]] sage: cyclotomic_cosets(2,15,5) [5, 10] sage: cyclotomic_cosets(3,16) [[0], [1, 3, 9, 11], [2, 6], [4, 12], [5, 7, 13, 15], [8], [10, 14]] sage: F.<z> = GF(2^4, "z") sage: P.<x> = PolynomialRing(F,"x") sage: a = z^5 sage: a.minimal_polynomial() x^2 + x + 1 sage: prod([x-z^i for i in [5, 10]]) x^2 + x + 1 sage: cyclotomic_cosets(3,2,0) [0] sage: cyclotomic_cosets(3,2,1) [1] sage: cyclotomic_cosets(3,2,2) [0] This last output loks strange but is correct, since the elements of the cosets are in ZZ/nZZ and 2 = 0 in ZZ/2ZZ. """ if not(t==None) and type(t)<>Integer: raise TypeError, "Optional input %s must None or an integer."%t if q<2 or n<2: raise TypeError, "Inputs %s and %s must be > 1."%(q,n) if GCD(q,n) <> 1: raise TypeError, "Inputs %s and %s must be relative prime."%(q,n) if t<>None and type(t)==Integer: S = Set([t*q**i%n for i in range(n)]) L = list(S) L.sort() return L ccs = Set([]) ccs_list = [[0]] for s in range(1,n): if not(s in ccs): S = Set([s*q**i%n for i in range(n)]) L = list(S) L.sort() ccs = ccs.union(S) ccs_list.append(L) return ccs_list
11390a66b39c7a71313e55734b4de512e35d6dc6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/11390a66b39c7a71313e55734b4de512e35d6dc6/code_constructions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6143, 830, 352, 24721, 67, 14445, 2413, 12, 85, 16, 290, 16, 268, 273, 599, 4672, 436, 8395, 225, 12943, 30, 1043, 16, 82, 16, 88, 6895, 12321, 261, 280, 268, 33, 7036, 13, 10548, 61...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6143, 830, 352, 24721, 67, 14445, 2413, 12, 85, 16, 290, 16, 268, 273, 599, 4672, 436, 8395, 225, 12943, 30, 1043, 16, 82, 16, 88, 6895, 12321, 261, 280, 268, 33, 7036, 13, 10548, 61...
if IView.implementedBy(provides) and self.permission: pfactory = ViewPermissionFactory(permission)
if provides.isOrExtends(IView) and self.permission: pfactory = ViewPermissionFactory(self.permission)
def __call__(self, event=None, context=None, force_reload=False): if force_reload is False: settings = component.queryUtility(ISettings) auto_reload = settings and settings.reload_templates if not auto_reload: return
aee83246f03a87fca5f672e18213fd95329b22c2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12476/aee83246f03a87fca5f672e18213fd95329b22c2/zcml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 871, 33, 7036, 16, 819, 33, 7036, 16, 2944, 67, 17517, 33, 8381, 4672, 309, 2944, 67, 17517, 353, 1083, 30, 1947, 273, 1794, 18, 2271, 6497, 12, 45, 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, 1001, 1991, 972, 12, 2890, 16, 871, 33, 7036, 16, 819, 33, 7036, 16, 2944, 67, 17517, 33, 8381, 4672, 309, 2944, 67, 17517, 353, 1083, 30, 1947, 273, 1794, 18, 2271, 6497, 12, 45, 26...
config.network.nameserver.value = map(int, split[1].split('.'))
config.network.dns.value = map(int, split[1].split('.'))
def loadNetworkConfig(self): try: # parse the interfaces-file fp = file('/etc/network/interfaces', 'r') interfaces = fp.readlines() fp.close() ifaces = {} currif = "" for i in interfaces: split = i.strip().split(' ') if (split[0] == "iface"): currif = split[1] ifaces[currif] = {} if (len(split) == 4 and split[3] == "dhcp"): ifaces[currif]["dhcp"] = "yes" else: ifaces[currif]["dhcp"] = "no" if (currif != ""): if (split[0] == "address"): ifaces[currif]["address"] = map(int, split[1].split('.')) if (split[0] == "netmask"): ifaces[currif]["netmask"] = map(int, split[1].split('.')) if (split[0] == "gateway"): ifaces[currif]["gateway"] = map(int, split[1].split('.')) # parse the resolv.conf-file fp = file('/etc/resolv.conf', 'r') resolv = fp.readlines() fp.close() except: pass try: for i in resolv: split = i.strip().split(' ') if (split[0] == "nameserver"): config.network.nameserver.value = map(int, split[1].split('.')) except: pass try: # set this config if (ifaces.has_key("eth0")): if (ifaces["eth0"]["dhcp"] == "yes"): config.network.dhcp.value = 1 else: config.network.dhcp.value = 0 if (ifaces["eth0"].has_key("address")): config.network.ip.value = ifaces["eth0"]["address"] if (ifaces["eth0"].has_key("netmask")): config.network.netmask.value = ifaces["eth0"]["netmask"] if (ifaces["eth0"].has_key("gateway")): config.network.gateway.value = ifaces["eth0"]["gateway"] except: pass
925a23bd54bf4cedb53c506524c7c297f7a66c99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/925a23bd54bf4cedb53c506524c7c297f7a66c99/Network.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 3906, 809, 12, 2890, 4672, 775, 30, 468, 1109, 326, 7349, 17, 768, 4253, 273, 585, 2668, 19, 14175, 19, 5185, 19, 15898, 2187, 296, 86, 6134, 7349, 273, 4253, 18, 896, 3548, 1435...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 3906, 809, 12, 2890, 4672, 775, 30, 468, 1109, 326, 7349, 17, 768, 4253, 273, 585, 2668, 19, 14175, 19, 5185, 19, 15898, 2187, 296, 86, 6134, 7349, 273, 4253, 18, 896, 3548, 1435...
log.err('[Worker %s, Job ID: %s ] %s' % (worker.id, worker.job.id, msg))
job_id = worker.job.job_id log.err('[Worker %s, Job ID: %s ] %s' % (worker.id, job_id, msg))
def check_output(self): """ check_output periodically polls workers for new output. This figures out whether or not there is anything new output that we should submit to the server. """
57dc1e724f1b28fcca12d50cbefbe6e2e25a6eaa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/57dc1e724f1b28fcca12d50cbefbe6e2e25a6eaa/dsage_worker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2844, 12, 2890, 4672, 3536, 866, 67, 2844, 26736, 2952, 3251, 9798, 364, 394, 876, 18, 225, 1220, 4291, 1823, 596, 2856, 578, 486, 1915, 353, 6967, 394, 876, 716, 732, 1410, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2844, 12, 2890, 4672, 3536, 866, 67, 2844, 26736, 2952, 3251, 9798, 364, 394, 876, 18, 225, 1220, 4291, 1823, 596, 2856, 578, 486, 1915, 353, 6967, 394, 876, 716, 732, 1410, 4...
pb.getObjectAt(self.host, self.port, 10).addCallbacks(self.connected, self.notConnected)
bf = pb.PBClientFactory() timeout = 10 if self.host == "unix": reactor.connectUNIX(self.port, bf, timeout) else: reactor.connectTCP(self.host, self.port, bf, timeout) d = bf.getRootObject() d.addCallbacks(self.connected, self.notConnected)
def render(self, request): """Render this request, from my server.
16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/16f9b300da0dbd3c03c5efdfb5ccc1f6aaa8139f/distrib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 590, 4672, 3536, 3420, 333, 590, 16, 628, 3399, 1438, 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, 1743, 12, 2890, 16, 590, 4672, 3536, 3420, 333, 590, 16, 628, 3399, 1438, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
def getname(pkgname):
def getname(self,pkgname):
def getname(pkgname): "returns file location for this particular package" return self.root+"/"+pkgname+".tbz2"
654342eaf782037e1b1a4a57c0a60d7c80639e73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2807/654342eaf782037e1b1a4a57c0a60d7c80639e73/portage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 529, 12, 2890, 16, 10657, 529, 4672, 315, 6154, 585, 2117, 364, 333, 6826, 2181, 6, 327, 365, 18, 3085, 9078, 4898, 15, 10657, 529, 9078, 18, 18587, 94, 22, 6, 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, 336, 529, 12, 2890, 16, 10657, 529, 4672, 315, 6154, 585, 2117, 364, 333, 6826, 2181, 6, 327, 365, 18, 3085, 9078, 4898, 15, 10657, 529, 9078, 18, 18587, 94, 22, 6, 2, -100, -100, -1...
key = (args, tuple(kargs.items()) )
key = self.getKey(*args, **kargs)
def fetch(self, fetch_function, *args, **kargs): key = (args, tuple(kargs.items()) ) return self.fetchObjectId(key, fetch_function, *args, **kargs)
1bb8771512da0d11e2a4f4f23161aaccb820ac4f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6604/1bb8771512da0d11e2a4f4f23161aaccb820ac4f/cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 12, 2890, 16, 2158, 67, 915, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 498, 273, 365, 18, 588, 653, 30857, 1968, 16, 2826, 79, 1968, 13, 327, 365, 18, 5754, 16661, 12, 856, 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, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 12, 2890, 16, 2158, 67, 915, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 498, 273, 365, 18, 588, 653, 30857, 1968, 16, 2826, 79, 1968, 13, 327, 365, 18, 5754, 16661, 12, 856, 16, ...
return http.Response(stream = '')
return HTMLResponse(stream = '')
def render(self, ctx): #self.worksheet.ping(self.username) self.worksheet.ping(username=None) # None so doesn't save a revision return http.Response(stream = '')
39855fabbbbe971c1c1d64566b1625e9c1c6d482 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/39855fabbbbe971c1c1d64566b1625e9c1c6d482/twist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 468, 2890, 18, 1252, 8118, 18, 1382, 12, 2890, 18, 5053, 13, 365, 18, 1252, 8118, 18, 1382, 12, 5053, 33, 7036, 13, 225, 468, 599, 1427, 3302, 1404, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 468, 2890, 18, 1252, 8118, 18, 1382, 12, 2890, 18, 5053, 13, 365, 18, 1252, 8118, 18, 1382, 12, 5053, 33, 7036, 13, 225, 468, 599, 1427, 3302, 1404, 1...
components = vobject.readComponents(file(filename, "r")) for vcard in components: try: vcard.filename = filename self.add_to_list(vcard) except: break
vcard = load_contact(filename) if vcard is not None: self.add_to_list(vcard, filename)
def load_contacts(self): self.contactData.clear() # read all files in folder for curfile in os.listdir(self.contact_dir): filename = os.path.join(self.contact_dir, curfile) # create vcard-object components = vobject.readComponents(file(filename, "r")) for vcard in components: try: vcard.filename = filename self.add_to_list(vcard) except: break self.contactSelection.select_path((0,)) return False
d146007907c6581d8d80f2f60d1a7f1efdee1728 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/d146007907c6581d8d80f2f60d1a7f1efdee1728/arkadas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 20777, 12, 2890, 4672, 365, 18, 8994, 751, 18, 8507, 1435, 468, 855, 777, 1390, 316, 3009, 364, 662, 768, 316, 1140, 18, 1098, 1214, 12, 2890, 18, 8994, 67, 1214, 4672, 1544,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 20777, 12, 2890, 4672, 365, 18, 8994, 751, 18, 8507, 1435, 468, 855, 777, 1390, 316, 3009, 364, 662, 768, 316, 1140, 18, 1098, 1214, 12, 2890, 18, 8994, 67, 1214, 4672, 1544,...
def test_handler_is_not_created_with_invalid_methods(self):
def test_handler_is_created_if_arg_or_doc_retrieval_fails(self):
def test_handler_is_not_created_with_invalid_methods(self): for reason in ['Attribute', 'Signature']: lib = TestLibrary('Invalid%sArgDocDynamicJavaLibrary' % reason) assert_equals(len(lib.handlers), 0)
6fbcc6c0dc97c5db83b815121f44d9e1c3826c2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/6fbcc6c0dc97c5db83b815121f44d9e1c3826c2e/test_testlibrary.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4176, 67, 291, 67, 4824, 67, 430, 67, 3175, 67, 280, 67, 2434, 67, 14580, 1125, 67, 6870, 87, 12, 2890, 4672, 364, 3971, 316, 10228, 1499, 2187, 296, 5374, 3546, 30, 2561, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4176, 67, 291, 67, 4824, 67, 430, 67, 3175, 67, 280, 67, 2434, 67, 14580, 1125, 67, 6870, 87, 12, 2890, 4672, 364, 3971, 316, 10228, 1499, 2187, 296, 5374, 3546, 30, 2561, ...
print "--- TCP/IP to Serial redirector --- type Ctrl-C / BREAK to quit" print "--- %s %s,%s,%s,%s ---" % (ser.portstr, ser.baudrate, 8, ser.parity, 1)
sys.stderr.write("--- TCP/IP to Serial redirector --- type Ctrl-C / BREAK to quit\n") sys.stderr.write("--- %s %s,%s,%s,%s ---\n" % (ser.portstr, ser.baudrate, 8, ser.parity, 1))
def stop(self): """Stop copying""" if self.alive: self.alive = False self.thread_read.join()
8c80bbcfa2dee7de96e5435fdcc0741993aac1ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/8c80bbcfa2dee7de96e5435fdcc0741993aac1ac/tcp_serial_redirect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2132, 12, 2890, 4672, 3536, 4947, 8933, 8395, 309, 365, 18, 11462, 30, 365, 18, 11462, 273, 1083, 365, 18, 5930, 67, 896, 18, 5701, 1435, 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, 2132, 12, 2890, 4672, 3536, 4947, 8933, 8395, 309, 365, 18, 11462, 30, 365, 18, 11462, 273, 1083, 365, 18, 5930, 67, 896, 18, 5701, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -...
self.dbsession.flush()
meta.Session.flush()
def generate_badges(self): defaults = dict(request.POST) stamp = False if defaults.has_key('stamp') and defaults['stamp']: stamp = defaults['stamp'] c.text = '' data = [] if request.method == 'POST' and defaults: if defaults['reg_id'] != '': reg_id_list = defaults['reg_id'].split("\n") registration_list = self.dbsession.query(self.model).filter(model.Registration.id.in_(reg_id_list)).all() if len(registration_list) != len(reg_id_list): c.text = 'Registration ID not found. Please check the <a href="/registration">registration list</a>.' return render('%s/generate_badges.mako' % self.individual) else: for registration in registration_list: data.append(self._registration_badge_data(registration, stamp)) registration.person.badge_printed = True else: registration_list = self.dbsession.query(self.model).all() for registration in registration_list: append = False if registration.person.has_paid_ticket() and not registration.person.badge_printed: if defaults['type'] == 'all': append = True else: for invoice in registration.person.invoices: if invoice.paid() and not invoice.is_void(): for item in invoice.items: if defaults['type'] == 'concession' and item.description.startswith('Concession'): append = True elif defaults['type'] == 'hobby' and (item.description.find('Hobbyist') > -1 or item.description.find('Hobbiest') > -1): append = True elif defaults['type'] == 'professional' and (item.description.find('Professional') > -1 or item.description.startswith('Fairy')): append = True elif defaults['type'] == 'press' and item.description.startswith('Press'): append = True elif defaults['type'] == 'organiser' and item.description.startswith('Organiser'): append = True elif defaults['type'] == 'monday_tuesday' and item.description.find('Monday + Tuesday') > -1: append = True if defaults['type'] == 'speaker' and registration.person.is_speaker(): append = True elif defaults['type'] == 'mc_organiser' and registration.person.is_miniconf_org(): append = True elif defaults['type'] == 'volunteer' and registration.person.is_volunteer(): append = True if append: data.append(self._registration_badge_data(registration, stamp)) registration.person.badge_printed = True
8712086b268b89a0e34820c443f605d37ceeeaf0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12856/8712086b268b89a0e34820c443f605d37ceeeaf0/registration.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 24768, 12, 2890, 4672, 3467, 273, 2065, 12, 2293, 18, 3798, 13, 14429, 273, 1083, 309, 3467, 18, 5332, 67, 856, 2668, 14317, 6134, 471, 3467, 3292, 14317, 3546, 30, 14429, 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, 2103, 67, 24768, 12, 2890, 4672, 3467, 273, 2065, 12, 2293, 18, 3798, 13, 14429, 273, 1083, 309, 3467, 18, 5332, 67, 856, 2668, 14317, 6134, 471, 3467, 3292, 14317, 3546, 30, 14429, 273,...
sm.setoptions(gridfunction='pb', ftmachine=ftmachine, location=posobs, cache=100000)
sm.setoptions(gridfunction='pb', ftmachine=ftmachine, location=posobs)
def sdsim( project=None,
dc407e3919a0f526dca5c2ceec255edfd1ef4690 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/dc407e3919a0f526dca5c2ceec255edfd1ef4690/task_sdsim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 2377, 381, 12, 1984, 33, 7036, 16, 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...
[ 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, 272, 2377, 381, 12, 1984, 33, 7036, 16, 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, ...
sys.exit(0) def emptyline(self): pass
print sys.exit( 0 ) def emptyline( self ): pass
def do_quit(self, args): """ Exit the shell.
b68208f4ea74e3c61aead9e641ff73054212c46c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/b68208f4ea74e3c61aead9e641ff73054212c46c/SystemAdministratorClientCLI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 27176, 12, 2890, 16, 833, 4672, 3536, 9500, 326, 5972, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 27176, 12, 2890, 16, 833, 4672, 3536, 9500, 326, 5972, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
Set default value for the given config variable. """ var._item._cfg_set(value, default = True)
Set default value for the given config variable (proxy). """ if isintance(var, VarProxy): var._item._cfg_set(value, default = True) def get_default(var): if isinstance(var, VarProxy): return var._item._default
def set_default(var, value): """ Set default value for the given config variable. """ var._item._cfg_set(value, default = True)
3504bca88d477541be4a23af6da68501b335d844 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11722/3504bca88d477541be4a23af6da68501b335d844/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 1886, 12, 1401, 16, 460, 4672, 3536, 1000, 805, 460, 364, 326, 864, 642, 2190, 261, 5656, 2934, 3536, 309, 353, 474, 1359, 12, 1401, 16, 4562, 3886, 4672, 569, 6315, 1726, 631...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 1886, 12, 1401, 16, 460, 4672, 3536, 1000, 805, 460, 364, 326, 864, 642, 2190, 261, 5656, 2934, 3536, 309, 353, 474, 1359, 12, 1401, 16, 4562, 3886, 4672, 569, 6315, 1726, 631...
print code
code= """def %(methodName)s (self, control, *ignore): print control.value self.value.%(methodName)s(control.value)"""
d76c9e74ec0ce88c5bd35bacf1d49d50d1da7dbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2750/d76c9e74ec0ce88c5bd35bacf1d49d50d1da7dbc/testController.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 981, 33, 3536, 536, 8975, 2039, 461, 13, 87, 261, 2890, 16, 3325, 16, 380, 6185, 4672, 1172, 3325, 18, 1132, 365, 18, 1132, 7866, 12, 2039, 461, 13, 87, 12, 7098, 18, 1132, 15574, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 981, 33, 3536, 536, 8975, 2039, 461, 13, 87, 261, 2890, 16, 3325, 16, 380, 6185, 4672, 1172, 3325, 18, 1132, 365, 18, 1132, 7866, 12, 2039, 461, 13, 87, 12, 7098, 18, 1132, 15574, 2, -100,...
'</ul>\n' % (__init__.version, isotime()))
'</ul>\n' % (version, isotime()))
def get(self, connection, path, headers): try: (scheme, netloc, path, pars, query, fragment) = urlparse(path) if self.uq_broken == 1: path = path.replace('+',' ') query = query.replace('+',' ') path = unquote(path)[1:] params = {} for s in query.split('&'): if s != '': i = s.index('=') params[unquote(s[:i])] = unquote(s[i+1:]) except ValueError, e: return (400, 'Bad Request', {'Content-Type': 'text/plain'}, 'you sent me garbage - ' + str(e)) if path == '' or path == 'index.html': s = StringIO() s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n' \ '<html><head><title>BitTorrent download info</title>\n') if self.favicon != None: s.write('<link rel="shortcut icon" href="/favicon.ico" />\n') s.write('</head>\n<body>\n' \ '<h3>BitTorrent download info</h3>\n'\ '<ul>\n' '<li><strong>tracker version:</strong> %s</li>\n' \ '<li><strong>server time:</strong> %s</li>\n' \ '</ul>\n' % (__init__.version, isotime())) names = self.downloads.keys() if names: names.sort() tn = 0 tc = 0 td = 0 tt = 0 # Total transferred ts = 0 # Total size nf = 0 # Number of files displayed uc = {} ud = {} if self.allowed != None and self.show_names: s.write('<table summary="files" border="1">\n' \ '<tr><th>info hash</th><th>torrent name</th><th align="right">size</th><th align="right">complete</th><th align="right">downloading</th><th align="right">downloaded</th><th align="right">transferred</th></tr>\n') else: s.write('<table summary="files">\n' \ '<tr><th>info hash</th><th align="right">complete</th><th align="right">downloading</th><th align="right">downloaded</th></tr>\n') for name in names: l = self.downloads[name] n = self.completed.get(name, 0) tn = tn + n lc = [] for i in l.values(): if type(i) == DictType: if i['left'] == 0: lc.append(1) uc[i['ip']] = 1 else: ud[i['ip']] = 1 c = len(lc) tc = tc + c d = len(l) - c td = td + d if self.allowed != None and self.show_names: if self.allowed.has_key(name): nf = nf + 1 sz = self.allowed[name]['length'] # size ts = ts + sz szt = sz * n # Transferred for this torrent tt = tt + szt if self.allow_get == 1: linkname = '<a href="/file?info_hash=' + quote(name) + '">' + self.allowed[name]['name'] + '</a>' else: linkname = self.allowed[name]['name'] s.write('<tr><td><code>%s</code></td><td>%s</td><td align="right">%s</td><td align="right">%i</td><td align="right">%i</td><td align="right">%i</td><td align="right">%s</td></tr>\n' \ % (b2a_hex(name), linkname, size_format(sz), c, d, n, size_format(szt))) else: s.write('<tr><td><code>%s</code></td><td align="right"><code>%i</code></td><td align="right"><code>%i</code></td><td align="right"><code>%i</code></td></tr>\n' \ % (b2a_hex(name), c, d, n)) ttn = 0 for i in self.completed.values(): ttn = ttn + i if self.allowed != None and self.show_names: s.write('<tr><td align="right" colspan="2">%i files</td><td align="right">%s</td><td align="right">%i/%i</td><td align="right">%i/%i</td><td align="right">%i/%i</td><td align="right">%s</td></tr>\n' % (nf, size_format(ts), len(uc), tc, len(ud), td, tn, ttn, size_format(tt))) else: s.write('<tr><td align="right">%i files</td><td align="right">%i/%i</td><td align="right">%i/%i</td><td align="right">%i/%i</td></tr>\n' % (nf, len(uc), tc, len(ud), td, tn, ttn)) s.write('</table>\n' \ '<ul>\n' \ '<li><em>info hash:</em> SHA1 hash of the "info" section of the metainfo (*.torrent)</li>\n' \ '<li><em>complete:</em> number of connected clients with the complete file (total: unique IPs/total connections)</li>\n' \ '<li><em>downloading:</em> number of connected clients still downloading (total: unique IPs/total connections)</li>\n' \ '<li><em>downloaded:</em> reported complete downloads (total: current/all)</li>\n' \ '<li><em>transferred:</em> torrent size * total downloaded (does not include partial transfers)</li>\n' \ '</ul>\n') else: s.write('<p>not tracking any files yet...</p>\n') s.write('</body>\n' \ '</html>\n') return (200, 'OK', {'Content-Type': 'text/html; charset=iso-8859-1'}, s.getvalue()) elif path == 'scrape': fs = {} names = [] if params.has_key('info_hash'): if self.downloads.has_key(params['info_hash']): names = [ params['info_hash'] ] # else return nothing else: names = self.downloads.keys() names.sort() for name in names: l = self.downloads[name] n = self.completed.get(name, 0) c = len([1 for i in l.values() if type(i) == DictType and i['left'] == 0]) d = len(l) - c fs[name] = {'complete': c, 'incomplete': d, 'downloaded': n} if (self.allowed is not None) and self.allowed.has_key(name): fs[name]['name'] = self.allowed[name]['name'] r = {'files': fs} return (200, 'OK', {'Content-Type': 'text/plain'}, bencode(r)) elif (path == 'file') and (self.allow_get == 1) and params.has_key('info_hash') and self.allowed.has_key(params['info_hash']): hash = params['info_hash'] fname = self.allowed[hash]['file'] fpath = self.allowed[hash]['path'] return (200, 'OK', {'Content-Type': 'application/x-bittorrent', 'Content-Disposition': 'attachment; filename=' + fname}, open(fpath, 'rb').read()) elif path == 'favicon.ico' and self.favicon != None: return (200, 'OK', {'Content-Type' : 'image/x-icon'}, self.favicon) if path != 'announce': return (404, 'Not Found', {'Content-Type': 'text/plain', 'Pragma': 'no-cache'}, alas) try: if not params.has_key('info_hash'): raise ValueError, 'no info hash' if params.has_key('ip') and not is_valid_ipv4(params['ip']): raise ValueError('DNS name or invalid IP address given for IP') infohash = params['info_hash'] if self.allowed != None: if not self.allowed.has_key(infohash): return (200, 'OK', {'Content-Type': 'text/plain', 'Pragma': 'no-cache'}, bencode({'failure reason': 'Requested download is not authorized for use with this tracker.'})) ip = connection.get_ip() ip_override = 0 if params.has_key('ip') and is_valid_ipv4(params['ip']) and ( not self.only_local_override_ip or is_local_ip(ip)): ip_override = 1 if params.has_key('event') and params['event'] not in ['started', 'completed', 'stopped']: raise ValueError, 'invalid event' port = long(params.get('port', '')) uploaded = long(params.get('uploaded', '')) downloaded = long(params.get('downloaded', '')) left = long(params.get('left', '')) myid = params.get('peer_id', '') if len(myid) != 20: raise ValueError, 'id not of length 20' rsize = self.response_size if params.has_key('numwant'): rsize = min(long(params['numwant']), self.max_give) except ValueError, e: return (400, 'Bad Request', {'Content-Type': 'text/plain'}, 'you sent me garbage - ' + str(e)) peers = self.downloads.setdefault(infohash, {}) self.completed.setdefault(infohash, 0) ts = self.times.setdefault(infohash, {}) confirm = 0 if peers.has_key(myid): myinfo = peers[myid] if myinfo.has_key('key'): if params.get('key') != myinfo['key']: return (200, 'OK', {'Content-Type': 'text/plain', 'Pragma': 'no-cache'}, bencode({'failure reason': 'key did not match key supplied earlier'})) confirm = 1 elif myinfo['ip'] == ip: confirm = 1 else: confirm = 1 if params.get('event', '') != 'stopped' and confirm: ts[myid] = time() if not peers.has_key(myid): peers[myid] = {'ip': ip, 'port': port, 'left': left} if params.has_key('key'): peers[myid]['key'] = params['key'] if params.has_key('ip') and is_valid_ipv4(params['ip']): peers[myid]['given ip'] = params['ip'] mip = ip if ip_override: mip = params['ip'] if not self.natcheck or ip_override: self.becache1.setdefault(infohash,{})[myid] = Bencached(bencode({'ip': mip, 'port': port, 'peer id': myid})) self.becache2.setdefault(infohash,{})[myid] = compact_peer_info(mip, port) else: peers[myid]['left'] = left peers[myid]['ip'] = ip if params.get('event', '') == 'completed': self.completed[infohash] = 1 + self.completed[infohash] if port == 0: peers[myid]['nat'] = 2**30 elif self.natcheck and not ip_override: to_nat = peers[myid].get('nat', -1) if to_nat and to_nat < self.natcheck: NatCheck(self.connectback_result, infohash, myid, ip, port, self.rawserver) else: peers[myid]['nat'] = 0 elif confirm: if peers.has_key(myid): if self.becache1[infohash].has_key(myid): del self.becache1[infohash][myid] del self.becache2[infohash][myid] del peers[myid] del ts[myid] data = {'interval': self.reannounce_interval} if params.get('compact', 0): if rsize == 0: data['peers'] = '' else: cache = self.cache2.setdefault(infohash, []) if len(cache) < rsize: del cache[:] cache.extend(self.becache2.setdefault(infohash, {}).values()) shuffle(cache) del self.cache1.get(infohash, [])[:] data['peers'] = ''.join(cache[-rsize:]) del cache[-rsize:] else: if rsize == 0: data['peers'] = [] else: cache = self.cache1.setdefault(infohash, []) if len(cache) < rsize: del cache[:] cache.extend(self.becache1.setdefault(infohash, {}).values()) shuffle(cache) del self.cache2.get(infohash, [])[:] data['peers'] = cache[-rsize:] del cache[-rsize:] connection.answer((200, 'OK', {'Content-Type': 'text/plain', 'Pragma': 'no-cache'}, bencode(data)))
457a76c89119e66a96375740feccc48418148c3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/457a76c89119e66a96375740feccc48418148c3b/track.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 16, 1459, 16, 589, 16, 1607, 4672, 775, 30, 261, 9068, 16, 17345, 16, 589, 16, 13249, 16, 843, 16, 5481, 13, 273, 15185, 12, 803, 13, 309, 365, 18, 89, 85, 67, 70, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 16, 1459, 16, 589, 16, 1607, 4672, 775, 30, 261, 9068, 16, 17345, 16, 589, 16, 13249, 16, 843, 16, 5481, 13, 273, 15185, 12, 803, 13, 309, 365, 18, 89, 85, 67, 70, ...
raise
raise
def installProduct(self,p,locked=0,hidden=0,swallowExceptions=0): ''' installs a product by name '''
21902debff604a425abce5fd0787f27657ddce27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/21902debff604a425abce5fd0787f27657ddce27/QuickInstallerTool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 4133, 12, 2890, 16, 84, 16, 15091, 33, 20, 16, 6345, 33, 20, 16, 5328, 5965, 11416, 33, 20, 4672, 9163, 31011, 279, 3017, 635, 508, 9163, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 4133, 12, 2890, 16, 84, 16, 15091, 33, 20, 16, 6345, 33, 20, 16, 5328, 5965, 11416, 33, 20, 4672, 9163, 31011, 279, 3017, 635, 508, 9163, 2, -100, -100, -100, -100, -100, -100, ...
request.app.cfg['blog_tagline'] = blog.description
app.cfg['blog_tagline'] = blog.description
def prepare_label(label): """Get a tag for a label.""" tag = label_mapping.get(label.slug) if tag is not None: return tag tag = Tag.objects.filter_by(slug=label.slug).first() if tag is not None: label_mapping[label.slug] = tag return tag tag = Tag.objects.filter_by(name=label.name).first() if tag is not None: label_mapping[label.slug] = tag return tag tag = label_mapping[label.id] = Tag(label.name, '', label.slug) return tag
7191cc848d1a96844a5e86cfd846c6d5b89031f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12815/7191cc848d1a96844a5e86cfd846c6d5b89031f0/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2911, 67, 1925, 12, 1925, 4672, 3536, 967, 279, 1047, 364, 279, 1433, 12123, 1047, 273, 1433, 67, 6770, 18, 588, 12, 1925, 18, 6436, 13, 309, 1047, 353, 486, 599, 30, 327, 1047, 1047, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 1925, 12, 1925, 4672, 3536, 967, 279, 1047, 364, 279, 1433, 12123, 1047, 273, 1433, 67, 6770, 18, 588, 12, 1925, 18, 6436, 13, 309, 1047, 353, 486, 599, 30, 327, 1047, 1047, ...
usage: test_argparse.py [-h] [-w W] [-x X] [-y Y | -z Z]
usage: {} [-h] [-w W] [-x X] [-y Y | -z Z]
def test_groups_parents(self): parent = ErrorRaisingArgumentParser(add_help=False) g = parent.add_argument_group(title='g', description='gd') g.add_argument('-w') g.add_argument('-x') m = parent.add_mutually_exclusive_group() m.add_argument('-y') m.add_argument('-z') parser = ErrorRaisingArgumentParser(parents=[parent])
b7f20bf68be07c173b4908790a8839e9478bcbc6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/b7f20bf68be07c173b4908790a8839e9478bcbc6/test_argparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4650, 67, 12606, 12, 2890, 4672, 982, 273, 1068, 12649, 13734, 1379, 2678, 12, 1289, 67, 5201, 33, 8381, 13, 314, 273, 982, 18, 1289, 67, 3446, 67, 1655, 12, 2649, 2218, 75, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4650, 67, 12606, 12, 2890, 4672, 982, 273, 1068, 12649, 13734, 1379, 2678, 12, 1289, 67, 5201, 33, 8381, 13, 314, 273, 982, 18, 1289, 67, 3446, 67, 1655, 12, 2649, 2218, 75, ...
str += self._module_list(doc.modules(), doc.sortorder())
str += self._module_list(doc.modules(), doc.sortorder(), doc.groups())
def _module_to_html(self, uid): """ @return: An HTML page describing the module identified by C{uid}. @rtype: C{string} @param uid: The unique identifier for the module that should be documented. @type uid: L{UID} """ # Get the module's documentation. doc = self._docmap[uid]
149531a2cda79700e8a2b9b1cbdefc79ff90296b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/149531a2cda79700e8a2b9b1cbdefc79ff90296b/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2978, 67, 869, 67, 2620, 12, 2890, 16, 4555, 4672, 3536, 632, 2463, 30, 1922, 3982, 1363, 16868, 326, 1605, 9283, 635, 385, 95, 1911, 5496, 632, 86, 723, 30, 385, 95, 1080, 97, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2978, 67, 869, 67, 2620, 12, 2890, 16, 4555, 4672, 3536, 632, 2463, 30, 1922, 3982, 1363, 16868, 326, 1605, 9283, 635, 385, 95, 1911, 5496, 632, 86, 723, 30, 385, 95, 1080, 97, ...
screen_coord = self.coord_to_screen(coord[0], coord[1], zl)
screen_coord = self.coord_to_screen(location[0], location[1], zl)
def draw_overlay(self, zl, conf, crossPixbuf, dlpixbuf, downloading=False, visual_dlconfig = {}, marker=None, locations={}, entry_name="", showMarkers=False, gps=None, gps_direction=False): self.set_scale_gc() self.set_visualdl_gc() rect = self.get_allocation() middle = (rect.width / 2, rect.height / 2) full = (rect.width, rect.height)
4ee032a2e9fa55433caaed49982dcf3b472c904f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5373/4ee032a2e9fa55433caaed49982dcf3b472c904f/widDrawingArea.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 67, 17312, 12, 2890, 16, 998, 80, 16, 2195, 16, 6828, 21816, 4385, 16, 8910, 14861, 4385, 16, 23742, 33, 8381, 16, 11623, 67, 5761, 1425, 273, 10615, 5373, 33, 7036, 16, 7838, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 17312, 12, 2890, 16, 998, 80, 16, 2195, 16, 6828, 21816, 4385, 16, 8910, 14861, 4385, 16, 23742, 33, 8381, 16, 11623, 67, 5761, 1425, 273, 10615, 5373, 33, 7036, 16, 7838, 28...
'björn',
r'\text{björn}',
def test_math(self): latexlist = [r"\sqrt{4}=2", r"a^2 + b^2 = c^2\,", r"E = m c^2", r"\begin{matrix}e^{\mathrm{i}\,\pi}\end{matrix}+1=0\;", r"1\,\mathrm{\frac{km}{h}} = 0{,}2\overline{7}\,\mathrm{\frac{m}{s}}", 'björn', ] for latex in latexlist: latex = unicode(latex, 'utf-8') res = renderMath(latex, self.tmpdir, output_mode='png', render_engine='blahtexml') assert res res = renderMath(latex, self.tmpdir, output_mode='mathml', render_engine='blahtexml') assert res res = renderMath(latex, self.tmpdir, output_mode='png', render_engine='texvc') assert res
8ff2a3e405ce7c991ee5872258a003492046ff81 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/8ff2a3e405ce7c991ee5872258a003492046ff81/test_math_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 15949, 12, 2890, 4672, 25079, 1098, 273, 306, 86, 12691, 24492, 95, 24, 97, 33, 22, 3113, 436, 6, 69, 66, 22, 397, 324, 66, 22, 273, 276, 66, 22, 64, 16, 3113, 436, 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, 1842, 67, 15949, 12, 2890, 4672, 25079, 1098, 273, 306, 86, 12691, 24492, 95, 24, 97, 33, 22, 3113, 436, 6, 69, 66, 22, 397, 324, 66, 22, 273, 276, 66, 22, 64, 16, 3113, 436, 6, ...
for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_)
for node_ in self.get_node(): node_.export(outfile, level, namespace_, name_='node') for edge_ in self.get_edge(): edge_.export(outfile, level, namespace_, name_='edge') for set_ in self.set: set_.export(outfile, level, namespace_, name_='set')
def exportChildren(self, outfile, level, namespace_='', name_='AbstractNetwork'): super(AbstractNetwork, self).exportChildren(outfile, level, namespace_, name_) for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_)
9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 4212, 12, 2890, 16, 8756, 16, 1801, 16, 1981, 67, 2218, 2187, 508, 67, 2218, 7469, 3906, 11, 4672, 2240, 12, 7469, 3906, 16, 365, 2934, 6530, 4212, 12, 26050, 16, 1801, 16, 1981,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 4212, 12, 2890, 16, 8756, 16, 1801, 16, 1981, 67, 2218, 2187, 508, 67, 2218, 7469, 3906, 11, 4672, 2240, 12, 7469, 3906, 16, 365, 2934, 6530, 4212, 12, 26050, 16, 1801, 16, 1981,...
> <doctest foo-bär@baz[1]>(1)<module>()->None
> <doctest foo-bär@baz[2]>(1)<module>()->None
def test_pdb_set_trace(): """Using pdb.set_trace from a doctest. You can use pdb.set_trace from a doctest. To do so, you must retrieve the set_trace function from the pdb module at the time you use it. The doctest module changes sys.stdout so that it can capture program output. It also temporarily replaces pdb.set_trace with a version that restores stdout. This is necessary for you to see debugger output. >>> doc = ''' ... >>> x = 42 ... >>> import pdb; pdb.set_trace() ... ''' >>> parser = doctest.DocTestParser() >>> test = parser.get_doctest(doc, {}, "foo-bär@baz", "foo-bär@baz.py", 0) >>> runner = doctest.DocTestRunner(verbose=False) To demonstrate this, we'll create a fake standard input that captures our debugger input: >>> import tempfile >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput([ ... 'print(x)', # print data defined by the example ... 'continue', # stop debugging ... '']) >>> try: runner.run(test) ... finally: sys.stdin = real_stdin --Return-- > <doctest foo-bär@baz[1]>(1)<module>()->None -> import pdb; pdb.set_trace() (Pdb) print(x) 42 (Pdb) continue TestResults(failed=0, attempted=2) You can also put pdb.set_trace in a function called from a test: >>> def calls_set_trace(): ... y=2 ... import pdb; pdb.set_trace() >>> doc = ''' ... >>> x=1 ... >>> calls_set_trace() ... ''' >>> test = parser.get_doctest(doc, globals(), "foo-bär@baz", "foo-bär@baz.py", 0) >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput([ ... 'print(y)', # print data defined in the function ... 'up', # out of function ... 'print(x)', # print data defined by the example ... 'continue', # stop debugging ... '']) >>> try: ... runner.run(test) ... finally: ... sys.stdin = real_stdin --Return-- > <doctest test.test_doctest.test_pdb_set_trace[8]>(3)calls_set_trace()->None -> import pdb; pdb.set_trace() (Pdb) print(y) 2 (Pdb) up > <doctest foo-bär@baz[1]>(1)<module>() -> calls_set_trace() (Pdb) print(x) 1 (Pdb) continue TestResults(failed=0, attempted=2) During interactive debugging, source code is shown, even for doctest examples: >>> doc = ''' ... >>> def f(x): ... ... g(x*2) ... >>> def g(x): ... ... print(x+3) ... ... import pdb; pdb.set_trace() ... >>> f(3) ... ''' >>> test = parser.get_doctest(doc, globals(), "foo-bär@baz", "foo-bär@baz.py", 0) >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput([ ... 'list', # list source from example 2 ... 'next', # return from g() ... 'list', # list source from example 1 ... 'next', # return from f() ... 'list', # list source from example 3 ... 'continue', # stop debugging ... '']) >>> try: runner.run(test) ... finally: sys.stdin = real_stdin ... # doctest: +NORMALIZE_WHITESPACE --Return-- > <doctest foo-bär@baz[1]>(3)g()->None -> import pdb; pdb.set_trace() (Pdb) list 1 def g(x): 2 print(x+3) 3 -> import pdb; pdb.set_trace() [EOF] (Pdb) next --Return-- > <doctest foo-bär@baz[0]>(2)f()->None -> g(x*2) (Pdb) list 1 def f(x): 2 -> g(x*2) [EOF] (Pdb) next --Return-- > <doctest foo-bär@baz[2]>(1)<module>()->None -> f(3) (Pdb) list 1 -> f(3) [EOF] (Pdb) continue ********************************************************************** File "foo-bär@baz.py", line 7, in foo-bär@baz Failed example: f(3) Expected nothing Got: 9 TestResults(failed=1, attempted=3) """
39b14e8f1a3d1360dce1b2dfe3aa2c96ad0c1ae1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/39b14e8f1a3d1360dce1b2dfe3aa2c96ad0c1ae1/test_doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 17414, 67, 542, 67, 5129, 13332, 3536, 7736, 10892, 18, 542, 67, 5129, 628, 279, 31263, 395, 18, 225, 4554, 848, 999, 10892, 18, 542, 67, 5129, 628, 279, 31263, 395, 18, 225,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 17414, 67, 542, 67, 5129, 13332, 3536, 7736, 10892, 18, 542, 67, 5129, 628, 279, 31263, 395, 18, 225, 4554, 848, 999, 10892, 18, 542, 67, 5129, 628, 279, 31263, 395, 18, 225,...
self.screen.addstr(self.curLineNumber, x_pos, comment, curses.color_pair(0))
self.screen.addstr(self.curLineNumber, x_pos, comment, curses.color_pair(6))
def updateCurrentLine(self, s, tab=False, stringCompletion=False, interruptFlag=False):
c6a31ea14242d43d18af9359f0b2548ac10d4c52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11578/c6a31ea14242d43d18af9359f0b2548ac10d4c52/repl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 3935, 1670, 12, 2890, 16, 272, 16, 3246, 33, 8381, 16, 533, 11238, 33, 8381, 16, 13123, 4678, 33, 8381, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3935, 1670, 12, 2890, 16, 272, 16, 3246, 33, 8381, 16, 533, 11238, 33, 8381, 16, 13123, 4678, 33, 8381, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
'product_id': fields.many2one('product.product','Product',required=True),
'product_id': fields.many2one('product.product', 'Product', required=True),
def _stock_search(self, cr, uid, obj, name, args): locations = self.pool.get('stock.location').search(cr, uid, [('usage','=','internal')]) cr.execute('''select prodlot_id, sum(name) from stock_report_prodlots where location_id in ('''+','.join(map(str, locations)) +''') group by prodlot_id having sum(name) ''' + str(args[0][1]) + ''' ''' + str(args[0][2]) ) res = cr.fetchall() ids = [('id','in',map(lambda x:x[0], res))] return ids
369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 15381, 67, 3072, 12, 2890, 16, 4422, 16, 4555, 16, 1081, 16, 508, 16, 833, 4672, 7838, 273, 365, 18, 6011, 18, 588, 2668, 15381, 18, 3562, 16063, 3072, 12, 3353, 16, 4555, 16, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 15381, 67, 3072, 12, 2890, 16, 4422, 16, 4555, 16, 1081, 16, 508, 16, 833, 4672, 7838, 273, 365, 18, 6011, 18, 588, 2668, 15381, 18, 3562, 16063, 3072, 12, 3353, 16, 4555, 16, 3...
lang_data = [] for root, dirs, files in os.walk('po/'): for name in files: ext = name.split(".") lang = root.split("/")[1] if len(ext) == 2: if ext[1] == "mo": lang_file = root + "/" + name print lang print lang_file lang_data.append(("locale/%s/LC_MESSAGES/%s"%(lang,name), ["%s"%(lang_file)]))
def setup_f(): global lang_data other_data = [('share/pixmaps', ['extras/upstream.png']), ('share/upstream', ['extras/canoe.glade']), ('etc/upstream', ['conf/upstream.conf']),] complete_data = other_data + lang_data print other_data print complete_data setup( name='Upstream', version="0.3-alpha", author="Mahangu Weerasighe", packages=['upstream', 'upstream.log-modules', 'upstream.submit-modules'], package_dir={'upstream' : 'upstream-base'}, package_data={'upstream': ['extras/*']}, data_files= complete_data, scripts=['canoe/canoe', 'kayak/kayak', 'upstream-base/upstream'])
136b0d316df8ef24d3e121e9ab82eeaa6da34548 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/635/136b0d316df8ef24d3e121e9ab82eeaa6da34548/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 74, 13332, 2552, 3303, 67, 892, 1308, 67, 892, 273, 306, 2668, 14419, 19, 14861, 10711, 2187, 10228, 23687, 19, 416, 3256, 18, 6446, 3546, 3631, 7707, 14419, 19, 416, 3256, 218...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 74, 13332, 2552, 3303, 67, 892, 1308, 67, 892, 273, 306, 2668, 14419, 19, 14861, 10711, 2187, 10228, 23687, 19, 416, 3256, 18, 6446, 3546, 3631, 7707, 14419, 19, 416, 3256, 218...
if self.current == None: self.current = user if self.mucous.mode == "private":
if self.mucous.mode == "private": if self.current == None: self.current = user
def Recieved(self,direction, timestamp, user, message): try: ctcpversion = 0 if message == curses.ascii.ctrl("A")+"VERSION"+curses.ascii.ctrl("A"): message = "CTCP VERSION" ctcpversion = 1 if user not in self.logs.keys(): self.logs[user] = [] if self.mucous.Config["mucous"]["logging"] in ("yes"): self.ImportLogs(user) if self.mucous.Config["mucous"]["logging"] in ("yes"): if direction == 0: self.mucous.FileLog("private", time.strftime("%d %b %Y %H:%M:%S"), user, "["+user+"]\t"+ message ) elif direction == 1: self.mucous.FileLog("private", time.strftime("%d %b %Y %H:%M:%S"), user, "["+self.mucous.username+"]\t"+ message ) if self.current == None: self.current = user self.Log(direction, user, message) if ctcpversion == 1 and direction == 0: if self.mucous.Config["mucous"]["extra_requests"] == "Yes": self.Send(user, "Mucous %s" % Version) if self.mucous.mode != "private": self.mucous.Alerts.Add(user, "PRIVATE") #self.Alerts.setStatus("New PM") #if user not in self.Alerts.alert["PRIVATE"]: #self.Alerts.alert["PRIVATE"].append(user) self.mucous.HotKeyBar() self.mucous.Beep() elif self.mucous.mode == "private" and self.current != user: self.mucous.Alerts.Add(user, "PRIVATE") self.mucous.HotKeyBar() self.mucous.Beep() if self.current == None: self.current = user if self.mucous.mode == "private": self.Mode() elif self.current == user: if self.mucous.mode == "private": self.Mode() elif self.current != user and self.current != None: pmusers = self.logs.keys() pmusers.sort(key=str.lower) self.mucous.DrawTabs(pmusers, self.current) #self.mucous.Alerts.setStatus("PM: "+user) except Exception ,e: self.mucous.Help.Log("debug", "PrivateChat.Recieved: " + str(e))
26e5c555150354eaccbf13fc5b89a9ce51be55c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8737/26e5c555150354eaccbf13fc5b89a9ce51be55c9/MucousPrivateChat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7776, 1385, 2155, 12, 2890, 16, 9855, 16, 2858, 16, 729, 16, 883, 4672, 775, 30, 225, 5691, 4057, 1589, 273, 374, 309, 883, 422, 30436, 18, 9184, 18, 16277, 2932, 37, 7923, 9078, 5757,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7776, 1385, 2155, 12, 2890, 16, 9855, 16, 2858, 16, 729, 16, 883, 4672, 775, 30, 225, 5691, 4057, 1589, 273, 374, 309, 883, 422, 30436, 18, 9184, 18, 16277, 2932, 37, 7923, 9078, 5757,...
if right[0] == KERNING_CLASS_PREFIX:
if right[0] == "@":
def guessPairType(self, pair): """ >>> kerning = { ... ("@A_left", "@A_right") : 1, ... ("A1", "@A_right") : 2, ... ("@A_left", "A2") : 3, ... ("A3", "A3") : 4, ... } >>> groups = { ... "@A_left" : ["A", "A1", "A2", "A3"], ... "@A_right" : ["A", "A1", "A2", "A3"], ... } >>> obj = MathKerning(kerning, groups) >>> obj.guessPairType(("@A_left", "@A_right")) ('class', 'class') >>> obj.guessPairType(("A1", "@A_right")) ('exception', 'class') >>> obj.guessPairType(("@A_left", "A2")) ('class', 'exception') >>> obj.guessPairType(("A3", "A3")) ('exception', 'exception') >>> obj.guessPairType(("A", "A")) ('single', 'single') """ left, right = pair CLASS_TYPE = "class" SINGLE_TYPE = "single" EXCEPTION_TYPE = "exception" # leftType = SINGLE_TYPE rightType = SINGLE_TYPE # is the left a simple class? if left[0] == KERNING_CLASS_PREFIX: leftType = CLASS_TYPE # or is it part of a class? if right[0] == KERNING_CLASS_PREFIX: rightType = CLASS_TYPE # if self._kerning.has_key(pair): potLeft = [left] potRight = [right] if leftType == SINGLE_TYPE and self._groupMap.has_key(left): for groupName in self._groupMap[left]: potLeft.append(groupName) if rightType == SINGLE_TYPE and self._groupMap.has_key(right): for groupName in self._groupMap[right]: potRight.append(groupName) # hits = [] for left in potLeft: for right in potRight: if self._kerning.has_key((left, right)): hits.append((left, right)) for left, right in hits: if leftType != CLASS_TYPE: if left[0] == KERNING_CLASS_PREFIX: leftType = EXCEPTION_TYPE if rightType != CLASS_TYPE: if right[0] == KERNING_CLASS_PREFIX: rightType = EXCEPTION_TYPE return (leftType, rightType)
de2dfa43a24bfa2f4da392648b9c09be60d7df98 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8840/de2dfa43a24bfa2f4da392648b9c09be60d7df98/mathKerning.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7274, 4154, 559, 12, 2890, 16, 3082, 4672, 3536, 4080, 417, 264, 2093, 273, 288, 1372, 377, 7566, 36, 37, 67, 4482, 3113, 8787, 37, 67, 4083, 7923, 294, 404, 16, 1372, 377, 7566, 37, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7274, 4154, 559, 12, 2890, 16, 3082, 4672, 3536, 4080, 417, 264, 2093, 273, 288, 1372, 377, 7566, 36, 37, 67, 4482, 3113, 8787, 37, 67, 4083, 7923, 294, 404, 16, 1372, 377, 7566, 37, ...
(0.001368852970712986, 0.0041009402016725094, 0.012252436441829828, 0.036308782091905023, 0.10501923017634662, 0.28312883556311919, 0.63159685013597011, 0.95000000000000351)
(0.001368852970712986, 0.0041009402016725094, 0.012252436441829..., 0.03630878209190..., 0.10501923017634..., 0.28312883556311..., 0.6315968501359..., 0.95000000000000...)
def gamma(self): """ Return the vector of the kbar transitional probabilities.
469a5d1130a86ee7f7941bd019841497bac6872f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/469a5d1130a86ee7f7941bd019841497bac6872f/markov_multifractal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9601, 12, 2890, 4672, 3536, 2000, 326, 3806, 434, 326, 417, 3215, 6007, 287, 17958, 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, 9601, 12, 2890, 4672, 3536, 2000, 326, 3806, 434, 326, 417, 3215, 6007, 287, 17958, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def _skip_to_nonblank(f, spacegroup):
def _skip_to_nonblank(f, spacegroup, setting):
def _skip_to_nonblank(f, spacegroup): """Read lines from f until a nonblank line not starting with a hash (#) is encountered and returns the line.""" while True: line = f.readline() if not line: raise SpacegroupNotFoundError( 'invalid spacegroup %s, not found in data base'%spacegroup) line.strip() if line and not line.startswith('#'): break return line
7d942e7ec423a80f705e069ecb530fa6d808eb5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/7d942e7ec423a80f705e069ecb530fa6d808eb5a/spacegroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7457, 67, 869, 67, 5836, 12111, 12, 74, 16, 3476, 1655, 16, 3637, 4672, 3536, 1994, 2362, 628, 284, 3180, 279, 1661, 12111, 980, 486, 5023, 598, 279, 1651, 23885, 13, 353, 9919, 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, 7457, 67, 869, 67, 5836, 12111, 12, 74, 16, 3476, 1655, 16, 3637, 4672, 3536, 1994, 2362, 628, 284, 3180, 279, 1661, 12111, 980, 486, 5023, 598, 279, 1651, 23885, 13, 353, 9919, 4...
timeouts = (win32con.MAXDWORD, 0, 0, 0, 1000)
timeouts = (win32con.MAXDWORD, 0, 0, 0, 0)
def __init__(self, port, #number of device, numbering starts at #zero. if everything fails, the user #can specify a device string, note #that this isn't portable anymore baudrate=9600, #baudrate bytesize=EIGHTBITS, #number of databits parity=PARITY_NONE, #enable parity checking stopbits=STOPBITS_ONE, #number of stopbits timeout=None, #set a timeout value, None for waiting forever xonxoff=0, #enable software flow control rtscts=0, #enable RTS/CTS flow control ): """initialize comm port"""
31d37f6e3af45fb00b4723ab8505374f875c5ec3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/31d37f6e3af45fb00b4723ab8505374f875c5ec3/serialwin32.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1756, 16, 5375, 468, 2696, 434, 2346, 16, 1300, 310, 2542, 622, 468, 7124, 18, 309, 7756, 6684, 16, 326, 729, 468, 4169, 4800, 279, 2346, 533, 16, 4721, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1756, 16, 5375, 468, 2696, 434, 2346, 16, 1300, 310, 2542, 622, 468, 7124, 18, 309, 7756, 6684, 16, 326, 729, 468, 4169, 4800, 279, 2346, 533, 16, 4721, ...
'HTTP_USER_AGENT', 'HTTP_COOKIE'):
'HTTP_USER_AGENT', 'HTTP_COOKIE', 'HTTP_REFERER'):
def run_cgi(self): """Execute a CGI script.""" path = self.path dir, rest = self.cgi_info
83b2bf6d9a7f3fe774bdce69b5d9a4202bd7889c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/83b2bf6d9a7f3fe774bdce69b5d9a4202bd7889c/CGIHTTPServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 19062, 12, 2890, 4672, 3536, 5289, 279, 385, 13797, 2728, 12123, 589, 273, 365, 18, 803, 1577, 16, 3127, 273, 365, 18, 19062, 67, 1376, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 19062, 12, 2890, 4672, 3536, 5289, 279, 385, 13797, 2728, 12123, 589, 273, 365, 18, 803, 1577, 16, 3127, 273, 365, 18, 19062, 67, 1376, 2, -100, -100, -100, -100, -100, -100, ...
def keys( self ):
def keys(self):
def keys( self ): return self.hash.keys()
b5657d3af65650c04d6839afe36ff00965f477c3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14418/b5657d3af65650c04d6839afe36ff00965f477c3/helpers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1311, 12, 2890, 4672, 327, 365, 18, 2816, 18, 2452, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1311, 12, 2890, 4672, 327, 365, 18, 2816, 18, 2452, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
output = self.executeCommand("cp %s ~/tmp/foo" % os.path.join(cacheDir,"submit.sh")) logging.debug("ARCSubmitter.doSubmit: %s " % output) for fname in self.jobInputFiles: output = self.executeCommand("cp %s ~/tmp/foo" % fname) logging.debug("ARCSubmitter.doSubmit: %s " % output)
def doSubmit(self): """ _doSubmit_
4ef3db3cbc3340b7e68535ecf0f0d1611752f3a1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/4ef3db3cbc3340b7e68535ecf0f0d1611752f3a1/ARCSubmitter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 11620, 12, 2890, 4672, 3536, 389, 2896, 11620, 67, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 11620, 12, 2890, 4672, 3536, 389, 2896, 11620, 67, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
path = 'path/to/mod'
path = os.path.join('path', 'to', 'mod')
def test_module_reuse(self): name = 'mod' path = 'path/to/mod' module = imp.new_module(name) mock = self.mocker({name: path}) with util.uncache(name): sys.modules[name] = module loaded_module = mock.load_module(name) self.assert_(loaded_module is module) self.assert_(sys.modules[name] is module) return mock, name
a95a3b71fe15ce3e077b3c8fe143ceab7e7cb20a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/a95a3b71fe15ce3e077b3c8fe143ceab7e7cb20a/test_abc_loader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2978, 67, 266, 1202, 12, 2890, 4672, 508, 273, 296, 1711, 11, 589, 273, 1140, 18, 803, 18, 5701, 2668, 803, 2187, 296, 869, 2187, 296, 1711, 6134, 1605, 273, 1646, 18, 2704, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2978, 67, 266, 1202, 12, 2890, 4672, 508, 273, 296, 1711, 11, 589, 273, 1140, 18, 803, 18, 5701, 2668, 803, 2187, 296, 869, 2187, 296, 1711, 6134, 1605, 273, 1646, 18, 2704, ...
hams += h
hams += g
def main(): """Main program; parse options and go.""" try: opts, args = getopt.getopt(sys.argv[1:], 'hdfg:s:p:u:r') except getopt.error, msg: usage(2, msg) if not opts: usage(2, "No options given") pck = DEFAULTDB good = [] spam = [] unknown = [] reverse = 0 do_filter = usedb = False for opt, arg in opts: if opt == '-h': usage(0) elif opt == '-g': good.append(arg) elif opt == '-s': spam.append(arg) elif opt == '-p': pck = arg elif opt == "-d": usedb = True elif opt == "-f": do_filter = True elif opt == '-u': unknown.append(arg) elif opt == '-r': reverse = 1 if args: usage(2, "Positional arguments not allowed") save = False bayes = createbayes(pck, usedb) h = Hammie(bayes) for g in good: print "Training ham (%s):" % g train(h, g, False) save = True for s in spam: print "Training spam (%s):" % s train(h, s, True) save = True if save: h.update_probabilities() if not usedb and pck: fp = open(pck, 'wb') pickle.dump(bayes, fp, 1) fp.close() if do_filter: msg = sys.stdin.read() filtered = h.filter(msg) sys.stdout.write(filtered) if unknown: (spams, hams) = (0, 0) for u in unknown: if len(unknown) > 1: print "Scoring", u s, h = score(h, u, reverse) spams += s hams += h print "Total %d spam, %d ham" % (spams, hams)
193f57fa80b5f6a120b0912dc376aa61fb346991 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/193f57fa80b5f6a120b0912dc376aa61fb346991/hammie.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 6376, 5402, 31, 1109, 702, 471, 1960, 12123, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 9499, 18, 19485, 63, 21, 30, 6487, 296, 22057, 2137, 30, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3536, 6376, 5402, 31, 1109, 702, 471, 1960, 12123, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 9499, 18, 19485, 63, 21, 30, 6487, 296, 22057, 2137, 30, 87, ...
code = self.write_code % {"name": self.base_name, "func": func, "op_idx": self.dest_reg_idx, "reg_idx": self.reg_spec, "size": self.size, "ctype": self.ctype, "final_val": final_val}
subst_dict = {"name": self.base_name, "func": func, "reg_idx": self.reg_spec, "size": self.size, "ctype": self.ctype, "final_val": final_val} if hasattr(self, 'dest_reg_idx'): subst_dict['op_idx'] = self.dest_reg_idx code = self.write_code % subst_dict
def buildWriteCode(self, func = None): if (self.size != self.dflt_size and self.is_signed): final_val = 'sext<%d>(%s)' % (self.size, self.base_name) else: final_val = self.base_name code = self.write_code % {"name": self.base_name, "func": func, "op_idx": self.dest_reg_idx, "reg_idx": self.reg_spec, "size": self.size, "ctype": self.ctype, "final_val": final_val} return ''' { %s final_val = %s; %s; if (traceData) { traceData->setData(final_val); } }''' % (self.dflt_ctype, final_val, code)
b8e823dac447e40f507bb62ad8b665f6bd47ff08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7385/b8e823dac447e40f507bb62ad8b665f6bd47ff08/isa_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 3067, 1085, 12, 2890, 16, 1326, 273, 599, 4672, 309, 261, 2890, 18, 1467, 480, 365, 18, 2180, 5618, 67, 1467, 471, 365, 18, 291, 67, 5679, 4672, 727, 67, 1125, 273, 296, 307, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3067, 1085, 12, 2890, 16, 1326, 273, 599, 4672, 309, 261, 2890, 18, 1467, 480, 365, 18, 2180, 5618, 67, 1467, 471, 365, 18, 291, 67, 5679, 4672, 727, 67, 1125, 273, 296, 307, 1...
if pdflatex:
if not engine or engine == "latex": command = "latex" suffix = "ps" return_suffix = "dvi" elif engine == "pdflatex":
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't convert the dvi file to png (because of postscript specials or other issues), then dvips is called, and the PS file is converted to a png file. INPUT: - ``filename`` - string: file to process, including full path - ``debug`` - bool (optional, default False): whether to print verbose debugging output - ``density`` - integer (optional, default 150): how big output image is. - ``pdflatex`` - bool (optional, default False): whether to use pdflatex. - ``png`` - bool (optional, default False): whether to produce a png file. - ``do_in_background`` - bool (optional, default False): whether to run in the background. OUTPUT: string, which could be a string starting with 'Error' (if there was a problem), or it could be 'pdf' or 'dvi'. If ``pdflatex`` is False, then a dvi file is created, but if there appear to be problems with it (because of PS special commands, for example), then a pdf file is created instead. The function returns 'dvi' or 'pdf' to indicate which type of file is created. (Detecting problems requires that dvipng be installed; if it is not, then the dvi file is not checked for problems and 'dvi' is returned.) If ``pdflatex`` is True and there are no errors, then 'pdf' is returned. .. warning:: If ``png`` is True, then when using latex (the default), you must have 'dvipng' (or 'dvips' and 'convert') installed on your operating system, or this command won't work. When using pdflatex, you must have 'convert' installed. EXAMPLES:: sage: from sage.misc.latex import _run_latex_, _latex_file_ sage: file = os.path.join(SAGE_TMP, "temp.tex") sage: O = open(file, 'w') sage: O.write(_latex_file_([ZZ[x], RR])); O.close() sage: _run_latex_(file) # random - depends on whether latex is installed 'dvi' """ if pdflatex is None: pdflatex = _Latex_prefs._option["pdflatex"] if not pdflatex and not have_latex(): print "Error: LaTeX does not seem to be installed. Download it from" print "ctan.org and try again." return "Error" if pdflatex and not have_pdflatex(): print "Error: PDFLaTeX does not seem to be installed. Download it from" print "ctan.org and try again." return "Error" # if png output + latex, check to see if dvipng or convert is installed. if png: if not pdflatex and not (have_dvipng() or have_convert()): print "" print "Error: neither dvipng nor convert (from the ImageMagick suite)" print "appear to be installed. Displaying LaTeX or PDFLaTeX output" print "requires at least one of these programs, so please install" print "and try again." print "" print "Go to http://sourceforge.net/projects/dvipng/ and" print "http://www.imagemagick.org to download these programs." return "Error" # if png output + pdflatex, check to see if convert is installed. elif pdflatex and not have_convert(): print "" print "Error: convert (from the ImageMagick suite) does not" print "appear to be installed. Displaying PDFLaTeX output" print "requires this program, so please install and try again." print "" print "Go to http://www.imagemagick.org to download it." return "Error" # check_validity: check to see if the dvi file is okay by trying # to convert to a png file. if this fails, return_suffix will be # set to "pdf". return_suffix is the return value for this # function. # # thus if not png output, check validity of dvi output if dvipng # or convert is installed. else: check_validity = have_dvipng() # set up filenames, other strings: base, filename = os.path.split(filename) filename = os.path.splitext(filename)[0] # get rid of extension if len(filename.split()) > 1: raise ValueError, "filename must contain no spaces" if not debug: redirect=' 2>/dev/null 1>/dev/null ' else: redirect='' if do_in_background: background = ' &' else: background = '' if pdflatex: command = "pdflatex" # 'suffix' is used in the string 'convert' ... suffix = "pdf" return_suffix = "pdf" else: command = "latex" suffix = "ps" return_suffix = "dvi" # Define the commands to be used: lt = 'cd "%s"&& sage-native-execute %s \\\\nonstopmode \\\\input{%s.tex} %s'%(base, command, filename, redirect) # dvipng is run with the 'picky' option: this means that if # there are warnings, no png file is created. dvipng = 'cd "%s"&& sage-native-execute dvipng --picky -q -T tight -D %s %s.dvi -o %s.png'%(base, density, filename, filename) dvips = 'sage-native-execute dvips %s.dvi %s'%(filename, redirect) ps2pdf = 'sage-native-execute ps2pdf %s.ps %s'%(filename, redirect) # We seem to need a larger size when using convert compared to # when using dvipng: density = int(1.4 * density / 1.3) convert = 'sage-native-execute convert -density %sx%s -trim %s.%s %s.png %s '%\ (density,density, filename, suffix, filename, redirect) e = 1 # it is possible to get through the following commands # without running a program, so in that case we force error if pdflatex: if png: cmd = ' && '.join([lt, convert]) else: cmd = lt if debug: print cmd e = os.system(cmd + ' ' + redirect + background) else: # latex, not pdflatex if (png or check_validity): if have_dvipng(): cmd = ' && '.join([lt, dvipng]) if debug: print cmd e = os.system(cmd + ' ' + redirect) dvipng_error = not os.path.exists(base + '/' + filename + '.png') # If there is no png file, then either the latex # process failed or dvipng failed. Assume that dvipng # failed, and try running dvips and convert. (If the # latex process failed, then dvips and convert will # fail also, so we'll still catch the error.) if dvipng_error: if png: if have_convert(): cmd = ' && '.join(['cd "%s"'%(base,), dvips, convert]) if debug: print "'dvipng' failed; trying 'convert' instead..." print cmd e = os.system(cmd + ' ' + redirect + background) else: print "Error: 'dvipng' failed and 'convert' is not installed." return "Error: dvipng failed." else: # not png, i.e., check_validity return_suffix = "pdf" cmd = ' && '.join(['cd "%s"'%(base,), dvips, ps2pdf]) if debug: print "bad dvi file; running dvips and ps2pdf instead..." print cmd e = os.system(cmd) if e: # error running dvips and/or ps2pdf command = "pdflatex" lt = 'cd "%s"&& sage-native-execute %s \\\\nonstopmode \\\\input{%s.tex} %s'%(base, command, filename, redirect) if debug: print "error running dvips and ps2pdf; trying pdflatex instead..." print cmd e = os.system(cmd + background) else: # don't have dvipng, so must have convert. run latex, dvips, convert. cmd = ' && '.join([lt, dvips, convert]) if debug: print cmd e = os.system(cmd + ' ' + redirect + background) if e: print "An error occurred." try: print open(base + '/' + filename + '.log').read() except IOError: pass return "Error latexing slide." return return_suffix
12cbced4c423573c5a4da0ddb9e58a2d0102170d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/12cbced4c423573c5a4da0ddb9e58a2d0102170d/latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2681, 67, 26264, 67, 12, 3459, 16, 1198, 33, 8381, 16, 12142, 33, 23014, 16, 8169, 26264, 33, 7036, 16, 14476, 33, 8381, 16, 741, 67, 267, 67, 9342, 33, 8381, 4672, 3536, 1220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2681, 67, 26264, 67, 12, 3459, 16, 1198, 33, 8381, 16, 12142, 33, 23014, 16, 8169, 26264, 33, 7036, 16, 14476, 33, 8381, 16, 741, 67, 267, 67, 9342, 33, 8381, 4672, 3536, 1220, ...
parms.append( '-' + parm + ' ' + url_attr )
parms += [ parm, url_attr ]
def recreate( me, ourl): parms = [] for url_parm,parm in [ ('host','h'), ('port','p'), ('username','U') ]: #XXX does the order really matter? url_attr = getattr( ourl, url_parm, '') if not url_attr: continue if not isinstance( url_attr, basestring): url_attr = str(url_attr) parms.append( '-' + parm + ' ' + url_attr ) parms.append( ourl.database ) print '<', parms, '>' #assert 0 if 'subprocess': from subprocess import Popen, PIPE try: p = Popen( ['dropdb'] + parms, stdout= PIPE ) output = p.communicate()[0] except OSError: pass p = Popen( ['createdb'] + parms, stdout= PIPE ) output = p.communicate()[0] else: parms_str = ' '.join( parms) import os try: r = os.system( 'dropdb ' + parms_str) except OSError: pass r = os.system( 'createdb ' + parms_str)
2c27924db6fba5894a639a9ac3f5be24207e1edb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10808/2c27924db6fba5894a639a9ac3f5be24207e1edb/sa_engine_defs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23052, 12, 1791, 16, 320, 718, 4672, 17902, 273, 5378, 364, 880, 67, 1065, 81, 16, 1065, 81, 316, 306, 7707, 2564, 17023, 76, 19899, 7707, 655, 17023, 84, 19899, 7707, 5053, 17023, 57, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23052, 12, 1791, 16, 320, 718, 4672, 17902, 273, 5378, 364, 880, 67, 1065, 81, 16, 1065, 81, 316, 306, 7707, 2564, 17023, 76, 19899, 7707, 655, 17023, 84, 19899, 7707, 5053, 17023, 57, ...
test_support.run_unittest(TestDifflibLongestMatch)
test_support.run_unittest( TestDifflibLongestMatch, TextIOWrapperTest)
def test_main(): test_support.run_unittest(TestDifflibLongestMatch)
3532734849021b586c1de97314e3a5d6764e9223 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/3532734849021b586c1de97314e3a5d6764e9223/outstanding_bugs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1842, 67, 13261, 18, 2681, 67, 4873, 3813, 12, 7766, 10428, 12678, 3708, 395, 2060, 16, 3867, 4294, 3611, 4709, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1842, 67, 13261, 18, 2681, 67, 4873, 3813, 12, 7766, 10428, 12678, 3708, 395, 2060, 16, 3867, 4294, 3611, 4709, 13, 225, 2, -100, -100, -100, -100, -100, -100, -10...
reportSections.append(("%s: Bcfg Nightly Errors"%machine.attrib['name'], "%s%s"%(modified, baddata)))
reportsections.append(("%s: Bcfg Nightly Errors" % machine.attrib['name'], \ "%s%s" % (modified, baddata)))
def generateReport(report, delivery, deliverytype, statdata): reportSections = [] deliverytype = delivery.get("type", default = "nodes-individual") reportgood = report.get("good", default = 'Y') reportmodified = report.get("modified", default = 'Y') current_date = asctime()[:10] baddata = '' modified = '' msg = '' mheader = '' dirty = '' clean = '' for machine in report.findall('Machine'): for node in statdata.findall('Node'): if node.attrib['name'] == machine.attrib['name']: if deliverytype == 'nodes-digest': mheader = "Machine: %s\n"%machine.attrib['name'] for stats in node.findall('Statistics'): if stats.attrib['state'] == 'clean' and current_date in stats.attrib['time']: clean += "%s\n"%machine.attrib['name'] if reportmodified == 'Y': for modxml in stats.findall('Modified'): if current_date in stats.attrib['time']: modified+="\n%s\n"%tostring(modxml) for bad in stats.findall('Bad'): srtd = bad.findall('*') srtd.sort(lambda x, y:cmp(tostring(x), tostring(y))) strongbad = Element("Bad") map(lambda x:strongbad.append(x), srtd) baddata += "Time Ran:%s\n%s\n"%(stats.attrib['time'], tostring(strongbad)) dirty += "%s\n"%machine.attrib['name'] strongbad = '' if deliverytype == 'nodes-individual': if baddata != '': reportSections.append(("%s: Bcfg Nightly Errors"%machine.attrib['name'], "%s%s"%(modified, baddata))) else: if reportgood == 'Y': reportSections.append(("%s: Bcfg Nightly Good"%machine.attrib['name'], "%s%s"%(modified, baddata))) baddata = '' modified = '' else: if not (modified == '' and baddata == ''): msg += "%s %s %s\n"%(mheader, modified, baddata) baddata = '' modified = '' if deliverytype == 'nodes-digest': if msg != '': reportSections.append(("Bcfg Nightly Errors", "DIRTY:\n%s\nCLEAN:\n%s\nDETAILS:\n%s"%(dirty, clean, msg))) else: if delivery.attrib['good'] == 'Y': reportSections.append(("Bcfg Nightly All Machines Good", "All Machines Nomnial")) if deliverytype == 'overview-stats': children = statdata.findall("Node") regex = string.join(map(lambda x:x.get("name"), report.findall('Machine')), '|') p = re.compile(regex) childstates = [] for child in children: if p.match(child.get("name")): child.states = [] for state in child.findall("Statistics"): child.states.append((child.get("name"), state.get("state"), state.get("time"))) if child.states != []: childstates.append(child.states[len(child.states)-1]) childstates.sort(lambda x, y:cmp(x[0], y[0])) staleones = [] cleanones = [] dirtyones = [] unpingableones = [] for instance in childstates: if instance[1] == "dirty": dirtyones.append(instance) elif instance[1] == "clean": cleanones.append(instance) if strptime(instance[2])[0] != strptime(ctime())[0] \ or strptime(instance[2])[1] != strptime(ctime())[1] \ or strptime(instance[2])[2] != strptime(ctime())[2]: staleones.append(instance) if staleones != []: print "Pinging hosts that didn't run today. Please wait" for instance in staleones: if os.system( 'ping -c 1 '+instance[0]+'.mcs.anl.gov &>/dev/null'): staleones.remove(instance) unpingableones.append(instance) statmsg = '' statmsg += "SUMMARY INFORMATION:\n" statmsg += "Up & Not Running Nightly: %d\n"%len(staleones) statmsg += "Unpingable: %d\n"%len(unpingableones) statmsg += "Dirty: %d\n"%len(dirtyones) statmsg += "Clean: %d\n"%len(cleanones) statmsg += "---------------------------------\n" total = len(cleanones)+len(dirtyones) statmsg += "Total: %d\n\n\n"%len(childstates) statmsg += "\n UP AND NOT RUNNING NIGHTLY:\n" for one in staleones: statmsg += one[0] + ".mcs.anl.gov\n" statmsg += "\nDIRTY:\n" for one in dirtyones: statmsg += one[0] + ".mcs.anl.gov\n" statmsg += "\nCLEAN:\n" for one in cleanones: statmsg += one[0] + ".mcs.anl.gov\n" statmsg += "\nUNPINGABLE:\n" for one in unpingableones: statmsg += one[0] + ".mcs.anl.gov\n" reportSections.append(("Bcfg Nightly Errors", "%s"%(statmsg))) return reportSections
33afd46c72c1863df5efda8a0855001399c8c49c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/33afd46c72c1863df5efda8a0855001399c8c49c/StatReports.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 4820, 12, 6006, 16, 7912, 16, 7912, 723, 16, 610, 892, 4672, 2605, 15965, 273, 5378, 225, 7912, 723, 273, 7912, 18, 588, 2932, 723, 3113, 805, 273, 315, 4690, 17, 22032, 5557, 79...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 4820, 12, 6006, 16, 7912, 16, 7912, 723, 16, 610, 892, 4672, 2605, 15965, 273, 5378, 225, 7912, 723, 273, 7912, 18, 588, 2932, 723, 3113, 805, 273, 315, 4690, 17, 22032, 5557, 79...
(r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '
(cs_ident, Name.Class, '
def _escape(st): return st.replace(u'\\', ur'\\').replace(u'-', ur'\-').\ replace(u'[', ur'\[').replace(u']', ur'\]')
2d51ba32a8d1a3aa53b0d1357926a4121af20db4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6148/2d51ba32a8d1a3aa53b0d1357926a4121af20db4/dotnet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6939, 12, 334, 4672, 327, 384, 18, 2079, 12, 89, 11, 1695, 2187, 8896, 11, 10471, 2934, 2079, 12, 89, 11, 17, 2187, 8896, 8314, 6627, 2934, 64, 1453, 12, 89, 11, 63, 2187, 8896,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6939, 12, 334, 4672, 327, 384, 18, 2079, 12, 89, 11, 1695, 2187, 8896, 11, 10471, 2934, 2079, 12, 89, 11, 17, 2187, 8896, 8314, 6627, 2934, 64, 1453, 12, 89, 11, 63, 2187, 8896,...
ResOperation('merge_point', [A.sum, A.fr, A.v], None),
def test_A_optimize_loop(): spec = PerfectSpecializer(Loop(A.ops)) spec.find_nodes() spec.intersect_input_and_output() spec.optimize_loop() equaloplists(spec.loop.operations, [ ResOperation('merge_point', [A.sum, A.fr, A.v], None), ResOperation('int_sub', [A.v, ConstInt(1)], A.v2), ResOperation('int_add', [A.sum, A.v], A.sum2), ResOperation('jump', [A.sum2, A.fr, A.v2], None), ])
42b0e930c018a70ed65878b3831250f8a7f68673 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/42b0e930c018a70ed65878b3831250f8a7f68673/test_vable_optimize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 37, 67, 29155, 67, 6498, 13332, 857, 273, 5722, 74, 386, 1990, 3926, 12, 6452, 12, 37, 18, 4473, 3719, 857, 18, 4720, 67, 4690, 1435, 857, 18, 12288, 67, 2630, 67, 464, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 37, 67, 29155, 67, 6498, 13332, 857, 273, 5722, 74, 386, 1990, 3926, 12, 6452, 12, 37, 18, 4473, 3719, 857, 18, 4720, 67, 4690, 1435, 857, 18, 12288, 67, 2630, 67, 464, 67,...
}
},
def get_hidden_imports(self): d = build_exe.py2exe.get_hidden_imports(self) d.setdefault('gtk._gtk', []).extend([ 'cairo', 'pango', 'pangocairo', 'atk']) return d
93fe221e59fb77242e8abee4ae0a5c5648391236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/93fe221e59fb77242e8abee4ae0a5c5648391236/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6345, 67, 21350, 12, 2890, 4672, 302, 273, 1361, 67, 14880, 18, 2074, 22, 14880, 18, 588, 67, 6345, 67, 21350, 12, 2890, 13, 302, 18, 542, 1886, 2668, 4521, 79, 6315, 4521, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6345, 67, 21350, 12, 2890, 4672, 302, 273, 1361, 67, 14880, 18, 2074, 22, 14880, 18, 588, 67, 6345, 67, 21350, 12, 2890, 13, 302, 18, 542, 1886, 2668, 4521, 79, 6315, 4521, ...
def getStatus(self): """ Returns the status code and message of this response. @returns: str
setStatus = set_status def get_status(self): """Returns the status code and message of this response.
def setStatus(self, status): """ Sets the status code for this response.
2d889182f07a1e20247eba2168cf4d18f81fcdab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11836/2d889182f07a1e20247eba2168cf4d18f81fcdab/pyblosxom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9433, 12, 2890, 16, 1267, 4672, 3536, 11511, 326, 1267, 981, 364, 333, 766, 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, 9433, 12, 2890, 16, 1267, 4672, 3536, 11511, 326, 1267, 981, 364, 333, 766, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
if len(node.attrib): ret = ['<%s %s>' % (node.tag, ' '.join(('%s="%s"' % (k, escape(v)) for (k, v) in node.attrib.items())))]
i = 1 while i < len(node): n = node[i] if node.tag in REMOVE_IF_EMPTY and len(n) == 0 and n.text == None: node[i:i+1] = [] else: i += 1 if node.text: node.text += node[0].tail or ''
def sanitise_node(self, node): if node.tag in DROP_TAGS: ret = [node.text or ''] for n in node: ret.append(self.sanitise_node(n)) ret.append(n.tail or '') return ''.join(ret)
b94077a13e88561afbe8f8e8c083d7e8bcd9ee8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14173/b94077a13e88561afbe8f8e8c083d7e8bcd9ee8c/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6764, 784, 67, 2159, 12, 2890, 16, 756, 4672, 309, 756, 18, 2692, 316, 25736, 67, 29915, 30, 325, 273, 306, 2159, 18, 955, 578, 875, 65, 364, 290, 316, 756, 30, 325, 18, 6923, 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, 6764, 784, 67, 2159, 12, 2890, 16, 756, 4672, 309, 756, 18, 2692, 316, 25736, 67, 29915, 30, 325, 273, 306, 2159, 18, 955, 578, 875, 65, 364, 290, 316, 756, 30, 325, 18, 6923, 12, ...
%(logo_html)s
def header(self, d): """ Assemble page header @param d: parameter dictionary @rtype: string @return: page header html """ dict = { 'config_header1_html': self.emit_custom_html(self.cfg.page_header1), 'config_header2_html': self.emit_custom_html(self.cfg.page_header2), 'search_form_html': self.searchform(d), 'logo_html': self.logo(), 'title_html': self.title(d), 'username_html': self.username(d), 'navibar_html': self.navibar(d), 'iconbar_html': self.iconbar(d), 'msg_html': self.msg(d), 'trail_html': self.trail(d), 'startpage_html': self.startPage(), } dict.update(d)
b5baadf5be76f746ddb76c2eb34e1c1c6ae6d340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/b5baadf5be76f746ddb76c2eb34e1c1c6ae6d340/classic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1446, 12, 2890, 16, 302, 4672, 3536, 2970, 10045, 1363, 1446, 225, 632, 891, 302, 30, 1569, 3880, 632, 86, 723, 30, 533, 632, 2463, 30, 1363, 1446, 1729, 3536, 2065, 273, 288, 296, 142...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1446, 12, 2890, 16, 302, 4672, 3536, 2970, 10045, 1363, 1446, 225, 632, 891, 302, 30, 1569, 3880, 632, 86, 723, 30, 533, 632, 2463, 30, 1363, 1446, 1729, 3536, 2065, 273, 288, 296, 142...
output_cache.append(((text,), {'colors': colors, 'newline': newline, 'toStdout': toStdout}))
cache_output(text, colors = colors, newline = newline, toStdout = toStdout)
def output(text, decoder = None, colors = [], newline = True, toStdout = False): """ Works like print, but uses the encoding used by the user's console (console_encoding in the configuration file) instead of ASCII. If decoder is None, text should be a unicode string. Otherwise it should be encoded in the given encoding. colors is a list of integers, one for each character of text. If a list entry is None, the default color will be used for the character at that position. If newline is True, a linebreak will be added after printing the text. If toStdout is True, the text will be sent to standard output, so that it can be piped to another process. All other text will be sent to stderr. See: http://en.wikipedia.org/wiki/Pipeline_%28Unix%29 """ output_lock.acquire() try: if decoder: text = unicode(text, decoder) elif type(text) != type(u''): if verbose: print "DBG> BUG: Non-unicode passed to wikipedia.output without decoder!" print traceback.print_stack() print "DBG> Attempting to recover, but please report this problem" try: text = unicode(text, 'utf-8') except UnicodeDecodeError: text = unicode(text, 'iso8859-1') if logfile: # save the text in a logfile (will be written in utf-8) logfile.write(text + '\n') logfile.flush() if input_lock.locked(): output_cache.append(((text,), {'colors': colors, 'newline': newline, 'toStdout': toStdout})) else: ui.output(text, colors = colors, newline = newline, toStdout = toStdout) finally: output_lock.release()
e730524cd5be39ec1fd511a2e2746b78a799de65 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/e730524cd5be39ec1fd511a2e2746b78a799de65/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 12, 955, 16, 8320, 273, 599, 16, 5740, 273, 5378, 16, 9472, 273, 1053, 16, 358, 27334, 273, 1083, 4672, 3536, 4147, 87, 3007, 1172, 16, 1496, 4692, 326, 2688, 1399, 635, 326, 729,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 12, 955, 16, 8320, 273, 599, 16, 5740, 273, 5378, 16, 9472, 273, 1053, 16, 358, 27334, 273, 1083, 4672, 3536, 4147, 87, 3007, 1172, 16, 1496, 4692, 326, 2688, 1399, 635, 326, 729,...
'lmo': [u'File', u'Immagine'],
'lmo': [u'Archivi', u'Immagine'],
def __init__(self): self.name = None # Updated from http://meta.wikimedia.org/wiki/Interwiki_sorting_order self.alphabetic = [ 'af', 'ak', 'ace', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc', 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'bm', 'bn', 'zh-min-nan', 'nan', 'map-bms', 'ba', 'be', 'be-x-old', 'bh', 'bcl', 'bi', 'bar', 'bo', 'bs', 'br', 'bg', 'bxr', 'ca', 'cv', 'ceb', 'cs', 'ch', 'cbk-zam', 'ny', 'sn', 'tum', 'cho', 'co', 'cy', 'da', 'dk', 'pdc', 'de', 'dv', 'nv', 'dsb', 'dz', 'mh', 'et', 'el', 'eml', 'en', 'myv', 'es', 'eo', 'ext', 'eu', 'ee', 'fa', 'hif', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', 'gv', 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'hak', 'xal', 'ko', 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', 'ilo', 'bpy', 'id', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is', 'it', 'he', 'jv', 'kl', 'kn', 'kr', 'pam', 'ka', 'ks', 'csb', 'kk', 'kw', 'rw', 'ky', 'rn', 'sw', 'kv', 'kg', 'ht', 'ku', 'kj', 'lad', 'lbe', 'lo', 'la', 'lv', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg', 'lmo', 'hu', 'mk', 'mg', 'ml', 'mt', 'mi', 'mr', 'arz', 'mzn', 'ms', 'cdo', 'mwl', 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'na', 'fj', 'nl', 'nds-nl', 'cr', 'ne', 'new', 'ja', 'nap', 'ce', 'pih', 'no', 'nb', 'nn', 'nrm', 'nov', 'ii', 'oc', 'mhr', 'or', 'om', 'ng', 'hz', 'uz', 'pa', 'pnb', 'pi', 'pag', 'pap', 'ps', 'km', 'pms', 'tpi', 'nds', 'pl', 'tokipona', 'tp', 'pnt', 'pt', 'aa', 'kaa', 'crh', 'ty', 'ksh', 'ro', 'rmy', 'rm', 'qu', 'ru', 'sah', 'se', 'sm', 'sa', 'sg', 'sc', 'za', 'sco', 'stq', 'st', 'tn', 'sq', 'scn', 'si', 'simple', 'sd', 'ss', 'sk', 'cu', 'sl', 'szl', 'so', 'ckb', 'srn', 'sr', 'sh', 'su', 'fi', 'sv', 'tl', 'ta', 'kab', 'roa-tara', 'tt', 'te', 'tet', 'th', 'ti', 'tg', 'to', 'chr', 'chy', 've', 'tr', 'tk', 'tw', 'udm', 'bug', 'uk', 'ur', 'ug', 'vec', 'vi', 'vo', 'fiu-vro', 'wa', 'zh-classical', 'vls', 'war', 'wo', 'wuu', 'ts', 'yi', 'yo', 'zh-yue', 'diq', 'zea', 'bat-smg', 'zh', 'zh-tw', 'zh-cn' ]
d0be13c8dd960f188cebfecb3decec6b1c69634e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/d0be13c8dd960f188cebfecb3decec6b1c69634e/family.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 529, 273, 599, 468, 19301, 628, 1062, 2207, 3901, 18, 11999, 381, 1980, 18, 3341, 19, 13044, 19, 2465, 13044, 67, 28751, 67, 1019, 365, 18, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4672, 365, 18, 529, 273, 599, 468, 19301, 628, 1062, 2207, 3901, 18, 11999, 381, 1980, 18, 3341, 19, 13044, 19, 2465, 13044, 67, 28751, 67, 1019, 365, 18, 28...
InsertText(text, GetTextLength(self.textbox), self.textbox)
InsertText(unicode(text, self.encoding), GetTextLength(self.textbox), self.textbox)
def append(self, text): InsertText(text, GetTextLength(self.textbox), self.textbox)
543a9d2ebc13d58a3939bcc8594bef70d4a59b0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3910/543a9d2ebc13d58a3939bcc8594bef70d4a59b0a/htmlimport.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 12, 2890, 16, 977, 4672, 8040, 1528, 12, 955, 16, 968, 1528, 1782, 12, 2890, 18, 955, 2147, 3631, 365, 18, 955, 2147, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 12, 2890, 16, 977, 4672, 8040, 1528, 12, 955, 16, 968, 1528, 1782, 12, 2890, 18, 955, 2147, 3631, 365, 18, 955, 2147, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.assertRaises(UnicodeError, eval, '\'\\Ufffffffe\'') self.assertRaises(UnicodeError, eval, '\'\\Uffffffff\'') self.assertRaises(UnicodeError, eval, '\'\\U%08x\'' % 0x110000)
self.assertRaises((UnicodeError, SyntaxError), eval, '\'\\Ufffffffe\'') self.assertRaises((UnicodeError, SyntaxError), eval, '\'\\Uffffffff\'') self.assertRaises((UnicodeError, SyntaxError), eval, '\'\\U%08x\'' % 0x110000)
def test_literals(self): self.assertEqual('\xff', '\u00ff') self.assertEqual('\uffff', '\U0000ffff') self.assertRaises(UnicodeError, eval, '\'\\Ufffffffe\'') self.assertRaises(UnicodeError, eval, '\'\\Uffffffff\'') self.assertRaises(UnicodeError, eval, '\'\\U%08x\'' % 0x110000)
697a84b16c9561a2035c0f74dfc0af0b5b868149 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/697a84b16c9561a2035c0f74dfc0af0b5b868149/test_unicode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 80, 11235, 12, 2890, 4672, 365, 18, 11231, 5812, 2668, 64, 5297, 2187, 2337, 89, 713, 1403, 6134, 365, 18, 11231, 5812, 2668, 64, 696, 25449, 2187, 2337, 57, 2787, 9460, 6134, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 80, 11235, 12, 2890, 4672, 365, 18, 11231, 5812, 2668, 64, 5297, 2187, 2337, 89, 713, 1403, 6134, 365, 18, 11231, 5812, 2668, 64, 696, 25449, 2187, 2337, 57, 2787, 9460, 6134, ...
sql += " WHERE (" + makeWhereClause('p.product', PRODUCTS) sql += ") AND b.product = p.product"
sql += " WHERE" + makeWhereClause('p.product', PRODUCTS) sql += " AND b.product = p.product"
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % \ (_db, _host, _user, ("*" * len(_password))) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "\nCleaning all tickets..." c = trac.db().cursor() c.execute("DELETE FROM ticket_change") trac.db().commit() c.execute("DELETE FROM ticket") trac.db().commit() c.execute("DELETE FROM ticket_custom") trac.db().commit() c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") # Straight from the Python documentation. for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_dir): os.mkdir(attachments_dir) trac.db().commit() print "All tickets cleaned..." print "\n0. Filtering products..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT name FROM products") else: mysql_cur.execute("SELECT product AS name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = products print " Using products", " ".join(PRODUCTS) print "\n1. Import severities..." trac.setSeverityList(SEVERITIES) print "\n2. Import components..." if not COMPONENTS_FROM_PRODUCTS: if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'name') else: if BZ_VERSION >= 2180: sql = ("SELECT p.name AS product, c.name AS comp, " " c.initialowner AS owner " "FROM components c, products p " "WHERE c.product_id = p.id and " + makeWhereClause('p.name', PRODUCTS)) else: sql = ("SELECT program AS product, value AS comp, " " initialowner AS owner " "FROM components WHERE" + makeWhereClause('program', PRODUCTS)) mysql_cur.execute(sql) lines = mysql_cur.fetchall() all_components = {} # product -> components all_owners = {} # product, component -> owner for line in lines: product = line['product'] comp = line['comp'] owner = line['owner'] all_components.setdefault(product, []).append(comp) all_owners[(product, comp)] = owner component_list = [] for product, components in all_components.items(): # find best default owner default = None for comp in DEFAULT_COMPONENTS: if comp in components: default = comp break if default is None: default = components[0] owner = all_owners[(product, default)] owner_name = trac.getLoginName(mysql_cur, owner) component_list.append({'product': product, 'owner': owner_name}) trac.setComponentList(component_list, 'product') print "\n3. Import priorities..." trac.setPriorityList(PRIORITIES) print "\n4. Import versions..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCTROW versions.value AS value FROM products, versions""" sql += " WHERE" + makeWhereClause('products.name', PRODUCTS) else: sql = "SELECT DISTINCTROW value FROM versions" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) milestones = mysql_cur.fetchall() trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.id" sql += " ORDER BY b.bug_id" else: sql = """SELECT DISTINCT b.*, c.value AS component, p.product AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.product', PRODUCTS) sql += ") AND b.product = p.product" sql += " AND b.component = c.value" sql += " ORDER BY b.bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print "\n7. Import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] if SEVERITIES: ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'].lower() else: # use bugzilla severities as trac priorities, and ignore bugzilla # priorities ticket['severity'] = '' ticket['priority'] = bug['bug_severity'] ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) # pack bugzilla fields into dictionary of trac custom field # names and values customfields = {} for bugfield, customfield in CUSTOMFIELD_MAP.iteritems(): customfields[customfield] = bug[bugfield] ticket['customfields'] = customfields mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) cc_list = [cc for cc in cc_list if cc not in IGNORE_CC] ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time = desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] keywords = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == "resolution" or field_name == "bug_status": removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == "resolution": resolution = added.lower() add_keywords = [] remove_keywords = [] # convert bugzilla field names... if field_name == "bug_severity": if SEVERITIES: field_name = "severity" else: field_name = "priority" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" if removed in STATUS_KEYWORDS: remove_keywords.append(STATUS_KEYWORDS[removed]) if added in STATUS_KEYWORDS: add_keywords.append(STATUS_KEYWORDS[added]) added = statusXlator[added] removed = statusXlator[removed] elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(removed, removed) if kw: remove_keywords.append(kw) if MAP_ALL_KEYWORDS or added in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(added, added) if kw: add_keywords.append(kw) if field_name == "component": # just keep the keyword change added = removed = "" elif field_name == "target_milestone": field_name = "milestone" if added in IGNORE_MILESTONES: added = "" if removed in IGNORE_MILESTONES: removed = "" ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if add_keywords or remove_keywords: # ensure removed ones are in old old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] # remove from new keywords = [kw for kw in keywords if kw not in remove_keywords] # add to new keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChangeKw['field'] = "keywords" ticketChangeKw['oldvalue'] = ' '.join(old_keywords) ticketChangeKw['newvalue'] = ' '.join(keywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # Skip changes that have no effect (think translation!). if added == removed: continue # Bugzilla splits large summary changes into two records. for oldChange in ticketChanges: if (field_name == "summary" and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break # cc sometime appear in different activities with same time if (field_name == "cc" \ and oldChange['time'] == ticketChange['time']): oldChange['newvalue'] += ", " + ticketChange['newvalue'] break else: ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # For some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. Let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == "closed": ticket['resolution'] = resolution bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] if kw not in keywords: keywords.append(kw) product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: keywords.append(kw) component = bug['component'] if (COMPONENTS_FROM_PRODUCTS and \ (MAP_ALL_KEYWORDS or component in KEYWORDS_MAPPING)): kw = KEYWORDS_MAPPING.get(component, component) if kw and kw not in keywords: keywords.append(kw) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) if BZ_VERSION >= 2210: mysql_cur.execute("SELECT attachments.*, attach_data.thedata " "FROM attachments, attach_data " "WHERE attachments.bug_id = %s AND " "attachments.attach_id = attach_data.id" % bugid) else: mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) trac.addAttachment(author, a) print "\n8. Importing users and passwords..." if BZ_VERSION >= 2167: selectlogins = "SELECT login_name, cryptpassword FROM profiles"; if IGNORE_DISABLED_USERS: selectlogins = selectlogins + " WHERE disabledtext=''" mysql_cur.execute(selectlogins) users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['login_name'] htpasswd.write(login + ":" + user['cryptpassword'] + "\n") htpasswd.close() print " Bugzilla users converted to htpasswd format, see 'htpasswd'." print "\nAll tickets converted."
25808c2392bb997c559e4337e46435149d877949 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2831/25808c2392bb997c559e4337e46435149d877949/bugzilla2trac.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
digest = md5.new(self.timestamp.group(1)+secret).digest()
digest = md5.new(m.group(1)+secret).digest()
def apop(self, user, secret): """Authorisation
9675d2b1083cc98732c9632f8e8306bfc087a410 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9675d2b1083cc98732c9632f8e8306bfc087a410/poplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 513, 556, 12, 2890, 16, 729, 16, 4001, 4672, 3536, 3594, 10742, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 513, 556, 12, 2890, 16, 729, 16, 4001, 4672, 3536, 3594, 10742, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if params.get('go') != 'refresh':
if params.get('go') != 'Refresh':
def onReview(self, **params): """Present a list of message for (re)training.""" # Train/discard sumbitted messages. self._writePreamble("Review") id = '' numTrained = 0 numDeferred = 0 if params.get('go') != 'refresh': for key, value in params.items(): if key.startswith('classify:'): id = key.split(':')[2] if value == 'spam': targetCorpus = state.spamCorpus elif value == 'ham': targetCorpus = state.hamCorpus elif value == 'discard': targetCorpus = None try: state.unknownCorpus.removeMessage(\ state.unknownCorpus[id]) except KeyError: pass # Must be a reload. else: # defer targetCorpus = None numDeferred += 1 if targetCorpus: sourceCorpus = None if state.unknownCorpus.get(id) is not None: sourceCorpus = state.unknownCorpus elif state.hamCorpus.get(id) is not None: sourceCorpus = state.hamCorpus elif state.spamCorpus.get(id) is not None: sourceCorpus = state.spamCorpus if sourceCorpus is not None: try: targetCorpus.takeMessage(id, sourceCorpus) if numTrained == 0: self.write("<p><b>Training... ") self.flush() numTrained += 1 except KeyError: pass # Must be a reload.
1ac007a7ac318ca620d185174d7afee7782201ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/1ac007a7ac318ca620d185174d7afee7782201ce/ProxyUI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 9159, 12, 2890, 16, 2826, 2010, 4672, 3536, 6351, 279, 666, 434, 883, 364, 261, 266, 13, 17584, 12123, 468, 2197, 267, 19, 31992, 2142, 3682, 2344, 2743, 18, 365, 6315, 2626, 52, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 9159, 12, 2890, 16, 2826, 2010, 4672, 3536, 6351, 279, 666, 434, 883, 364, 261, 266, 13, 17584, 12123, 468, 2197, 267, 19, 31992, 2142, 3682, 2344, 2743, 18, 365, 6315, 2626, 52, ...
print >> sys.stderr, ("Attempted to set [%s] %s with invalid" " value %s (%s)" %
print >> sys.stderr, ("Attempted to set [%s] %s with " "invalid value %s (%s)" %
def set(self, sect, opt, val=None): '''Set an option.''' if self.conversion_table.has_key((sect, opt.lower())): sect, opt = self.conversion_table[sect, opt.lower()] if self.is_valid(sect, opt, val): self._options[sect, opt.lower()].set(val) else: print >> sys.stderr, ("Attempted to set [%s] %s with invalid" " value %s (%s)" % (sect, opt.lower(), val, type(val)))
120ad164336c887a4488515e8f69ec9abe8572ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/120ad164336c887a4488515e8f69ec9abe8572ef/OptionsClass.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12, 2890, 16, 29140, 16, 2153, 16, 1244, 33, 7036, 4672, 9163, 694, 392, 1456, 1093, 6309, 309, 365, 18, 20990, 67, 2121, 18, 5332, 67, 856, 12443, 5709, 16, 2153, 18, 8167, 1435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12, 2890, 16, 29140, 16, 2153, 16, 1244, 33, 7036, 4672, 9163, 694, 392, 1456, 1093, 6309, 309, 365, 18, 20990, 67, 2121, 18, 5332, 67, 856, 12443, 5709, 16, 2153, 18, 8167, 1435,...
self.dirstate.update(mmap.keys(), "n")
self.dirstate.update(files, "n")
def rawcommit(self, files, text, user, date, p1=None, p2=None): p1 = p1 or self.dirstate.parents()[0] or nullid p2 = p2 or self.dirstate.parents()[1] or nullid pchange = self.changelog.read(p1) pmmap = self.manifest.read(pchange[0]) tr = self.transaction() mmap = {} linkrev = self.changelog.count() for f in files: try: t = file(f).read() except IOError: self.ui.warn("Read file %s error, skipped\n" % f) continue r = self.file(f) # FIXME - need to find both parents properly prev = pmmap.get(f, nullid) mmap[f] = r.add(t, tr, linkrev, prev)
d28dfb673f54a4ab197cab7a012ae86c69a139b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/d28dfb673f54a4ab197cab7a012ae86c69a139b4/hg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1831, 7371, 12, 2890, 16, 1390, 16, 977, 16, 729, 16, 1509, 16, 293, 21, 33, 7036, 16, 293, 22, 33, 7036, 4672, 293, 21, 273, 293, 21, 578, 365, 18, 72, 920, 340, 18, 12606, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1831, 7371, 12, 2890, 16, 1390, 16, 977, 16, 729, 16, 1509, 16, 293, 21, 33, 7036, 16, 293, 22, 33, 7036, 4672, 293, 21, 273, 293, 21, 578, 365, 18, 72, 920, 340, 18, 12606, 1435, ...
" Convert IEEEtran layouts and styles to TeX codeT "
" Convert IEEEtran layouts and styles to TeX code "
def revert_IEEEtran(document): " Convert IEEEtran layouts and styles to TeX codeT " revert_flex_inset(document, "IEEE membership", "\\IEEEmembership", 0) revert_flex_inset(document, "Lowercase", "\\MakeLowercase", 0)
8cc770423d99b323ced4a602a0127fd169f3e16b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/8cc770423d99b323ced4a602a0127fd169f3e16b/lyx_2_0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 8732, 9383, 13171, 12, 5457, 4672, 315, 4037, 467, 9383, 41, 13171, 22412, 471, 5687, 358, 28602, 60, 981, 315, 15226, 67, 27592, 67, 267, 542, 12, 5457, 16, 315, 8732, 9383, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 8732, 9383, 13171, 12, 5457, 4672, 315, 4037, 467, 9383, 41, 13171, 22412, 471, 5687, 358, 28602, 60, 981, 315, 15226, 67, 27592, 67, 267, 542, 12, 5457, 16, 315, 8732, 9383, ...
Args: file_storage_dir: string with path Returns: normalized file_storage_dir (string) if valid, None otherwise
@type file_storage_dir: str @param file_storage_dir: the path to check @return: the normalized path if valid, None otherwise
def _TransformFileStorageDir(file_storage_dir): """Checks whether given file_storage_dir is valid. Checks wheter the given file_storage_dir is within the cluster-wide default file_storage_dir stored in SimpleStore. Only paths under that directory are allowed. Args: file_storage_dir: string with path Returns: normalized file_storage_dir (string) if valid, None otherwise """ cfg = _GetConfig() file_storage_dir = os.path.normpath(file_storage_dir) base_file_storage_dir = cfg.GetFileStorageDir() if (not os.path.commonprefix([file_storage_dir, base_file_storage_dir]) == base_file_storage_dir): logging.error("file storage directory '%s' is not under base file" " storage directory '%s'", file_storage_dir, base_file_storage_dir) return None return file_storage_dir
b120698460d00db45b531d83a820129230c339d5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/b120698460d00db45b531d83a820129230c339d5/backend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4059, 812, 3245, 1621, 12, 768, 67, 5697, 67, 1214, 4672, 3536, 4081, 2856, 864, 585, 67, 5697, 67, 1214, 353, 923, 18, 225, 13074, 600, 847, 326, 864, 585, 67, 5697, 67, 1214, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4059, 812, 3245, 1621, 12, 768, 67, 5697, 67, 1214, 4672, 3536, 4081, 2856, 864, 585, 67, 5697, 67, 1214, 353, 923, 18, 225, 13074, 600, 847, 326, 864, 585, 67, 5697, 67, 1214, ...
Return a pair ([source_lines], starting line number) of the source code associated to obj, or None.
Return a pair ([source_lines], starting line number) of the source code associated to obj, or None.
def sage_getsourcelines(obj, is_binary=False): r""" Return a pair ([source_lines], starting line number) of the source code associated to obj, or None. At this time we ignore is_binary in favour of a 'do our best' strategy. AUTHOR: -- William Stein -- Extensions by Nick Alexander """ # If we can handle it, we do. This is because Python's inspect will # happily dump binary for cython extension source code. d = inspect.getdoc(obj) pos = _extract_embedded_position(d) if pos is None: return inspect.getsourcelines(obj) (orig, filename, lineno) = pos try: source_lines = open(filename).readlines() except IOError: return None return _extract_source(source_lines, lineno), lineno
c43fc27bcca15a11197d5ecabf5853373754dc64 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/c43fc27bcca15a11197d5ecabf5853373754dc64/sageinspect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 410, 67, 14665, 477, 2183, 1465, 12, 2603, 16, 353, 67, 8578, 33, 8381, 4672, 436, 8395, 2000, 279, 3082, 23265, 3168, 67, 3548, 6487, 5023, 980, 1300, 13, 434, 326, 1084, 981, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 410, 67, 14665, 477, 2183, 1465, 12, 2603, 16, 353, 67, 8578, 33, 8381, 4672, 436, 8395, 2000, 279, 3082, 23265, 3168, 67, 3548, 6487, 5023, 980, 1300, 13, 434, 326, 1084, 981, 36...
return self.call_method(env, target, source, **overrides)
return self.method(target, source, **overrides)
def __call__(self, env, target = None, source = _null, **overrides): es = env['EXTRA_SOURCES'] if source == _null and len(es) == 0: return self.call_method(env, target, source, **overrides) else: if type(source) != type([]): source = [source] return self.call_method(env, target, source + es, **overrides)
b9ab93193da8fb8642770b62b603e9a01587d228 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1466/b9ab93193da8fb8642770b62b603e9a01587d228/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 1550, 16, 1018, 273, 599, 16, 1084, 273, 389, 2011, 16, 2826, 19775, 4672, 5001, 273, 1550, 3292, 22639, 67, 6537, 55, 3546, 309, 1084, 422, 389, 2011, 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, 1001, 1991, 972, 12, 2890, 16, 1550, 16, 1018, 273, 599, 16, 1084, 273, 389, 2011, 16, 2826, 19775, 4672, 5001, 273, 1550, 3292, 22639, 67, 6537, 55, 3546, 309, 1084, 422, 389, 2011, 4...
return (application.pattern is not None)
return bool(application.pattern)
def is_doable(cls, application, page): """Return True if action can be done."""
d4c44e8471530876f0bac6739c168fd21d9bf811 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12852/d4c44e8471530876f0bac6739c168fd21d9bf811/text.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 2896, 429, 12, 6429, 16, 2521, 16, 1363, 4672, 3536, 990, 1053, 309, 1301, 848, 506, 2731, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 2896, 429, 12, 6429, 16, 2521, 16, 1363, 4672, 3536, 990, 1053, 309, 1301, 848, 506, 2731, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
for i in range(0,width/256): for j in range(0,height/256): tile_src = im.crop((i*256,j*256,(i+1)*256,(j+1)*256)) tile_src.save("%s%d_%d_4.png" % (filename_base,i,j),"PNG")
for i in range(0,width/512): for j in range(0,height/512): tile_src = im.crop((i*512,j*512,(i+1)*512,(j+1)*512)) tile_src = tile_src.resize((256,256)) tile_src.MAXBLOCK = 1000000 tile_src.save("%s%d_%d_4.jpg" % (filename_base,i,j),quality=70,optimize=True)
def multiple_1024(n): return n + (1024 - (n%1024))
0a6f8bda0f84cc1acbe860a7006d78834b4b6a9e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9355/0a6f8bda0f84cc1acbe860a7006d78834b4b6a9e/map_tiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3229, 67, 2163, 3247, 12, 82, 4672, 327, 290, 397, 261, 2163, 3247, 300, 261, 82, 9, 2163, 3247, 3719, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3229, 67, 2163, 3247, 12, 82, 4672, 327, 290, 397, 261, 2163, 3247, 300, 261, 82, 9, 2163, 3247, 3719, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
lineSizer = wx.BoxSizer(wx.HORIZONTAL) lineSizer.Add(wx.StaticText(frame, -1, _("Files of type:")), 0, wx.ALIGN_CENTER | wx.RIGHT, HALF_SPACE) lineSizer.Add(filterChoice, 1, wx.LEFT, HALF_SPACE) contentSizer.Add(lineSizer, 0, wx.BOTTOM|wx.EXPAND, SPACE)
flexGridSizer.Add(wx.StaticText(frame, -1, _("Files of type:")), 0, wx.ALIGN_CENTER_VERTICAL) flexGridSizer.Add(filterChoice, 1, wx.EXPAND) contentSizer.Add(flexGridSizer, 0, wx.ALL|wx.EXPAND, SPACE)
def OnBrowseButton(event): dlg = wx.DirDialog(frame, _("Choose a directory:"), style=wx.DD_DEFAULT_STYLE) dir = dirCtrl.GetValue() if len(dir): dlg.SetPath(dir) if dlg.ShowModal() == wx.ID_OK: dirCtrl.SetValue(dlg.GetPath()) dirCtrl.SetToolTipString(dirCtrl.GetValue()) dirCtrl.SetInsertionPointEnd()
bbb2889740248dad3f6405367f6382e7cb6cb839 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/bbb2889740248dad3f6405367f6382e7cb6cb839/ProjectEditor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 27304, 3616, 12, 2575, 4672, 25840, 273, 7075, 18, 1621, 6353, 12, 3789, 16, 389, 2932, 24529, 279, 1867, 2773, 3631, 2154, 33, 27226, 18, 5698, 67, 5280, 67, 15066, 13, 1577, 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, 2755, 27304, 3616, 12, 2575, 4672, 25840, 273, 7075, 18, 1621, 6353, 12, 3789, 16, 389, 2932, 24529, 279, 1867, 2773, 3631, 2154, 33, 27226, 18, 5698, 67, 5280, 67, 15066, 13, 1577, 273,...
self._cleanup()
def unexpected(self,msg): self._cleanup() err = error_line(self.outfile("err")) or error_line(self.outfile("out")) raise BadProcessStatus("%s %s%s" % (self.pname, msg, err))
4ef64fd92b7c35a44e11139b12e0d27f10585227 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/197/4ef64fd92b7c35a44e11139b12e0d27f10585227/brokertest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9733, 12, 2890, 16, 3576, 4672, 393, 273, 555, 67, 1369, 12, 2890, 18, 26050, 2932, 370, 6, 3719, 578, 555, 67, 1369, 12, 2890, 18, 26050, 2932, 659, 6, 3719, 1002, 6107, 2227, 1482, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9733, 12, 2890, 16, 3576, 4672, 393, 273, 555, 67, 1369, 12, 2890, 18, 26050, 2932, 370, 6, 3719, 578, 555, 67, 1369, 12, 2890, 18, 26050, 2932, 659, 6, 3719, 1002, 6107, 2227, 1482, ...
def _getStatusInt(self,status,connection=False): connection = self._getConnection(connection)
def _getStatusInt( self, status, connection = False ): connection = self._getConnection( connection )
def _getStatusInt(self,status,connection=False): connection = self._getConnection(connection) req = "SELECT StatusID FROM FC_Statuses WHERE Status = '%s';" % status res = self.db._query(req,connection) if not res['OK']: return res if res['Value']: return S_OK(res['Value'][0][0]) req = "INSERT INTO FC_Statuses (Status) VALUES ('%s');" % status res = self.db._update(req,connection) if not res['OK']: return res return S_OK(res['lastRowId'])
26c5008a7adbc1c761e2409bed59b7710e5f2c74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/26c5008a7adbc1c761e2409bed59b7710e5f2c74/FileManagerBase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 1482, 1702, 12, 365, 16, 1267, 16, 1459, 273, 1083, 262, 30, 1459, 273, 365, 6315, 588, 1952, 12, 1459, 262, 1111, 273, 315, 4803, 2685, 734, 4571, 478, 39, 67, 15220, 4852, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1482, 1702, 12, 365, 16, 1267, 16, 1459, 273, 1083, 262, 30, 1459, 273, 365, 6315, 588, 1952, 12, 1459, 262, 1111, 273, 315, 4803, 2685, 734, 4571, 478, 39, 67, 15220, 4852, ...
saytext2('
saytext2('
def respawnPlayer(userid, respawnRound): # Make sure the round is active if not roundActive: return # Check if respawn was issued in the current round if currentRound != respawnRound: return # Make sure the player is respawnable if not plPlayer(userid).isdead or not plPlayer(userid).isobserver: return index = plPlayer(userid).index # Tell everyone that they are respawning saytext2('#all', index, 'RespawningPlayer', {'player': es.getplayername(userid)}) # Respawn player ggPlayer(userid).respawn()
b0a868442e655bdfcd38d50f439fb5af44230673 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4555/b0a868442e655bdfcd38d50f439fb5af44230673/gg_elimination.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1718, 9533, 12148, 12, 8339, 16, 1718, 9533, 11066, 4672, 468, 4344, 3071, 326, 3643, 353, 2695, 309, 486, 3643, 3896, 30, 327, 225, 468, 2073, 309, 1718, 9533, 1703, 16865, 316, 326, 78...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1718, 9533, 12148, 12, 8339, 16, 1718, 9533, 11066, 4672, 468, 4344, 3071, 326, 3643, 353, 2695, 309, 486, 3643, 3896, 30, 327, 225, 468, 2073, 309, 1718, 9533, 1703, 16865, 316, 326, 78...
sellf.url += '&ip=' + quote(ip)
self.url += '&ip=' + quote(ip)
def __init__(self, url, interval, sched, howmany, minpeers, connect, externalsched, amount_left, up, down, port, ip, myid, infohash, timeout, errorfunc): self.url = ('%s?info_hash=%s&peer_id=%s&port=%s' % (url, quote(infohash), quote(myid), str(port))) if ip != '': sellf.url += '&ip=' + quote(ip) self.interval = interval self.announce_interval = 30 * 60 self.sched = sched self.howmany = howmany self.minpeers = minpeers self.connect = connect self.externalsched = externalsched self.amount_left = amount_left self.up = up self.down = down self.timeout = timeout self.errorfunc = errorfunc self.sched(self.c, interval)
9d2feec11bd40ee87f4a5df3f9188c150bca8505 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/9d2feec11bd40ee87f4a5df3f9188c150bca8505/Rerequester.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 880, 16, 3673, 16, 23964, 16, 3661, 9353, 16, 1131, 30502, 16, 3077, 16, 18885, 1031, 2049, 16, 3844, 67, 4482, 16, 731, 16, 2588, 16, 1756, 16, 2359, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 880, 16, 3673, 16, 23964, 16, 3661, 9353, 16, 1131, 30502, 16, 3077, 16, 18885, 1031, 2049, 16, 3844, 67, 4482, 16, 731, 16, 2588, 16, 1756, 16, 2359, ...