rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
try: self.__buf = self.__buf + struct.pack('>f', x) | try: self.__buf.write(struct.pack('>f', x)) | def pack_float(self, x): try: self.__buf = self.__buf + struct.pack('>f', x) except struct.error, msg: raise ConversionError, msg | c47016ee74fdd765bdad0f890c810518501de22a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c47016ee74fdd765bdad0f890c810518501de22a/xdrlib.py |
try: self.__buf = self.__buf + struct.pack('>d', x) | try: self.__buf.write(struct.pack('>d', x)) | def pack_double(self, x): try: self.__buf = self.__buf + struct.pack('>d', x) except struct.error, msg: raise ConversionError, msg | c47016ee74fdd765bdad0f890c810518501de22a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c47016ee74fdd765bdad0f890c810518501de22a/xdrlib.py |
self.__buf = self.__buf + data | self.__buf.write(data) | def pack_fstring(self, n, s): if n < 0: raise ValueError, 'fstring size must be nonnegative' n = ((n+3)/4)*4 data = s[:n] data = data + (n - len(data)) * '\0' self.__buf = self.__buf + data | c47016ee74fdd765bdad0f890c810518501de22a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c47016ee74fdd765bdad0f890c810518501de22a/xdrlib.py |
self.hashcode = random.randrange(1000000000) def __hash__(self): return self.hashcode | def __hash__(self): return 42 | def __init__(self, i): # Comparison outcomes are determined by the value of i. self.i = i | dc5f6b232be9f669f78d627cdcacc07d2ba167af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc5f6b232be9f669f78d627cdcacc07d2ba167af/test_mutants.py |
XXX | def test_one(n): global mutate, dict1, dict2, dict1keys, dict2keys # Fill the dicts without mutating them. mutate = 0 dict1keys = fill_dict(dict1, range(n), n) dict2keys = fill_dict(dict2, range(n), n) # Enable mutation, then compare the dicts so long as they have the # same size. mutate = 1 if verbose: print "trying... | dc5f6b232be9f669f78d627cdcacc07d2ba167af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc5f6b232be9f669f78d627cdcacc07d2ba167af/test_mutants.py | |
parts = parts[1:] | parts = parts[1:] | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 1b3c04b510c875fd3e31d13b73e76d3702bf99a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b3c04b510c875fd3e31d13b73e76d3702bf99a0/unittest.py |
for key, val in dict.items(): | for key in dict.keys(): | def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st... | 2e3f7bece07f3c40f0fe1785b83dd90aea59cb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e3f7bece07f3c40f0fe1785b83dd90aea59cb34/xmllib.py |
key = key[6:] start, end = self.elements.get(key, (None, None)) | tag = key[6:] start, end = self.elements.get(tag, (None, None)) | def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st... | 2e3f7bece07f3c40f0fe1785b83dd90aea59cb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e3f7bece07f3c40f0fe1785b83dd90aea59cb34/xmllib.py |
self.elements[key] = val, end | self.elements[tag] = getattr(self, key), end | def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st... | 2e3f7bece07f3c40f0fe1785b83dd90aea59cb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e3f7bece07f3c40f0fe1785b83dd90aea59cb34/xmllib.py |
key = key[4:] start, end = self.elements.get(key, (None, None)) | tag = key[4:] start, end = self.elements.get(tag, (None, None)) | def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st... | 2e3f7bece07f3c40f0fe1785b83dd90aea59cb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e3f7bece07f3c40f0fe1785b83dd90aea59cb34/xmllib.py |
self.elements[key] = start, val | self.elements[tag] = start, getattr(self, key) | def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st... | 2e3f7bece07f3c40f0fe1785b83dd90aea59cb34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e3f7bece07f3c40f0fe1785b83dd90aea59cb34/xmllib.py |
try: f = eval('self.repr_' + typename) except AttributeError: | if hasattr(self, 'repr_' + typename): return getattr(self, 'repr_' + typename)(x, level) else: | def repr1(self, x, level): typename = `type(x)`[7:-2] # "<type '......'>" if ' ' in typename: parts = string.split(typename) typename = string.joinfields(parts, '_') try: f = eval('self.repr_' + typename) except AttributeError: s = `x` if len(s) > self.maxother: i = max(0, (self.maxother-3)/2) j = max(0, self.maxother-... | 8d2080d043629702a5a79b968e778bcf991dfd73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d2080d043629702a5a79b968e778bcf991dfd73/repr.py |
return f(x, level) | def repr1(self, x, level): typename = `type(x)`[7:-2] # "<type '......'>" if ' ' in typename: parts = string.split(typename) typename = string.joinfields(parts, '_') try: f = eval('self.repr_' + typename) except AttributeError: s = `x` if len(s) > self.maxother: i = max(0, (self.maxother-3)/2) j = max(0, self.maxother-... | 8d2080d043629702a5a79b968e778bcf991dfd73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d2080d043629702a5a79b968e778bcf991dfd73/repr.py | |
if inspect.isroutine(object): returnself.docroutine(*args) | if inspect.isroutine(object): return self.docroutine(*args) | def document(self, object, name=None, *args): """Generate documentation for an object.""" args = (object, name) + args if inspect.ismodule(object): return self.docmodule(*args) if inspect.isclass(object): return self.docclass(*args) if inspect.isroutine(object): returnself.docroutine(*args) return self.docother(*args) | 4f959d2c73463bdce97a0f2047c9964f2ca0d32d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f959d2c73463bdce97a0f2047c9964f2ca0d32d/pydoc.py |
def test_lc_numeric_basic(self): # Test nl_langinfo against localeconv for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) except Error: continue for li, lc in ((RADIXCHAR, "decimal_point"), (THOUSEP, "thousands_sep")): nl_radixchar = nl_langinfo(li) li_radixchar = localeconv()[lc] try: set_locale = setlocale... | bb459734550094e9ea85d327afe87dc179b59986 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb459734550094e9ea85d327afe87dc179b59986/test__locale.py | ||
def test_float_parsing(self): # Bug #1391872: Test whether float parsing is okay on European # locales. for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) except Error: continue self.assertEquals(int(eval('3.14') * 100), 314, "using eval('3.14') failed for %s" % loc) self.assertEquals(int(float('3.14') * 100... | bb459734550094e9ea85d327afe87dc179b59986 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb459734550094e9ea85d327afe87dc179b59986/test__locale.py | ||
map = socket_map | map = self._map | def add_channel(self, map=None): #self.log_info('adding channel %s' % self) if map is None: map = socket_map map[self._fileno] = self | f9ca40929241fa83c4fc7a8f2ba6c334286e5e16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f9ca40929241fa83c4fc7a8f2ba6c334286e5e16/asyncore.py |
map = socket_map | map = self._map | def del_channel(self, map=None): fd = self._fileno if map is None: map = socket_map if map.has_key(fd): #self.log_info('closing channel %d:%s' % (fd, self)) del map[fd] | f9ca40929241fa83c4fc7a8f2ba6c334286e5e16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f9ca40929241fa83c4fc7a8f2ba6c334286e5e16/asyncore.py |
def make_release_tree (self, base_dir, files): | 1b3a9af5cf4827ff8248a69ef01468044ae67f25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b3a9af5cf4827ff8248a69ef01468044ae67f25/dist.py | ||
self.announce ("making hard links in %s..." % base_dir) | try: link = os.link msg = "making hard links in %s..." % base_dir except AttributeError: link = 0 msg = "copying files to %s..." % base_dir self.announce (msg) | def make_release_tree (self, base_dir, files): | 1b3a9af5cf4827ff8248a69ef01468044ae67f25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b3a9af5cf4827ff8248a69ef01468044ae67f25/dist.py |
if not os.path.exists (dest): self.execute (os.link, (file, dest), "linking %s -> %s" % (file, dest)) | if link: if not os.path.exists (dest): self.execute (os.link, (file, dest), "linking %s -> %s" % (file, dest)) else: self.copy_file (file, dest) | def make_release_tree (self, base_dir, files): | 1b3a9af5cf4827ff8248a69ef01468044ae67f25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b3a9af5cf4827ff8248a69ef01468044ae67f25/dist.py |
("unable to create zip file '%s.zip':" + | ("unable to create zip file '%s.zip': " + | def make_zipfile (self, base_dir): | 1b3a9af5cf4827ff8248a69ef01468044ae67f25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b3a9af5cf4827ff8248a69ef01468044ae67f25/dist.py |
elif os.name == 'windows': if verbose: print string.join (cmd, ' ') if not dry_run: os.spawnv (os.P_WAIT, cmd[0], cmd[1:]) | elif os.name in ( 'nt', 'windows' ): _spawn_nt (cmd, search_path, verbose, dry_run) | def spawn (cmd, search_path=1, verbose=0, dry_run=0): """Run another program, specified as a command list 'cmd', in a new process. 'cmd' is just the argument list for the new process, ie. cmd[0] is the program to run and cmd[1:] are the rest of its arguments. There is no way to run a program with a name different fr... | 69628b0ad10f89a65902f5b911d1040ed9ae1ca2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69628b0ad10f89a65902f5b911d1040ed9ae1ca2/spawn.py |
self.copy_file(name, outfile, preserve_mode = 0) | self.copy_file(os.path.join(package_dir, name), outfile, preserve_mode = 0) | def run(self): # Copies all .py files, then also copies the txt and gif files build_py.run(self) assert self.packages == [idlelib] for name in txt_files: outfile = self.get_plain_outfile(self.build_lib, [idlelib], name) dir = os.path.dirname(outfile) self.mkpath(dir) self.copy_file(name, outfile, preserve_mode = 0) for... | dc46175dc35d47df87e2955fec899cf471d3135f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc46175dc35d47df87e2955fec899cf471d3135f/setup.py |
icons = [os.path.join("Icons",name) for name in Icons] | icons = [os.path.join(package_dir, "Icons",name) for name in Icons] txts = [os.path.join(package_dir, name) for name in txt_files] | def get_source_files(self): # returns the .py files, the .txt files, and the icons icons = [os.path.join("Icons",name) for name in Icons] return build_py.get_source_files(self)+txt_files+icons | dc46175dc35d47df87e2955fec899cf471d3135f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc46175dc35d47df87e2955fec899cf471d3135f/setup.py |
package_dir = {idlelib:'.'}, | package_dir = {idlelib: package_dir}, | def _bytecode_filenames(self, files): files = [n for n in files if n.endswith('.py')] return install_lib._bytecode_filenames(self,files) | dc46175dc35d47df87e2955fec899cf471d3135f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc46175dc35d47df87e2955fec899cf471d3135f/setup.py |
scripts = ['idle'] | scripts = [os.path.join(package_dir, 'idle')] | def _bytecode_filenames(self, files): files = [n for n in files if n.endswith('.py')] return install_lib._bytecode_filenames(self,files) | dc46175dc35d47df87e2955fec899cf471d3135f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc46175dc35d47df87e2955fec899cf471d3135f/setup.py |
import sys | if debug_stderr: sys.stderr = debug_stderr | def __init__(self): self.preffilepath = ":Python:PythonIDE preferences" Wapplication.Application.__init__(self, 'Pide') from Carbon import AE from Carbon import AppleEvents AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCore... | e0ba087d4476c43dd91cdf7779f3eea27c70bc12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e0ba087d4476c43dd91cdf7779f3eea27c70bc12/PythonIDEMain.py |
if not ':' in head: | if os.sep == ':' and not ':' in head: | def mkdirs(dst): """Make directories leading to 'dst' if they don't exist yet""" if dst == '' or os.path.exists(dst): return head, tail = os.path.split(dst) if not ':' in head: head = head + ':' mkdirs(head) os.mkdir(dst, 0777) | d64845dbbec63c44a0a23b558b3cfe12dbc495fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d64845dbbec63c44a0a23b558b3cfe12dbc495fc/macostools.py |
expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT) self.assertEquals( compile_command(str, "<input>", symbol), expected) | if is_jython: code = compile_command(str, "<input>", symbol) self.assert_(code) if symbol == "single": d,r = {},{} sys.stdout = cStringIO.StringIO() try: exec code in d exec compile(str,"<input>","single") in r finally: sys.stdout = sys.__stdout__ elif symbol == 'eval': ctx = {'a': 2} d = { 'value': eval(code,ctx) } r ... | def assertValid(self, str, symbol='single'): '''succeed iff str is a valid piece of code''' expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT) self.assertEquals( compile_command(str, "<input>", symbol), expected) | de9a0d3158df0278d83754740f33276f780cef90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de9a0d3158df0278d83754740f33276f780cef90/test_codeop.py |
self.assertEquals(compile_command(""), compile("pass", "<input>", 'single', PyCF_DONT_IMPLY_DEDENT)) | av("a = 9+ \\\n3") | av("def x():\n pass\n") | de9a0d3158df0278d83754740f33276f780cef90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de9a0d3158df0278d83754740f33276f780cef90/test_codeop.py |
ai("def x():\n") | ai("def x():\n") | de9a0d3158df0278d83754740f33276f780cef90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de9a0d3158df0278d83754740f33276f780cef90/test_codeop.py | |
ai("a = (") | ai("if 1:") ai("if 1:\n") ai("if 1:\n pass\n if 1:\n pass\n else:") ai("if 1:\n pass\n if 1:\n pass\n else:\n") ai("if 1:\n pass\n if 1:\n pass\n else:\n pass") ai("def x():") ai("def x():\n") ai("def x():\n\n") ai("def x():\n pass") ai("def x():\n pass\n ") ai("def x():\n pass\n ") ai("\n\ndef x():\n pass")... | ai("def x():\n") | de9a0d3158df0278d83754740f33276f780cef90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de9a0d3158df0278d83754740f33276f780cef90/test_codeop.py |
r = (24 - currentHour) * 60 * 60 r = r + (59 - currentMinute) * 60 r = r + (59 - currentSecond) | if (currentMinute == 0) and (currentSecond == 0): r = (24 - currentHour) * 60 * 60 else: r = (23 - currentHour) * 60 * 60 r = r + (59 - currentMinute) * 60 r = r + (60 - currentSecond) | def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None): BaseRotatingHandler.__init__(self, filename, 'a', encoding) self.when = string.upper(when) self.backupCount = backupCount # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filen... | 74a83e9ffbee00288bbc1ddd0e5a40e84a03b4af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74a83e9ffbee00288bbc1ddd0e5a40e84a03b4af/handlers.py |
self.flags = [] | self.flags = 0 | def __init__(self): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def setflag(self, flag): if flag in self.flags: self.flags.append(flag) | def setflag(self, flag): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | |
self.flags = [] | def __init__(self, pattern, data=None): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | |
lo = lo + i * av[0] hi = hi + j * av[1] | lo = lo + long(i) * av[0] hi = hi + long(j) * av[1] | def getwidth(self): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def set(self, flag): if not flag in self.flags: self.flags.append(flag) def reset(self, flag): if flag in self.flags: self.flags.remove(flag) | def set(self, flag): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | |
self.string = list(string) | self.index = 0 self.string = string | def __init__(self, string): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
if not self.string: | if self.index >= len(self.string): | def __next(self): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
char = self.string[0] | char = self.string[self.index] | def __next(self): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
c = self.string[1] | c = self.string[self.index + 1] | def __next(self): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
try: if c == "x": for i in xrange(2, sys.maxint): c = self.string[i] if str(c) not in HEXDIGITS: break char = char + c elif str(c) in DIGITS: for i in xrange(2, sys.maxint): c = self.string[i] if str(c) not in DIGITS: break char = char + c except IndexError: pass del self.string[0:len(char)] | self.index = self.index + len(char) | def __next(self): | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def _fixescape(escape, character_class=0): if character_class: code = ESCAPES.get(escape) if code: return code code = CATEGORIES.get(escape) else: code = CATEGORIES.get(escape) if code: return code code = ESCAPES.get(escape) | def _group(escape, state): try: group = int(escape[1:]) if group and group < state.groups: return group except ValueError: pass return None def _class_escape(source, escape): code = ESCAPES.get(escape) | def _fixescape(escape, character_class=0): # convert escape to (type, value) if character_class: # inside a character class, we'll look in the character # escapes dictionary first code = ESCAPES.get(escape) if code: return code code = CATEGORIES.get(escape) else: code = CATEGORIES.get(escape) if code: return code code ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
if not character_class: try: group = int(escape[1:]) return GROUP, group except ValueError: pass | code = CATEGORIES.get(escape) if code: return code | def _fixescape(escape, character_class=0): # convert escape to (type, value) if character_class: # inside a character class, we'll look in the character # escapes dictionary first code = ESCAPES.get(escape) if code: return code code = CATEGORIES.get(escape) else: code = CATEGORIES.get(escape) if code: return code code ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
return LITERAL, chr(int(escape[-2:], 16) & 0xff) elif str(escape[1:2]) in DIGITS: return LITERAL, chr(int(escape[1:], 8) & 0xff) elif len(escape) == 2: | return LITERAL, chr(int(escape[-4:], 16) & 0xff) elif str(escape[1:2]) in OCTDIGITS: while source.next in OCTDIGITS: escape = escape + source.get() escape = escape[1:] return LITERAL, chr(int(escape[-6:], 8) & 0xff) if len(escape) == 2: | def _fixescape(escape, character_class=0): # convert escape to (type, value) if character_class: # inside a character class, we'll look in the character # escapes dictionary first code = ESCAPES.get(escape) if code: return code code = CATEGORIES.get(escape) else: code = CATEGORIES.get(escape) if code: return code code ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def _branch(subpattern, items): | def _escape(source, escape, state): code = CATEGORIES.get(escape) if code: return code code = ESCAPES.get(escape) if code: return code try: if escape[1:2] == "x": while source.next in HEXDIGITS: escape = escape + source.get() escape = escape[2:] return LITERAL, chr(int(escape[-4:], 16) & 0xff) elif str(escape[1:2]) i... | def _branch(subpattern, items): # form a branch operator from a set of items (FIXME: move this # optimization to the compiler module!) # check if all items share a common prefix while 1: prefix = None for item in items: if not item: break if prefix is None: prefix = item[0] elif item[0] != prefix: break else: # all s... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
return | return subpattern | def _branch(subpattern, items): # form a branch operator from a set of items (FIXME: move this # optimization to the compiler module!) # check if all items share a common prefix while 1: prefix = None for item in items: if not item: break if prefix is None: prefix = item[0] elif item[0] != prefix: break else: # all s... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def _parse(source, pattern, flags=()): | return subpattern def _parse(source, state, flags=0): | def _branch(subpattern, items): # form a branch operator from a set of items (FIXME: move this # optimization to the compiler module!) # check if all items share a common prefix while 1: prefix = None for item in items: if not item: break if prefix is None: prefix = item[0] elif item[0] != prefix: break else: # all s... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
subpattern = SubPattern(pattern) this = None | subpattern = SubPattern(state) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
code1 = _fixescape(this, 1) | code1 = _class_escape(source, this) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
code2 = _fixescape(this, 1) | code2 = _class_escape(source, this) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | ||
min, max = 0, sys.maxint | min, max = 0, MAXREPEAT | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
min, max = 1, sys.maxint | min, max = 1, MAXREPEAT | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
min, max = 0, sys.maxint | min, max = 0, MAXREPEAT | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | ||
index = len(subpattern)-1 while subpattern[index][0] is MARK: index = index - 1 item = subpattern[index:index+1] | item = subpattern[-1:] | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
subpattern[index] = (MIN_REPEAT, (min, max, item)) | subpattern[-1] = (MIN_REPEAT, (min, max, item)) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
subpattern[index] = (MAX_REPEAT, (min, max, item)) | subpattern[-1] = (MAX_REPEAT, (min, max, item)) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | ||
if char is None or char == ">": | if char is None: raise SyntaxError, "unterminated name" if char == ">": | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
elif source.match_set("iI"): pattern.setflag("i") elif source.match_set("lL"): pattern.setflag("l") elif source.match_set("mM"): pattern.setflag("m") elif source.match_set("sS"): pattern.setflag("s") elif source.match_set("xX"): pattern.setflag("x") | elif source.match(" while 1: char = source.get() if char is None or char == ")": break else: while FLAGS.has_key(source.next): state.flags = state.flags | FLAGS[source.get()] | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
group = pattern.getgroup(name) if group: subpattern.append((MARK, (group-1)*2)) | group = state.getgroup(name) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
p = _parse(source, pattern, flags) | p = _parse(source, state, flags) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
_branch(subpattern, b) else: subpattern.append((SUBPATTERN, (group, p))) | p = _branch(state, b) subpattern.append((SUBPATTERN, (group, p))) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
if group: subpattern.append((MARK, (group-1)*2+1)) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | |
def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py | ||
code =_fixescape(this) | code = _escape(source, this, state) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: ... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def parse(source, flags=()): s = Tokenizer(source) g = Pattern() | def parse(pattern, flags=0): source = Tokenizer(pattern) state = State() | def parse(source, flags=()): s = Tokenizer(source) g = Pattern() b = [] while 1: p = _parse(s, g, flags) tail = s.get() if tail == "|": b.append(p) elif tail == ")": raise SyntaxError, "unbalanced parenthesis" elif tail is None: if b: b.append(p) p = SubPattern(g) _branch(p, b) break else: raise SyntaxError, "bogus cha... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
p = _parse(s, g, flags) tail = s.get() | p = _parse(source, state, flags) tail = source.get() | def parse(source, flags=()): s = Tokenizer(source) g = Pattern() b = [] while 1: p = _parse(s, g, flags) tail = s.get() if tail == "|": b.append(p) elif tail == ")": raise SyntaxError, "unbalanced parenthesis" elif tail is None: if b: b.append(p) p = SubPattern(g) _branch(p, b) break else: raise SyntaxError, "bogus cha... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
p = SubPattern(g) _branch(p, b) | p = _branch(state, b) | def parse(source, flags=()): s = Tokenizer(source) g = Pattern() b = [] while 1: p = _parse(s, g, flags) tail = s.get() if tail == "|": b.append(p) elif tail == ")": raise SyntaxError, "unbalanced parenthesis" elif tail is None: if b: b.append(p) p = SubPattern(g) _branch(p, b) break else: raise SyntaxError, "bogus cha... | 815d5b934b8e8c0b7832353593050a6db660f517 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/815d5b934b8e8c0b7832353593050a6db660f517/sre_parse.py |
def getlongresp(self): | def getlongresp(self,fileHandle=None): | def getlongresp(self): """Internal: get a response plus following text from the server. Raise various errors if the response indicates an error.""" resp = self.getresp() if resp[:3] not in LONGRESP: raise NNTPReplyError(resp) list = [] while 1: line = self.getline() if line == '.': break if line[:2] == '..': line = lin... | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
resp = self.getresp() if resp[:3] not in LONGRESP: raise NNTPReplyError(resp) list = [] while 1: line = self.getline() if line == '.': break if line[:2] == '..': line = line[1:] list.append(line) | openedFile = None try: if isinstance(fileHandle, types.StringType): openedFile = fileHandle = open(fileHandle, "w") resp = self.getresp() if resp[:3] not in LONGRESP: raise NNTPReplyError(resp) list = [] while 1: line = self.getline() if line == '.': break if line[:2] == '..': line = line[1:] if fileHandle: fileHand... | def getlongresp(self): """Internal: get a response plus following text from the server. Raise various errors if the response indicates an error.""" resp = self.getresp() if resp[:3] not in LONGRESP: raise NNTPReplyError(resp) list = [] while 1: line = self.getline() if line == '.': break if line[:2] == '..': line = lin... | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
def longcmd(self, line): | def longcmd(self, line, fileHandle=None): | def longcmd(self, line): """Internal: send a command and get the response plus following text.""" self.putcmd(line) return self.getlongresp() | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
return self.getlongresp() | return self.getlongresp(fileHandle) | def longcmd(self, line): """Internal: send a command and get the response plus following text.""" self.putcmd(line) return self.getlongresp() | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
def artcmd(self, line): | def artcmd(self, line, fileHandle=None): | def artcmd(self, line): """Internal: process a HEAD, BODY or ARTICLE command.""" resp, list = self.longcmd(line) resp, nr, id = self.statparse(resp) return resp, nr, id, list | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
resp, list = self.longcmd(line) | resp, list = self.longcmd(line,fileHandle) | def artcmd(self, line): """Internal: process a HEAD, BODY or ARTICLE command.""" resp, list = self.longcmd(line) resp, nr, id = self.statparse(resp) return resp, nr, id, list | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
def body(self, id): | def body(self, id, fileHandle=None): | def body(self, id): """Process a BODY command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: article number - id: message id - list: the lines of the article's body""" | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
- list: the lines of the article's body""" return self.artcmd('BODY ' + id) | - list: the lines of the article's body or an empty list if fileHandle was used""" return self.artcmd('BODY ' + id, fileHandle) | def body(self, id): """Process a BODY command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: article number - id: message id - list: the lines of the article's body""" | d1d584f4e820dc893175cdde74b901b6808ed3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1d584f4e820dc893175cdde74b901b6808ed3ab/nntplib.py |
if callable(template): filter = template else: template = _compile_repl(template, pattern) if not template[0] and len(template[1]) == 1: filter = template[1][0] else: def filter(match, template=template): return sre_parse.expand_template(template, match) | template = _compile_repl(template, pattern) if not template[0] and len(template[1]) == 1: return template[1][0] def filter(match, template=template): return sre_parse.expand_template(template, match) | def _subx(pattern, template): # internal: pattern.sub/subn implementation helper if callable(template): filter = template else: template = _compile_repl(template, pattern) if not template[0] and len(template[1]) == 1: # literal replacement filter = template[1][0] else: def filter(match, template=template): return sre_p... | dac58492aa3bf476fa0b4b586edababfe3aaca53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dac58492aa3bf476fa0b4b586edababfe3aaca53/sre.py |
def _sub(pattern, template, text, count=0): return _subn(pattern, template, text, count)[0] def _subn(pattern, template, text, count=0): filter = _subx(pattern, template) if not callable(filter): def filter(match, literal=filter): return literal n = i = 0 s = [] append = s.append c = pattern.scanner(text) while ... | def filter(match, template=template): return sre_parse.expand_template(template, match) | dac58492aa3bf476fa0b4b586edababfe3aaca53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dac58492aa3bf476fa0b4b586edababfe3aaca53/sre.py | |
if _iscommand("kfm") or _iscommand("konqueror"): register("kfm", Konqueror, Konqueror()) | if _iscommand("kfm"): register("kfm", Konqueror, Konqueror("kfm")) elif _iscommand("konqueror"): register("konqueror", Konqueror, Konqueror("konqueror")) | def register_X_browsers(): # First, the Mozilla/Netscape browsers for browser in ("mozilla-firefox", "firefox", "mozilla-firebird", "firebird", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Mozilla(browser)) # The default Gnome browser if _iscommand("gconftool-2"): # get the web browser strin... | b980113a8df699797b837f103ac6d2049a214551 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b980113a8df699797b837f103ac6d2049a214551/webbrowser.py |
archive_basename = "%s.win32" % self.distribution.get_fullname() | fullname = self.distribution.get_fullname() archive_basename = os.path.join(self.bdist_dir, "%s.win32" % fullname) | def run (self): | fd9f168bcfea84b39f6bea55f7b57c1a62c162fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd9f168bcfea84b39f6bea55f7b57c1a62c162fe/bdist_wininst.py |
self.create_exe (arcname) | self.create_exe (arcname, fullname) | def run (self): | fd9f168bcfea84b39f6bea55f7b57c1a62c162fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd9f168bcfea84b39f6bea55f7b57c1a62c162fe/bdist_wininst.py |
def create_exe (self, arcname): | def create_exe (self, arcname, fullname): | def create_exe (self, arcname): import struct, zlib | fd9f168bcfea84b39f6bea55f7b57c1a62c162fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd9f168bcfea84b39f6bea55f7b57c1a62c162fe/bdist_wininst.py |
installer_name = "%s.win32.exe" % self.distribution.get_fullname() | installer_name = os.path.join(self.dist_dir, "%s.win32.exe" % fullname) | def create_exe (self, arcname): import struct, zlib | fd9f168bcfea84b39f6bea55f7b57c1a62c162fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd9f168bcfea84b39f6bea55f7b57c1a62c162fe/bdist_wininst.py |
if hasattr(m, "__file__"): | if hasattr(m, "__file__") and m.__file__: | def makepath(*paths): dir = os.path.join(*paths) return os.path.normcase(os.path.abspath(dir)) | 62d248892f8782d01cfeb1951d53eaeac81750fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62d248892f8782d01cfeb1951d53eaeac81750fe/site.py |
[here, os.path.join(here, os.pardir), os.curdir]) | [os.path.join(here, os.pardir), here, os.curdir]) | def __call__(self): self.__setup() prompt = 'Hit Return for more, or q (and Return) to quit: ' lineno = 0 while 1: try: for i in range(lineno, lineno + self.MAXLINES): print self.__lines[i] except IndexError: break else: lineno += self.MAXLINES key = None while key is None: key = raw_input(prompt) if key not in ('', 'q... | 62d248892f8782d01cfeb1951d53eaeac81750fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62d248892f8782d01cfeb1951d53eaeac81750fe/site.py |
if sys.platform == "darwin": supports_unicode_filenames = True else: supports_unicode_filenames = False | supports_unicode_filenames = False | def realpath(filename): """Return the canonical path of the specified filename, eliminating any | 2d4e988c35e5da0bf4bd35ca3eb6851e83970764 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d4e988c35e5da0bf4bd35ca3eb6851e83970764/posixpath.py |
def index(dir): """Return a list of (module-name, synopsis) pairs for a directory tree.""" results = [] for entry in os.listdir(dir): path = os.path.join(dir, entry) if ispackage(path): results.extend(map( lambda (m, s), pkg=entry: (pkg + '.' + m, s), index(path))) elif os.path.isfile(path) and entry[-3:] == '.py': res... | def index(dir): """Return a list of (module-name, synopsis) pairs for a directory tree.""" results = [] for entry in os.listdir(dir): path = os.path.join(dir, entry) if ispackage(path): results.extend(map( lambda (m, s), pkg=entry: (pkg + '.' + m, s), index(path))) elif os.path.isfile(path) and entry[-3:] == '.py': res... | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py | |
elif lower(filename[-4:]) == '.pyc': | elif lower(filename[-4:]) in ['.pyc', '.pyd', '.pyo']: | def modulename(path): """Return the Python module name for a given path, or None.""" filename = os.path.basename(path) if lower(filename[-3:]) == '.py': return filename[:-3] elif lower(filename[-4:]) == '.pyc': return filename[:-4] elif lower(filename[-11:]) == 'module.so': return filename[:-11] elif lower(filename[-13... | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py |
if inspect.ismethod(object): return apply(self.docmethod, args) if inspect.isbuiltin(object): return apply(self.docbuiltin, args) if inspect.isfunction(object): return apply(self.docfunction, args) | if inspect.isroutine(object): return apply(self.docroutine, args) | def document(self, object, *args): """Generate documentation for an object.""" args = (object,) + args if inspect.ismodule(object): return apply(self.docmodule, args) if inspect.isclass(object): return apply(self.docclass, args) if inspect.ismethod(object): return apply(self.docmethod, args) if inspect.isbuiltin(object... | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py |
<tr bgcolor="%s"><td colspan=3 valign=bottom><small><small><br></small></small ><font color="%s" face="helvetica, arial"> %s</font></td | <tr bgcolor="%s"><td> </td> <td valign=bottom><small><small><br></small></small ><font color="%s" face="helvetica"><br> %s</font></td | def heading(self, title, fgcol, bgcol, extras=''): """Format a page heading.""" return """ | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py |
><font color="%s" face="helvetica, arial"> %s</font></td></tr></table> """ % (bgcol, fgcol, title, fgcol, extras) | ><font color="%s" face="helvetica">%s</font></td><td> </td></tr></table> """ % (bgcol, fgcol, title, fgcol, extras or ' ') | def heading(self, title, fgcol, bgcol, extras=''): """Format a page heading.""" return """ | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py |
<tr bgcolor="%s"><td colspan=3 valign=bottom><small><small><br></small></small | <tr bgcolor="%s"><td rowspan=2> </td> <td colspan=3 valign=bottom><small><small><br></small></small | def section(self, title, fgcol, bgcol, contents, width=20, prelude='', marginalia=None, gap=' '): """Format a section with a heading.""" if marginalia is None: marginalia = ' ' * width result = """ | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py |
def footer(self): return """ <table width="100%"><tr><td align=right> <font face="helvetica, arial"><small><small>generated with <strong>htmldoc</strong> by Ka-Ping Yee</a></small></small></font> </td></tr></table> """ | def bigsection(self, title, *args): """Format a section with a big heading.""" title = '<big><strong>%s</strong></big>' % title return apply(self.section, (title,) + args) | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py | |
result = '' head = '<br><big><big><strong> %s</strong></big></big>' % name | parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color=" (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ result = '' head = '<br><big><big><strong> %s</strong></big></big>' % name try: path = os.path.abspath(inspect.getfile(object)) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink =... | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py |
result = result + self.heading( | result = self.heading( | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ result = '' head = '<br><big><big><strong> %s</strong></big></big>' % name try: path = os.path.abspath(inspect.getfile(object)) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink =... | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.