rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
l = [1L, 2L, 3L, 4L, 5L] * (size // 5) | l = [1L, 2L, 3L, 4L, 5L] * size size *= 5 | def test_index(self, size): l = [1L, 2L, 3L, 4L, 5L] * (size // 5) self.assertEquals(l.index(1), 0) self.assertEquals(l.index(5, size - 5), size - 1) self.assertEquals(l.index(5, size - 5, size), size - 1) self.assertRaises(ValueError, l.index, 1, size - 4, size) self.assertRaises(ValueError, l.index, 6L) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
@bigmemtest(minsize=_2G + 20, memuse=8) | @bigmemtest(minsize=_2G // 5 + 4, memuse=8 * 5) | def test_insert(self, size): l = [1.0] * size l.insert(size - 1, "A") size += 1 self.assertEquals(len(l), size) self.assertEquals(l[-3:], [1.0, "A", 1.0]) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
l = [u"a", u"b", u"c", u"d", u"e"] * (size // 5) | l = [u"a", u"b", u"c", u"d", u"e"] * size size *= 5 | def test_pop(self, size): l = [u"a", u"b", u"c", u"d", u"e"] * (size // 5) self.assertEquals(len(l), size) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
@bigmemtest(minsize=_2G + 10, memuse=8) | @bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5) | def test_remove(self, size): l = [10] * size self.assertEquals(len(l), size) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
l = [1, 2, 3, 4, 5] * (size // 5) | l = [1, 2, 3, 4, 5] * size | def test_reverse(self, size): l = [1, 2, 3, 4, 5] * (size // 5) l.reverse() self.assertEquals(len(l), size) self.assertEquals(l[-5:], [5, 4, 3, 2, 1]) self.assertEquals(l[:5], [5, 4, 3, 2, 1]) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
self.assertEquals(len(l), size) | self.assertEquals(len(l), size * 5) | def test_reverse(self, size): l = [1, 2, 3, 4, 5] * (size // 5) l.reverse() self.assertEquals(len(l), size) self.assertEquals(l[-5:], [5, 4, 3, 2, 1]) self.assertEquals(l[:5], [5, 4, 3, 2, 1]) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
@bigmemtest(minsize=_2G + 10, memuse=8) | @bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5) | def test_reverse(self, size): l = [1, 2, 3, 4, 5] * (size // 5) l.reverse() self.assertEquals(len(l), size) self.assertEquals(l[-5:], [5, 4, 3, 2, 1]) self.assertEquals(l[:5], [5, 4, 3, 2, 1]) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
l = [1, 2, 3, 4, 5] * (size // 5) | l = [1, 2, 3, 4, 5] * size | def test_sort(self, size): l = [1, 2, 3, 4, 5] * (size // 5) l.sort() self.assertEquals(len(l), size) self.assertEquals(l.count(1), size // 5) self.assertEquals(l[:10], [1] * 10) self.assertEquals(l[-10:], [5] * 10) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
self.assertEquals(len(l), size) self.assertEquals(l.count(1), size // 5) | self.assertEquals(len(l), size * 5) self.assertEquals(l.count(1), size) | def test_sort(self, size): l = [1, 2, 3, 4, 5] * (size // 5) l.sort() self.assertEquals(len(l), size) self.assertEquals(l.count(1), size // 5) self.assertEquals(l[:10], [1] * 10) self.assertEquals(l[-10:], [5] * 10) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py |
_userprog = re.compile('^([^@]*)@(.*)$') | _userprog = re.compile('^(.*)@(.*)$') | def splituser(host): """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" global _userprog if _userprog is None: import re _userprog = re.compile('^([^@]*)@(.*)$') match = _userprog.match(host) if match: return map(unquote, match.group(1, 2)) return None, host | f2e45dd9dde5fa45afeb2bb42660a5a1a2d199d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f2e45dd9dde5fa45afeb2bb42660a5a1a2d199d5/urllib.py |
return None | return False | def begin(self): self.resetoutput() if use_subprocess: nosub = '' client = self.interp.start_subprocess() if not client: self.close() return None else: nosub = "==== No Subprocess ====" self.write("Python %s on %s\n%s\n%s\nIDLE %s %s\n" % (sys.version, sys.platform, self.COPYRIGHT, self.firewallmessage, idlever.ID... | 7663729ec72f5ffe44b8e7f76bdb56d8663c5e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7663729ec72f5ffe44b8e7f76bdb56d8663c5e6e/PyShell.py |
return client | return True | def begin(self): self.resetoutput() if use_subprocess: nosub = '' client = self.interp.start_subprocess() if not client: self.close() return None else: nosub = "==== No Subprocess ====" self.write("Python %s on %s\n%s\n%s\nIDLE %s %s\n" % (sys.version, sys.platform, self.COPYRIGHT, self.firewallmessage, idlever.ID... | 7663729ec72f5ffe44b8e7f76bdb56d8663c5e6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7663729ec72f5ffe44b8e7f76bdb56d8663c5e6e/PyShell.py |
gotone, evt = Evt.WaitNextEvent(-1, 0) | gotone, evt = Evt.WaitNextEvent(0xffff, 0) | def main(): print 'hello world' # XXXX # skip the toolbox initializations, already done # XXXX Should use gestalt here to check for quicktime version Qt.EnterMovies() # Get the movie file fss, ok = macfs.StandardGetFile(QuickTime.MovieFileType) if not ok: sys.exit(0) # Open the window bounds = (175, 75, 175+160, 75+1... | 19f273c7b6e7c7e7b1911518fdfc1fcba9fefd30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19f273c7b6e7c7e7b1911518fdfc1fcba9fefd30/VerySimplePlayer.py |
def basename(s): return split(s)[1] | 03c06ee7fc62512c4b2af0ed3c57a09128f4b2ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03c06ee7fc62512c4b2af0ed3c57a09128f4b2ce/macpath.py | ||
n = m[:] for i in range(len(n)): n[i] = n[i].split(os.sep) if os.altsep and len(n[i]) == 1: n[i] = n[i].split(os.altsep) prefix = n[0] for item in n: | prefix = m[0] for item in m: | def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' n = m[:] for i in range(len(n)): n[i] = n[i].split(os.sep) # if os.sep didn't have any effect, try os.altsep if os.altsep and len(n[i]) == 1: n[i] = n[i].split(os.altsep) prefix = n[0] for item in n: for ... | 03c06ee7fc62512c4b2af0ed3c57a09128f4b2ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03c06ee7fc62512c4b2af0ed3c57a09128f4b2ce/macpath.py |
return os.sep.join(prefix) def isdir(s): """Return true if the pathname refers to an existing directory.""" try: st = os.stat(s) except os.error: return 0 return S_ISDIR(st[ST_MODE]) def getsize(filename): """Return the size of a file, reported by os.stat().""" st = os.stat(filename) return st[ST_SIZE] def getm... | return prefix | def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' n = m[:] for i in range(len(n)): n[i] = n[i].split(os.sep) # if os.sep didn't have any effect, try os.altsep if os.altsep and len(n[i]) == 1: n[i] = n[i].split(os.altsep) prefix = n[0] for item in n: for ... | 03c06ee7fc62512c4b2af0ed3c57a09128f4b2ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03c06ee7fc62512c4b2af0ed3c57a09128f4b2ce/macpath.py |
pat = re.compile(r'^\s*class\s*' + name + r'\b') | pat = re.compile(r'^(\s*)class\s*' + name + r'\b') candidates = [] | def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r... | b2e81e307dc7e7d8a552619b6defddb06e028613 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2e81e307dc7e7d8a552619b6defddb06e028613/inspect.py |
if pat.match(lines[i]): return lines, i | match = pat.match(lines[i]) if match: if lines[i][0] == 'c': return lines, i candidates.append((match.group(1), i)) if candidates: candidates.sort() return lines, candidates[0][1] | def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r... | b2e81e307dc7e7d8a552619b6defddb06e028613 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2e81e307dc7e7d8a552619b6defddb06e028613/inspect.py |
"install-base or install-platbase supplied, but " + \ "installation scheme is incomplete" | ("install-base or install-platbase supplied, but " "installation scheme is incomplete") | def finalize_unix (self): | dc8412e54132069f6906fdd1912a85ed0f459d26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc8412e54132069f6906fdd1912a85ed0f459d26/install.py |
"'extra_path' option must be a list, tuple, or " + \ "comma-separated string with 1 or 2 elements" | ("'extra_path' option must be a list, tuple, or " "comma-separated string with 1 or 2 elements") | def handle_extra_path (self): | dc8412e54132069f6906fdd1912a85ed0f459d26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc8412e54132069f6906fdd1912a85ed0f459d26/install.py |
self.warn(("modules installed to '%s', which is not in " + "Python's module search path (sys.path) -- " + "you'll have to change the search path yourself") % self.install_lib) | log.debug(("modules installed to '%s', which is not in " "Python's module search path (sys.path) -- " "you'll have to change the search path yourself"), self.install_lib) | def run (self): | dc8412e54132069f6906fdd1912a85ed0f459d26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc8412e54132069f6906fdd1912a85ed0f459d26/install.py |
def_op('RAISE_VARARGS', 130) def_op('CALL_FUNCTION', 131) def_op('MAKE_FUNCTION', 132) def_op('BUILD_SLICE', 133) | def_op('RAISE_VARARGS', 130) def_op('CALL_FUNCTION', 131) def_op('MAKE_FUNCTION', 132) def_op('BUILD_SLICE', 133) def_op('CALL_FUNCTION_VAR', 140) def_op('CALL_FUNCTION_KW', 141) def_op('CALL_FUNCTION_VAR_KW', 142) | def jabs_op(name, op): opname[op] = name hasjabs.append(op) | 7690151c7e95f38b91a9c572ce29b4d8a4ca671d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7690151c7e95f38b91a9c572ce29b4d8a4ca671d/dis.py |
def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1): | def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1, sync=0, use=None): | def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is g... | 9441c078cf929a0129a75032678a9e40d919f235 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9441c078cf929a0129a75032678a9e40d919f235/Tkinter.py |
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk) | self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) | def __init__(self, screenName=None, baseName=None, className='Tk', useTk=1): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is g... | 9441c078cf929a0129a75032678a9e40d919f235 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9441c078cf929a0129a75032678a9e40d919f235/Tkinter.py |
def do_clear_break(self, arg): if not arg: self.do_clear("") return arg = string.strip(arg) args = string.split(arg) if len(args) < 2: print '*** Specify file and line number.' return try: line = int(args[1]) except: print '*** line number must be an integer.' return result =self.clear_break(args[0], line) if result:... | def do_clear(self, arg): # Three possibilities, tried in this order: # clear -> clear all breaks, ask for confirmation # clear file:lineno -> clear all breaks at file:lineno # clear bpno bpno ... -> clear breakpoints by number if not arg: try: reply = raw_input('Clear all breaks? ') except EOFError: reply = 'no' reply ... | 583cc31c223de8f021db7e427876e6097374bc9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/583cc31c223de8f021db7e427876e6097374bc9e/pdb.py | |
if iconv_incs: if iconv_libs: | if platform not in ['darwin'] and iconv_incs is not None: if iconv_libs is not None: | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 9ce623fce5707c9c2c9c4716d719e4178a08f80b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9ce623fce5707c9c2c9c4716d719e4178a08f80b/setup.py |
if len(text) <= 1: text = ' '+text | if not text: text = ' ' | def record_sub_info(match_object,sub_info=sub_info): sub_info.append([match_object.group(1)[0],match_object.span()]) return match_object.group(1) | 0ca0c64409056047b4e24617f79a8faff93c2875 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ca0c64409056047b4e24617f79a8faff93c2875/difflib.py |
cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall}, | cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall, 'install_lib':PyBuildInstallLib}, | def main(): # turn off warnings when deprecated modules are imported import warnings warnings.filterwarnings("ignore",category=DeprecationWarning) setup(name = 'Python standard library', version = '%d.%d' % sys.version_info[:2], cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall}, # The struct module is defin... | 529a505da4c2ffc79b598935a241a9ffe17563e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/529a505da4c2ffc79b598935a241a9ffe17563e5/setup.py |
verify(str(s).__class__ is str) | def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__("".join(L)) return self._rev | 5a49ade70e19a76aa252cd596accf79930765f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a49ade70e19a76aa252cd596accf79930765f31/test_descr.py | |
verify(str(msg).find("weakly") >= 0) | verify(str(msg).find("weak reference") >= 0) | def weakrefs(): if verbose: print "Testing weak references..." import weakref class C(object): pass c = C() r = weakref.ref(c) verify(r() is c) del c verify(r() is None) del r class NoWeak(object): __slots__ = ['foo'] no = NoWeak() try: weakref.ref(no) except TypeError, msg: verify(str(msg).find("weakly") >= 0) else: v... | 4bf018b1383f2fb1cb1f276dbf137ea1e3f77cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4bf018b1383f2fb1cb1f276dbf137ea1e3f77cc4/test_descr.py |
'.ps': 'application/postscript', | '.pyo': 'application/x-python-code', | def read_mime_types(file): try: f = open(file) except IOError: return None map = {} while 1: line = f.readline() if not line: break words = line.split() for i in range(len(words)): if words[i][0] == '#': del words[i:] break if not words: continue type, suffixes = words[0], words[1:] for suff in suffixes: map['.'+suff] ... | 2750bcc2d139f95b08693512af4b4ae50c505998 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2750bcc2d139f95b08693512af4b4ae50c505998/mimetypes.py |
if (self.compiler.find_library_file(lib_dirs, 'ncurses')): | if (self.compiler.find_library_file(lib_dirs, 'ncursesw')): curses_libs = ['ncursesw'] exts.append( Extension('_curses', ['_cursesmodule.c'], libraries = curses_libs) ) elif (self.compiler.find_library_file(lib_dirs, 'ncurses')): | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | a55e55e9f3034ceacbf90facc1a0548d63250df4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a55e55e9f3034ceacbf90facc1a0548d63250df4/setup.py |
def writestr(self, zinfo, bytes): | def writestr(self, zinfo_or_arcname, bytes): | def writestr(self, zinfo, bytes): """Write a file into the archive. The contents is the string 'bytes'.""" self._writecheck(zinfo) zinfo.file_size = len(bytes) # Uncompressed size zinfo.CRC = binascii.crc32(bytes) # CRC-32 checksum if zinfo.compress_type == ZIP_DEFLATED: co = zlib.compressobj(zlib.Z_D... | b083cb3901fcb7487c04ad996148d1cf0aa32350 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b083cb3901fcb7487c04ad996148d1cf0aa32350/zipfile.py |
'bytes'.""" | 'bytes'. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.""" if not isinstance(zinfo_or_arcname, ZipInfo): zinfo = ZipInfo(filename=zinfo_or_arcname, date_time=time.localtime(time.time())) zinfo.compress_type = self.compression else: zinfo = zinfo_or_arcname | def writestr(self, zinfo, bytes): """Write a file into the archive. The contents is the string 'bytes'.""" self._writecheck(zinfo) zinfo.file_size = len(bytes) # Uncompressed size zinfo.CRC = binascii.crc32(bytes) # CRC-32 checksum if zinfo.compress_type == ZIP_DEFLATED: co = zlib.compressobj(zlib.Z_D... | b083cb3901fcb7487c04ad996148d1cf0aa32350 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b083cb3901fcb7487c04ad996148d1cf0aa32350/zipfile.py |
self.pred=[] | self.pred = [] | def __init__(self, versionPredicateStr): """Parse a version predicate string. """ # Fields: # name: package name # pred: list of (comparison string, StrictVersion) | abc1566eab0b21c066df2e19e28fe0ea3beb2e5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/abc1566eab0b21c066df2e19e28fe0ea3beb2e5e/versionpredicate.py |
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP) | os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP) os.chown(p, -1, gid) | def buildPython(): print "Building a universal python" buildDir = os.path.join(WORKDIR, '_bld', 'python') rootDir = os.path.join(WORKDIR, '_root') if os.path.exists(buildDir): shutil.rmtree(buildDir) if os.path.exists(rootDir): shutil.rmtree(rootDir) os.mkdir(buildDir) os.mkdir(rootDir) os.mkdir(os.path.join(rootDir,... | a1cf44de4c085d733944b2fc3c20735f048e321d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a1cf44de4c085d733944b2fc3c20735f048e321d/build-installer.py |
test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1) test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1) | test(r"""sre.match(r"\%03o" % i, chr(i)) != None""", 1) test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") != None""", 1) | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_... | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.search('x*', 'axx').span(0)""", (0, 0)) test(r"""sre.search('x*', 'axx').span()""", (0, 0)) test(r"""sre.search('x+', 'axx').span(0)""", (1, 3)) test(r"""sre.search('x+', 'axx').span()""", (1, 3)) test(r"""sre.search('x', 'aaa')""", None) test(r"""sre.match('a*', 'xxx').span(0)""", (0, 0)) test(r"""sre.ma... | test(r"""sre.search(r'x*', 'axx').span(0)""", (0, 0)) test(r"""sre.search(r'x*', 'axx').span()""", (0, 0)) test(r"""sre.search(r'x+', 'axx').span(0)""", (1, 3)) test(r"""sre.search(r'x+', 'axx').span()""", (1, 3)) test(r"""sre.search(r'x', 'aaa')""", None) test(r"""sre.match(r'a*', 'xxx').span(0)""", (0, 0)) test(r"""... | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_... | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.match('(a)|(b)', 'b').start(1)""", -1) test(r"""sre.match('(a)|(b)', 'b').end(1)""", -1) test(r"""sre.match('(a)|(b)', 'b').span(1)""", (-1, -1)) | test(r"""sre.match(r'(a)|(b)', 'b').start(1)""", -1) test(r"""sre.match(r'(a)|(b)', 'b').end(1)""", -1) test(r"""sre.match(r'(a)|(b)', 'b').span(1)""", (-1, -1)) | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_... | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.sub("(?i)b+", "x", "bbbb BBBB")""", 'x x') | test(r"""sre.sub(r"(?i)b+", "x", "bbbb BBBB")""", 'x x') | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_... | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.sub('.', lambda m: r"\n", 'x')""", '\\n') test(r"""sre.sub('.', r"\n", 'x')""", '\n') | test(r"""sre.sub(r'.', lambda m: r"\n", 'x')""", '\\n') test(r"""sre.sub(r'.', r"\n", 'x')""", '\n') | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.sub('(.)', s, 'x')""", 'xx') test(r"""sre.sub('(.)', sre.escape(s), 'x')""", s) test(r"""sre.sub('(.)', lambda m: s, 'x')""", s) test(r"""sre.sub('(?P<a>x)', '\g<a>\g<a>', 'xx')""", 'xxxx') test(r"""sre.sub('(?P<a>x)', '\g<a>\g<1>', 'xx')""", 'xxxx') test(r"""sre.sub('(?P<unk>x)', '\g<unk>\g<unk>', 'xx')"... | test(r"""sre.sub(r'(.)', s, 'x')""", 'xx') test(r"""sre.sub(r'(.)', sre.escape(s), 'x')""", s) test(r"""sre.sub(r'(.)', lambda m: s, 'x')""", s) test(r"""sre.sub(r'(?P<a>x)', '\g<a>\g<a>', 'xx')""", 'xxxx') test(r"""sre.sub(r'(?P<a>x)', '\g<a>\g<1>', 'xx')""", 'xxxx') test(r"""sre.sub(r'(?P<unk>x)', '\g<unk>\g<unk>', ... | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.sub('a', 'b', 'aaaaa')""", 'bbbbb') test(r"""sre.sub('a', 'b', 'aaaaa', 1)""", 'baaaa') | test(r"""sre.sub(r'a', 'b', 'aaaaa')""", 'bbbbb') test(r"""sre.sub(r'a', 'b', 'aaaaa', 1)""", 'baaaa') | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.sub('(?P<a>x)', '\g<a', 'xx')""", None, sre.error) test(r"""sre.sub('(?P<a>x)', '\g<', 'xx')""", None, sre.error) test(r"""sre.sub('(?P<a>x)', '\g', 'xx')""", None, sre.error) test(r"""sre.sub('(?P<a>x)', '\g<a a>', 'xx')""", None, sre.error) test(r"""sre.sub('(?P<a>x)', '\g<1a1>', 'xx')""", None, sre.erro... | test(r"""sre.sub(r'(?P<a>x)', '\g<a', 'xx')""", None, sre.error) test(r"""sre.sub(r'(?P<a>x)', '\g<', 'xx')""", None, sre.error) test(r"""sre.sub(r'(?P<a>x)', '\g', 'xx')""", None, sre.error) test(r"""sre.sub(r'(?P<a>x)', '\g<a a>', 'xx')""", None, sre.error) test(r"""sre.sub(r'(?P<a>x)', '\g<1a1>', 'xx')""", None, sre... | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.subn("(?i)b+", "x", "bbbb BBBB")""", ('x x', 2)) test(r"""sre.subn("b+", "x", "bbbb BBBB")""", ('x BBBB', 1)) test(r"""sre.subn("b+", "x", "xyz")""", ('xyz', 0)) test(r"""sre.subn("b*", "x", "xyz")""", ('xxxyxzx', 4)) test(r"""sre.subn("b*", "x", "xyz", 2)""", ('xxxyz', 2)) | test(r"""sre.subn(r"(?i)b+", "x", "bbbb BBBB")""", ('x x', 2)) test(r"""sre.subn(r"b+", "x", "bbbb BBBB")""", ('x BBBB', 1)) test(r"""sre.subn(r"b+", "x", "xyz")""", ('xyz', 0)) test(r"""sre.subn(r"b*", "x", "xyz")""", ('xxxyxzx', 4)) test(r"""sre.subn(r"b*", "x", "xyz", 2)""", ('xxxyz', 2)) | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.split(":", ":a:b::c")""", ['', 'a', 'b', '', 'c']) test(r"""sre.split(":*", ":a:b::c")""", ['', 'a', 'b', 'c']) test(r"""sre.split("(:*)", ":a:b::c")""", ['', ':', 'a', ':', 'b', '::', 'c']) test(r"""sre.split("(?::*)", ":a:b::c")""", ['', 'a', 'b', 'c']) test(r"""sre.split("(:)*", ":a:b::c")""", ['', ':',... | test(r"""sre.split(r":", ":a:b::c")""", ['', 'a', 'b', '', 'c']) test(r"""sre.split(r":*", ":a:b::c")""", ['', 'a', 'b', 'c']) test(r"""sre.split(r"(:*)", ":a:b::c")""", ['', ':', 'a', ':', 'b', '::', 'c']) test(r"""sre.split(r"(?::*)", ":a:b::c")""", ['', 'a', 'b', 'c']) test(r"""sre.split(r"(:)*", ":a:b::c")""", ['',... | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.split("(?:b)|(?::+)", ":a:b::c")""", ['', 'a', '', '', 'c']) test(r"""sre.split(":", ":a:b::c", 2)""", ['', 'a', 'b::c']) test(r"""sre.split(':', 'a:b:c:d', 2)""", ['a', 'b', 'c:d']) test(r"""sre.split("(:)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) test(r"""sre.split("(:*)", ":a:b::c", 2)""", ['',... | test(r"""sre.split(r"(?:b)|(?::+)", ":a:b::c")""", ['', 'a', '', '', 'c']) test(r"""sre.split(r":", ":a:b::c", 2)""", ['', 'a', 'b::c']) test(r"""sre.split(r':', 'a:b:c:d', 2)""", ['a', 'b', 'c:d']) test(r"""sre.split(r"(:)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) test(r"""sre.split(r"(:*)", ":a:b::c", 2)""",... | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.findall(":+", "abc")""", []) test(r"""sre.findall(":+", "a:b::c:::d")""", [":", "::", ":::"]) test(r"""sre.findall("(:+)", "a:b::c:::d")""", [":", "::", ":::"]) test(r"""sre.findall("(:)(:*)", "a:b::c:::d")""", | test(r"""sre.findall(r":+", "abc")""", []) test(r"""sre.findall(r":+", "a:b::c:::d")""", [":", "::", ":::"]) test(r"""sre.findall(r"(:+)", "a:b::c:::d")""", [":", "::", ":::"]) test(r"""sre.findall(r"(:)(:*)", "a:b::c:::d")""", | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.findall("(a)|(b)", "abc")""", [("a", ""), ("", "b")]) | test(r"""sre.findall(r"(a)|(b)", "abc")""", [("a", ""), ("", "b")]) | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.match('a', 'a').groups()""", ()) test(r"""sre.match('(a)', 'a').groups()""", ('a',)) test(r"""sre.match('(a)', 'a').group(0)""", 'a') test(r"""sre.match('(a)', 'a').group(1)""", 'a') test(r"""sre.match('(a)', 'a').group(1, 1)""", ('a', 'a')) pat = sre.compile('((a)|(b))(c)?') | test(r"""sre.match(r'a', 'a').groups()""", ()) test(r"""sre.match(r'(a)', 'a').groups()""", ('a',)) test(r"""sre.match(r'(a)', 'a').group(0)""", 'a') test(r"""sre.match(r'(a)', 'a').group(1)""", 'a') test(r"""sre.match(r'(a)', 'a').group(1, 1)""", ('a', 'a')) pat = sre.compile(r'((a)|(b))(c)?') | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
pat = sre.compile('(?:(?P<a1>a)|(?P<b2>b))(?P<c3>c)?') | pat = sre.compile(r'(?:(?P<a1>a)|(?P<b2>b))(?P<c3>c)?') | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
pat = sre.compile('a(?:b|(c|e){1,2}?|d)+?(.)') | pat = sre.compile(r'a(?:b|(c|e){1,2}?|d)+?(.)') | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
pat = sre.compile('a(?:b|(c|e){1,2}?|d)+?(.)') | pat = sre.compile(r'a(?:b|(c|e){1,2}?|d)+?(.)') | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
test(r"""sre.match('(x)*', 50000*'x').span()""", (0, 50000), RuntimeError) test(r"""sre.match('(x)*y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) test(r"""sre.match('(x)*?y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) | test(r"""sre.match(r'(x)*', 50000*'x').span()""", (0, 50000), RuntimeError) test(r"""sre.match(r'(x)*y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) test(r"""sre.match(r'(x)*?y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
pass | print '=== Compiled incorrectly', t | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py |
updated is a tuple naming the attributes off the wrapper that | updated is a tuple naming the attributes of the wrapper that | def update_wrapper(wrapper, wrapped, assigned = WRAPPER_ASSIGNMENTS, updated = WRAPPER_UPDATES): """Update a wrapper function to look like the wrapped function wrapper is the function to be updated wrapped is the original function assigned is a tuple naming the attributes assigned directly from the wrapped function to... | efb57072feb9da7ff7870e36f0fc9272a103de80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/efb57072feb9da7ff7870e36f0fc9272a103de80/functools.py |
self._cont_handler.startElement(name, attrs) | self._cont_handler.startElementNS(name, qname, attrs) | def startElementNS(self, name, qname, attrs): self._cont_handler.startElement(name, attrs) | 0ea558f7b4b6242a7457cf6a20ad33cf2769b7b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ea558f7b4b6242a7457cf6a20ad33cf2769b7b1/saxutils.py |
def subconvert(line, ofp, table, discards, autoclosing, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("- %s \n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n") | 637ad47e61c51f605a15337b007493586ad37e7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/637ad47e61c51f605a15337b007493586ad37e7f/latex2esis.py | ||
subconvert(ifp.read(), ofp, table, discards, autoclosing) | subconvert(data, ofp, table, discards, autoclosing) | def convert(ifp, ofp, table={}, discards=(), autoclosing=()): try: subconvert(ifp.read(), ofp, table, discards, autoclosing) except IOError, (err, msg): if err != errno.EPIPE: raise | 637ad47e61c51f605a15337b007493586ad37e7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/637ad47e61c51f605a15337b007493586ad37e7f/latex2esis.py |
expectedchecksum = 'b45b79f3203ee1a896d9b5655484adaff5d4964b' | expectedchecksum = '4e389f97e9f88b8b7ab743121fd643089116f9f2' | def tearDown(self): del self.db | d004fc810af3e1985686e616763e14a1b0aa60c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d004fc810af3e1985686e616763e14a1b0aa60c1/test_unicodedata.py |
parts = resp[left+1].split(resp[left + 1:right]) | parts = resp[left + 1:right].split(resp[left+1]) | def parse229(resp, peer): '''Parse the '229' response for a EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] <> '229': raise error_reply, resp left = resp.find('(') if left < 0: raise error_proto, resp right = resp.find(')', left + 1) if ... | a401ae4010eeb385a0775c505637bbc332bc184c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a401ae4010eeb385a0775c505637bbc332bc184c/ftplib.py |
if len(a) < len(b): a, b = b, a res = a[:] for i in range(len(b)): res[i] = res[i] - b[i] return normalize(res) | neg_b = map(lambda x: -x, b[:]) return plus(a, neg_b) | def minus(a, b): if len(a) < len(b): a, b = b, a # make sure a is the longest res = a[:] # make a copy for i in range(len(b)): res[i] = res[i] - b[i] return normalize(res) | 971dc53f0ede0945dda9471596e4c727ea23dc7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/971dc53f0ede0945dda9471596e4c727ea23dc7c/poly.py |
self.create_system = 0 | if sys.platform == 'win32': self.create_system = 0 else: self.create_system = 3 | def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)): self.orig_filename = filename # Original file name in archive | 0075690ced8026e68cf96e3bf9310c9002b2d36f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0075690ced8026e68cf96e3bf9310c9002b2d36f/zipfile.py |
def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. self.fileobj.seek(-8, 1) crc32 = read32(self.fileobj) isize = U32(read... | 9288f95cb5d7be807c2ba6dbc195ec6b52ac3bd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9288f95cb5d7be807c2ba6dbc195ec6b52ac3bd4/gzip.py | ||
elif isize != self.size: | elif isize != LOWU32(self.size): | def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. self.fileobj.seek(-8, 1) crc32 = read32(self.fileobj) isize = U32(read... | 9288f95cb5d7be807c2ba6dbc195ec6b52ac3bd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9288f95cb5d7be807c2ba6dbc195ec6b52ac3bd4/gzip.py |
write32u(self.fileobj, self.size) | write32u(self.fileobj, LOWU32(self.size)) | def close(self): if self.mode == WRITE: self.fileobj.write(self.compress.flush()) write32(self.fileobj, self.crc) # self.size may exceed 2GB write32u(self.fileobj, self.size) self.fileobj = None elif self.mode == READ: self.fileobj = None if self.myfileobj: self.myfileobj.close() self.myfileobj = None | 9288f95cb5d7be807c2ba6dbc195ec6b52ac3bd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9288f95cb5d7be807c2ba6dbc195ec6b52ac3bd4/gzip.py |
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 57fc21018f570b708a898f858d8fe4706d504812 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/57fc21018f570b708a898f858d8fe4706d504812/setup.py | ||
def check_module_event(self, event): | def check_module_event(self, event=None): | def check_module_event(self, event): filename = self.getfilename() if not filename: return if not self.tabnanny(filename): return self.checksyntax(filename) | 2618c7fadc756ebd81213423055626411920f379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2618c7fadc756ebd81213423055626411920f379/ScriptBinding.py |
filename = self.getfilename() if not filename: return if not self.tabnanny(filename): return code = self.checksyntax(filename) | code = self.check_module_event(event) | def run_module_event(self, event): """Run the module after setting up the environment. | 2618c7fadc756ebd81213423055626411920f379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2618c7fadc756ebd81213423055626411920f379/ScriptBinding.py |
r = (40, 40, 400, 300) | r = windowbounds(400, 400) | def open(self, path, name, data): self.path = path self.name = name r = (40, 40, 400, 300) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w r2 = (0, 0, 345, 245) Qd.SetPort(w) Qd.TextFont(4) Qd.TextSize(9) self.ted = TE.TENew(r2, r2) self.ted.TEAutoView(1) self.ted.TESetText(data) w.DrawGrowIcon() self.... | 8444507faf45eb14bc19be4371a766c05d684aa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8444507faf45eb14bc19be4371a766c05d684aa2/ped.py |
r2 = (0, 0, 345, 245) | vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 dr = (0, 0, vr[2], 0) | def open(self, path, name, data): self.path = path self.name = name r = (40, 40, 400, 300) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w r2 = (0, 0, 345, 245) Qd.SetPort(w) Qd.TextFont(4) Qd.TextSize(9) self.ted = TE.TENew(r2, r2) self.ted.TEAutoView(1) self.ted.TESetText(data) w.DrawGrowIcon() self.... | 8444507faf45eb14bc19be4371a766c05d684aa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8444507faf45eb14bc19be4371a766c05d684aa2/ped.py |
self.ted = TE.TENew(r2, r2) | self.ted = TE.TENew(dr, vr) | def open(self, path, name, data): self.path = path self.name = name r = (40, 40, 400, 300) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w r2 = (0, 0, 345, 245) Qd.SetPort(w) Qd.TextFont(4) Qd.TextSize(9) self.ted = TE.TENew(r2, r2) self.ted.TEAutoView(1) self.ted.TESetText(data) w.DrawGrowIcon() self.... | 8444507faf45eb14bc19be4371a766c05d684aa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8444507faf45eb14bc19be4371a766c05d684aa2/ped.py |
return vx, vy | return None, vy | def getscrollbarvalues(self): dr = self.ted.destRect vr = self.ted.viewRect height = self.ted.nLines * self.ted.lineHeight vx = self.scalebarvalue(dr[0], dr[2]-dr[0], vr[0], vr[2]) vy = self.scalebarvalue(dr[1], dr[1]+height, vr[1], vr[3]) print dr, vr, height, vx, vy return vx, vy | 8444507faf45eb14bc19be4371a766c05d684aa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8444507faf45eb14bc19be4371a766c05d684aa2/ped.py |
if what == 'set': return if what == '-': delta = self.ted.viewRect[2]/10 elif what == '--': delta = self.ted.viewRect[2]/2 elif what == '+': delta = +self.ted.viewRect[2]/10 elif what == '++': delta = +self.ted.viewRect[2]/2 self.ted.TEPinScroll(delta, 0) | pass | def scrollbar_callback(self, which, what, value): if which == 'y': if what == 'set': height = self.ted.nLines * self.ted.lineHeight cur = self.getscrollbarvalues()[1] delta = (cur-value)*height/32767 if what == '-': delta = self.ted.lineHeight elif what == '--': delta = (self.ted.viewRect[3]-self.ted.lineHeight) if del... | 8444507faf45eb14bc19be4371a766c05d684aa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8444507faf45eb14bc19be4371a766c05d684aa2/ped.py |
for l in self._windows.values(): l.do_idle() | if self.active: self.active.do_idle() | def idle(self, *args): for l in self._windows.values(): l.do_idle() | 8444507faf45eb14bc19be4371a766c05d684aa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8444507faf45eb14bc19be4371a766c05d684aa2/ped.py |
def handle(self): """Handle a single HTTP request. You normally don't need to override this method; see the class __doc__ string for information on how to handle specific HTTP commands such as GET and POST. """ self.raw_requestline = self.rfile.readline() | def parse_request(self): """Parse a request (internal). The request should be stored in self.raw_request; the results are in self.command, self.path, self.request_version and self.headers. Return value is 1 for success, 0 for failure; on failure, an error is sent back. """ | def handle(self): """Handle a single HTTP request. | d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4/BaseHTTPServer.py |
return | return 0 | def handle(self): """Handle a single HTTP request. | d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4/BaseHTTPServer.py |
return | return 0 | def handle(self): """Handle a single HTTP request. | d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4/BaseHTTPServer.py |
return | return 0 | def handle(self): """Handle a single HTTP request. | d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4/BaseHTTPServer.py |
mname = 'do_' + command | return 1 def handle(self): """Handle a single HTTP request. You normally don't need to override this method; see the class __doc__ string for information on how to handle specific HTTP commands such as GET and POST. """ self.raw_requestline = self.rfile.readline() if not self.parse_request(): return mname = 'do_' +... | def handle(self): """Handle a single HTTP request. | d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4/BaseHTTPServer.py |
self.send_error(501, "Unsupported method (%s)" % `command`) | self.send_error(501, "Unsupported method (%s)" % `self.command`) | def handle(self): """Handle a single HTTP request. | d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d65b53923ecefc96f24d9cbc4e3e83dd2194d6b4/BaseHTTPServer.py |
return copy.copy(self) | data = self.data try: self.data = {} c = copy.copy(self) finally: self.data = data c.update(self) return c | def copy(self): if self.__class__ is UserDict: return UserDict(self.data) import copy return copy.copy(self) | 3ce5af70e352b3a8fbea8e3f27464b6ca2d66ebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3ce5af70e352b3a8fbea8e3f27464b6ca2d66ebd/UserDict.py |
'tk' + version ) | lib_prefix + 'tk' + version) | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e/setup.py |
'tcl' + version ) | lib_prefix + 'tcl' + version) | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e/setup.py |
if platform == 'cygwin': x11_inc = find_file('X11/Xlib.h', [], inc_dirs) if x11_inc is None: return | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e/setup.py | |
libs.append('tk'+version) libs.append('tcl'+version) | libs.append(lib_prefix + 'tk'+ version) libs.append(lib_prefix + 'tcl'+ version) | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbe8961698de3a4e3e17512b6e88e9d7fcd52d4e/setup.py |
return "" | def paren_open_event(self, event): self._remove_calltip_window() arg_text = get_arg_text(self.get_object_at_cursor()) if arg_text: self.calltip_start = self.text.index("insert") self.calltip = self._make_calltip_window() self.calltip.showtip(arg_text) # dont return "break" so the key is inserted. | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py | |
def paren_close_event(self, event): # Now just hides, but later we should check if other # paren'd expressions remain open. # dont return "break" so the key is inserted. self._remove_calltip_window() | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py | ||
return "" def calltip_cancel_event(self, event): self._remove_calltip_window() return "" | def check_calltip_cancel_event(self, event): # This doesnt quite work correctly as it is processed # _before_ the key is handled. Thus, when the "Up" key # is pressed, this test happens before the cursor is moved. # This will do for now. if self.calltip: # If we have moved before the start of the calltip, # or off the... | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py | |
index = 0 while 1: index = index + 1 indexspec = "insert-%dc" % index ch = text.get(indexspec) if ch not in wordchars: break if text.compare(indexspec, "<=", "1.0"): break word = text.get("insert-%dc" % (index-1,), "insert") if word: | chars = text.get("insert linestart", "insert") i = len(chars) while i and chars[i-1] in wordchars: i = i-1 word = chars[i:] if word: | def get_object_at_cursor(self, wordchars="._" + string.uppercase + string.lowercase + string.digits): # XXX - This need to be moved to a better place # as the "." attribute lookup code can also use it. text = self.text index = 0 while 1: index = index + 1 indexspec = "insert-%dc" % index ch = text.get(indexspec) if ch ... | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py |
def get_object_at_cursor(self, wordchars="._" + string.uppercase + string.lowercase + string.digits): # XXX - This need to be moved to a better place # as the "." attribute lookup code can also use it. text = self.text index = 0 while 1: index = index + 1 indexspec = "insert-%dc" % index ch = text.get(indexspec) if ch ... | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py | ||
if not argText and hasattr(ob, "__doc__") and ob.__doc__: | if hasattr(ob, "__doc__") and ob.__doc__: | def get_arg_text(ob): # Get a string describing the arguments for the given object. argText = "" if ob is not None: argOffset = 0 # bit of a hack for methods - turn it into a function # but we drop the "self" param. if type(ob)==types.MethodType: ob = ob.im_func argOffset = 1 # Try and build one for Python defined func... | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py |
argText = ob.__doc__[:pos] | if argText: argText = argText + "\n" argText = argText + ob.__doc__[:pos] | def get_arg_text(ob): # Get a string describing the arguments for the given object. argText = "" if ob is not None: argOffset = 0 # bit of a hack for methods - turn it into a function # but we drop the "self" param. if type(ob)==types.MethodType: ob = ob.im_func argOffset = 1 # Try and build one for Python defined func... | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py |
def t6(self, a, b=None, *args, **kw): "(a, b=None, ...)" | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py | ||
if get_arg_text(t) != t.__doc__: | if get_arg_text(t) != t.__doc__ + "\n" + t.__doc__: | def test( tests ): failed=[] for t in tests: if get_arg_text(t) != t.__doc__: failed.append(t) print "%s - expected %s, but got %s" % (t, `t.__doc__`, `get_arg_text(t)`) print "%d of %d tests failed" % (len(failed), len(tests)) | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py |
tc = TC() tests = t1, t2, t3, t4, t5, t6, \ tc.t1, tc.t2, tc.t3, tc.t4, tc.t5, tc.t6 | tc = TC() tests = t1, t2, t3, t4, t5, t6, \ tc.t1, tc.t2, tc.t3, tc.t4, tc.t5, tc.t6 | def test( tests ): failed=[] for t in tests: if get_arg_text(t) != t.__doc__: failed.append(t) print "%s - expected %s, but got %s" % (t, `t.__doc__`, `get_arg_text(t)`) print "%d of %d tests failed" % (len(failed), len(tests)) | 6290dabdbbf19f2ad93bd7800226f2c6761c61b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6290dabdbbf19f2ad93bd7800226f2c6761c61b1/CallTips.py |
print 'XXX', (_function, (_object,), _parameters) | def callback_wrapper(self, _request, _reply): _parameters, _attributes = aetools.unpackevent(_request) _class = _attributes['evcl'].type _type = _attributes['evid'].type if self.ae_handlers.has_key((_class, _type)): _function = self.ae_handlers[(_class, _type)] elif self.ae_handlers.has_key((_class, '****')): _functio... | 260400f3f5e13aa005f5cf16efcd063a59f282d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/260400f3f5e13aa005f5cf16efcd063a59f282d6/MiniAEFrame.py | |
def _strxor(s1, s2): """Utility method. XOR the two strings s1 and s2 (must have same length). """ return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2)) | trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)]) trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)]) | def _strxor(s1, s2): """Utility method. XOR the two strings s1 and s2 (must have same length). """ return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2)) | 8fe2d2015dc57e4e048f733c7fbb5c0712b05d15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8fe2d2015dc57e4e048f733c7fbb5c0712b05d15/hmac.py |
ipad = "\x36" * blocksize opad = "\x5C" * blocksize | def __init__(self, key, msg = None, digestmod = None): """Create a new HMAC object. | 8fe2d2015dc57e4e048f733c7fbb5c0712b05d15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8fe2d2015dc57e4e048f733c7fbb5c0712b05d15/hmac.py | |
self.outer.update(_strxor(key, opad)) self.inner.update(_strxor(key, ipad)) | self.outer.update(key.translate(trans_5C)) self.inner.update(key.translate(trans_36)) | def __init__(self, key, msg = None, digestmod = None): """Create a new HMAC object. | 8fe2d2015dc57e4e048f733c7fbb5c0712b05d15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8fe2d2015dc57e4e048f733c7fbb5c0712b05d15/hmac.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.