rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def handle_charref(self, name): try: n = int(name) except ValueError: self.unknown_charref(name) return if not 0 <= n <= 255: self.unknown_charref(name) return self.handle_data(chr(n))
08f8dd6d0caead7891d1a70f956409a88d0ed5a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/08f8dd6d0caead7891d1a70f956409a88d0ed5a6/sgmllib.py
if dir[-1] == '\n': dir = dir[:-1]
dir = dir.rstrip()
def addpackage(sitedir, name): global _dirs_in_sys_path if _dirs_in_sys_path is None: _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exe...
497331fa2ba93ee290144046754c59b3025b5eb1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/497331fa2ba93ee290144046754c59b3025b5eb1/site.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]
162bd855a631ed66f83ff3ed76ae1533de033298 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/162bd855a631ed66f83ff3ed76ae1533de033298/ntpath.py
import imp
def load_dynamic(self, name, filename, file): if name not in self.ok_dynamic_modules: raise ImportError, "untrusted dynamic module: %s" % name if sys.modules.has_key(name): src = sys.modules[name] else: import imp src = imp.load_dynamic(name, filename, file) dst = self.copy_except(src, []) return dst
59b2a74c752578cb67b02b6966f283fd049f646a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/59b2a74c752578cb67b02b6966f283fd049f646a/rexec.py
print '%s.%s%s =? %s... ' % (repr(input), method, args, output),
print '%s.%s%s =? %s... ' % (repr(input), method, args, repr(output)),
def test(method, input, output, *args): if verbose: print '%s.%s%s =? %s... ' % (repr(input), method, args, output), try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value != output: if verbose: print 'no' print '*',f, `input`, `output`, `v...
15ffc71c0f811d4c3053efb0480d70502ec35c99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/15ffc71c0f811d4c3053efb0480d70502ec35c99/test_unicode.py
if value != output:
if value != output or type(value) is not type(output):
def test(method, input, output, *args): if verbose: print '%s.%s%s =? %s... ' % (repr(input), method, args, output), try: f = getattr(input, method) value = apply(f, args) except: value = sys.exc_type exc = sys.exc_info()[:2] else: exc = None if value != output: if verbose: print 'no' print '*',f, `input`, `output`, `v...
15ffc71c0f811d4c3053efb0480d70502ec35c99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/15ffc71c0f811d4c3053efb0480d70502ec35c99/test_unicode.py
def __init__(self): self.seq = 'wxyz'
def __init__(self, seq): self.seq = seq
def __init__(self): self.seq = 'wxyz'
15ffc71c0f811d4c3053efb0480d70502ec35c99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/15ffc71c0f811d4c3053efb0480d70502ec35c99/test_unicode.py
test('join', u' ', u'w x y z', Sequence())
test('join', u' ', u'w x y z', Sequence('wxyz'))
def __getitem__(self, i): return self.seq[i]
15ffc71c0f811d4c3053efb0480d70502ec35c99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/15ffc71c0f811d4c3053efb0480d70502ec35c99/test_unicode.py
class BadSeq(Sequence): def __init__(self): self.seq = [7, u'hello', 123L] test('join', u' ', TypeError, BadSeq())
test('join', u' ', TypeError, Sequence([7, u'hello', 123L])) test('join', ' ', u'a b c d', [u'a', u'b', u'c', u'd']) test('join', ' ', u'a b c d', ['a', 'b', u'c', u'd']) test('join', '', u'abcd', (u'a', u'b', u'c', u'd')) test('join', ' ', u'w x y z', Sequence(u'wxyz')) test('join', ' ', TypeError, 7)
def __getitem__(self, i): return self.seq[i]
15ffc71c0f811d4c3053efb0480d70502ec35c99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/15ffc71c0f811d4c3053efb0480d70502ec35c99/test_unicode.py
chmfile = os.path.join(sys.prefix, "Python%d%d.chm" % sys.version_info[:2])
chmfile = os.path.join(sys.prefix, 'Doc', 'Python%d%d.chm' % sys.version_info[:2])
def __init__(self, flist=None, filename=None, key=None, root=None): if EditorWindow.help_url is None: dochome = os.path.join(sys.prefix, 'Doc', 'index.html') if sys.platform.count('linux'): # look for html docs in a couple of standard places pyver = 'python-docs-' + '%s.%s.%s' % sys.version_info[:3] if os.path.isdir('...
090e636add33907d196b9899eb0f019654a055e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/090e636add33907d196b9899eb0f019654a055e8/EditorWindow.py
os.rename(tmp_file.name, dest)
try: if hasattr(os, 'link'): os.link(tmp_file.name, dest) os.remove(tmp_file.name) else: os.rename(tmp_file.name, dest) except OSError, e: os.remove(tmp_file.name) if e.errno == errno.EEXIST: raise ExternalClashError('Name clash with existing message: %s' % dest) else: raise
def add(self, message): """Add message and return assigned key.""" tmp_file = self._create_tmp() try: self._dump_message(message, tmp_file) finally: _sync_close(tmp_file) if isinstance(message, MaildirMessage): subdir = message.get_subdir() suffix = self.colon + message.get_info() if suffix == self.colon: suffix = '' e...
7ea928c452e2baaa929e5a078d796ece3720e765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ea928c452e2baaa929e5a078d796ece3720e765/mailbox.py
return open(path, 'wb+')
try: return _create_carefully(path) except OSError, e: if e.errno != errno.EEXIST: raise
def _create_tmp(self): """Create a file in the tmp subdirectory and open and return it.""" now = time.time() hostname = socket.gethostname() if '/' in hostname: hostname = hostname.replace('/', r'\057') if ':' in hostname: hostname = hostname.replace(':', r'\072') uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6...
7ea928c452e2baaa929e5a078d796ece3720e765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ea928c452e2baaa929e5a078d796ece3720e765/mailbox.py
else: raise ExternalClashError('Name clash prevented file creation: %s' % path)
raise ExternalClashError('Name clash prevented file creation: %s' % path)
def _create_tmp(self): """Create a file in the tmp subdirectory and open and return it.""" now = time.time() hostname = socket.gethostname() if '/' in hostname: hostname = hostname.replace('/', r'\057') if ':' in hostname: hostname = hostname.replace(':', r'\072') uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6...
7ea928c452e2baaa929e5a078d796ece3720e765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ea928c452e2baaa929e5a078d796ece3720e765/mailbox.py
parts = ctype.split('/') if len(parts) > 0: return ctype.split('/')[0] return failobj
if ctype.count('/') <> 1: return failobj return ctype.split('/')[0]
def get_main_type(self, failobj=None): """Return the message's main content type if present.""" missing = [] ctype = self.get_type(missing) if ctype is missing: return failobj parts = ctype.split('/') if len(parts) > 0: return ctype.split('/')[0] return failobj
c10686426edd6883b88950a754335b678750bf67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c10686426edd6883b88950a754335b678750bf67/Message.py
parts = ctype.split('/') if len(parts) > 1: return ctype.split('/')[1] return failobj
if ctype.count('/') <> 1: return failobj return ctype.split('/')[1] def get_content_type(self): """Returns the message's content type. The returned string is coerced to lowercase and returned as a ingle string of the form `maintype/subtype'. If there was no Content-Type: header in the message, the default type a...
def get_subtype(self, failobj=None): """Return the message's content subtype if present.""" missing = [] ctype = self.get_type(missing) if ctype is missing: return failobj parts = ctype.split('/') if len(parts) > 1: return ctype.split('/')[1] return failobj
c10686426edd6883b88950a754335b678750bf67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c10686426edd6883b88950a754335b678750bf67/Message.py
ctype must be either "text/plain" or "message/rfc822". The default content type is not stored in the Content-Type: header. """ if ctype not in ('text/plain', 'message/rfc822'): raise ValueError( 'first arg must be either "text/plain" or "message/rfc822"')
ctype should be either "text/plain" or "message/rfc822", although this is not enforced. The default content type is not stored in the Content-Type: header. """
def set_default_type(self, ctype): """Set the `default' content type.
c10686426edd6883b88950a754335b678750bf67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c10686426edd6883b88950a754335b678750bf67/Message.py
def seek(self): raise IOError, 'Random access not allowed in gzip files' def tell(self): raise IOError, 'I won\'t tell() you for gzip files'
def flush(self): self.fileobj.flush()
44f5f8fb26185b211d50fd9501ba42446505a8d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/44f5f8fb26185b211d50fd9501ba42446505a8d7/gzip.py
if len(error_302_dict)>10 or req.error_302_dict.has_key(newurl):
if len(req.error_302_dict)>10 or \ req.error_302_dict.has_key(newurl):
def http_error_302(self, req, fp, code, msg, headers): if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return nil = fp.read() fp.close()
2d996c07049db6648ddf33aedff52e78908949c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d996c07049db6648ddf33aedff52e78908949c6/urllib2.py
srcfss = macfs.FSSpec(src) dstfss = macfs.FSSpec(dst)
def copy(src, dst, createpath=0, copydates=1, forcetype=None): """Copy a file, including finder info, resource fork, etc""" if createpath: mkdirs(os.path.split(dst)[0]) srcfss = macfs.FSSpec(src) dstfss = macfs.FSSpec(dst) ifp = open(srcfss.as_pathname(), 'rb') ofp = open(dstfss.as_pathname(), 'wb') d = ifp.read(BUFSI...
0a9d7559e8e07336860fb2aa901c1ba8b77b5921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a9d7559e8e07336860fb2aa901c1ba8b77b5921/macostools.py
ifp = open(srcfss.as_pathname(), 'rb') ofp = open(dstfss.as_pathname(), 'wb')
ifp = open(src, 'rb') ofp = open(dst, 'wb')
def copy(src, dst, createpath=0, copydates=1, forcetype=None): """Copy a file, including finder info, resource fork, etc""" if createpath: mkdirs(os.path.split(dst)[0]) srcfss = macfs.FSSpec(src) dstfss = macfs.FSSpec(dst) ifp = open(srcfss.as_pathname(), 'rb') ofp = open(dstfss.as_pathname(), 'wb') d = ifp.read(BUFSI...
0a9d7559e8e07336860fb2aa901c1ba8b77b5921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a9d7559e8e07336860fb2aa901c1ba8b77b5921/macostools.py
ifp = openrf(srcfss.as_pathname(), '*rb') ofp = openrf(dstfss.as_pathname(), '*wb')
ifp = openrf(src, '*rb') ofp = openrf(dst, '*wb')
def copy(src, dst, createpath=0, copydates=1, forcetype=None): """Copy a file, including finder info, resource fork, etc""" if createpath: mkdirs(os.path.split(dst)[0]) srcfss = macfs.FSSpec(src) dstfss = macfs.FSSpec(dst) ifp = open(srcfss.as_pathname(), 'rb') ofp = open(dstfss.as_pathname(), 'wb') d = ifp.read(BUFSI...
0a9d7559e8e07336860fb2aa901c1ba8b77b5921 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a9d7559e8e07336860fb2aa901c1ba8b77b5921/macostools.py
verify(tuple(a).__class__ is tuple)
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__(L) return self._rev
4c3a0a35cd80a0abb9628dc8d4ade911fe2d5015 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c3a0a35cd80a0abb9628dc8d4ade911fe2d5015/test_descr.py
for version in ['8.4', '84', '8.3', '83', '8.2',
for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module.
4c4a45de8f992bb0c5cf35910d34ed6c63fa9d14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c4a45de8f992bb0c5cf35910d34ed6c63fa9d14/setup.py
d[types.CodeType] = _deepcopy_atomic
try: d[types.CodeType] = _deepcopy_atomic except AttributeError: pass
def _deepcopy_atomic(x, memo): return x
88b666ca3f2e403d23c05a94fbc8038ad2c1fc4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/88b666ca3f2e403d23c05a94fbc8038ad2c1fc4d/copy.py
the local hostname is found using gethostbyname().
the local hostname is found using socket.getfqdn().
def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance.
4b186aff486400c3a7412ee552587f5a30be2381 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b186aff486400c3a7412ee552587f5a30be2381/smtplib.py
modname = modname + dirname + '.'
modname = dirname + '.' + modname
def getenvironment(self): if self.path: file = self.path dir = os.path.dirname(file) # check if we're part of a package modname = "" while os.path.exists(os.path.join(dir, "__init__.py")): dir, dirname = os.path.split(dir) modname = modname + dirname + '.' subname = _filename_as_modname(self.title) if modname: if subna...
2aaeb52665fb297b3d65006b8b22eee290f17e7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2aaeb52665fb297b3d65006b8b22eee290f17e7f/PyEdit.py
modname = modname[:-1]
modname = modname[:-1]
def getenvironment(self): if self.path: file = self.path dir = os.path.dirname(file) # check if we're part of a package modname = "" while os.path.exists(os.path.join(dir, "__init__.py")): dir, dirname = os.path.split(dir) modname = modname + dirname + '.' subname = _filename_as_modname(self.title) if modname: if subna...
2aaeb52665fb297b3d65006b8b22eee290f17e7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2aaeb52665fb297b3d65006b8b22eee290f17e7f/PyEdit.py
modname = modname + subname
modname = modname + subname
def getenvironment(self): if self.path: file = self.path dir = os.path.dirname(file) # check if we're part of a package modname = "" while os.path.exists(os.path.join(dir, "__init__.py")): dir, dirname = os.path.split(dir) modname = modname + dirname + '.' subname = _filename_as_modname(self.title) if modname: if subna...
2aaeb52665fb297b3d65006b8b22eee290f17e7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2aaeb52665fb297b3d65006b8b22eee290f17e7f/PyEdit.py
def __init__(self, text):
def __init__(self, text, fileclass=StringIO.StringIO):
def __init__(self, text): self.text = text
121d34af198b2d051eec158fd1be7aa19a224c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/121d34af198b2d051eec158fd1be7aa19a224c28/test_httplib.py
return StringIO.StringIO(self.text)
return self.fileclass(self.text) class NoEOFStringIO(StringIO.StringIO): """Like StringIO, but raises AssertionError on EOF. This is used below to test that httplib doesn't try to read more from the underlying file than it should. """ def read(self, n=-1): data = StringIO.StringIO.read(self, n) if data == '': raise A...
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
121d34af198b2d051eec158fd1be7aa19a224c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/121d34af198b2d051eec158fd1be7aa19a224c28/test_httplib.py
import sys
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
121d34af198b2d051eec158fd1be7aa19a224c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/121d34af198b2d051eec158fd1be7aa19a224c28/test_httplib.py
def redirect_request(self, req, fp, code, msg, headers):
def redirect_request(self, req, fp, code, msg, headers, newurl):
def redirect_request(self, req, fp, code, msg, headers): """Return a Request or None in response to a redirect.
0389295dcdc72df81a037d2712afea600aad9445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0389295dcdc72df81a037d2712afea600aad9445/urllib2.py
if "location" in headers: newurl = headers["location"] elif "uri" in headers: newurl = headers["uri"] else: return newurl = urlparse.urljoin(req.get_full_url(), newurl)
def redirect_request(self, req, fp, code, msg, headers): """Return a Request or None in response to a redirect.
0389295dcdc72df81a037d2712afea600aad9445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0389295dcdc72df81a037d2712afea600aad9445/urllib2.py
new = self.redirect_request(req, fp, code, msg, headers)
new = self.redirect_request(req, fp, code, msg, headers, newurl)
def http_error_302(self, req, fp, code, msg, headers): if 'location' in headers: newurl = headers['location'] elif 'uri' in headers: newurl = headers['uri'] else: return newurl = urlparse.urljoin(req.get_full_url(), newurl)
0389295dcdc72df81a037d2712afea600aad9445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0389295dcdc72df81a037d2712afea600aad9445/urllib2.py
host = 'www.cwi.nl:80' selector = '/index.html'
host = 'www.python.org' selector = '/'
def test(): import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.cwi.nl:80' selector = '/index.html' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) ...
a0dfc7ad65429e026e28d175626c32bd9fa1d078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a0dfc7ad65429e026e28d175626c32bd9fa1d078/httplib.py
print 'headers =', headers
def test(): import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.cwi.nl:80' selector = '/index.html' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) ...
a0dfc7ad65429e026e28d175626c32bd9fa1d078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a0dfc7ad65429e026e28d175626c32bd9fa1d078/httplib.py
def sample(self, population, k, int=int):
def sample(self, population, k):
def sample(self, population, k, int=int): """Chooses k unique random elements from a population sequence.
fdbe5223b7402ee34c4f0c06caa6faabd9e73e35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fdbe5223b7402ee34c4f0c06caa6faabd9e73e35/random.py
j = int(random() * (n-i))
j = _int(random() * (n-i))
def sample(self, population, k, int=int): """Chooses k unique random elements from a population sequence.
fdbe5223b7402ee34c4f0c06caa6faabd9e73e35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fdbe5223b7402ee34c4f0c06caa6faabd9e73e35/random.py
j = int(random() * n)
j = _int(random() * n)
def sample(self, population, k, int=int): """Chooses k unique random elements from a population sequence.
fdbe5223b7402ee34c4f0c06caa6faabd9e73e35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fdbe5223b7402ee34c4f0c06caa6faabd9e73e35/random.py
j = int(random() * n)
j = _int(random() * n)
def sample(self, population, k, int=int): """Chooses k unique random elements from a population sequence.
fdbe5223b7402ee34c4f0c06caa6faabd9e73e35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fdbe5223b7402ee34c4f0c06caa6faabd9e73e35/random.py
if ((template_exists and (template_newer or setup_newer)) or self.force_manifest or self.manifest_only):
if manifest_outofdate or neither_exists or force_regen:
def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the s...
d3b76a8fbfc2af2d01ce48c323c9f76c0947af49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3b76a8fbfc2af2d01ce48c323c9f76c0947af49/sdist.py
standards = [('README', 'README.txt'), 'setup.py']
standards = [('README', 'README.txt'), self.distribution.script_name]
def add_defaults (self): """Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setu...
d3b76a8fbfc2af2d01ce48c323c9f76c0947af49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3b76a8fbfc2af2d01ce48c323c9f76c0947af49/sdist.py
import saxutils
from . import saxutils
def parse(self, source): import saxutils source = saxutils.prepare_input_source(source)
7ec155f5be6cdcbf55a607c2846cbd4ea80c3681 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ec155f5be6cdcbf55a607c2846cbd4ea80c3681/xmlreader.py
socket = _socketobject
socket = SocketType = _socketobject
_s = ("def %s(self, *args): return self._sock.%s(*args)\n\n" "%s.__doc__ = _realsocket.%s.__doc__\n")
dbfb12148d59933273d9bf68cb0cbe5486b1ca61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dbfb12148d59933273d9bf68cb0cbe5486b1ca61/socket.py
def gen_id(self, dir, file):
def gen_id(self, file):
def gen_id(self, dir, file): logical = _logical = make_id(file) pos = 1 while logical in self.filenames: logical = "%s.%d" % (_logical, pos) pos += 1 self.filenames.add(logical) return logical
388a8c26fae0c9fdce06fcf69223b7b43cb25acf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/388a8c26fae0c9fdce06fcf69223b7b43cb25acf/__init__.py
def append(self, full, logical):
def append(self, full, file, logical):
def append(self, full, logical): if os.path.isdir(full): return self.index += 1 self.files.append((full, logical)) return self.index, logical
388a8c26fae0c9fdce06fcf69223b7b43cb25acf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/388a8c26fae0c9fdce06fcf69223b7b43cb25acf/__init__.py
sequence, logical = self.cab.append(absolute, logical)
sequence, logical = self.cab.append(absolute, file, logical)
def add_file(self, file, src=None, version=None, language=None): """Add a file to the current component of the directory, starting a new one one if there is no current component. By default, the file name in the source and the file table will be identical. If the src file is specified, it is interpreted relative to the...
388a8c26fae0c9fdce06fcf69223b7b43cb25acf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/388a8c26fae0c9fdce06fcf69223b7b43cb25acf/__init__.py
def mapping(self, mapping, attribute):
def mapping(self, event, attribute):
def mapping(self, mapping, attribute): add_data(self.dlg.db, "EventMapping", [(self.dlg.name, self.name, event, attribute)])
388a8c26fae0c9fdce06fcf69223b7b43cb25acf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/388a8c26fae0c9fdce06fcf69223b7b43cb25acf/__init__.py
mo = AbstractBasicAuthHandler.rx.match(authreq)
mo = AbstractBasicAuthHandler.rx.search(authreq)
def http_error_auth_reqed(self, authreq, host, req, headers): # XXX could be multiple headers authreq = headers.get(authreq, None) if authreq: mo = AbstractBasicAuthHandler.rx.match(authreq) if mo: scheme, realm = mo.groups() if scheme.lower() == 'basic': return self.retry_http_basic_auth(host, req, realm)
65a7975f16f92f0e715a16b807f732c0d7a34bf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65a7975f16f92f0e715a16b807f732c0d7a34bf0/urllib2.py
doc = getattr(ob, "__doc__", "")
doc = getattr(ob, "__doc__", "").lstrip()
def get_arg_text(ob): "Get a string describing the arguments for the given object" argText = "" if ob is not None: argOffset = 0 if type(ob)==types.ClassType: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: argOffset = 1 elif type(ob)==types.Metho...
61bfb736b4989b7eb639c63ef0589c8e398bfc5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61bfb736b4989b7eb639c63ef0589c8e398bfc5a/CallTips.py
while doc[:1] in " \t\n": doc = doc[1:]
def get_arg_text(ob): "Get a string describing the arguments for the given object" argText = "" if ob is not None: argOffset = 0 if type(ob)==types.ClassType: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: argOffset = 1 elif type(ob)==types.Metho...
61bfb736b4989b7eb639c63ef0589c8e398bfc5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/61bfb736b4989b7eb639c63ef0589c8e398bfc5a/CallTips.py
tarinfo = self.tarfile.next() if not tarinfo: self.tarfile._loaded = True raise StopIteration
if not self.tarfile._loaded: tarinfo = self.tarfile.next() if not tarinfo: self.tarfile._loaded = True raise StopIteration else: try: tarinfo = self.tarfile.members[self.index] except IndexError: raise StopIteration self.index += 1
def next(self): """Return the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. """ tarinfo = self.tarfile.next() if not tarinfo: self.tarfile._loaded = True raise StopIteration return tarinfo
637431bf145a4e35458219c18db843a054e0adf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/637431bf145a4e35458219c18db843a054e0adf3/tarfile.py
pointer = -1
if self.cyclic: pointer = -1 else: self.text.bell() return
def history_do(self, reverse): nhist = len(self.history) pointer = self.history_pointer prefix = self.history_prefix if pointer is not None and prefix is not None: if self.text.compare("insert", "!=", "end-1c") or \ self._get_source("iomark", "end-1c") != self.history[pointer]: pointer = prefix = None if pointer is Non...
0676dfdce06f6b01f35d76a4fb77c77c03468366 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0676dfdce06f6b01f35d76a4fb77c77c03468366/IdleHistory.py
if self._get_source("iomark", "end-1c") != prefix: self.text.delete("iomark", "end-1c") self._put_source("iomark", prefix) pointer = prefix = None
if not self.cyclic and pointer < 0: return else: if self._get_source("iomark", "end-1c") != prefix: self.text.delete("iomark", "end-1c") self._put_source("iomark", prefix) pointer = prefix = None
def history_do(self, reverse): nhist = len(self.history) pointer = self.history_pointer prefix = self.history_prefix if pointer is not None and prefix is not None: if self.text.compare("insert", "!=", "end-1c") or \ self._get_source("iomark", "end-1c") != self.history[pointer]: pointer = prefix = None if pointer is Non...
0676dfdce06f6b01f35d76a4fb77c77c03468366 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0676dfdce06f6b01f35d76a4fb77c77c03468366/IdleHistory.py
val = int(value) self.write("<value><int>%s</int></value>\n" % val)
if value > MAXINT or value < MININT: raise OverflowError, "long int exceeds XML-RPC limits" self.write("<value><int>%s</int></value>\n" % int(value))
def dump_long(self, value): val = int(value) self.write("<value><int>%s</int></value>\n" % val)
5449e08412a5abd83c21d59764ef6240c58872b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5449e08412a5abd83c21d59764ef6240c58872b0/xmlrpclib.py
self.send_error(403, "CGI script is not a plain file (%r)" %
self.send_error(403, "CGI script is not a plain file (%r)" %
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip...
27f49610afe5ca8fdce780490ec22def39bbbe3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/27f49610afe5ca8fdce780490ec22def39bbbe3c/CGIHTTPServer.py
chunk.skip()
if formlength > 0: chunk.skip()
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ...
93f07400737a430ce642b4e7f6c9bd3e4460229c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/93f07400737a430ce642b4e7f6c9bd3e4460229c/aifc.py
params = [CL.FRAME_BUFFER_SIZE, len(data) * 2]
params = [CL.FRAME_BUFFER_SIZE, len(data) * 2, \ CL.COMPRESSED_BUFFER_SIZE, len(data)]
def readframes(self, nframes): if self._ssnd_seek_needed: self._ssnd_chunk.rewind() dummy = self._ssnd_chunk.read(8) pos = self._soundpos * self._nchannels * self._sampwidth if self._decomp: if self._comptype in ('ULAW', 'ALAW'): pos = pos / 2 if pos: self._ssnd_chunk.setpos(pos + 8) self._ssnd_seek_needed = 0 size = n...
93f07400737a430ce642b4e7f6c9bd3e4460229c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/93f07400737a430ce642b4e7f6c9bd3e4460229c/aifc.py
has_cte = is_qp = 0
has_cte = is_qp = is_base64 = 0
def mimify_part(ifile, ofile, is_mime): '''Convert an 8bit part of a MIME mail message to quoted-printable.''' has_cte = is_qp = 0 multipart = None must_quote_body = must_quote_header = has_iso_chars = 0 header = [] header_end = '' message = [] message_end = '' # read header hfile = HeaderFile(ifile) while 1: line = h...
69155682e614bba1ad5978f605263f04f37b2ced /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69155682e614bba1ad5978f605263f04f37b2ced/mimify.py
if must_quote_body:
if is_base64: line = line + 'base64\n' elif must_quote_body:
def mimify_part(ifile, ofile, is_mime): '''Convert an 8bit part of a MIME mail message to quoted-printable.''' has_cte = is_qp = 0 multipart = None must_quote_body = must_quote_header = has_iso_chars = 0 header = [] header_end = '' message = [] message_end = '' # read header hfile = HeaderFile(ifile) while 1: line = h...
69155682e614bba1ad5978f605263f04f37b2ced /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69155682e614bba1ad5978f605263f04f37b2ced/mimify.py
verify(f4.func_code.co_varnames == ('two', '.2', 'compound', 'argument', 'list')) verify(f5.func_code.co_varnames == ('.0', 'two', 'compound', 'first'))
if sys.platform.startswith('java'): verify(f4.func_code.co_varnames == ('two', '(compound, (argument, list))',)) verify(f5.func_code.co_varnames == ('(compound, first)', 'two', 'compound', 'first')) else: verify(f4.func_code.co_varnames == ('two', '.2', 'compound', 'argument', 'list')) verify(f5.func_code.co_varnames ...
def f5((compound, first), two): pass
7d3dff2b390272dec07ca687f53ad34bd00df39b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7d3dff2b390272dec07ca687f53ad34bd00df39b/test_grammar.py
verify(v3.func_code.co_varnames == ('a', '.2', 'rest', 'b', 'c'))
if sys.platform.startswith('java'): verify(v3.func_code.co_varnames == ('a', '(b, c)', 'rest', 'b', 'c')) else: verify(v3.func_code.co_varnames == ('a', '.2', 'rest', 'b', 'c'))
def v3(a, (b, c), *rest): return a, b, c, rest
7d3dff2b390272dec07ca687f53ad34bd00df39b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7d3dff2b390272dec07ca687f53ad34bd00df39b/test_grammar.py
u = u''.join(map(unichr, xrange(1024))) for encoding in ('utf-7', 'utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'raw_unicode_escape', 'unicode_escape', 'unicode_internal'): self.assertEqual(unicode(u.encode(encoding),encoding), u)
for c in xrange(1024): u = unichr(c) for encoding in ('utf-7', 'utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', 'raw_unicode_escape', 'unicode_escape', 'unicode_internal'): self.assertEqual(unicode(u.encode(encoding),encoding), u)
def test_codecs(self): # Encoding self.assertEqual(u'hello'.encode('ascii'), 'hello') self.assertEqual(u'hello'.encode('utf-7'), 'hello') self.assertEqual(u'hello'.encode('utf-8'), 'hello') self.assertEqual(u'hello'.encode('utf8'), 'hello') self.assertEqual(u'hello'.encode('utf-16-le'), 'h\000e\000l\000l\000o\000') sel...
835b243c71f5529da95aca5ca78fb9939278cffe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/835b243c71f5529da95aca5ca78fb9939278cffe/test_unicode.py
u = u''.join(map(unichr, xrange(256))) for encoding in ('latin-1',): self.assertEqual(unicode(u.encode(encoding),encoding), u)
for c in xrange(256): u = unichr(c) for encoding in ('latin-1',): self.assertEqual(unicode(u.encode(encoding),encoding), u)
def test_codecs(self): # Encoding self.assertEqual(u'hello'.encode('ascii'), 'hello') self.assertEqual(u'hello'.encode('utf-7'), 'hello') self.assertEqual(u'hello'.encode('utf-8'), 'hello') self.assertEqual(u'hello'.encode('utf8'), 'hello') self.assertEqual(u'hello'.encode('utf-16-le'), 'h\000e\000l\000l\000o\000') sel...
835b243c71f5529da95aca5ca78fb9939278cffe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/835b243c71f5529da95aca5ca78fb9939278cffe/test_unicode.py
u = u''.join(map(unichr, xrange(128))) for encoding in ('ascii',): self.assertEqual(unicode(u.encode(encoding),encoding), u)
for c in xrange(128): u = unichr(c) for encoding in ('ascii',): self.assertEqual(unicode(u.encode(encoding),encoding), u)
def test_codecs(self): # Encoding self.assertEqual(u'hello'.encode('ascii'), 'hello') self.assertEqual(u'hello'.encode('utf-7'), 'hello') self.assertEqual(u'hello'.encode('utf-8'), 'hello') self.assertEqual(u'hello'.encode('utf8'), 'hello') self.assertEqual(u'hello'.encode('utf-16-le'), 'h\000e\000l\000l\000o\000') sel...
835b243c71f5529da95aca5ca78fb9939278cffe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/835b243c71f5529da95aca5ca78fb9939278cffe/test_unicode.py
s = "Module(%r" % % (self.__name__,)
s = "Module(%r" % (self.__name__,)
def __repr__(self): s = "Module(%r" % % (self.__name__,) if self.__file__ is not None: s = s + ", %r" % (self.__file__,) if self.__path__ is not None: s = s + ", %r" % (self.__path__,) s = s + ")" return s
32d23c9264a44316b028f712bdc516fbddb0a752 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/32d23c9264a44316b028f712bdc516fbddb0a752/modulefinder.py
self.socket.close()
def process_request(self, request, client_address): """Fork a new subprocess to process the request.""" self.collect_children() pid = os.fork() if pid: # Parent process if self.active_children is None: self.active_children = [] self.active_children.append(pid) return else: # Child process. # This must never return, hen...
198e7cac5a3267ffa7243514ac085410f2638c69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/198e7cac5a3267ffa7243514ac085410f2638c69/SocketServer.py
testboth("% testboth("% testboth("% testboth("%
testboth("% testboth("% testboth("% testboth("%
def testboth(formatstr, *args): testformat(formatstr, *args) testformat(unicode(formatstr), *args)
fff53250789c3879e5f63d4dde80d17e0b9c4dbb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fff53250789c3879e5f63d4dde80d17e0b9c4dbb/test_format.py
def set_link_objects (self, objects): """Set the list of object files (or analogues) to be included in every link to 'objects'. This does not affect any standard object files that the linker may include by default (such as system libraries). """ self.objects = copy (objects)
e65008038eccdcef396b0b2c09c8b4d72cf9b915 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e65008038eccdcef396b0b2c09c8b4d72cf9b915/ccompiler.py
n = int(s.rstrip(NUL) or "0", 8)
n = int(s.rstrip(NUL + " ") or "0", 8)
def nti(s): """Convert a number field to a python number. """ # There are two possible encodings for a number field, see # itn() below. if s[0] != chr(0200): n = int(s.rstrip(NUL) or "0", 8) else: n = 0L for i in xrange(len(s) - 1): n <<= 8 n += ord(s[i + 1]) return n
58bf57fa040741496cd4c53c85e3269a3e11af1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58bf57fa040741496cd4c53c85e3269a3e11af1b/tarfile.py
if re.match(e[1], result): continue
if re.match(escapestr(e[1], ampm), result): continue
def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = str(long(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='(AM|am)' else: ampm='(PM|pm)' jan1 = time.localtime(time.mktime((now[0], 1, 1, 0, 0, 0, 0, 1, 0))) try: if now[8]: tz = time.tzname[1] else: t...
c82208eecbe97e1535be4b1c8c12a68d54d29bd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c82208eecbe97e1535be4b1c8c12a68d54d29bd5/test_strftime.py
if re.match(e[1], result):
if re.match(escapestr(e[1], ampm), result):
def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = str(long(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='(AM|am)' else: ampm='(PM|pm)' jan1 = time.localtime(time.mktime((now[0], 1, 1, 0, 0, 0, 0, 1, 0))) try: if now[8]: tz = time.tzname[1] else: t...
c82208eecbe97e1535be4b1c8c12a68d54d29bd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c82208eecbe97e1535be4b1c8c12a68d54d29bd5/test_strftime.py
self.socket.connect(address)
self.socket.connect(address)
def _connect_unixsocket(self, address): self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) # syslog may require either DGRAM or STREAM sockets try: self.socket.connect(address) except socket.error: self.socket.close() self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.socket.connect(addres...
8b6b53f8ac132603e040145b5bbfd27a18015888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6b53f8ac132603e040145b5bbfd27a18015888/handlers.py
s = pickle.dumps(d) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e))
for i in (0, 1, 2): s = pickle.dumps(d, i) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e)) def test_pickle_recursive(self): d = deque('abc') d.append(d) for i in (0, 1, 2): e = pickle.loads(pickle.dumps(d, i)) self.assertNotEqual(id(d), id(e)) self.assertEqual(id(e), id(e[-1]))...
def test_pickle(self): d = deque(xrange(200)) s = pickle.dumps(d) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e))
952f8808b264f82b6dbf8e613307769050eba611 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/952f8808b264f82b6dbf8e613307769050eba611/test_deque.py
def test(openmethod, what):
def test(openmethod, what, ondisk=1):
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
print '\nTesting: ', what
print '\nTesting: ', what, (ondisk and "on disk" or "in memory")
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
fname = tempfile.mktemp()
if ondisk: fname = tempfile.mktemp() else: fname = None
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
if verbose: print 'modification...' f = openmethod(fname, 'w') f['d'] = 'discovered'
if ondisk: if verbose: print 'modification...' f = openmethod(fname, 'w') f['d'] = 'discovered'
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
if verbose: print 'access...' for key in f.keys(): word = f[key]
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
print word
print 'access...' for key in f.keys(): word = f[key] if verbose: print word
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
f.close() try: os.remove(fname) except os.error: pass
f.close() try: os.remove(fname) except os.error: pass
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
test(type[0], type[1])
test(*type)
def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b...
8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py
sys.stdout = sys.__stdout__
sys.stdout = saved_stdout
def assertValid(self, str, symbol='single'): '''succeed iff str is a valid piece of code''' 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.stdo...
72c5c77ce17b5b1dbe23a10bc801d1169cf94d92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/72c5c77ce17b5b1dbe23a10bc801d1169cf94d92/test_codeop.py
dbfile = s.optiondb()['DBFILE']
dbfile = s.optiondb().get('DBFILE')
def build(master=None, initialcolor=None, initfile=None, ignore=None, dbfile=None): # create all output widgets s = Switchboard(not ignore and initfile) # defer to the command line chosen color database, falling back to the one # in the .pynche file. if dbfile is None: dbfile = s.optiondb()['DBFILE'] # find a parseable...
eb296d967b4e1ff2e87d652cf1d80f6adedb1228 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/eb296d967b4e1ff2e87d652cf1d80f6adedb1228/Main.py
rounding = context.rounding
def __pow__(self, n, modulo = None, context=None): """Return self ** n (mod modulo)
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
shouldround = context._rounding_decision == ALWAYS_ROUND
def __pow__(self, n, modulo = None, context=None): """Return self ** n (mod modulo)
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
if shouldround:
if context._rounding_decision == ALWAYS_ROUND:
def __pow__(self, n, modulo = None, context=None): """Return self ** n (mod modulo)
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
out = 0
def _rescale(self, exp, rounding=None, context=None, watchexp=1): """Rescales so that the exponent is exp.
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
prevexact = context.flags[Inexact]
def _rescale(self, exp, rounding=None, context=None, watchexp=1): """Rescales so that the exponent is exp.
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
count = 1
def sqrt(self, context=None): """Return the square root of self.
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
context._rounding_decision == ALWAYS_ROUND return ans._fix(context)
if context._rounding_decision == ALWAYS_ROUND: return ans._fix(context) return ans
def max(self, other, context=None): """Returns the larger value.
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
context._rounding_decision == ALWAYS_ROUND return ans._fix(context)
if context._rounding_decision == ALWAYS_ROUND: return ans._fix(context) return ans
def min(self, other, context=None): """Returns the smaller value.
76e60d687dde9d987f39e16f8fe7814daf1f1e26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76e60d687dde9d987f39e16f8fe7814daf1f1e26/decimal.py
verify(log == [('getattr', '__init__'), ('getattr', '__setattr__'),
verify(log == [('getattr', '__setattr__'),
def __delattr__(self, name): log.append(("delattr", name)) MT.__delattr__(self, name)
a5be8eda37e864ed3c169b8e2c660d3c65eaec38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a5be8eda37e864ed3c169b8e2c660d3c65eaec38/test_descr.py
cur = (32767 * viewoffset) / (destheight - viewheight)
cur = (32767L * viewoffset) / (destheight - viewheight)
def vscroll(self, value): lineheight = self.ted.WEGetHeight(0, 1) dr = self.ted.WEGetDestRect() vr = self.ted.WEGetViewRect() destheight = dr[3] - dr[1] viewheight = vr[3] - vr[1] viewoffset = maxdelta = vr[1] - dr[1] mindelta = vr[3] - dr[3] if value == "+": delta = lineheight elif value == "-": delta = - lineheight e...
6c487c4d34a0dc80b2ed942acb487d32f8938798 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6c487c4d34a0dc80b2ed942acb487d32f8938798/Wtext.py
tcl_version = self.tk.getvar('tcl_version')
tcl_version = str(self.tk.getvar('tcl_version'))
def __init__(self, screenName=None, baseName=None, className='Tk'): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is given. CLA...
5489597f56e82f9b8d2b519651f80241f4ea4326 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5489597f56e82f9b8d2b519651f80241f4ea4326/Tkinter.py
base = base.replace("/", ".")
base = base.replace(os.sep, ".") if os.altsep: base = base.replace(os.altsep, ".")
def fullmodname(path): """Return a plausible module name for the path.""" # If the file 'path' is part of a package, then the filename isn't # enough to uniquely identify it. Try to do the right thing by # looking in sys.path for the longest matching prefix. We'll # assume that the rest is the package name. longest...
bbca8da3ca5191d68c4cd8777b8ba8632c0cff44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbca8da3ca5191d68c4cd8777b8ba8632c0cff44/trace.py
return
return 0, 0
def write_results_file(self, path, lines, lnotab, lines_hit): """Return a coverage results file in path."""
bbca8da3ca5191d68c4cd8777b8ba8632c0cff44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbca8da3ca5191d68c4cd8777b8ba8632c0cff44/trace.py
raise RuntimeError, "UserList.__cmp__() is obsolete"
return cmp(self.data, self.__cast(other))
def __cmp__(self, other): raise RuntimeError, "UserList.__cmp__() is obsolete"
0163d6d6ef85dd0cd0ea4ea6dce4b867e39cd6b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0163d6d6ef85dd0cd0ea4ea6dce4b867e39cd6b9/UserList.py
if brightness <= 0.5:
if brightness <= 128:
def __trackarrow(self, chip, rgbtuple): # invert the last chip if self.__lastchip is not None: color = self.__canvas.itemcget(self.__lastchip, 'fill') self.__canvas.itemconfigure(self.__lastchip, outline=color) self.__lastchip = chip
26f4b5dfe4f357d662a015f0c89a925fb0fe3465 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26f4b5dfe4f357d662a015f0c89a925fb0fe3465/StripViewer.py
ioloop(s, otheraddr) except KeyboardInterrupt: log('client got intr') except error: log('client got error')
try: ioloop(s, otheraddr) except KeyboardInterrupt: log('client got intr') except error: log('client got error')
def client(hostname): print 'client starting' cmd = 'rsh ' + hostname + ' "cd ' + AUDIODIR cmd = cmd + '; DISPLAY=:0; export DISPLAY' cmd = cmd + '; ' + PYTHON + ' intercom.py -r ' for flag in debug: cmd = cmd + flag + ' ' cmd = cmd + gethostname() cmd = cmd + '"' if debug: print cmd pipe = posix.popen(cmd, 'r') ack = ...
6f1f39188c54b89bac8b0e3b91529ad733929bc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6f1f39188c54b89bac8b0e3b91529ad733929bc4/intercom.py