rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
while 1: | while True: | def recolorize_main(self): next = "1.0" while 1: item = self.tag_nextrange("TODO", next) if not item: break head, tail = item self.tag_remove("SYNC", head, tail) item = self.tag_prevrange("SYNC", head) if item: head = item[1] else: head = "1.0" | 23c51b7e2ad0cd0ebfb1f2688c21f331403da4b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/23c51b7e2ad0cd0ebfb1f2688c21f331403da4b8/ColorDelegator.py |
ok = 0 | ok = False | def recolorize_main(self): next = "1.0" while 1: item = self.tag_nextrange("TODO", next) if not item: break head, tail = item self.tag_remove("SYNC", head, tail) item = self.tag_prevrange("SYNC", head) if item: head = item[1] else: head = "1.0" | 23c51b7e2ad0cd0ebfb1f2688c21f331403da4b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/23c51b7e2ad0cd0ebfb1f2688c21f331403da4b8/ColorDelegator.py |
def readfp(self): | def readfp(self, fp): | def readfp(self): """Read a single mime.types-format file.""" map = self.types_map while 1: line = f.readline() if not line: break words = line.split() for i in range(len(words)): if words[i][0] == '#': del words[i:] break if not words: continue type, suffixes = words[0], words[1:] for suff in suffixes: map['.' + suff]... | 14e6604ab23f47e3f1203ea37922684331e8f1dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14e6604ab23f47e3f1203ea37922684331e8f1dc/mimetypes.py |
line = f.readline() | line = fp.readline() | def readfp(self): """Read a single mime.types-format file.""" map = self.types_map while 1: line = f.readline() if not line: break words = line.split() for i in range(len(words)): if words[i][0] == '#': del words[i:] break if not words: continue type, suffixes = words[0], words[1:] for suff in suffixes: map['.' + suff]... | 14e6604ab23f47e3f1203ea37922684331e8f1dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/14e6604ab23f47e3f1203ea37922684331e8f1dc/mimetypes.py |
print >>sys.stderr, "l1=%r, l2=%r, ignore=%r" % (l1, l2, ignore) | print >>sys.stderr, "l1=%r\nl2=%r\nignore=%r" % (l1, l2, ignore) | def assertListEq(self, l1, l2, ignore): ''' succeed iff {l1} - {ignore} == {l2} - {ignore} ''' try: for p1, p2 in (l1, l2), (l2, l1): for item in p1: ok = (item in p2) or (item in ignore) if not ok: self.fail("%r missing" % item) except: print >>sys.stderr, "l1=%r, l2=%r, ignore=%r" % (l1, l2, ignore) raise | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py |
if type(getattr(py_item, m)) == MethodType: | if ismethod(getattr(py_item, m), m): | def checkModule(self, moduleName, module=None, ignore=()): ''' succeed iff pyclbr.readmodule_ex(modulename) corresponds to the actual module object, module. Any identifiers in ignore are ignored. If no module is provided, the appropriate module is loaded with __import__.''' | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py |
self.assertListEq(foundMethods, actualMethods, ignore) self.assertEquals(py_item.__module__, value.module) | try: self.assertListEq(foundMethods, actualMethods, ignore) self.assertEquals(py_item.__module__, value.module) | def checkModule(self, moduleName, module=None, ignore=()): ''' succeed iff pyclbr.readmodule_ex(modulename) corresponds to the actual module object, module. Any identifiers in ignore are ignored. If no module is provided, the appropriate module is loaded with __import__.''' | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py |
self.assertEquals(py_item.__name__, value.name, ignore) | self.assertEquals(py_item.__name__, value.name, ignore) except: print >>sys.stderr, "class=%s" % py_item raise | def checkModule(self, moduleName, module=None, ignore=()): ''' succeed iff pyclbr.readmodule_ex(modulename) corresponds to the actual module object, module. Any identifiers in ignore are ignored. If no module is provided, the appropriate module is loaded with __import__.''' | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py |
self.checkModule('doctest', ignore=['_isclass', '_isfunction', '_ismodule', '_classify_class_attrs']) self.checkModule('rfc822', ignore=["get"]) | self.checkModule('doctest') self.checkModule('rfc822') | def test_easy(self): self.checkModule('pyclbr') self.checkModule('doctest', ignore=['_isclass', '_isfunction', '_ismodule', '_classify_class_attrs']) self.checkModule('rfc822', ignore=["get"]) self.checkModule('difflib') | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py |
def test_others(self): cm = self.checkModule | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py | ||
cm('cgi', ignore=('f', 'g', 'log')) cm('mhlib', ignore=('do', 'bisect')) cm('urllib', ignore=('getproxies_environment', 'getproxies_registry', 'open_https')) cm('pickle', ignore=('g',)) cm('aifc', ignore=('openfp',)) cm('Cookie', ignore=('__str__', 'Cookie')) cm('sre_parse', ignore=('literal', 'makedict', 'dump'... | cm('cgi', ignore=('log',)) cm('mhlib') cm('urllib', ignore=('getproxies_registry', 'open_https')) cm('pickle', ignore=('g',)) cm('aifc', ignore=('openfp',)) cm('Cookie') cm('sre_parse', ignore=('dump',)) cm('pdb') cm('pydoc') | def test_others(self): cm = self.checkModule | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py |
cm('test.test_pyclbr', ignore=('defined_in',)) | cm('test.test_pyclbr') | def test_others(self): cm = self.checkModule | 97a954f27e265b063a070d59d67f3b50b4d404bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97a954f27e265b063a070d59d67f3b50b4d404bb/test_pyclbr.py |
return st[stat.ST_MTIME] | return st[stat.ST_ATIME] | def getatime(filename): """Return the last access time of a file, reported by os.stat().""" st = os.stat(filename) return st[stat.ST_MTIME] | 5a3d2b8bab038301f414d510c1a8aacf56670603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5a3d2b8bab038301f414d510c1a8aacf56670603/posixpath.py |
if verbose: print "starting pause() loop..." | print "starting pause() loop..." | def force_test_exit(): # Sigh, both imports seem necessary to avoid errors. import os fork_pid = os.fork() if fork_pid: # In parent. return fork_pid # In child. import os, time try: # Wait 5 seconds longer than the expected alarm to give enough # time for the normal sequence of events to occur. This is # just a stop-... | 11fbca2526a5766131e45212497e4feed4e79200 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11fbca2526a5766131e45212497e4feed4e79200/test_signal.py |
def __hasattr__(self, attr): "Delegate attribute access to the interpreter object" return hasattr(self.tk, attr) def __delattr__(self, attr): "Delegate attribute access to the interpreter object" return delattr(self.tk, attr) | def __hasattr__(self, attr): "Delegate attribute access to the interpreter object" return hasattr(self.tk, attr) | dade502a066916c27f37d8c1fbff09249eeccded /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dade502a066916c27f37d8c1fbff09249eeccded/Tkinter.py | |
pass | if size > self.extrasize: size = self.extrasize | def read(self, size=None): if self.extrasize <= 0 and self.fileobj is None: return '' | 1b6f23d7919af1d6608a3e6eabf9c2564dc750d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1b6f23d7919af1d6608a3e6eabf9c2564dc750d9/gzip.py |
self.extrasize = len(self.extrabuf) | self.extrasize = len(buf) + self.extrasize | def _unread(self, buf): self.extrabuf = buf + self.extrabuf self.extrasize = len(self.extrabuf) | 1b6f23d7919af1d6608a3e6eabf9c2564dc750d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1b6f23d7919af1d6608a3e6eabf9c2564dc750d9/gzip.py |
return string.split(buf, '\n') | lines = string.split(buf, '\n') for i in range(len(lines)-1): lines[i] = lines[i] + '\n' if lines and not lines[-1]: del lines[-1] return lines | def readlines(self): buf = self.read() return string.split(buf, '\n') | 1b6f23d7919af1d6608a3e6eabf9c2564dc750d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1b6f23d7919af1d6608a3e6eabf9c2564dc750d9/gzip.py |
if url[:i] == 'http': | if url[:i] == 'http': | def urlparse(url, scheme = '', allow_fragments = 1): key = url, scheme, allow_fragments cached = _parse_cache.get(key, None) if cached: return cached if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() find = string.find netloc = path = params = query = fragment = '' i = find(url, ':') if i > 0... | 37b14f64ee6224c92225a6e432de593e14959773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/37b14f64ee6224c92225a6e432de593e14959773/urlparse.py |
fragment = url[i+1:] | def urlparse(url, scheme = '', allow_fragments = 1): key = url, scheme, allow_fragments cached = _parse_cache.get(key, None) if cached: return cached if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() find = string.find netloc = path = params = query = fragment = '' i = find(url, ':') if i > 0... | 37b14f64ee6224c92225a6e432de593e14959773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/37b14f64ee6224c92225a6e432de593e14959773/urlparse.py | |
query = url[i+1:] | def urlparse(url, scheme = '', allow_fragments = 1): key = url, scheme, allow_fragments cached = _parse_cache.get(key, None) if cached: return cached if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() find = string.find netloc = path = params = query = fragment = '' i = find(url, ':') if i > 0... | 37b14f64ee6224c92225a6e432de593e14959773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/37b14f64ee6224c92225a6e432de593e14959773/urlparse.py | |
params = url[i+1:] | def urlparse(url, scheme = '', allow_fragments = 1): key = url, scheme, allow_fragments cached = _parse_cache.get(key, None) if cached: return cached if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() find = string.find netloc = path = params = query = fragment = '' i = find(url, ':') if i > 0... | 37b14f64ee6224c92225a6e432de593e14959773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/37b14f64ee6224c92225a6e432de593e14959773/urlparse.py | |
SyntaxError: 'yield' outside function (<doctest test.test_generators.__test__.coroutine[10]>, line 1) | SyntaxError: 'yield' outside function (<doctest test.test_generators.__test__.coroutine[21]>, line 1) | >>> def f(): list(i for i in [(yield 26)]) | 7ec75c310a51b135d4907e5f20d244faa9a0f438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ec75c310a51b135d4907e5f20d244faa9a0f438/test_generators.py |
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.coroutine[11]>, line 1) | SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.coroutine[22]>, line 1) | >>> def f(): return lambda x=(yield): 1 | 7ec75c310a51b135d4907e5f20d244faa9a0f438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ec75c310a51b135d4907e5f20d244faa9a0f438/test_generators.py |
SyntaxError: assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[12]>, line 1) | SyntaxError: assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[23]>, line 1) >>> def f(): (yield bar) = y Traceback (most recent call last): ... SyntaxError: can't assign to yield expression (<doctest test.test_generators.__test__.coroutine[24]>, line 1) >>> def f(): (yield... | >>> def f(): x = yield = y | 7ec75c310a51b135d4907e5f20d244faa9a0f438 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ec75c310a51b135d4907e5f20d244faa9a0f438/test_generators.py |
(msg is None or mod.match(module)) and | (mod is None or mod.match(module)) and | def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: module = filename if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: registry = {} if isinstance(message, Warning): text = str(message) category = message.__c... | 37d0208e5d510bc9da42f15d8122edcce1f5ef3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/37d0208e5d510bc9da42f15d8122edcce1f5ef3c/warnings.py |
if self.disp.format == 'mono': nline = (len(data)*8)/self.vw elif self.disp.format == 'grey2': nline = (len(data)*4)/self.vw elif self.disp.format == 'grey4': nline = (len(data)*2)/self.vw else: nline = len(data)/self.vw if nline*self.vw <> len(data): print 'Incorrect-sized video fragment ignored' return | nline = len(data)/self.linewidth() if nline*self.linewidth() <> len(data): print 'Incorrect-sized video fragment ignored' return | def putnextpacket(self, pos, data): if self.disp.format == 'mono': # Unfortunately size-check is difficult for # packed video nline = (len(data)*8)/self.vw elif self.disp.format == 'grey2': nline = (len(data)*4)/self.vw elif self.disp.format == 'grey4': nline = (len(data)*2)/self.vw else: nline = len(data)/self.vw if n... | 11a506675edf1746a18f4af9ef54bc48ed370b0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11a506675edf1746a18f4af9ef54bc48ed370b0f/LiveVideoOut.py |
def handle(self): """ Handle multiple requests - each expected to be a 4-byte length, followed by the LogRecord in pickle format. Logs the record according to whatever policy is configured locally. """ while 1: try: chunk = self.connection.recv(4) if len(chunk) < 4: break slen = struct.unpack(">L", chunk)[0] #print sle... | 0844d53e3656902c7bcae91b70ecad553c369283 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0844d53e3656902c7bcae91b70ecad553c369283/test_logging.py | ||
rd, wr, ex = select([self.socket.fileno()], | rd, wr, ex = select.select([self.socket.fileno()], | def serve_until_stopped(self): abort = 0 while not abort: rd, wr, ex = select([self.socket.fileno()], [], [], self.timeout) if rd: self.handle_request() abort = self.abort | 0844d53e3656902c7bcae91b70ecad553c369283 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0844d53e3656902c7bcae91b70ecad553c369283/test_logging.py |
sys.stdout.write("About to start TCP server...\n") | def test_main(): rootLogger = logging.getLogger("") rootLogger.setLevel(logging.DEBUG) hdlr = logging.StreamHandler(sys.stdout) fmt = logging.Formatter(logging.BASIC_FORMAT) hdlr.setFormatter(fmt) rootLogger.addHandler(hdlr) #Set up a handler such that all events are sent via a socket to the log #receiver (logrecv). #... | 0844d53e3656902c7bcae91b70ecad553c369283 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0844d53e3656902c7bcae91b70ecad553c369283/test_logging.py | |
banner("logrecv output", "begin") sys.stdout.write(sockOut.getvalue()) sockOut.close() banner("logrecv output", "end") | def test_main(): rootLogger = logging.getLogger("") rootLogger.setLevel(logging.DEBUG) hdlr = logging.StreamHandler(sys.stdout) fmt = logging.Formatter(logging.BASIC_FORMAT) hdlr.setFormatter(fmt) rootLogger.addHandler(hdlr) #Set up a handler such that all events are sent via a socket to the log #receiver (logrecv). #... | 0844d53e3656902c7bcae91b70ecad553c369283 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0844d53e3656902c7bcae91b70ecad553c369283/test_logging.py | |
sys.stdout.flush() | def test_main(): rootLogger = logging.getLogger("") rootLogger.setLevel(logging.DEBUG) hdlr = logging.StreamHandler(sys.stdout) fmt = logging.Formatter(logging.BASIC_FORMAT) hdlr.setFormatter(fmt) rootLogger.addHandler(hdlr) #Set up a handler such that all events are sent via a socket to the log #receiver (logrecv). #... | 0844d53e3656902c7bcae91b70ecad553c369283 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0844d53e3656902c7bcae91b70ecad553c369283/test_logging.py | |
__import__(ext.name) | imp.load_dynamic(ext.name, ext_filename) | def build_extension(self, ext): | 5040d17b0506ec706385694db75b0cd71d5ab816 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5040d17b0506ec706385694db75b0cd71d5ab816/setup.py |
oparg = ord(code[i]) + ord(code[i+1])*256 | oparg = ord(code[i]) + ord(code[i+1])*256 + extended_arg extended_arg = 0 | def disassemble(co, lasti=-1): """Disassemble a code object.""" code = co.co_code labels = findlabels(code) n = len(code) i = 0 while i < n: c = code[i] op = ord(c) if op == SET_LINENO and i > 0: print # Extra blank line if i == lasti: print '-->', else: print ' ', if i in labels: print '>>', else: print ' ', print ... | aae123dd6672b549f7f87ca80e3dac359180254c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aae123dd6672b549f7f87ca80e3dac359180254c/dis.py |
self.simpleElement("real", str(value)) | self.simpleElement("real", repr(value)) | def writeValue(self, value): if isinstance(value, (str, unicode)): self.simpleElement("string", value) elif isinstance(value, bool): # must switch for bool before int, as bool is a # subclass of int... if value: self.simpleElement("true") else: self.simpleElement("false") elif isinstance(value, int): self.simpleElement... | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py |
import base64 | def fromBase64(cls, data): import base64 return cls(base64.decodestring(data)) | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py | |
import base64 | def asBase64(self): import base64 return base64.encodestring(self.data) | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py | |
"""Primitive date wrapper, uses time floats internally, is agnostic about time zones. | """Primitive date wrapper, uses UTC datetime instances internally. | def __repr__(self): return "%s(%s)" % (self.__class__.__name__, repr(self.data)) | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py |
if isinstance(date, str): from xml.utils.iso8601 import parse date = parse(date) | if isinstance(date, datetime.datetime): pass elif isinstance(date, (float, int)): date = datetime.datetime.fromtimestamp(date) elif isinstance(date, basestring): order = ('year', 'month', 'day', 'hour', 'minute', 'second') gd = _dateParser.match(date).groupdict() lst = [] for key in order: val = gd[key] if val is None:... | def __init__(self, date): if isinstance(date, str): from xml.utils.iso8601 import parse date = parse(date) self.date = date | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py |
from xml.utils.iso8601 import tostring return tostring(self.date) | d = self.date return '%04d-%02d-%02dT%02d:%02d:%02dZ' % ( d.year, d.month, d.day, d.second, d.minute, d.hour, ) | def toString(self): from xml.utils.iso8601 import tostring return tostring(self.date) | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py |
elif isinstance(other, (int, float)): return cmp(self.date, other) | elif isinstance(other, (datetime.datetime, float, int, basestring)): return cmp(self.date, Date(other).date) | def __cmp__(self, other): if isinstance(other, self.__class__): return cmp(self.date, other.date) elif isinstance(other, (int, float)): return cmp(self.date, other) else: return cmp(id(self), id(other)) | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py |
def parse(self, file): | def parse(self, fileobj): | def parse(self, file): from xml.parsers.expat import ParserCreate parser = ParserCreate() parser.StartElementHandler = self.handleBeginElement parser.EndElementHandler = self.handleEndElement parser.CharacterDataHandler = self.handleData parser.ParseFile(file) return self.root | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py |
parser.ParseFile(file) | parser.ParseFile(fileobj) | def parse(self, file): from xml.parsers.expat import ParserCreate parser = ParserCreate() parser.StartElementHandler = self.handleBeginElement parser.EndElementHandler = self.handleEndElement parser.CharacterDataHandler = self.handleData parser.ParseFile(file) return self.root | db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db18cae3fb4acb2ad7fd458106f7bd6f0e45be2f/plistlib.py |
compile_dir(dir, maxlevels, None, force) | success = success and compile_dir(dir, maxlevels, None, force) return success | def compile_path(skip_curdir=1, maxlevels=0, force=0): """Byte-compile all module on sys.path. Arguments (all optional): skip_curdir: if true, skip current directory (default true) maxlevels: max recursion level (default 0) force: as for compile_dir() (default 0) """ for dir in sys.path: if (not dir or dir == os.c... | 43466024fcd34a55fb212b6e9e92f95bc4f0917e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43466024fcd34a55fb212b6e9e92f95bc4f0917e/compileall.py |
compile_dir(dir, maxlevels, ddir, force) | success = success and compile_dir(dir, maxlevels, ddir, force) | def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfd:') except getopt.error, msg: print msg print "usage: compileall [-l] [-f] [-d destdir] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" print "-d destdir: pu... | 43466024fcd34a55fb212b6e9e92f95bc4f0917e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43466024fcd34a55fb212b6e9e92f95bc4f0917e/compileall.py |
compile_path() | success = compile_path() | def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfd:') except getopt.error, msg: print msg print "usage: compileall [-l] [-f] [-d destdir] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" print "-d destdir: pu... | 43466024fcd34a55fb212b6e9e92f95bc4f0917e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43466024fcd34a55fb212b6e9e92f95bc4f0917e/compileall.py |
main() | sys.exit(not main()) | def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfd:') except getopt.error, msg: print msg print "usage: compileall [-l] [-f] [-d destdir] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" print "-d destdir: pu... | 43466024fcd34a55fb212b6e9e92f95bc4f0917e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43466024fcd34a55fb212b6e9e92f95bc4f0917e/compileall.py |
f = codecs.getwriter(self.encoding)(s) | f = codecs.getreader(self.encoding)(s) | def test_badbom(self): s = StringIO.StringIO("\xff\xff") f = codecs.getwriter(self.encoding)(s) self.assertRaises(UnicodeError, f.read) | dba72778e1699efe6169309e525352455797125c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dba72778e1699efe6169309e525352455797125c/test_codecs.py |
f = codecs.getwriter(self.encoding)(s) | f = codecs.getreader(self.encoding)(s) | def test_badbom(self): s = StringIO.StringIO("\xff\xff") f = codecs.getwriter(self.encoding)(s) self.assertRaises(UnicodeError, f.read) | dba72778e1699efe6169309e525352455797125c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dba72778e1699efe6169309e525352455797125c/test_codecs.py |
def addwork(self, job): if not job: raise TypeError, 'cannot add null job' | def addwork(self, func, args): job = (func, args) | def addwork(self, job): if not job: raise TypeError, 'cannot add null job' self.mutex.acquire() self.work.append(job) self.mutex.release() if len(self.work) == 1: self.todo.release() | 1f2d599483f0de4985b22ff58524ec806da21e64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1f2d599483f0de4985b22ff58524ec806da21e64/find.py |
Ctrl-E Go to right edge (nospaces off) or end of line (nospaces on). | Ctrl-E Go to right edge (stripspaces off) or end of line (stripspaces on). | def rectangle(win, uly, ulx, lry, lrx): "Draw a rectangle." win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1) win.addch(uly, ulx, curses.ACS_ULCORNER)... | ecb4ce01035f420a5b56798053ec52bfbf5f9123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecb4ce01035f420a5b56798053ec52bfbf5f9123/textpad.py |
Ctrl-L Refresh screen | Ctrl-L Refresh screen. | def rectangle(win, uly, ulx, lry, lrx): "Draw a rectangle." win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1) win.addch(uly, ulx, curses.ACS_ULCORNER)... | ecb4ce01035f420a5b56798053ec52bfbf5f9123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecb4ce01035f420a5b56798053ec52bfbf5f9123/textpad.py |
def firstblank(self, y): | def _end_of_line(self, y): | def firstblank(self, y): "Go to the location of the first blank on the given line." last = self.maxx while 1: if ascii.ascii(self.win.inch(y, last)) != ascii.SP: last = last + 1 break elif last == 0: break last = last - 1 return last | ecb4ce01035f420a5b56798053ec52bfbf5f9123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecb4ce01035f420a5b56798053ec52bfbf5f9123/textpad.py |
self.win.move(y-1, self.firstblank(y-1)) | self.win.move(y-1, self._end_of_line(y-1)) | def do_command(self, ch): "Process a single editing command." (y, x) = self.win.getyx() self.lastcmd = ch if ascii.isprint(ch): if y < self.maxy or x < self.maxx: # The try-catch ignores the error we trigger from some curses # versions by trying to write into the lowest-rightmost spot # in the self.window. try: self.wi... | ecb4ce01035f420a5b56798053ec52bfbf5f9123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecb4ce01035f420a5b56798053ec52bfbf5f9123/textpad.py |
self.win.move(y, self.firstblank(y)) | self.win.move(y, self._end_of_line(y)) | def do_command(self, ch): "Process a single editing command." (y, x) = self.win.getyx() self.lastcmd = ch if ascii.isprint(ch): if y < self.maxy or x < self.maxx: # The try-catch ignores the error we trigger from some curses # versions by trying to write into the lowest-rightmost spot # in the self.window. try: self.wi... | ecb4ce01035f420a5b56798053ec52bfbf5f9123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecb4ce01035f420a5b56798053ec52bfbf5f9123/textpad.py |
if x == 0 and self.firstblank(y) == 0: | if x == 0 and self._end_of_line(y) == 0: | def do_command(self, ch): "Process a single editing command." (y, x) = self.win.getyx() self.lastcmd = ch if ascii.isprint(ch): if y < self.maxy or x < self.maxx: # The try-catch ignores the error we trigger from some curses # versions by trying to write into the lowest-rightmost spot # in the self.window. try: self.wi... | ecb4ce01035f420a5b56798053ec52bfbf5f9123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecb4ce01035f420a5b56798053ec52bfbf5f9123/textpad.py |
stop = self.firstblank(y) | stop = self._end_of_line(y) | def gather(self): "Collect and return the contents of the window." result = "" for y in range(self.maxy+1): self.win.move(y, 0) stop = self.firstblank(y) #sys.stderr.write("y=%d, firstblank(y)=%d\n" % (y, stop)) if stop == 0 and self.stripspaces: continue for x in range(self.maxx+1): if self.stripspaces and x == stop: ... | ecb4ce01035f420a5b56798053ec52bfbf5f9123 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ecb4ce01035f420a5b56798053ec52bfbf5f9123/textpad.py |
while not os.path.isdir(":Mac:Plugins"): | while not os.path.isdir(":Mac:PlugIns"): | def gotopluginfolder(): """Go to the plugin folder, assuming we are somewhere in the Python tree""" import os while not os.path.isdir(":Mac:Plugins"): os.chdir("::") os.chdir(":Mac:Plugins") if verbose: print "current directory is", os.getcwd() | 6f64d41ac974d9168ddb8f710ec995dc98e77fc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f64d41ac974d9168ddb8f710ec995dc98e77fc6/ConfigurePython.py |
os.chdir(":Mac:Plugins") | os.chdir(":Mac:PlugIns") | def gotopluginfolder(): """Go to the plugin folder, assuming we are somewhere in the Python tree""" import os while not os.path.isdir(":Mac:Plugins"): os.chdir("::") os.chdir(":Mac:Plugins") if verbose: print "current directory is", os.getcwd() | 6f64d41ac974d9168ddb8f710ec995dc98e77fc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f64d41ac974d9168ddb8f710ec995dc98e77fc6/ConfigurePython.py |
if not os.path.exists(src): if not os.path.exists(altsrc): | if not os.path.exists(os.path.join(sys.exec_prefix, src)): if not os.path.exists(os.path.join(sys.exec_prefix, altsrc)): | def mkcorealias(src, altsrc): import string import macostools version = string.split(sys.version)[0] dst = getextensiondirfile(src+ ' ' + version) if not os.path.exists(src): if not os.path.exists(altsrc): if verbose: print '*', src, 'not found' return 0 src = altsrc try: os.unlink(dst) except os.error: pass macostool... | 6f64d41ac974d9168ddb8f710ec995dc98e77fc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f64d41ac974d9168ddb8f710ec995dc98e77fc6/ConfigurePython.py |
macostools.mkalias(src, dst) | macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) | def mkcorealias(src, altsrc): import string import macostools version = string.split(sys.version)[0] dst = getextensiondirfile(src+ ' ' + version) if not os.path.exists(src): if not os.path.exists(altsrc): if verbose: print '*', src, 'not found' return 0 src = altsrc try: os.unlink(dst) except os.error: pass macostool... | 6f64d41ac974d9168ddb8f710ec995dc98e77fc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f64d41ac974d9168ddb8f710ec995dc98e77fc6/ConfigurePython.py |
if intro is not None: self.intro = intro if self.intro: self.stdout.write(str(self.intro)+"\n") stop = None while not stop: if self.cmdqueue: line = self.cmdqueue.pop(0) else: if self.use_rawinput: try: line = raw_input(self.prompt) except EOFError: line = 'EOF' else: self.stdout.write(self.prompt) self.stdout.flush() ... | if self.use_rawinput and self.completekey: | def cmdloop(self, intro=None): """Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument. | 39682cc9eb4d740b6d603f582659bcec4f5238f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/39682cc9eb4d740b6d603f582659bcec4f5238f9/cmd.py |
if self.completekey: try: import readline readline.set_completer(self.old_completer) except ImportError: pass | pass | def postloop(self): """Hook method executed once when the cmdloop() method is about to return. | 39682cc9eb4d740b6d603f582659bcec4f5238f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/39682cc9eb4d740b6d603f582659bcec4f5238f9/cmd.py |
def run_suite(suite): | def run_suite(suite, testclass=None): | def run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" if verbose: runner = unittest.TextTestRunner(sys.stdout, verbosity=2) else: runner = BasicTestRunner() result = runner.run(suite) if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] e... | f28cb9da8b6967491d4ef661a2d730f795d81316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f28cb9da8b6967491d4ef661a2d730f795d81316/test_support.py |
raise TestFailed("errors occurred in %s.%s" % (testclass.__module__, testclass.__name__)) | if testclass is None: msg = "errors occurred; run in verbose mode for details" else: msg = "errors occurred in %s.%s" \ % (testclass.__module__, testclass.__name__) raise TestFailed(msg) | def run_suite(suite): """Run tests from a unittest.TestSuite-derived class.""" if verbose: runner = unittest.TextTestRunner(sys.stdout, verbosity=2) else: runner = BasicTestRunner() result = runner.run(suite) if not result.wasSuccessful(): if len(result.errors) == 1 and not result.failures: err = result.errors[0][1] e... | f28cb9da8b6967491d4ef661a2d730f795d81316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f28cb9da8b6967491d4ef661a2d730f795d81316/test_support.py |
run_suite(unittest.makeSuite(testclass)) | run_suite(unittest.makeSuite(testclass), testclass) | def run_unittest(testclass): """Run tests from a unittest.TestCase-derived class.""" run_suite(unittest.makeSuite(testclass)) | f28cb9da8b6967491d4ef661a2d730f795d81316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f28cb9da8b6967491d4ef661a2d730f795d81316/test_support.py |
return _Dialog._fixresult(widget, result) | return _Dialog._fixresult(self, widget, result) | def _fixresult(self, widget, result): if isinstance(result, tuple): # multiple results: result = tuple([getattr(r, "string", r) for r in result]) if result: import os path, file = os.path.split(result[0]) self.options["initialdir"] = path # don't set initialfile or filename, as we have multiple of these return result i... | 02857c1278d1a81a932ad904e0a731667e9c0cb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02857c1278d1a81a932ad904e0a731667e9c0cb7/tkFileDialog.py |
def _import_hook(self, fqname, globals=None, locals=None, fromlist=None): """Python calls this hook to locate and import a module.""" | 1074dd8465de6cd653f9538d144f0d85e05ebf73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1074dd8465de6cd653f9538d144f0d85e05ebf73/imputil.py | ||
return top_module | if fromlist: return getattr(top_module, parts[1]) else: return top_module | def _import_hook(self, fqname, globals=None, locals=None, fromlist=None): """Python calls this hook to locate and import a module.""" | 1074dd8465de6cd653f9538d144f0d85e05ebf73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1074dd8465de6cd653f9538d144f0d85e05ebf73/imputil.py |
self.editFont=tkFont.Font(self,('courier',12,'normal')) | self.editFont=tkFont.Font(self,('courier',10,'normal')) | def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) #self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabP... | ca3c212db32de8c5626f76ab7c4b9881107ad630 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca3c212db32de8c5626f76ab7c4b9881107ad630/configDialog.py |
self.fontName.set(self.listFontName.get(ANCHOR)) | font = self.listFontName.get(ANCHOR) self.fontName.set(font.lower()) | def OnListFontButtonRelease(self,event): self.fontName.set(self.listFontName.get(ANCHOR)) self.SetFontSample() | ca3c212db32de8c5626f76ab7c4b9881107ad630 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca3c212db32de8c5626f76ab7c4b9881107ad630/configDialog.py |
self.fontName.set(configuredFont) if configuredFont in fonts: currentFontIndex=fonts.index(configuredFont) | lc_configuredFont = configuredFont.lower() self.fontName.set(lc_configuredFont) lc_fonts = [s.lower() for s in fonts] if lc_configuredFont in lc_fonts: currentFontIndex = lc_fonts.index(lc_configuredFont) | def LoadFontCfg(self): ##base editor font selection list fonts=list(tkFont.families(self)) fonts.sort() for font in fonts: self.listFontName.insert(END,font) configuredFont=idleConf.GetOption('main','EditorWindow','font', default='courier') self.fontName.set(configuredFont) if configuredFont in fonts: currentFontIndex=... | ca3c212db32de8c5626f76ab7c4b9881107ad630 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca3c212db32de8c5626f76ab7c4b9881107ad630/configDialog.py |
default='12') | default='10') | def LoadFontCfg(self): ##base editor font selection list fonts=list(tkFont.families(self)) fonts.sort() for font in fonts: self.listFontName.insert(END,font) configuredFont=idleConf.GetOption('main','EditorWindow','font', default='courier') self.fontName.set(configuredFont) if configuredFont in fonts: currentFontIndex=... | ca3c212db32de8c5626f76ab7c4b9881107ad630 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca3c212db32de8c5626f76ab7c4b9881107ad630/configDialog.py |
self.relative = 0 | def initialize_options (self): self.bdist_dir = None self.plat_name = None self.format = None self.keep_temp = 0 self.dist_dir = None self.skip_build = 0 | 907684388e7725cdde587a53061abd2b263d5600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/907684388e7725cdde587a53061abd2b263d5600/bdist_dumb.py | |
self.make_archive(os.path.join(self.dist_dir, archive_basename), self.format, root_dir=self.bdist_dir) | pseudoinstall_root = os.path.join(self.dist_dir, archive_basename) if not self.relative: archive_root = self.bdist_dir else: if (self.distribution.has_ext_modules() and (install.install_base != install.install_platbase)): raise DistutilsPlatformError, \ ("can't make a dumb built distribution where " "base and platbase ... | def run (self): | 907684388e7725cdde587a53061abd2b263d5600 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/907684388e7725cdde587a53061abd2b263d5600/bdist_dumb.py |
self.assert_(isinstance(bi[0], int)) | self.assert_(isinstance(bi[0], (int, long))) | def test_buffer_info(self): a = array.array(self.typecode, self.example) self.assertRaises(TypeError, a.buffer_info, 42) bi = a.buffer_info() self.assert_(isinstance(bi, tuple)) self.assertEqual(len(bi), 2) self.assert_(isinstance(bi[0], int)) self.assert_(isinstance(bi[1], int)) self.assertEqual(bi[1], len(a)) | e8c3bf57d99b78c504b8b1565eede81d85f0a429 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e8c3bf57d99b78c504b8b1565eede81d85f0a429/test_array.py |
labelEmail.grid(row=6,column=0,columnspan=2,sticky=W,padx=10,pady=0) | labelEmail.grid(row=6, column=0, columnspan=2, sticky=W, padx=10, pady=0) | def CreateWidgets(self): frameMain = Frame(self, borderwidth=2, relief=SUNKEN) frameButtons = Frame(self) frameButtons.pack(side=BOTTOM, fill=X) frameMain.pack(side=TOP, expand=TRUE, fill=BOTH) self.buttonOk = Button(frameButtons, text='Close', command=self.Ok) self.buttonOk.pack(padx=5, pady=5) #self.picture = Image('... | 9d05254d7e8763cc0b622bb8106f4694aaa82b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d05254d7e8763cc0b622bb8106f4694aaa82b32/aboutDialog.py |
idle_v = Label(frameBg, text='IDLE version ' + idlever.IDLE_VERSION, | idle_v = Label(frameBg, text='IDLE version: ' + idlever.IDLE_VERSION, | def CreateWidgets(self): frameMain = Frame(self, borderwidth=2, relief=SUNKEN) frameButtons = Frame(self) frameButtons.pack(side=BOTTOM, fill=X) frameMain.pack(side=TOP, expand=TRUE, fill=BOTH) self.buttonOk = Button(frameButtons, text='Close', command=self.Ok) self.buttonOk.pack(padx=5, pady=5) #self.picture = Image('... | 9d05254d7e8763cc0b622bb8106f4694aaa82b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d05254d7e8763cc0b622bb8106f4694aaa82b32/aboutDialog.py |
fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),viewFile) | fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), viewFile) | def ViewFile(self, viewTitle, viewFile, encoding=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),viewFile) if encoding: import codecs try: textFile = codecs.open(fn, 'r') except IOError: tkMessageBox.showerror(title='File Load Error', message='Unable to load file '+ `fileName`+' .') return else: data ... | 9d05254d7e8763cc0b622bb8106f4694aaa82b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d05254d7e8763cc0b622bb8106f4694aaa82b32/aboutDialog.py |
aboutDialog.AboutDialog(root,'About') | aboutDialog.AboutDialog(root, 'About') | def run(): import aboutDialog aboutDialog.AboutDialog(root,'About') | 9d05254d7e8763cc0b622bb8106f4694aaa82b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d05254d7e8763cc0b622bb8106f4694aaa82b32/aboutDialog.py |
parent = readmodule(package, path, inpackage) child = readmodule(submodule, parent['__path__'], 1) | parent = readmodule_ex(package, path, inpackage) child = readmodule_ex(submodule, parent['__path__'], 1) | def readmodule_ex(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' dict = {} i = module.rfind('.') if i >= 0: # Dotted module name pa... | b25c78db0ea0d77e2a8bbcfb2cd7827a285c1d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b25c78db0ea0d77e2a8bbcfb2cd7827a285c1d32/pyclbr.py |
d = readmodule(n, path, inpackage) | d = readmodule_ex(n, path, inpackage) | def readmodule_ex(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' dict = {} i = module.rfind('.') if i >= 0: # Dotted module name pa... | b25c78db0ea0d77e2a8bbcfb2cd7827a285c1d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b25c78db0ea0d77e2a8bbcfb2cd7827a285c1d32/pyclbr.py |
d = readmodule(mod, path, inpackage) | d = readmodule_ex(mod, path, inpackage) | def readmodule_ex(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' dict = {} i = module.rfind('.') if i >= 0: # Dotted module name pa... | b25c78db0ea0d77e2a8bbcfb2cd7827a285c1d32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b25c78db0ea0d77e2a8bbcfb2cd7827a285c1d32/pyclbr.py |
import Plist builder.plist = Plist.fromFile(plistname) | import plistlib builder.plist = plistlib.Plist.fromFile(plistname) | def process_common_macho(template, progress, code, rsrcname, destname, is_update, raw=0, others=[], filename=None): # Check that we have a filename if filename is None: raise BuildError, "Need source filename on MacOSX" # First make sure the name ends in ".app" if destname[-4:] != '.app': destname = destname + '.app' #... | 675eba2fe3b2cd91ba5f45394df00a4a0dc716d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/675eba2fe3b2cd91ba5f45394df00a4a0dc716d4/buildtools.py |
if row: | if row is not None: | def grid_slaves(self, row=None, column=None): args = () if row: args = args + ('-row', row) if column: args = args + ('-column', column) return map(self._nametowidget, self.tk.splitlist(self.tk.call( ('grid', 'slaves', self._w) + args))) | d3b81ace8b8e39939950bc7a3d05f280a88af87f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d3b81ace8b8e39939950bc7a3d05f280a88af87f/Tkinter.py |
if column: | if column is not None: | def grid_slaves(self, row=None, column=None): args = () if row: args = args + ('-row', row) if column: args = args + ('-column', column) return map(self._nametowidget, self.tk.splitlist(self.tk.call( ('grid', 'slaves', self._w) + args))) | d3b81ace8b8e39939950bc7a3d05f280a88af87f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d3b81ace8b8e39939950bc7a3d05f280a88af87f/Tkinter.py |
return self._bind((self._w, 'bind', tagOrId), sequence, func, add) | res = self._bind((self._w, 'bind', tagOrId), sequence, func, add) if sequence and func and res: if self._tagcommands is None: self._tagcommands = {} list = self._tagcommands.get(tagOrId) or [] self._tagcommands[tagOrId] = list list.append(res) return res | def tag_bind(self, tagOrId, sequence=None, func=None, add=None): return self._bind((self._w, 'bind', tagOrId), sequence, func, add) | d3b81ace8b8e39939950bc7a3d05f280a88af87f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d3b81ace8b8e39939950bc7a3d05f280a88af87f/Tkinter.py |
def search(self, charset, criteria): | def search(self, charset, *criteria): | def search(self, charset, criteria): """Search mailbox for matching messages. | 2fbd7617bcdf8eddf623f673ab3b45c3d8327a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fbd7617bcdf8eddf623f673ab3b45c3d8327a08/imaplib.py |
(typ, [data]) = <instance>.search(charset, criteria) | (typ, [data]) = <instance>.search(charset, criterium, ...) | def search(self, charset, criteria): """Search mailbox for matching messages. | 2fbd7617bcdf8eddf623f673ab3b45c3d8327a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fbd7617bcdf8eddf623f673ab3b45c3d8327a08/imaplib.py |
typ, dat = self._simple_command(name, charset, criteria) | typ, dat = apply(self._simple_command, (name, charset) + criteria) | def search(self, charset, criteria): """Search mailbox for matching messages. | 2fbd7617bcdf8eddf623f673ab3b45c3d8327a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fbd7617bcdf8eddf623f673ab3b45c3d8327a08/imaplib.py |
import getpass, sys host = '' if sys.argv[1:]: host = sys.argv[1] | import getopt, getpass, sys try: optlist, args = getopt.getopt(sys.argv[1:], 'd:') except getopt.error, val: pass for opt,val in optlist: if opt == '-d': Debug = int(val) if not args: args = ('',) host = args[0] | def print_log(): _mesg('last %d IMAP4 interactions:' % len(_cmd_log)) for secs,line in _cmd_log: _mesg(line, secs) | 2fbd7617bcdf8eddf623f673ab3b45c3d8327a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fbd7617bcdf8eddf623f673ab3b45c3d8327a08/imaplib.py |
('search', (None, '(TO zork)')), | ('search', (None, 'SUBJECT', 'test')), | def print_log(): _mesg('last %d IMAP4 interactions:' % len(_cmd_log)) for secs,line in _cmd_log: _mesg(line, secs) | 2fbd7617bcdf8eddf623f673ab3b45c3d8327a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fbd7617bcdf8eddf623f673ab3b45c3d8327a08/imaplib.py |
Debug = 5 M = IMAP4(host) _mesg('PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION) for cmd,args in test_seq1: run(cmd, args) for ml in run('list', ('/tmp/', 'yy%')): mo = re.match(r'.*"([^"]+)"$', ml) if mo: path = mo.group(1) else: path = string.split(ml)[-1] run('delete', (path,)) for cmd,args in test_seq2: dat = run(c... | try: M = IMAP4(host) _mesg('PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION) for cmd,args in test_seq1: run(cmd, args) for ml in run('list', ('/tmp/', 'yy%')): mo = re.match(r'.*"([^"]+)"$', ml) if mo: path = mo.group(1) else: path = string.split(ml)[-1] run('delete', (path,)) for cmd,args in test_seq2: dat = run(cmd, a... | def run(cmd, args): _mesg('%s %s' % (cmd, args)) typ, dat = apply(eval('M.%s' % cmd), args) _mesg('%s => %s %s' % (cmd, typ, dat)) return dat | 2fbd7617bcdf8eddf623f673ab3b45c3d8327a08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fbd7617bcdf8eddf623f673ab3b45c3d8327a08/imaplib.py |
mod = imp.new_module(fullname) sys.modules[fullname] = mod | mod = sys.modules.setdefault(fullname,imp.new_module(fullname)) | def load_module(self, fullname): ispkg, code = self.modules[fullname] mod = imp.new_module(fullname) sys.modules[fullname] = mod mod.__file__ = "<%s>" % self.__class__.__name__ mod.__loader__ = self if ispkg: mod.__path__ = self._get__path__() exec code in mod.__dict__ return mod | 080f60c4b086ffa6826afaabfc730dab04834791 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/080f60c4b086ffa6826afaabfc730dab04834791/test_importhooks.py |
def generate_help (header=None): | def generate_help (self, header=None): | def generate_help (header=None): """Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object.""" | d183c094086d3a6602c3b41c939969541baa11df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d183c094086d3a6602c3b41c939969541baa11df/fancy_getopt.py |
def print_help (self, file=None, header=None): | def print_help (self, header=None, file=None): | def print_help (self, file=None, header=None): if file is None: file = sys.stdout for line in self.generate_help (header): file.write (line + "\n") | d183c094086d3a6602c3b41c939969541baa11df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d183c094086d3a6602c3b41c939969541baa11df/fancy_getopt.py |
testtype('u', u'\u263a') | if have_unicode: testtype('u', unicode(r'\u263a', 'unicode-escape')) | def main(): testtype('c', 'c') testtype('u', u'\u263a') for type in (['b', 'h', 'i', 'l', 'f', 'd']): testtype(type, 1) testunicode() testsubclassing() unlink(TESTFN) | db6b399f23452fdc46f5281f0de1fff07600367f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6b399f23452fdc46f5281f0de1fff07600367f/test_array.py |
testunicode() | if have_unicode: testunicode() | def main(): testtype('c', 'c') testtype('u', u'\u263a') for type in (['b', 'h', 'i', 'l', 'f', 'd']): testtype(type, 1) testunicode() testsubclassing() unlink(TESTFN) | db6b399f23452fdc46f5281f0de1fff07600367f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6b399f23452fdc46f5281f0de1fff07600367f/test_array.py |
array.array('b', u'foo') | array.array('b', unicode('foo', 'ascii')) | def testunicode(): try: array.array('b', u'foo') except TypeError: pass else: raise TestFailed("creating a non-unicode array from " "a Unicode string should fail") x = array.array('u', u'\xa0\xc2\u1234') x.fromunicode(u' ') x.fromunicode(u'') x.fromunicode(u'') x.fromunicode(u'\x11abc\xff\u1234') s = x.tounicode() if ... | db6b399f23452fdc46f5281f0de1fff07600367f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6b399f23452fdc46f5281f0de1fff07600367f/test_array.py |
x = array.array('u', u'\xa0\xc2\u1234') x.fromunicode(u' ') x.fromunicode(u'') x.fromunicode(u'') x.fromunicode(u'\x11abc\xff\u1234') | x = array.array('u', unicode(r'\xa0\xc2\u1234', 'unicode-escape')) x.fromunicode(unicode(' ', 'ascii')) x.fromunicode(unicode('', 'ascii')) x.fromunicode(unicode('', 'ascii')) x.fromunicode(unicode(r'\x11abc\xff\u1234', 'unicode-escape')) | def testunicode(): try: array.array('b', u'foo') except TypeError: pass else: raise TestFailed("creating a non-unicode array from " "a Unicode string should fail") x = array.array('u', u'\xa0\xc2\u1234') x.fromunicode(u' ') x.fromunicode(u'') x.fromunicode(u'') x.fromunicode(u'\x11abc\xff\u1234') s = x.tounicode() if ... | db6b399f23452fdc46f5281f0de1fff07600367f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db6b399f23452fdc46f5281f0de1fff07600367f/test_array.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.