rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
socketDataProcessed.acquire()
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). #...
b12ca583a6d7086b0f656a4acc8ada68425877b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b12ca583a6d7086b0f656a4acc8ada68425877b6/test_logging.py
socketDataProcessed.release()
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). #...
b12ca583a6d7086b0f656a4acc8ada68425877b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b12ca583a6d7086b0f656a4acc8ada68425877b6/test_logging.py
self.assertRaises(ValueError, u"%c".__mod__, (sys.maxunicode+1,))
self.assertRaises(OverflowError, u"%c".__mod__, (sys.maxunicode+1,))
def test_formatting(self): string_tests.MixinStrUnicodeUserStringTest.test_formatting(self) # Testing Unicode formatting strings... self.assertEqual(u"%s, %s" % (u"abc", "abc"), u'abc, abc') self.assertEqual(u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", 1, 2, 3), u'abc, abc, 1, 2.000000, 3.00') self.assertEqual(u"%s, %s,...
af4d89be439790637af3f16f817c0df3594b297e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/af4d89be439790637af3f16f817c0df3594b297e/test_unicode.py
raise error, "bogus escape"
raise error, "bogus escape (end of line)"
def __next(self): if self.index >= len(self.string): self.next = None return char = self.string[self.index] if char[0] == "\\": try: c = self.string[self.index + 1] except IndexError: raise error, "bogus escape" char = char + c self.index = self.index + len(char) self.next = char
8cdf1d98cb8676d10b31e6eaa984064db5ec019d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cdf1d98cb8676d10b31e6eaa984064db5ec019d/sre_parse.py
"""Container for the properties of an event.
"""Container for the properties of an event.
def _cnfmerge(cnfs): """Internal function.""" if type(cnfs) is DictionaryType: return cnfs elif type(cnfs) in (NoneType, StringType): return cnfs else: cnf = {} for c in _flatten(cnfs): try: cnf.update(c) except (AttributeError, TypeError), msg: print "_cnfmerge: fallback due to:", msg for k, v in c.items(): cnf[k] = v...
c2bfd9409912b5d4eb3e4b97641fc6321393918f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2bfd9409912b5d4eb3e4b97641fc6321393918f/Tkinter.py
"""Return a tupel of x and y coordinates of the pointer on the root window."""
"""Return a tuple of x and y coordinates of the pointer on the root window."""
def winfo_pointerxy(self): """Return a tupel of x and y coordinates of the pointer on the root window.""" return self._getints( self.tk.call('winfo', 'pointerxy', self._w))
c2bfd9409912b5d4eb3e4b97641fc6321393918f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2bfd9409912b5d4eb3e4b97641fc6321393918f/Tkinter.py
return getint(
return getint(
def winfo_pointery(self): """Return the y coordinate of the pointer on the root window.""" return getint( self.tk.call('winfo', 'pointery', self._w))
c2bfd9409912b5d4eb3e4b97641fc6321393918f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2bfd9409912b5d4eb3e4b97641fc6321393918f/Tkinter.py
"""Return tupel of decimal values for red, green, blue for
"""Return tuple of decimal values for red, green, blue for
def winfo_rgb(self, color): """Return tupel of decimal values for red, green, blue for COLOR in this widget.""" return self._getints( self.tk.call('winfo', 'rgb', self._w, color))
c2bfd9409912b5d4eb3e4b97641fc6321393918f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2bfd9409912b5d4eb3e4b97641fc6321393918f/Tkinter.py
def __init__(self, name=""): """Construct a TarInfo object. name is the optional name of the member. """
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
self.prefix = ""
def __init__(self, name=""): """Construct a TarInfo object. name is the optional name of the member. """
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
tarinfo.prefix = buf[345:500]
prefix = buf[345:500].rstrip(NUL) if prefix and not tarinfo.issparse(): tarinfo.name = prefix + "/" + tarinfo.name
def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise ValueError("empty header")
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
"""Return a tar header block as a 512 byte string. """
"""Return a tar header as a string of 512 byte blocks. """ buf = "" type = self.type prefix = "" if self.name.endswith("/"): type = DIRTYPE name = normpath(self.name) if type == DIRTYPE: name += "/" linkname = self.linkname if linkname: linkname = normpath(linkname) if posix: if self.size > MAXSIZE_MEMBER: raise...
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
stn(self.name, 100),
stn(name, 100),
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
self.type,
type,
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
stn(self.prefix, 155)
stn(prefix, 155)
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
buf = struct.pack("%ds" % BLOCKSIZE, "".join(parts))
buf += struct.pack("%ds" % BLOCKSIZE, "".join(parts))
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
buf = buf[:148] + "%06o\0" % chksum + buf[155:]
buf = buf[:-364] + "%06o\0" % chksum + buf[-357:]
def tobuf(self, posix=False): """Return a tar header block as a 512 byte string. """ parts = [ stn(self.name, 100), itn(self.mode & 07777, 8, posix), itn(self.uid, 8, posix), itn(self.gid, 8, posix), itn(self.size, 12, posix), itn(self.mtime, 12, posix), " ", # checksum field self.type, stn(self.linkname, 100), ...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
tarinfo.name = normpath(tarinfo.name) if tarinfo.isdir(): tarinfo.name += "/" if tarinfo.linkname: tarinfo.linkname = normpath(tarinfo.linkname) if tarinfo.size > MAXSIZE_MEMBER: if self.posix: raise ValueError("file is too large (>= 8 GB)") else: self._dbg(2, "tarfile: Created GNU tar largefile header") if len(ta...
tarinfo = copy.copy(tarinfo) buf = tarinfo.tobuf(self.posix) self.fileobj.write(buf) self.offset += len(buf)
def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
tarinfo.name = normpath(os.path.join(tarinfo.prefix.rstrip(NUL), tarinfo.name))
def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
tarinfo.prefix = ""
def proc_sparse(self, tarinfo): """Process a GNU sparse header plus extra headers. """ buf = tarinfo.buf sp = _ringbuffer() pos = 386 lastpos = 0L realpos = 0L # There are 4 possible sparse structs in the # first header. for i in xrange(4): try: offset = nti(buf[pos:pos + 12]) numbytes = nti(buf[pos + 12:pos + 24]) exc...
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
def _create_gnulong(self, name, type): """Write a GNU longname/longlink member to the TarFile. It consists of an extended tar header, with the length of the longname as size, followed by data blocks, which contain the longname as a null terminated string. """ name += NUL tarinfo = TarInfo() tarinfo.name = "././@LongL...
def __iter__(self): """Provide an iterator object. """ if self._loaded: return iter(self.members) else: return TarIter(self)
a5d321590b6fbeded04d879956891c67090e606f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5d321590b6fbeded04d879956891c67090e606f/tarfile.py
except:
except NameError:
def _init_categories(categories=categories): for k,v in globals().items(): if k[:3] == 'LC_': categories[k] = v
326fc0c070ceed2a8a465b214cb3a3c65bce272f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/326fc0c070ceed2a8a465b214cb3a3c65bce272f/locale.py
This is called by the http_error_30x methods when a redirection response is received. If a redirection should take place, return a new Request to allow http_error_30x to perform the redirect. Otherwise, raise HTTPError if no-one else should try to handle this url. Return None if you can't but another Handler might.
This is called by the http_error_30x methods when a redirection response is received. If a redirection should take place, return a new Request to allow http_error_30x to perform the redirect. Otherwise, raise HTTPError if no-one else should try to handle this url. Return None if you can't but another Handler might.
def redirect_request(self, req, fp, code, msg, headers, newurl): """Return a Request or None in response to a redirect.
20de815e627877d604ee88b5781bf5b64b2edb18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20de815e627877d604ee88b5781bf5b64b2edb18/urllib2.py
user, password = HTTPPasswordMgr.find_user_password(self,realm,authuri)
user, password = HTTPPasswordMgr.find_user_password(self, realm, authuri)
def find_user_password(self, realm, authuri): user, password = HTTPPasswordMgr.find_user_password(self,realm,authuri) if user is not None: return user, password return HTTPPasswordMgr.find_user_password(self, None, authuri)
20de815e627877d604ee88b5781bf5b64b2edb18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20de815e627877d604ee88b5781bf5b64b2edb18/urllib2.py
header = 'Authorization'
auth_header = 'Authorization'
def get_entity_digest(self, data, chal): # XXX not implemented yet return None
20de815e627877d604ee88b5781bf5b64b2edb18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20de815e627877d604ee88b5781bf5b64b2edb18/urllib2.py
header = 'Proxy-Authorization'
auth_header = 'Proxy-Authorization'
def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] self.http_error_auth_reqed('www-authenticate', host, req, headers)
20de815e627877d604ee88b5781bf5b64b2edb18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20de815e627877d604ee88b5781bf5b64b2edb18/urllib2.py
if path.startswith(dir) and path[len(dir)] == os.path.sep:
dir = os.path.normcase(dir) if comparepath.startswith(dir) and comparepath[len(dir)] == os.sep:
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...
7e47ee1f260b297b5c11015bbcdb53dbe10da90a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7e47ee1f260b297b5c11015bbcdb53dbe10da90a/trace.py
FILE = open(self.file_path, 'wU')
FILE = open(self.file_path, 'w')
def create(self): """Create a .pth file with a comment, blank lines, an ``import <self.imported>``, a line with self.good_dirname, and a line with self.bad_dirname.
936bc6091d116f5ac4135118d15148b7cbf231b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/936bc6091d116f5ac4135118d15148b7cbf231b7/test_site.py
return os.path.join(prefix, "Mac", "Plugins")
return os.path.join(prefix, "Lib", "lib-dynload")
def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the ...
e02d632ecbf922864b83cc707f4ea1e36509501a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e02d632ecbf922864b83cc707f4ea1e36509501a/sysconfig.py
raise DistutilsPlatformError( "OK, where DO site-specific extensions go on the Mac?")
return os.path.join(prefix, "Lib", "site-packages")
def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the ...
e02d632ecbf922864b83cc707f4ea1e36509501a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e02d632ecbf922864b83cc707f4ea1e36509501a/sysconfig.py
raise DistutilsPlatformError( "OK, where DO site-specific modules go on the Mac?")
return os.path.join(prefix, "Lib", "site-packages")
def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the ...
e02d632ecbf922864b83cc707f4ea1e36509501a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e02d632ecbf922864b83cc707f4ea1e36509501a/sysconfig.py
import macfs
import macfs
def islink(s): """Return true if the pathname refers to a symbolic link.""" try: import macfs return macfs.ResolveAliasFile(s)[2] except: return False
d79ca7d394cfa8387460f121d73f6147718acfc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d79ca7d394cfa8387460f121d73f6147718acfc0/macpath.py
path = os.path.join(host, path) if path[-1] == "/": path = path + "index.html"
if not path or path[-1] == "/": path = path + "index.html"
def savefilename(self, url): type, rest = urllib.splittype(url) host, path = urllib.splithost(rest) while path[:1] == "/": path = path[1:] user, host = urllib.splituser(host) host, port = urllib.splitnport(host) host = string.lower(host) path = os.path.join(host, path) if path[-1] == "/": path = path + "index.html" if ...
6b4dae1604cc214f5125fc888e72dfd12c7afc67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b4dae1604cc214f5125fc888e72dfd12c7afc67/websucker.py
l.append (fd, flags)
l.append ((fd, flags))
def poll2 (timeout=0.0): import poll # timeout is in milliseconds timeout = int(timeout*1000) if socket_map: fd_map = {} for s in socket_map.keys(): fd_map[s.fileno()] = s l = [] for fd, s in fd_map.items(): flags = 0 if s.readable(): flags = poll.POLLIN if s.writable(): flags = flags | poll.POLLOUT if flags: l.append ...
1a2db408820053542eb9c09530d1c00e5cd61f75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a2db408820053542eb9c09530d1c00e5cd61f75/asyncore.py
tbinfo.append (
tbinfo.append ((
def compact_traceback (): t,v,tb = sys.exc_info() tbinfo = [] while 1: tbinfo.append ( tb.tb_frame.f_code.co_filename, tb.tb_frame.f_code.co_name, str(tb.tb_lineno) ) tb = tb.tb_next if not tb: break # just to be safe del tb file, function, line = tbinfo[-1] info = '[' + string.join ( map ( lambda x: string.join (x, ...
1a2db408820053542eb9c09530d1c00e5cd61f75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a2db408820053542eb9c09530d1c00e5cd61f75/asyncore.py
tb.tb_frame.f_code.co_name,
tb.tb_frame.f_code.co_name,
def compact_traceback (): t,v,tb = sys.exc_info() tbinfo = [] while 1: tbinfo.append ( tb.tb_frame.f_code.co_filename, tb.tb_frame.f_code.co_name, str(tb.tb_lineno) ) tb = tb.tb_next if not tb: break # just to be safe del tb file, function, line = tbinfo[-1] info = '[' + string.join ( map ( lambda x: string.join (x, ...
1a2db408820053542eb9c09530d1c00e5cd61f75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a2db408820053542eb9c09530d1c00e5cd61f75/asyncore.py
)
))
def compact_traceback (): t,v,tb = sys.exc_info() tbinfo = [] while 1: tbinfo.append ( tb.tb_frame.f_code.co_filename, tb.tb_frame.f_code.co_name, str(tb.tb_lineno) ) tb = tb.tb_next if not tb: break # just to be safe del tb file, function, line = tbinfo[-1] info = '[' + string.join ( map ( lambda x: string.join (x, ...
1a2db408820053542eb9c09530d1c00e5cd61f75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a2db408820053542eb9c09530d1c00e5cd61f75/asyncore.py
'ext_modules': ('build_ext', 'modules'),
'ext_modules': ('build_ext', 'extensions'),
def setup (**attrs): """The gateway to the Distutils: do everything your setup script needs to do, in a highly flexible and user-driven way. Briefly: create a Distribution instance; parse the command-line, creating and customizing instances of the command class for each command found on the command-line; run each of t...
363e008b0984072a91bd94e893ad053fb115cf56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/363e008b0984072a91bd94e893ad053fb115cf56/core.py
"command %s: no such option %s" % \
"command '%s': no such option '%s'" % \
def set_option (self, option, value): """Set the value of a single option for this command. Raise DistutilsOptionError if 'option' is not known."""
363e008b0984072a91bd94e893ad053fb115cf56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/363e008b0984072a91bd94e893ad053fb115cf56/core.py
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
387f886616dbba17fb0cbf3f2ed160325117c2b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/387f886616dbba17fb0cbf3f2ed160325117c2b8/setup.py
env_val = os.getenv(env_var)
env_val = sysconfig.get_config_var(env_var)
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
387f886616dbba17fb0cbf3f2ed160325117c2b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/387f886616dbba17fb0cbf3f2ed160325117c2b8/setup.py
output.write(input.read())
return output.write(input.read())
def decode(input, output, encoding): """Decode common content-transfer-encodings (base64, quopri, uuencode).""" if encoding == 'base64': import base64 return base64.decode(input, output) if encoding == 'quoted-printable': import quopri return quopri.decode(input, output) if encoding in ('uuencode', 'x-uuencode', 'uue',...
aa2aaa53f3cfd347bd8a4f3e9e4a036e3c8f41f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa2aaa53f3cfd347bd8a4f3e9e4a036e3c8f41f8/mimetools.py
output.write(input.read())
return output.write(input.read())
def encode(input, output, encoding): """Encode common content-transfer-encodings (base64, quopri, uuencode).""" if encoding == 'base64': import base64 return base64.encode(input, output) if encoding == 'quoted-printable': import quopri return quopri.encode(input, output, 0) if encoding in ('uuencode', 'x-uuencode', 'uu...
aa2aaa53f3cfd347bd8a4f3e9e4a036e3c8f41f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa2aaa53f3cfd347bd8a4f3e9e4a036e3c8f41f8/mimetools.py
FILE = file(test_support.TESTFN, 'w')
FILE = file(test_support.TESTFN, 'wb')
def setUp(self): """Setup of a temp file to use for testing""" self.text = "test_urllib: %s\n" % self.__class__.__name__ FILE = file(test_support.TESTFN, 'w') try: FILE.write(self.text) finally: FILE.close() self.pathname = test_support.TESTFN self.returned_obj = urllib.urlopen("file:%s" % self.pathname)
0244c7405d6d30653be5ec1be555809e876e451c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0244c7405d6d30653be5ec1be555809e876e451c/test_urllib.py
prefix = m[0] for item in m: for i in range(len(prefix)): if prefix[:i+1] != item[:i+1]: prefix = prefix[:i] if i == 0: return '' break return prefix
s1 = min(m) s2 = max(m) n = min(len(s1), len(s2)) for i in xrange(n): if s1[i] != s2[i]: return s1[:i] return s1[:n]
def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' prefix = m[0] for item in m: for i in range(len(prefix)): if prefix[:i+1] != item[:i+1]: prefix = prefix[:i] if i == 0: return '' break return prefix
d04bdebb06ff2c76629ecb030df623125ffd8954 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d04bdebb06ff2c76629ecb030df623125ffd8954/posixpath.py
inc_dir = get_python_inc(plat_specific=1)
if python_build: inc_dir = '.' else: inc_dir = get_python_inc(plat_specific=1)
def get_config_h_filename(): """Return full pathname of installed config.h file.""" inc_dir = get_python_inc(plat_specific=1) return os.path.join(inc_dir, "config.h")
be596c4e7399c1d2d8df512cb5c7df1a15f9c315 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/be596c4e7399c1d2d8df512cb5c7df1a15f9c315/sysconfig.py
if os.name == 'mac': def writable(self): return not self.accepting else: def writable(self): return True
def writable(self): return True
def readable(self): return True
0f998027cc4f83e4bb8c052e65d620fe3d011a9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0f998027cc4f83e4bb8c052e65d620fe3d011a9f/asyncore.py
typ, dat = self._simple_command('GETQUOTA', root)
typ, dat = self._simple_command('GETQUOTA', mailbox)
def getquotaroot(self, mailbox): """Get the list of quota roots for the named mailbox.
857ee505440131ca1750d94966f51ba4b2fbd0ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/857ee505440131ca1750d94966f51ba4b2fbd0ca/imaplib.py
self.disallow_all = 0 self.allow_all = 0
self.disallow_all = False self.allow_all = False
def __init__(self, url=''): self.entries = [] self.default_entry = None self.disallow_all = 0 self.allow_all = 0 self.set_url(url) self.last_checked = 0
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
self.disallow_all = 1
self.disallow_all = True
def read(self): """Reads the robots.txt URL and feeds it to the parser.""" opener = URLopener() f = opener.open(self.url) lines = [] line = f.readline() while line: lines.append(line.strip()) line = f.readline() self.errcode = opener.errcode if self.errcode == 401 or self.errcode == 403: self.disallow_all = 1 _debug("d...
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
self.allow_all = 1
self.allow_all = True
def read(self): """Reads the robots.txt URL and feeds it to the parser.""" opener = URLopener() f = opener.open(self.url) lines = [] line = f.readline() while line: lines.append(line.strip()) line = f.readline() self.errcode = opener.errcode if self.errcode == 401 or self.errcode == 403: self.disallow_all = 1 _debug("d...
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
entry.rulelines.append(RuleLine(line[1], 0))
entry.rulelines.append(RuleLine(line[1], False))
def parse(self, lines): """parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.""" state = 0 linenumber = 0 entry = Entry()
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
entry.rulelines.append(RuleLine(line[1], 1))
entry.rulelines.append(RuleLine(line[1], True))
def parse(self, lines): """parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.""" state = 0 linenumber = 0 entry = Entry()
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
"""A rule line is a single "Allow:" (allowance==1) or "Disallow:" (allowance==0) followed by a path."""
"""A rule line is a single "Allow:" (allowance==True) or "Disallow:" (allowance==False) followed by a path."""
def __str__(self): ret = "" for entry in self.entries: ret = ret + str(entry) + "\n" return ret
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
allowance = 1
allowance = True
def __init__(self, path, allowance): if path == '' and not allowance: # an empty value means allow all allowance = 1 self.path = urllib.quote(path) self.allowance = allowance
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
return 1
return True
def allowance(self, filename): """Preconditions: - our agent applies to this entry - filename is URL decoded""" for line in self.rulelines: _debug((filename, str(line), line.allowance)) if line.applies_to(filename): return line.allowance return 1
cdc5dc13bf5601f11087fe93324730aef873843b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdc5dc13bf5601f11087fe93324730aef873843b/robotparser.py
'$CC -Wl,-t -o /dev/null 2>&1 -l' + name
'$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name
def _findLib_gcc(name): expr = '[^\(\)\s]*lib%s\.[^\(\)\s]*' % name cmd = 'if type gcc &>/dev/null; then CC=gcc; else CC=cc; fi;' \ '$CC -Wl,-t -o /dev/null 2>&1 -l' + name try: fdout, outfile = tempfile.mkstemp() fd = os.popen(cmd) trace = fd.read() err = fd.close() finally: try: os.unlink(outfile) except OSError, e:...
5ecd565a310c7efd0270382d27f395e78aae57ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5ecd565a310c7efd0270382d27f395e78aae57ab/util.py
def index(path, archivo, output):
def index(path, indexpage, output):
def index(path, archivo, output): f = formatter.AbstractFormatter(AlmostNullWriter()) parser = IdxHlpHtmlParser(f) parser.path = path parser.ft = output fil = path + '/' + archivo parser.feed(open(fil).read()) parser.close()
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
fil = path + '/' + archivo parser.feed(open(fil).read())
f = open(path + '/' + indexpage) parser.feed(f.read())
def index(path, archivo, output): f = formatter.AbstractFormatter(AlmostNullWriter()) parser = IdxHlpHtmlParser(f) parser.path = path parser.ft = output fil = path + '/' + archivo parser.feed(open(fil).read()) parser.close()
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
def content(path, archivo, output):
f.close() def content(path, contentpage, output):
def index(path, archivo, output): f = formatter.AbstractFormatter(AlmostNullWriter()) parser = IdxHlpHtmlParser(f) parser.path = path parser.ft = output fil = path + '/' + archivo parser.feed(open(fil).read()) parser.close()
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
fil = path + '/' + archivo parser.feed(open(fil).read())
f = open(path + '/' + contentpage) parser.feed(f.read())
def content(path, archivo, output): f = formatter.AbstractFormatter(AlmostNullWriter()) parser = TocHlpHtmlParser(f) parser.path = path parser.ft = output fil = path + '/' + archivo parser.feed(open(fil).read()) parser.close()
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
print '\t', book[2] if book[4]: index(book[0], book[4], output)
print '\t', book.title, '-', book.indexpage if book.indexpage: index(book.directory, book.indexpage, output)
def do_index(library, output): output.write('<UL>\n') for book in library: print '\t', book[2] if book[4]: index(book[0], book[4], output) output.write('</UL>\n')
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
print '\t', book[2] output.write(object_sitemap % (book[0]+"/"+book[2], book[1])) if book[3]: content(book[0], book[3], output)
print '\t', book.title, '-', book.firstpage output.write(object_sitemap % (book.directory + "/" + book.firstpage, book.title)) if book.contentpage: content(book.directory, book.contentpage, output)
def do_content(library, version, output): output.write(contents_header % version) for book in library: print '\t', book[2] output.write(object_sitemap % (book[0]+"/"+book[2], book[1])) if book[3]: content(book[0], book[3], output) output.write(contents_footer)
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
directory = book[0]
directory = book.directory
def do_project(library, output, arch, version): output.write(project_template % locals()) for book in library: directory = book[0] path = directory + '\\%s\n' for page in os.listdir(directory): if page.endswith('.html') or page.endswith('.css'): output.write(path % page)
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
library = supported_libraries[ version ]
library = supported_libraries[version]
def do_it(args = None): if not args: args = sys.argv[1:] if not args: usage() try: optlist, args = getopt.getopt(args, 'ckpv:') except getopt.error, msg: print msg usage() if not args or len(args) > 1: usage() arch = args[0] version = None for opt in optlist: if opt[0] == '-v': version = opt[1] break if not version...
8015dfc7a15e3f806424cf9b38ac0fd2916f7714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8015dfc7a15e3f806424cf9b38ac0fd2916f7714/prechm.py
proxies[protocol] = '%s://%s' % (protocol, address)
type, address = splittype(address) if not type: address = '%s://%s' % (protocol, address) proxies[protocol] = address
def getproxies_registry(): """Return a dictionary of scheme -> proxy server URL mappings.
d597ca3d9862870f3cbf1c7881365128cb40f3c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d597ca3d9862870f3cbf1c7881365128cb40f3c0/urllib.py
fd = os.open(filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700)
fd = os.open(filename, os.O_RDWR | os.O_CREAT | os.O_EXCL, 0700)
def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0,...
6e01c4ab5ac2ed81ddd6c15179dfe1063910d3ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e01c4ab5ac2ed81ddd6c15179dfe1063910d3ed/tempfile.py
doc = `doc`
doc = '"' + doc + '"'
def outputGetSetList(self): if self.getsetlist: for name, get, set, doc in self.getsetlist: if get: self.outputGetter(name, get) else: Output("#define %s_get_%s NULL", self.prefix, name) if set: self.outputSetter(name, set) else: Output("#define %s_set_%s NULL", self.prefix, name) Output("static PyGetSetDef %s_getsetl...
58f7c2f628fd21b0cd986c52e47bd7f98f844acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58f7c2f628fd21b0cd986c52e47bd7f98f844acd/bgenObjectDefinition.py
Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s}",
Output("{\"%s\", (getter)%s_get_%s, (setter)%s_set_%s, %s},",
def outputGetSetList(self): if self.getsetlist: for name, get, set, doc in self.getsetlist: if get: self.outputGetter(name, get) else: Output("#define %s_get_%s NULL", self.prefix, name) if set: self.outputSetter(name, set) else: Output("#define %s_set_%s NULL", self.prefix, name) Output("static PyGetSetDef %s_getsetl...
58f7c2f628fd21b0cd986c52e47bd7f98f844acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58f7c2f628fd21b0cd986c52e47bd7f98f844acd/bgenObjectDefinition.py
Output("static int %s_get_%s(%s *self, PyObject *v, void *closure)",
Output("static int %s_set_%s(%s *self, PyObject *v, void *closure)",
def outputSetter(self, name, code): Output("static int %s_get_%s(%s *self, PyObject *v, void *closure)", self.prefix, name, self.objecttype) OutLbrace() Output(code) Output("return 0;") OutRbrace()
58f7c2f628fd21b0cd986c52e47bd7f98f844acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58f7c2f628fd21b0cd986c52e47bd7f98f844acd/bgenObjectDefinition.py
emit((av[0]-1)*2)
emit(av[0]-1)
def fixup(literal, flags=flags): return _sre.getlower(literal, flags)
4466f55f524737416d8193ec960009dbea6180f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4466f55f524737416d8193ec960009dbea6180f1/sre_compile.py
self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1)
self.set_reuse_addr()
def __init__(self, localaddr, remoteaddr): self._localaddr = localaddr self._remoteaddr = remoteaddr asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) # try to re-use a server port if possible self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt(...
d936b8a52f7f33f8ebd7f76a39aabf0ae157083e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d936b8a52f7f33f8ebd7f76a39aabf0ae157083e/smtpd.py
print """usage: basd64 [-d] [-e] [-u] [-t] [file|-]
print """usage: %s [-d|-e|-u|-t] [file|-]
def test(): """Small test program""" import sys, getopt try: opts, args = getopt.getopt(sys.argv[1:], 'deut') except getopt.error, msg: sys.stdout = sys.stderr print msg print """usage: basd64 [-d] [-e] [-u] [-t] [file|-] -d, -u: decode -e: encode (default) -t: decode string 'Aladdin:open sesame'""" sys.exit(2) func = ...
33f9f987fe46bfee692503cefaaae73700cd9f6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33f9f987fe46bfee692503cefaaae73700cd9f6f/base64.py
-t: decode string 'Aladdin:open sesame'"""
-t: encode and decode string 'Aladdin:open sesame'"""%sys.argv[0]
def test(): """Small test program""" import sys, getopt try: opts, args = getopt.getopt(sys.argv[1:], 'deut') except getopt.error, msg: sys.stdout = sys.stderr print msg print """usage: basd64 [-d] [-e] [-u] [-t] [file|-] -d, -u: decode -e: encode (default) -t: decode string 'Aladdin:open sesame'""" sys.exit(2) func = ...
33f9f987fe46bfee692503cefaaae73700cd9f6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33f9f987fe46bfee692503cefaaae73700cd9f6f/base64.py
class PyShell(MultiEditorWindow):
class PyShell(PyShellEditorWindow):
def write(self, s): # Override base class write self.tkconsole.console.write(s)
6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f/PyShell.py
flist = FileList(root) MultiEditorWindow.__init__(self, flist, None, None)
flist = PyShellFileList(root) PyShellEditorWindow.__init__(self, flist, None, None)
def __init__(self, flist=None): self.interp = ModifiedInterpreter(self) if flist is None: root = Tk() fixwordbreaks(root) root.withdraw() flist = FileList(root)
6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f/PyShell.py
reply = MultiEditorWindow.close(self)
reply = PyShellEditorWindow.close(self)
def close(self): # Extend base class method if self.executing: # XXX Need to ask a question here if not tkMessageBox.askokcancel( "Cancel?", "The program is still running; do you want to cancel it?", default="ok", master=self.text): return "cancel" self.canceled = 1 if self.reading: self.top.quit() return "cancel" repl...
6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f/PyShell.py
def interact(self):
def begin(self):
def interact(self): self.resetoutput() self.write("Python %s on %s\n%s\n" % (sys.version, sys.platform, sys.copyright)) try: sys.ps1 except AttributeError: sys.ps1 = ">>> " self.showprompt() import Tkinter Tkinter._default_root = None self.top.mainloop()
6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f/PyShell.py
flist = FileList(root)
flist = PyShellFileList(root)
def main(): global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = FileList(root) if sys.argv[1:]: for filename in sys.argv[1:]: flist.open(filename) t = PyShell(flist) t.interact()
6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f/PyShell.py
t.interact()
flist.pyshell = t t.begin() root.mainloop()
def main(): global flist, root root = Tk() fixwordbreaks(root) root.withdraw() flist = FileList(root) if sys.argv[1:]: for filename in sys.argv[1:]: flist.open(filename) t = PyShell(flist) t.interact()
6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6cc30cf0dd8dfcc402a00fc2e1e213407f2eac1f/PyShell.py
os.close(r2w[rd])
os.close(r2w[rd]) ; os.close( rd ) p.unregister( r2w[rd] ) p.unregister( rd )
def test_poll1(): """Basic functional test of poll object Create a bunch of pipe and test that poll works with them. """ print 'Running poll test 1' p = select.poll() NUM_PIPES = 12 MSG = " This is a test." MSG_LEN = len(MSG) readers = [] writers = [] r2w = {} w2r = {} for i in range(NUM_PIPES): rd, wr = os.pipe() p...
7df471db89dc663b66037c656e758b99fba2d76d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7df471db89dc663b66037c656e758b99fba2d76d/test_poll.py
if fdlist[0] == (p.fileno(),select.POLLHUP):
fd, flags = fdlist[0] if flags & select.POLLHUP:
def test_poll2(): print 'Running poll test 2' cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') pollster = select.poll() pollster.register( p, select.POLLIN ) for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10: if verbose: print 'timeout =', tout fdlist = pollster.pol...
7df471db89dc663b66037c656e758b99fba2d76d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7df471db89dc663b66037c656e758b99fba2d76d/test_poll.py
elif fdlist[0] == (p.fileno(),select.POLLIN):
elif flags & select.POLLIN:
def test_poll2(): print 'Running poll test 2' cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') pollster = select.poll() pollster.register( p, select.POLLIN ) for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10: if verbose: print 'timeout =', tout fdlist = pollster.pol...
7df471db89dc663b66037c656e758b99fba2d76d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7df471db89dc663b66037c656e758b99fba2d76d/test_poll.py
verify (D().meth(4) == "D(4)C(4)B(4)A(4)")
vereq(D().meth(4), "D(4)C(4)B(4)A(4)") class mysuper(super): def __init__(self, *args): return super(mysuper, self).__init__(*args) class E(D): def meth(self, a): return "E(%r)" % a + mysuper(E, self).meth(a) vereq(E().meth(5), "E(5)D(5)C(5)B(5)A(5)") class F(E): def meth(self, a): s = self.__super return "F(%r)[...
def meth(self, a): return "D(%r)" % a + super(D, self).meth(a)
1e06da30efcdb24053590df2c44633dd7be69aeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1e06da30efcdb24053590df2c44633dd7be69aeb/test_descr.py
return self.sslobj.read(size)
data = self.sslobj.read(size) while len(data) < size: data += self.sslobj.read(len(data)-size) return data
def read(self, size): """Read 'size' bytes from remote.""" return self.sslobj.read(size)
99825c88c11843fd85e8b70558f3acb6fc09c834 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99825c88c11843fd85e8b70558f3acb6fc09c834/imaplib.py
self.sslobj.write(data)
bytes = len(data) while bytes > 0: sent = self.sslobj.write(data) if sent == bytes: break data = data[sent:] bytes = bytes - sent
def send(self, data): """Send data to remote.""" self.sslobj.write(data)
99825c88c11843fd85e8b70558f3acb6fc09c834 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99825c88c11843fd85e8b70558f3acb6fc09c834/imaplib.py
return
return command
def reinitialize_command (self, command): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This gives provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the confi...
e62772dd379287126a3774aacb60cd9a4073e7bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e62772dd379287126a3774aacb60cd9a4073e7bd/dist.py
def write(self, arg, move=0): x, y = start = self._position
def write(self, text, move=False): """ Write text at the current pen position. If move is true, the pen is moved to the bottom-right corner of the text. By default, move is False. Example: >>> turtle.write('The race is on!') >>> turtle.write('Home = (0, 0)', True) """ x, y = self._position
def write(self, arg, move=0): x, y = start = self._position x = x-1 # correction -- calibrated for Windows item = self._canvas.create_text(x, y, text=str(arg), anchor="sw", fill=self._color) self._items.append(item) if move: x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) self._draw_turtle()
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
text=str(arg), anchor="sw",
text=str(text), anchor="sw",
def write(self, arg, move=0): x, y = start = self._position x = x-1 # correction -- calibrated for Windows item = self._canvas.create_text(x, y, text=str(arg), anchor="sw", fill=self._color) self._items.append(item) if move: x0, y0, x1, y1 = self._canvas.bbox(item) self._goto(x1, y1) self._draw_turtle()
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
self._canvas.lower(item)
def fill(self, flag): if self._filling: path = tuple(self._path) smooth = self._filling < 0 if len(path) > 2: item = self._canvas._create('polygon', path, {'fill': self._color, 'smooth': smooth}) self._items.append(item) self._canvas.lower(item) if self._tofill: for item in self._tofill: self._canvas.itemconfigure(item...
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
start = self._angle - 90.0
start = self._angle - (self._fullcircle / 4.0)
def circle(self, radius, extent=None): if extent is None: extent = self._fullcircle x0, y0 = self._position xc = x0 - radius * sin(self._angle * self._invradian) yc = y0 - radius * cos(self._angle * self._invradian) if radius >= 0.0: start = self._angle - 90.0 else: start = self._angle + 90.0 extent = -extent if self._...
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
start = self._angle + 90.0
start = self._angle + (self._fullcircle / 4.0)
def circle(self, radius, extent=None): if extent is None: extent = self._fullcircle x0, y0 = self._position xc = x0 - radius * sin(self._angle * self._invradian) yc = y0 - radius * cos(self._angle * self._invradian) if radius >= 0.0: start = self._angle - 90.0 else: start = self._angle + 90.0 extent = -extent if self._...
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
x0, y0 = start = self._position
x0, y0 = self._position
def _goto(self, x1, y1): x0, y0 = start = self._position self._position = map(float, (x1, y1)) if self._filling: self._path.append(self._position) if self._drawing: if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) distance = hypot(dx, dy) nhops = int(distance) item = self._canvas.create_line(x0, y0, x0, y0, wi...
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
self._canvas.after(10)
self._canvas.after(self._delay)
def _goto(self, x1, y1): x0, y0 = start = self._position self._position = map(float, (x1, y1)) if self._filling: self._path.append(self._position) if self._drawing: if self._tracing: dx = float(x1 - x0) dy = float(y1 - y0) distance = hypot(dx, dy) nhops = int(distance) item = self._canvas.create_line(x0, y0, x0, y0, wi...
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
def _draw_turtle(self,position=[]):
def speed(self, speed): """ Set the turtle's speed. speed must one of these five strings: 'fastest' is a 0 ms delay 'fast' is a 5 ms delay 'normal' is a 10 ms delay 'slow' is a 15 ms delay 'slowest' is a 20 ms delay Example: >>> turtle.speed('slow') """ try: speed = speed.strip().lower() self._delay = speeds.index(s...
def _draw_turtle(self,position=[]): if not self._tracing: return if position == []: position = self._position x,y = position distance = 8 dx = distance * cos(self._angle*self._invradian) dy = distance * sin(self._angle*self._invradian) self._delete_turtle() self._arrow = self._canvas.create_line(x-dx,y+dy,x,y, width=se...
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
self._arrow = 0
self._arrow = 0
def _delete_turtle(self): if self._arrow != 0: self._canvas.delete(self._arrow) self._arrow = 0
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
def _destroy(self): global _root, _canvas, _pen root = self._canvas._root() if root is _root: _pen = None _root = None _canvas = None root.destroy()
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
pen = _pen if not pen: _pen = pen = Pen() return pen
if not _pen: _pen = Pen() return _pen class Turtle(Pen): pass """For documentation of the following functions see the RawPen methods with the same names """
def _getpen(): global _pen pen = _pen if not pen: _pen = pen = Pen() return pen
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
if __name__ == '__main__': _root.mainloop()
def demo2(): speed('fast') width(3) setheading(towards(0,0)) x,y = position() r = (x**2+y**2)**.5/2.0 right(90) pendown = True for i in range(18): if pendown: up() pendown = False else: down() pendown = True circle(r,10) sleep(2) reset() left(90) l = 10 color("green") width(3) left(180) sp = 5 for i in range(-2,...
def demo(): reset() tracer(1) up() backward(100) down() # draw 3 squares; the last filled width(3) for i in range(3): if i == 2: fill(1) for j in range(4): forward(20) left(90) if i == 2: color("maroon") fill(0) up() forward(30) down() width(1) color("black") # move out of the way tracer(0) up() right(90) forward(100) ...
9221c22d6c6b431b17192173cf539900e3bec058 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9221c22d6c6b431b17192173cf539900e3bec058/turtle.py
print "*** skipping leakage tests ***"
if verbose: print "*** skipping leakage tests ***"
def test_lineterminator(self): class mydialect(csv.Dialect): delimiter = ";" escapechar = '\\' doublequote = False skipinitialspace = True lineterminator = '\r\n' quoting = csv.QUOTE_NONE d = mydialect()
bc64a907f00d08e8b583332c634d558059893102 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc64a907f00d08e8b583332c634d558059893102/test_csv.py