rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
<SCRIPT LANGUAGE="JavaScript"> | <script type="text/javascript"> | def js_output(self, attrs=None): # Print javascript return """ <SCRIPT LANGUAGE="JavaScript"> <!-- begin hiding document.cookie = \"%s\" // end hiding --> </script> """ % ( self.OutputString(attrs), ) | 03a33ea3a85f9f2ed158f678295b7605f2f9721a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03a33ea3a85f9f2ed158f678295b7605f2f9721a/Cookie.py |
document.cookie = \"%s\" | document.cookie = \"%s\"; | def js_output(self, attrs=None): # Print javascript return """ <SCRIPT LANGUAGE="JavaScript"> <!-- begin hiding document.cookie = \"%s\" // end hiding --> </script> """ % ( self.OutputString(attrs), ) | 03a33ea3a85f9f2ed158f678295b7605f2f9721a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03a33ea3a85f9f2ed158f678295b7605f2f9721a/Cookie.py |
def writelines(self, list): self.write(''.join(list)) | def writelines(self, iterable): write = self.write for line in iterable: write(line) | def writelines(self, list): self.write(''.join(list)) | 6ec099658ab49ed6d3c2861e437fe659e1c7037f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ec099658ab49ed6d3c2861e437fe659e1c7037f/StringIO.py |
prefix = m[0] for item in m: for i in range(len(prefix)): if prefix[:i+1] != item[:i+1]: prefix = prefix[:i] if i == 0: return '' break return prefix | s1 = min(m) s2 = max(m) n = min(len(s1), len(s2)) for i in xrange(n): if s1[i] != s2[i]: return s1[:i] return s1[:n] | def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' prefix = m[0] for item in m: for i in range(len(prefix)): if prefix[:i+1] != item[:i+1]: prefix = prefix[:i] if i == 0: return '' break return prefix | 74bb7f03b1ff097d2e08544539549ec7283ffc75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74bb7f03b1ff097d2e08544539549ec7283ffc75/posixpath.py |
def start_doctype_decl(self, name, pubid, sysid, has_internal_subset): | def start_doctype_decl(self, name, sysid, pubid, has_internal_subset): | def start_doctype_decl(self, name, pubid, sysid, has_internal_subset): self._lex_handler_prop.startDTD(name, pubid, sysid) | 456ab1d2712dc9cebd878966c8fb16af47ea79f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/456ab1d2712dc9cebd878966c8fb16af47ea79f0/expatreader.py |
if mname in self.modules: return self.modules[mname] self.modules[mname] = m = self.hooks.new_module(mname) | m = self.modules.get(mname) if m is None: self.modules[mname] = m = self.hooks.new_module(mname) | def add_module(self, mname): if mname in self.modules: return self.modules[mname] self.modules[mname] = m = self.hooks.new_module(mname) m.__builtins__ = self.modules['__builtin__'] return m | 7f7c3d0a9c401d7bc9a9d86ec7181cf09c4b3bab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f7c3d0a9c401d7bc9a9d86ec7181cf09c4b3bab/rexec.py |
code.interact( "*** RESTRICTED *** Python %s on %s\n" 'Type "help", "copyright", "credits" or "license" ' "for more information." % (sys.version, sys.platform), local=r.modules['__main__'].__dict__) | RestrictedConsole(r.modules['__main__'].__dict__).interact() | def test(): import getopt, traceback opts, args = getopt.getopt(sys.argv[1:], 'vt:') verbose = 0 trusted = [] for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-t': trusted.append(a) r = RExec(verbose=verbose) if trusted: r.ok_builtin_modules = r.ok_builtin_modules + tuple(trusted) if args: r.modules['sys'].... | 7f7c3d0a9c401d7bc9a9d86ec7181cf09c4b3bab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f7c3d0a9c401d7bc9a9d86ec7181cf09c4b3bab/rexec.py |
if w[0] != '-' and w[-2:] in ('.o', '.a'): | if w[0] not in ('-', '$') and w[-2:] in ('.o', '.a'): | def select(e, mods, vars, mod, skipofiles): files = [] for w in mods[mod]: w = treatword(w) if not w: continue w = expandvars(w, vars) for w in string.split(w): if skipofiles and w[-2:] == '.o': continue if w[0] != '-' and w[-2:] in ('.o', '.a'): w = os.path.join(e, w) if w[:2] in ('-L', '-R'): w = w[:2] + os.path.join... | ce7695191fdcfd5564a6fdf7f54255c74206a8c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce7695191fdcfd5564a6fdf7f54255c74206a8c2/checkextensions.py |
if w[:2] in ('-L', '-R'): | if w[:2] in ('-L', '-R') and w[2:3] != '$': | def select(e, mods, vars, mod, skipofiles): files = [] for w in mods[mod]: w = treatword(w) if not w: continue w = expandvars(w, vars) for w in string.split(w): if skipofiles and w[-2:] == '.o': continue if w[0] != '-' and w[-2:] in ('.o', '.a'): w = os.path.join(e, w) if w[:2] in ('-L', '-R'): w = w[:2] + os.path.join... | ce7695191fdcfd5564a6fdf7f54255c74206a8c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce7695191fdcfd5564a6fdf7f54255c74206a8c2/checkextensions.py |
dstfinfo = dstfss.GetFInfo() dstfinfo.Flags = dstfinfo.Flags|0x8000 dstfss.SetFInfo(dstfinfo) def main(): dir, ok = macfs.GetDirectory() if not ok: sys.exit(0) os.chdir(dir.as_pathname()) | if __name__ == '__main__': run(1) | def mkalias(src, dst): """Create a finder alias""" srcfss = macfs.FSSpec(src) dstfss = macfs.FSSpec(dst) alias = srcfss.NewAlias() srcfinfo = srcfss.GetFInfo() Res.FSpCreateResFile(dstfss, srcfinfo.Creator, srcfinfo.Type, -1) h = Res.FSpOpenResFile(dstfss, 3) resource = Res.Resource(alias.data) resource.AddResource('a... | d8eb8a79456555385185782df350c39233104341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8eb8a79456555385185782df350c39233104341/fixfiletypes.py |
if EasyDialogs.AskYesNoCancel('Proceed with removing old aliases?') <= 0: sys.exit(0) LibFiles = [] allfiles = os.listdir(':') for f in allfiles: if f[-4:] == '.slb': finfo = macfs.FSSpec(f).GetFInfo() if finfo.Flags & 0x8000: os.unlink(f) else: LibFiles.append(f) | def main(): # Ask the user for the plugins directory dir, ok = macfs.GetDirectory() if not ok: sys.exit(0) os.chdir(dir.as_pathname()) # Remove old .slb aliases and collect a list of .slb files if EasyDialogs.AskYesNoCancel('Proceed with removing old aliases?') <= 0: sys.exit(0) LibFiles = [] allfiles = os.listdir(':'... | d8eb8a79456555385185782df350c39233104341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8eb8a79456555385185782df350c39233104341/fixfiletypes.py | |
print LibFiles if EasyDialogs.AskYesNoCancel('Proceed with creating new ones?') <= 0: sys.exit(0) for dst, src in goals: if src in LibFiles: mkalias(src, dst) else: EasyDialogs.Message(dst+' not created: '+src+' not found') EasyDialogs.Message('All done!') if __name__ == '__main__': main() | def main(): # Ask the user for the plugins directory dir, ok = macfs.GetDirectory() if not ok: sys.exit(0) os.chdir(dir.as_pathname()) # Remove old .slb aliases and collect a list of .slb files if EasyDialogs.AskYesNoCancel('Proceed with removing old aliases?') <= 0: sys.exit(0) LibFiles = [] allfiles = os.listdir(':'... | d8eb8a79456555385185782df350c39233104341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8eb8a79456555385185782df350c39233104341/fixfiletypes.py | |
- prepend _ if the result is a python keyword | - append _ if the result is a python keyword | def identify(str): """Turn any string into an identifier: - replace space by _ - replace other illegal chars by _xx_ (hex code) - prepend _ if the result is a python keyword """ if not str: return "empty_ae_name_" rv = '' ok = string.ascii_letters + '_' ok2 = ok + string.digits for c in str: if c in ok: rv = rv + c eli... | 36d49a907fdc1dd34ee30b3b407ea9d92e35f4f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36d49a907fdc1dd34ee30b3b407ea9d92e35f4f9/gensuitemodule.py |
import _socket | if not sys.platform.startswith('java'): import _socket | def check_all(modname): names = {} try: exec "import %s" % modname in names except ImportError: # Silent fail here seems the best route since some modules # may not be available in all environments. # Since an ImportError may leave a partial module object in # sys.modules, get rid of that first. Here's what happens if... | cbfc0343fc66cb4bd7f962698c81ff74b94ea554 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cbfc0343fc66cb4bd7f962698c81ff74b94ea554/test___all__.py |
finfo = macfs.FSSpec(name).GetFInfo() | finfo = FSSpec(name).FSpGetFInfo() | def getfileinfo(name): finfo = macfs.FSSpec(name).GetFInfo() dir, file = os.path.split(name) # XXXX Get resource/data sizes fp = open(name, 'rb') fp.seek(0, 2) dlen = fp.tell() fp = openrf(name, '*rb') fp.seek(0, 2) rlen = fp.tell() return file, finfo, dlen, rlen | 5ea4bf1c58aee31ed15faad6985d9a36498fdf02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ea4bf1c58aee31ed15faad6985d9a36498fdf02/binhex.py |
def getfileinfo(name): finfo = macfs.FSSpec(name).GetFInfo() dir, file = os.path.split(name) # XXXX Get resource/data sizes fp = open(name, 'rb') fp.seek(0, 2) dlen = fp.tell() fp = openrf(name, '*rb') fp.seek(0, 2) rlen = fp.tell() return file, finfo, dlen, rlen | 5ea4bf1c58aee31ed15faad6985d9a36498fdf02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ea4bf1c58aee31ed15faad6985d9a36498fdf02/binhex.py | ||
else: | except ImportError: | def openrsrc(name, *mode): if not mode: mode = '*rb' else: mode = '*' + mode[0] return openrf(name, mode) | 5ea4bf1c58aee31ed15faad6985d9a36498fdf02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ea4bf1c58aee31ed15faad6985d9a36498fdf02/binhex.py |
fss = macfs.FSSpec(ofname) | fss = FSSpec(ofname) | def __init__(self, (name, finfo, dlen, rlen), ofp): if type(ofp) == type(''): ofname = ofp ofp = open(ofname, 'w') if os.name == 'mac': fss = macfs.FSSpec(ofname) fss.SetCreatorType('BnHq', 'TEXT') ofp.write('(This file must be converted with BinHex 4.0)\n\n:') hqxer = _Hqxcoderengine(ofp) self.ofp = _Rlecoderengine(hq... | 5ea4bf1c58aee31ed15faad6985d9a36498fdf02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ea4bf1c58aee31ed15faad6985d9a36498fdf02/binhex.py |
ofss = macfs.FSSpec(out) | ofss = FSSpec(out) | def hexbin(inp, out): """(infilename, outfilename) - Decode binhexed file""" ifp = HexBin(inp) finfo = ifp.FInfo if not out: out = ifp.FName if os.name == 'mac': ofss = macfs.FSSpec(out) out = ofss.as_pathname() ofp = open(out, 'wb') # XXXX Do translation on non-mac systems while 1: d = ifp.read(128000) if not d: brea... | 5ea4bf1c58aee31ed15faad6985d9a36498fdf02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ea4bf1c58aee31ed15faad6985d9a36498fdf02/binhex.py |
prog = open(filename).read() | prog = open(filename, "rU").read() | def find_executable_linenos(filename): """Return dict where keys are line numbers in the line number table.""" assert filename.endswith('.py') try: prog = open(filename).read() except IOError, err: print >> sys.stderr, ("Not printing coverage data for %r: %s" % (filename, err)) return {} code = compile(prog, filename, ... | c00fc8452e1ce89ede278f417a2bd272bda98eae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c00fc8452e1ce89ede278f417a2bd272bda98eae/trace.py |
print `header` | def decode(input, output, resonly=0): if type(input) == type(''): input = open(input, 'rb') # Should we also test for FSSpecs or FSRefs? header = input.read(AS_HEADER_LENGTH) print `header` try: magic, version, dummy, nentry = struct.unpack(AS_HEADER_FORMAT, header) except ValueError, arg: raise Error, "Unpack header e... | 695b33b02a0288819c2b0e61f5b1e28bcd5ac966 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/695b33b02a0288819c2b0e61f5b1e28bcd5ac966/applesingle.py | |
def set_get_returns_none(self, *args, **kwargs): return apply(self._cobj.set_get_returns_none, args, kwargs) | def set_get_returns_none(self, *args, **kwargs): return apply(self._cobj.set_get_returns_none, args, kwargs) | db8a80735b9ce54f26d3e6796d0ae647455ca854 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/db8a80735b9ce54f26d3e6796d0ae647455ca854/dbobj.py | |
if not debugger: | if not debugger and \ self.editwin.getvar("<<toggle-jit-stack-viewer>>"): | def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file... | 9ea32898dbfe88426f031d60126e44d5279e2ded /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9ea32898dbfe88426f031d60126e44d5279e2ded/ScriptBinding.py |
manifest = open (self.manifest, "w") for fn in self.files: manifest.write (fn + '\n') manifest.close () | self.execute(write_file, (self.manifest, self.files), "writing manifest file") | def write_manifest (self): """Write the file list in 'self.files' (presumably as filled in by 'find_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'.""" | 1b8e1d4c0dd1a1d738ffdac053446117f6d70656 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b8e1d4c0dd1a1d738ffdac053446117f6d70656/sdist.py |
['response', ['mesg_num octets', ...]]. | ['response', ['mesg_num octets', ...], octets]. | def list(self, which=None): """Request listing, return result. | 2772c679e9c9503965301541ffa2a730c2527976 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2772c679e9c9503965301541ffa2a730c2527976/poplib.py |
except: | except IOError: | def is_zipfile(filename): """Quickly see if file is a ZIP file by checking the magic number. Will not accept a ZIP archive with an ending comment. """ try: fpin = open(filename, "rb") fpin.seek(-22, 2) # Seek to end-of-file record endrec = fpin.read() fpin.close() if endrec[0:4] == "PK\005\006" and endre... | 7e473800c31e650ad573e5af21a6ed63e155c2f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e473800c31e650ad573e5af21a6ed63e155c2f6/zipfile.py |
sentence_end = ".?!" | sentence_end_re = re.compile(r'[%s]' r'[\.\!\?]' r'[\"\']?' % string.lowercase) | def islower (c): return c in string.lowercase | 9b4864e40af38eee803b65e9a336a1590b0f633e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b4864e40af38eee803b65e9a336a1590b0f633e/textwrap.py |
punct = self.sentence_end | pat = self.sentence_end_re | def _fix_sentence_endings (self, chunks): """_fix_sentence_endings(chunks : [string]) | 9b4864e40af38eee803b65e9a336a1590b0f633e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b4864e40af38eee803b65e9a336a1590b0f633e/textwrap.py |
if (chunks[i][-1] in punct and chunks[i+1] == " " and islower(chunks[i][-2])): | if chunks[i+1] == " " and pat.search(chunks[i]): | def _fix_sentence_endings (self, chunks): """_fix_sentence_endings(chunks : [string]) | 9b4864e40af38eee803b65e9a336a1590b0f633e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b4864e40af38eee803b65e9a336a1590b0f633e/textwrap.py |
self._file.write(struct.pack('<lsslhhllhhs', | self._file.write(struct.pack('<l4s4slhhllhh4s', | def _write_header(self, initlength): self._file.write('RIFF') if not self._nframes: self._nframes = initlength / (self._nchannels * self._sampwidth) self._datalength = self._nframes * self._nchannels * self._sampwidth self._form_length_pos = self._file.tell() self._file.write(struct.pack('<lsslhhllhhs', 36 + self._data... | eca576c68be8299b006251eeea0f23068520ed57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eca576c68be8299b006251eeea0f23068520ed57/wave.py |
print cmd | def _remote(self, action, autoraise): raise_opt = ("-noraise", "-raise")[autoraise] cmd = "%s %s -remote '%s' >/dev/null 2>&1" % (self.name, raise_opt, action) print cmd rc = os.system(cmd) if rc: import time os.system("%s &" % self.name) time.sleep(PROCESS_CREATION_DELAY) rc = os.system(cmd) return not rc | cb33165ca2f8c1493b511bb7b38b44ede4211280 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cb33165ca2f8c1493b511bb7b38b44ede4211280/webbrowser.py | |
_tryorder = ("mozilla","netscape","kfm","grail","links","lynx","w3m") | _tryorder = ["mozilla","netscape","kfm","grail","links","lynx","w3m"] | def open_new(self, url): self.open(url) | cb33165ca2f8c1493b511bb7b38b44ede4211280 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cb33165ca2f8c1493b511bb7b38b44ede4211280/webbrowser.py |
_tryorder = ("netscape", "windows-default") | _tryorder = ["netscape", "windows-default"] | def open_new(self, url): self.open(url) | cb33165ca2f8c1493b511bb7b38b44ede4211280 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cb33165ca2f8c1493b511bb7b38b44ede4211280/webbrowser.py |
_tryorder = ("internet-config", ) | _tryorder = ["internet-config"] | def open_new(self, url): self.open(url) | cb33165ca2f8c1493b511bb7b38b44ede4211280 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cb33165ca2f8c1493b511bb7b38b44ede4211280/webbrowser.py |
_tryorder = ("os2netscape",) | _tryorder = ["os2netscape"] | def open_new(self, url): self.open(url) | cb33165ca2f8c1493b511bb7b38b44ede4211280 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cb33165ca2f8c1493b511bb7b38b44ede4211280/webbrowser.py |
if hasattr(os, 'utime'): past = time.time() - 3 os.utime(testfile, (past, past)) else: time.sleep(3) | def test(): raise ValueError""" # if this test runs fast, test_bug737473.py will have same mtime # even if it's rewrited and it'll not reloaded. so adjust mtime # of original to past. if hasattr(os, 'utime'): past = time.time() - 3 os.utime(testfile, (past, past)) else: time.sleep(3) if 'test_bug737473' in sys.modul... | 4a8d8519106789688d9a10a5c20e7b0d29b70024 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4a8d8519106789688d9a10a5c20e7b0d29b70024/test_traceback.py | |
self.rfile.flush() | def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip... | b54c27c861ad71fc090939da4c5fdb4f5e3bc67c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b54c27c861ad71fc090939da4c5fdb4f5e3bc67c/CGIHTTPServer.py | |
return From(fromname, [('*', None)]) | return From(fromname, [('*', None)], lineno=nodelist[0][2]) | def import_from(self, nodelist): # import_from: 'from' dotted_name 'import' ('*' | # '(' import_as_names ')' | import_as_names) assert nodelist[0][1] == 'from' assert nodelist[1][0] == symbol.dotted_name assert nodelist[2][1] == 'import' fromname = self.com_dotted_name(nodelist[1]) if nodelist[3][0] == token.STAR: #... | 05522ad795fe83dd1ffee4923c36d2ee8890708c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05522ad795fe83dd1ffee4923c36d2ee8890708c/transformer.py |
test.test_support.run_unittest(XrangeTest) | test.test_support.run_unittest(BytesTest) | def test_main(): test.test_support.run_unittest(XrangeTest) | 5f6f27de4d9f7cb260e243cf517cec629e54e985 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f6f27de4d9f7cb260e243cf517cec629e54e985/test_bytes.py |
self.fail("Error testing host resolution mechanisms.") | self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqdn, repr(all_host_names))) | def testHostnameRes(self): # Testing hostname resolution mechanisms hostname = socket.gethostname() try: ip = socket.gethostbyname(hostname) except socket.error: # Probably name lookup wasn't set up right; skip this test return self.assert_(ip.find('.') >= 0, "Error resolving host to ip.") try: hname, aliases, ipaddrs ... | c667d052e5c10ef519c61fd9c2e2713cc99297a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c667d052e5c10ef519c61fd9c2e2713cc99297a9/test_socket.py |
interp = interp[:-5] = interp[-4:] | interp = interp[:-5] + interp[-4:] | def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip... | 0afde13b435f484ecbc3e95107d2318415f21d29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0afde13b435f484ecbc3e95107d2318415f21d29/CGIHTTPServer.py |
if a.index(-2,-10) != 0: raise TestFailed, 'list index, negative start argument' | if a.index(0,-4) != 2: raise TestFailed, 'list index, -start argument' if a.index(-2,-10) != 0: raise TestFailed, 'list index, very -start argument' | def __getitem__(self, key): return str(key) + '!!!' | 2743d87d7934535f16a0ea062a28c21ea18e5a24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2743d87d7934535f16a0ea062a28c21ea18e5a24/test_types.py |
raise TestFailed, 'list index, negative stop argument' | raise TestFailed, 'list index, very -stop argument' | def __getitem__(self, key): return str(key) + '!!!' | 2743d87d7934535f16a0ea062a28c21ea18e5a24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2743d87d7934535f16a0ea062a28c21ea18e5a24/test_types.py |
header.append(mapping[2*i]+256*mapping[2*i+1]) | if sys.byteorder == 'big': header.append(256*mapping[2*i]+mapping[2*i+1]) else: header.append(mapping[2*i]+256*mapping[2*i+1]) | def _optimize_unicode(charset, fixup): charmap = [0]*65536 negate = 0 for op, av in charset: if op is NEGATE: negate = 1 elif op is LITERAL: charmap[fixup(av)] = 1 elif op is RANGE: for i in range(fixup(av[0]), fixup(av[1])+1): charmap[i] = 1 elif op is CATEGORY: # XXX: could expand category return charset # cannot com... | 3550dd30bb8cb880840a4f1f492a7f3e9207cab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3550dd30bb8cb880840a4f1f492a7f3e9207cab9/sre_compile.py |
bp = bdb.Breakpoint.bpbynumber[int(i)] | try: i = int(i) except ValueError: print 'Breakpoint index %r is not a number' % i continue if not (0 <= i < len(bdb.Breakpoint.bpbynumber)): print 'No breakpoint numbered', i continue bp = bdb.Breakpoint.bpbynumber[i] | def do_enable(self, arg): args = arg.split() for i in args: bp = bdb.Breakpoint.bpbynumber[int(i)] if bp: bp.enable() | b1f8bab6542635cd32dfbebde3839f86819548ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b1f8bab6542635cd32dfbebde3839f86819548ab/pdb.py |
bp = bdb.Breakpoint.bpbynumber[int(i)] | try: i = int(i) except ValueError: print 'Breakpoint index %r is not a number' % i continue if not (0 <= i < len(bdb.Breakpoint.bpbynumber)): print 'No breakpoint numbered', i continue bp = bdb.Breakpoint.bpbynumber[i] | def do_disable(self, arg): args = arg.split() for i in args: bp = bdb.Breakpoint.bpbynumber[int(i)] if bp: bp.disable() | b1f8bab6542635cd32dfbebde3839f86819548ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b1f8bab6542635cd32dfbebde3839f86819548ab/pdb.py |
fp = open(pathname, "U") | if hasattr(sys.stdout, "newlines"): fp = open(pathname, "U") else: fp = open(pathname, "r") | def run_script(self, pathname): self.msg(2, "run_script", pathname) fp = open(pathname, "U") stuff = ("", "r", imp.PY_SOURCE) self.load_module('__main__', fp, pathname, stuff) | 919000e9ec36c513f08253091b71a3aead2aff08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/919000e9ec36c513f08253091b71a3aead2aff08/modulefinder.py |
fp = open(pathname, "U") | if hasattr(sys.stdout, "newlines"): fp = open(pathname, "U") else: fp = open(pathname, "r") | def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) fp = open(pathname, "U") stuff = (ext, "r", imp.PY_SOURCE) self.load_module(name, fp, pathname, stuff) | 919000e9ec36c513f08253091b71a3aead2aff08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/919000e9ec36c513f08253091b71a3aead2aff08/modulefinder.py |
def __init__(self, encoding=None): | def __init__(self, encoding=None, allow_none=0): | def __init__(self, encoding=None): self.memo = {} self.data = None self.encoding = encoding | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py |
self.allow_none = allow_none | def __init__(self, encoding=None): self.memo = {} self.data = None self.encoding = encoding | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py | |
def dumps(params, methodname=None, methodresponse=None, encoding=None): | def dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=0): | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments... | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py |
m = Marshaller(encoding) | m = Marshaller(encoding, allow_none) | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments... | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py |
def __init__(self, uri, transport=None, encoding=None, verbose=0): | def __init__(self, uri, transport=None, encoding=None, verbose=0, allow_none=0): | def __init__(self, uri, transport=None, encoding=None, verbose=0): # establish a "logical" server connection | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py |
self.__allow_none = allow_none | def __init__(self, uri, transport=None, encoding=None, verbose=0): # establish a "logical" server connection | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py | |
request = dumps(params, methodname, encoding=self.__encoding) | request = dumps(params, methodname, encoding=self.__encoding, allow_none=self.__allow_none) | def __request(self, methodname, params): # call a method on the remote server | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py |
server = ServerProxy("http://betty.userland.com") | server = ServerProxy("http://betty.userland.com") | def __getattr__(self, name): # magic method dispatcher return _Method(self.__request, name) | a4c2b7485b6c33d0d6221d1a4505350ea9353668 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a4c2b7485b6c33d0d6221d1a4505350ea9353668/xmlrpclib.py |
if value.sign == 1: self._sign = 0 else: self._sign = 1 | self._sign = value.sign | def __new__(cls, value="0", context=None): """Create a decimal point instance. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py | ||
diff = cmp(abs(op1), abs(op2)) | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py | |
if diff == 0: | if op1.int == op2.int: | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
if diff < 0: | if op1.int < op2.int: | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
if op1.sign == -1: result.sign = -1 | if op1.sign == 1: result.sign = 1 | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
result.sign = 1 | result.sign = 0 | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
elif op1.sign == -1: result.sign = -1 op1.sign, op2.sign = (1, 1) | elif op1.sign == 1: result.sign = 1 op1.sign, op2.sign = (0, 0) | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
result.sign = 1 | result.sign = 0 | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
if op2.sign == 1: | if op2.sign == 0: | def __add__(self, other, context=None): """Returns self + other. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
if sign: sign = -1 else: sign = 1 adjust = 0 | def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py | |
otherside = otherside._rescale(exp, context=context, watchexp=0) | otherside = otherside._rescale(exp, context=context, watchexp=0) | def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
def to_integral(self, a): """Rounds to an integer. | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py | ||
if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1 | elif isinstance(value, Decimal): self.sign = value._sign | def __init__(self, value=None): if value is None: self.sign = None self.int = 0 self.exp = None if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1 cum = 0 for digit in value._int: cum = cum * 10 + digit self.int = cum self.exp = value._exp if isinstance(value, tuple): self.sign = value[0]... | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
for digit in value._int: | for digit in value._int: | def __init__(self, value=None): if value is None: self.sign = None self.int = 0 self.exp = None if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1 cum = 0 for digit in value._int: cum = cum * 10 + digit self.int = cum self.exp = value._exp if isinstance(value, tuple): self.sign = value[0]... | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
if isinstance(value, tuple): | else: | def __init__(self, value=None): if value is None: self.sign = None self.int = 0 self.exp = None if isinstance(value, Decimal): if value._sign: self.sign = -1 else: self.sign = 1 cum = 0 for digit in value._int: cum = cum * 10 + digit self.int = cum self.exp = value._exp if isinstance(value, tuple): self.sign = value[0]... | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py |
def __neg__(self): if self.sign == 1: return _WorkRep( (-1, self.int, self.exp) ) else: return _WorkRep( (1, self.int, self.exp) ) def __abs__(self): if self.sign == -1: return -self else: return self def __cmp__(self, other): if self.exp != other.exp: raise ValueError("Operands not normalized: %r, %r" % (self, othe... | def __repr__(self): return "(%r, %r, %r)" % (self.sign, self.int, self.exp) | 17931de110ac84e6b0eb88d77a95798f8670765a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17931de110ac84e6b0eb88d77a95798f8670765a/decimal.py | |
state = [kThemeStateActive, kThemeStateInactive][not onoff] App.DrawThemeListBoxFrame(Qd.InsetRect(self._bounds, 1, 1), state) | def activate(self, onoff): self._activated = onoff if self._visible: self._list.LActivate(onoff) state = [kThemeStateActive, kThemeStateInactive][not onoff] App.DrawThemeListBoxFrame(Qd.InsetRect(self._bounds, 1, 1), state) if self._selected: self.drawselframe(onoff) | 59d5a9b5b7db3c84435d80224a825b8133654273 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59d5a9b5b7db3c84435d80224a825b8133654273/Wlists.py | |
if isinstance(s, StringType): | if isinstance(s, str): | def _is8bitstring(s): if isinstance(s, StringType): try: unicode(s, 'us-ascii') except UnicodeError: return True return False | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
self.__maxheaderlen = maxheaderlen | self._maxheaderlen = maxheaderlen | def __init__(self, outfp, mangle_from_=True, maxheaderlen=78): """Create the generator for message flattening. | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
return self.__class__(fp, self._mangle_from_, self.__maxheaderlen) | return self.__class__(fp, self._mangle_from_, self._maxheaderlen) | def clone(self, fp): """Clone this generator with the exact same options.""" return self.__class__(fp, self._mangle_from_, self.__maxheaderlen) | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
if self.__maxheaderlen == 0: | if self._maxheaderlen == 0: | def _write_headers(self, msg): for h, v in msg.items(): print >> self._fp, '%s:' % h, if self.__maxheaderlen == 0: # Explicit no-wrapping print >> self._fp, v elif isinstance(v, Header): # Header instances know what to do print >> self._fp, v.encode() elif _is8bitstring(v): # If we have raw 8bit data in a byte string, ... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
v, maxlinelen=self.__maxheaderlen, | v, maxlinelen=self._maxheaderlen, | def _write_headers(self, msg): for h, v in msg.items(): print >> self._fp, '%s:' % h, if self.__maxheaderlen == 0: # Explicit no-wrapping print >> self._fp, v elif isinstance(v, Header): # Header instances know what to do print >> self._fp, v.encode() elif _is8bitstring(v): # If we have raw 8bit data in a byte string, ... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
if not _isstring(payload): | if not isinstance(payload, basestring): | def _handle_text(self, msg): payload = msg.get_payload() if payload is None: return cset = msg.get_charset() if cset is not None: payload = cset.body_encode(payload) if not _isstring(payload): raise TypeError, 'string payload expected: %s' % type(payload) if self._mangle_from_: payload = fcre.sub('>From ', payload) sel... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
boundary = msg.get_boundary(failobj=_make_boundary()) print >> self._fp, '--' + boundary print >> self._fp, '\n' print >> self._fp, '--' + boundary + '--' return elif _isstring(subparts): | subparts = [] elif isinstance(subparts, basestring): | def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_bounda... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
elif not isinstance(subparts, ListType): | elif not isinstance(subparts, list): | def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_bounda... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_bounda... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py | ||
self._fp.write(msg.preamble) plines = NLCRE.split(msg.preamble) if plines <> [''] and plines[-1] <> '': self._fp.write('\n') | print >> self._fp, msg.preamble | def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_bounda... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
joiner = '\n--' + boundary + '\n' self._fp.write(joiner.join(msgtexts)) print >> self._fp, '\n--' + boundary + '--', | if msgtexts: self._fp.write(msgtexts.pop(0)) for body_part in msgtexts: print >> self._fp, '\n--' + boundary self._fp.write(body_part) self._fp.write('\n--' + boundary + '--') | def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_bounda... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
if not msg.epilogue.startswith('\n'): print >> self._fp | print >> self._fp | def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_bounda... | 36112f2d34253c36784302cb703977ec78ccc7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/36112f2d34253c36784302cb703977ec78ccc7b2/Generator.py |
filename = words[-1] infostuff = words[-5:-1] | filename = string.join(words[8:]) infostuff = words[5:] | def mirrorsubdir(f, localdir): pwd = f.pwd() if localdir and not os.path.isdir(localdir): if verbose: print 'Creating local directory', localdir try: makedir(localdir) except os.error, msg: print "Failed to establish local directory", localdir return infofilename = os.path.join(localdir, '.mirrorinfo') try: text = open... | aeeda5b276e26eafa8c1e8fa8af08c0af7d7f34c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/aeeda5b276e26eafa8c1e8fa8af08c0af7d7f34c/ftpmirror.py |
assert output_dir is not None | if output_dir is None: output_dir = '' | def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): assert output_dir is not None obj_names = [] for src_name in source_filenames: base, ext = os.path.splitext(src_name) if ext not in self.src_extensions: raise UnknownFileError, \ "unknown file type '%s' (from '%s')" % (ext, src_name) if strip_dir... | cc3a6df506db57d614225b3657b4e97efc078970 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc3a6df506db57d614225b3657b4e97efc078970/ccompiler.py |
strip_dir=python_build, | strip_dir=0, | def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra): """Process arguments and decide which source files to compile. | ad647859f4e45af749ca2f5a5bc45aaad3b1ca20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad647859f4e45af749ca2f5a5bc45aaad3b1ca20/ccompiler.py |
objects = self.object_filenames(sources, strip_dir=python_build, output_dir=output_dir) | objects = self.object_filenames(sources, output_dir=output_dir) | def _prep_compile(self, sources, output_dir, depends=None): """Decide which souce files must be recompiled. | ad647859f4e45af749ca2f5a5bc45aaad3b1ca20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad647859f4e45af749ca2f5a5bc45aaad3b1ca20/ccompiler.py |
uchunks = [unicode(s, str(charset)) for s, charset in self._chunks] return u''.join(uchunks) | uchunks = [] lastcs = None for s, charset in self._chunks: nextcs = charset if uchunks: if lastcs is not None: if nextcs is None or nextcs == 'us-ascii': uchunks.append(USPACE) nextcs = None elif nextcs is not None and nextcs <> 'us-ascii': uchunks.append(USPACE) lastcs = nextcs uchunks.append(unicode(s, str(charse... | def __unicode__(self): """Helper for the built-in unicode function.""" # charset item is a Charset instance so we need to stringify it. uchunks = [unicode(s, str(charset)) for s, charset in self._chunks] return u''.join(uchunks) | 484880534160893c610e5e3a723cf8a3d9f8f116 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/484880534160893c610e5e3a723cf8a3d9f8f116/Header.py |
_urandomfd = None | def _pickle_statvfs_result(sr): (type, args) = sr.__reduce__() return (_make_statvfs_result, args) | 9e43acf2f31e67a976475c2c9f8674dd27571cc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e43acf2f31e67a976475c2c9f8674dd27571cc6/os.py | |
global _urandomfd if _urandomfd is None: try: _urandomfd = open("/dev/urandom", O_RDONLY) except: _urandomfd = NotImplementedError if _urandomfd is NotImplementedError: | try: _urandomfd = open("/dev/urandom", O_RDONLY) except: | def urandom(n): """urandom(n) -> str | 9e43acf2f31e67a976475c2c9f8674dd27571cc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e43acf2f31e67a976475c2c9f8674dd27571cc6/os.py |
value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value == output and type(value) is type(output): | value = f(*args) self.assertEqual(output, value) self.assert_(type(output) is type(value)) | def test(method, input, output, *args): if verbose: print '%s.%s%s =? %s... ' % (repr(input), method, args, repr(output)), try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value == output and type(value) is type(output): # if the original i... | 28256f276e1d61d54301b874958fc78c26117c9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/28256f276e1d61d54301b874958fc78c26117c9e/test_unicode.py |
try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] if value is input: if verbose: print 'no' print '*',f, `input`, `output`, `value` return if value != output or type(value) is not type(output): if verbose: print 'no' print '*',f, `input`, `output`, `value` if e... | f = getattr(input, method) value = f(*args) self.assertEqual(output, value) self.assert_(input is not value) def test_capitalize(self): self.checkmethod('capitalize', u' hello ', u' hello ') self.checkmethod('capitalize', u'Hello ', u'Hello ') self.checkmethod('capitalize', u'hello ', u'Hello ') self.checkmethod('capi... | def __repr__(self): return 'usub(%r)' % unicode.__repr__(self) | 28256f276e1d61d54301b874958fc78c26117c9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/28256f276e1d61d54301b874958fc78c26117c9e/test_unicode.py |
return None codecs.register(search_function) self.assertRaises(TypeError, "hello".decode, "test.unicode1") self.assertRaises(TypeError, unicode, "hello", "test.unicode2") self.assertRaises(TypeError, u"hello".encode, "test.unicode1") self.assertRaises(TypeError, u"hello".encode, "test.unicode2") import imp self.assert... | def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le... | 28256f276e1d61d54301b874958fc78c26117c9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/28256f276e1d61d54301b874958fc78c26117c9e/test_unicode.py | |
else: pass verify('...%(foo)s...' % {'foo':u"abc"} == u'...abc...') verify('...%(foo)s...' % {'foo':"abc"} == '...abc...') verify('...%(foo)s...' % {u'foo':"abc"} == '...abc...') verify('...%(foo)s...' % {u'foo':u"abc"} == u'...abc...') verify('...%(foo)s...' % {u'foo':u"abc",'def':123} == u'...abc...') verify('...... | out = BitBucket() print >>out, u'abc' print >>out, u'abc', u'def' print >>out, u'abc', 'def' print >>out, 'abc', u'def' print >>out, u'abc\n' print >>out, u'abc\n', print >>out, u'abc\n', print >>out, u'def\n' print >>out, u'def\n' def test_mul(self): self.checkmethod('__mul__', u'abc', u'', -1) self.checkmethod('__m... | def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le... | 28256f276e1d61d54301b874958fc78c26117c9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/28256f276e1d61d54301b874958fc78c26117c9e/test_unicode.py |
print dir(tas) | print fixdir(dir(tas)) | def runtest(hier, code): root = tempfile.mktemp() mkhier(root, hier) savepath = sys.path[:] codefile = tempfile.mktemp() f = open(codefile, "w") f.write(code) f.close() try: sys.path.insert(0, root) if verbose: print "sys.path =", sys.path try: execfile(codefile, globals(), {}) except: traceback.print_exc(file=sys.stdo... | d304f44906b818c7e336fcbb99241516c9170d29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d304f44906b818c7e336fcbb99241516c9170d29/test_pkg.py |
print dir(subpar) | print fixdir(dir(subpar)) | def runtest(hier, code): root = tempfile.mktemp() mkhier(root, hier) savepath = sys.path[:] codefile = tempfile.mktemp() f = open(codefile, "w") f.write(code) f.close() try: sys.path.insert(0, root) if verbose: print "sys.path =", sys.path try: execfile(codefile, globals(), {}) except: traceback.print_exc(file=sys.stdo... | d304f44906b818c7e336fcbb99241516c9170d29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d304f44906b818c7e336fcbb99241516c9170d29/test_pkg.py |
print dir(subsubsub) | print fixdir(dir(subsubsub)) | def runtest(hier, code): root = tempfile.mktemp() mkhier(root, hier) savepath = sys.path[:] codefile = tempfile.mktemp() f = open(codefile, "w") f.write(code) f.close() try: sys.path.insert(0, root) if verbose: print "sys.path =", sys.path try: execfile(codefile, globals(), {}) except: traceback.print_exc(file=sys.stdo... | d304f44906b818c7e336fcbb99241516c9170d29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d304f44906b818c7e336fcbb99241516c9170d29/test_pkg.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.