rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if issubclass(t, TypeType):
try: issc = issubclass(t, TypeType) except TypeError: issc = 0 if issc:
def save(self, object, pers_save = 0): memo = self.memo
85ee491b3af3e1c124522249a52443b4d8c34c88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/85ee491b3af3e1c124522249a52443b4d8c34c88/pickle.py
match = mime_head.group(0, 1) newline = newline + line[:i] + mime_decode(match[1]) line = line[i + len(match[0]):]
match0, match1 = mime_head.group(0, 1) match1 = string.join(string.split(match1, '_'), ' ') newline = newline + line[:i] + mime_decode(match1) line = line[i + len(match0):]
def mime_decode_header(line): '''Decode a header line to 8bit.''' newline = '' while 1: i = mime_head.search(line) if i < 0: break match = mime_head.group(0, 1) newline = newline + line[:i] + mime_decode(match[1]) line = line[i + len(match[0]):] return newline + line
88bb808d7700307d37692f7e658d2d4b1582e0dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/88bb808d7700307d37692f7e658d2d4b1582e0dc/mimify.py
emit(LOGHEADER, self.ui, os.environ, date=date, _file=tfn)
emit(LOGHEADER, self.ui, os.environ, date=date, _file=tf)
def commit(self, entry): file = entry.file # Normalize line endings in body if '\r' in self.ui.body: self.ui.body = re.sub('\r\n?', '\n', self.ui.body) # Normalize whitespace in title self.ui.title = ' '.join(self.ui.title.split()) # Check that there were any changes if self.ui.body == entry.body and self.ui.title == e...
e6e77e5fe74289af8afe653ea426bcf966afff89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6e77e5fe74289af8afe653ea426bcf966afff89/faqwiz.py
os.unlink(tfn)
os.unlink(tf.name)
def commit(self, entry): file = entry.file # Normalize line endings in body if '\r' in self.ui.body: self.ui.body = re.sub('\r\n?', '\n', self.ui.body) # Normalize whitespace in title self.ui.title = ' '.join(self.ui.title.split()) # Check that there were any changes if self.ui.body == entry.body and self.ui.title == e...
e6e77e5fe74289af8afe653ea426bcf966afff89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6e77e5fe74289af8afe653ea426bcf966afff89/faqwiz.py
if __name__ == "__main__": import glob f = glob.glob("command/*.py") byte_compile(f, optimize=0, prefix="command/", base_dir="/usr/lib/python")
def byte_compile (py_files, optimize=0, force=0, prefix=None, base_dir=None, verbose=1, dry_run=0, direct=None): """Byte-compile a collection of Python source files to either .pyc or .pyo files in the same directory. 'py_files' is a list of files to compile; any files that don't end in ".py" are silently skipped. 'opt...
047c3723d02e691578724271a536ee27ad1b2fc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/047c3723d02e691578724271a536ee27ad1b2fc2/util.py
self._dkeys = self._dict.keys() self._dkeys.sort()
def __init__(self, *args): unittest.TestCase.__init__(self, *args) self._dkeys = self._dict.keys() self._dkeys.sort()
c08fe82b32386d2621f4c6c17cc334c7a3a924b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c08fe82b32386d2621f4c6c17cc334c7a3a924b9/test_dumbdbm.py
_delete_files()
def test_dumbdbm_creation(self): _delete_files() f = dumbdbm.open(_fname, 'c') self.assertEqual(f.keys(), []) for key in self._dict: f[key] = self._dict[key] self.read_helper(f) f.close()
c08fe82b32386d2621f4c6c17cc334c7a3a924b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c08fe82b32386d2621f4c6c17cc334c7a3a924b9/test_dumbdbm.py
self.assertEqual(keys, self._dkeys)
dkeys = self._dict.keys() dkeys.sort() self.assertEqual(keys, dkeys)
def keys_helper(self, f): keys = f.keys() keys.sort() self.assertEqual(keys, self._dkeys) return keys
c08fe82b32386d2621f4c6c17cc334c7a3a924b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c08fe82b32386d2621f4c6c17cc334c7a3a924b9/test_dumbdbm.py
socketDataProcessed = threading.Condition()
socketDataProcessed = threading.Event()
def handleLogRecord(self, record): logname = "logrecv.tcp." + record.name #If the end-of-messages sentinel is seen, tell the server to terminate if record.msg == FINISH_UP: self.server.abort = 1 record.msg = record.msg + " (via " + logname + ")" logger = logging.getLogger(logname) logger.handle(record)
f9addb676d7ef864c6685a1ac8423b5b2663ec68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f9addb676d7ef864c6685a1ac8423b5b2663ec68/test_logging.py
socketDataProcessed.acquire() socketDataProcessed.notify() socketDataProcessed.release()
socketDataProcessed.set()
def serve_until_stopped(self): abort = 0 while not abort: rd, wr, ex = select.select([self.socket.fileno()], [], [], self.timeout) if rd: self.handle_request() abort = self.abort #notify the main thread that we're about to exit socketDataProcessed.acquire() socketDataProcessed.notify() socketDataProcessed.release()
f9addb676d7ef864c6685a1ac8423b5b2663ec68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f9addb676d7ef864c6685a1ac8423b5b2663ec68/test_logging.py
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). #...
f9addb676d7ef864c6685a1ac8423b5b2663ec68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f9addb676d7ef864c6685a1ac8423b5b2663ec68/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). #...
f9addb676d7ef864c6685a1ac8423b5b2663ec68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f9addb676d7ef864c6685a1ac8423b5b2663ec68/test_logging.py
parts = msg.split(" ", 2)
parts = msg.split(" ", 1)
def _decode_msg(self, msg): seqno = self.decode_seqno(msg[:self.SEQNO_ENC_LEN]) msg = msg[self.SEQNO_ENC_LEN:] parts = msg.split(" ", 2) if len(parts) == 1: cmd = msg arg = '' else: cmd = parts[0] arg = parts[1] return cmd, arg, seqno
55956c93615855b47cfc5bf9ddc2633a5f73044c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/55956c93615855b47cfc5bf9ddc2633a5f73044c/RemoteInterp.py
return sys.modules[fqname]
module = sys.modules[fqname] module.__name__ = fqname return module
def _process_result(self, (ispkg, code, values), fqname): # did get_code() return an actual module? (rather than a code object) is_module = isinstance(code, _ModuleType)
70195da3ff1cae7f4c6e76b0f2a19c3fe04bc1e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/70195da3ff1cae7f4c6e76b0f2a19c3fe04bc1e4/imputil.py
return _urlopener.retrieve(url, filename)
return _urlopener.retrieve(url, filename)
def urlretrieve(url, filename=None): global _urlopener if not _urlopener: _urlopener = FancyURLopener() if filename: return _urlopener.retrieve(url, filename) else: return _urlopener.retrieve(url)
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
return _urlopener.retrieve(url)
return _urlopener.retrieve(url)
def urlretrieve(url, filename=None): global _urlopener if not _urlopener: _urlopener = FancyURLopener() if filename: return _urlopener.retrieve(url, filename) else: return _urlopener.retrieve(url)
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
self.tempcache.clear()
self.tempcache.clear()
def cleanup(self): # This code sometimes runs when the rest of this module # has already been deleted, so it can't use any globals # or import anything. if self.__tempfiles: for file in self.__tempfiles: try: self.__unlink(file) except: pass del self.__tempfiles[:] if self.tempcache: self.tempcache.clear()
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
def open(self, fullurl, data=None): fullurl = unwrap(fullurl) if self.tempcache and self.tempcache.has_key(fullurl): filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') return addinfourl(fp, headers, fullurl) type, url = splittype(fullurl) if not type: type = 'file' if self.proxies.has_key(type): prox...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import tempfile filename = tempfile.mktemp() self.__tempfiles.append(filename)
import tempfile filename = tempfile.mktemp() self.__tempfiles.append(filename)
def retrieve(self, url, filename=None): url = unwrap(url) if self.tempcache and self.tempcache.has_key(url): return self.tempcache[url] type, url1 = splittype(url) if not filename and (not type or type == 'file'): try: fp = self.open_local_file(url1) del fp return url2pathname(splithost(url1)[1]), None except IOError, ...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
realhost = None
realhost = None
def open_http(self, url, data=None): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) user_passwd = None if string.lower(urltype) != 'http': realhost = None else: realhost, rest = s...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest)
realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest)
def open_http(self, url, data=None): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) user_passwd = None if string.lower(urltype) != 'http': realhost = None else: realhost, rest = s...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: return self.open_local_file(url)
if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: return self.open_local_file(url)
def open_file(self, url): if url[:2] == '//' and url[2:3] != '/': return self.open_ftp(url) else: return self.open_local_file(url)
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
return addinfourl(fp, headers, "http:" + url)
return addinfourl(fp, headers, "http:" + url)
def http_error_default(self, url, fp, errcode, errmsg, headers): return addinfourl(fp, headers, "http:" + url)
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
scheme, realm = match.groups()
scheme, realm = match.groups()
def http_error_401(self, url, fp, errcode, errmsg, headers): if headers.has_key('www-authenticate'): stuff = headers['www-authenticate'] import re match = re.match( '[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) if match: scheme, realm = match.groups() if string.lower(scheme) == 'basic': return self.retry_http_basic_au...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _typeprog = re.compile('^([^/:]+):') match = _typeprog.match(url)
import re _typeprog = re.compile('^([^/:]+):') match = _typeprog.match(url)
def splittype(url): global _typeprog if _typeprog is None: import re _typeprog = re.compile('^([^/:]+):') match = _typeprog.match(url) if match: scheme = match.group(1) return scheme, url[len(scheme) + 1:] return None, url
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _hostprog = re.compile('^//([^/]+)(.*)$')
import re _hostprog = re.compile('^//([^/]+)(.*)$')
def splithost(url): global _hostprog if _hostprog is None: import re _hostprog = re.compile('^//([^/]+)(.*)$') match = _hostprog.match(url) if match: return match.group(1, 2) return None, url
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _userprog = re.compile('^([^@]*)@(.*)$')
import re _userprog = re.compile('^([^@]*)@(.*)$')
def splituser(host): global _userprog if _userprog is None: import re _userprog = re.compile('^([^@]*)@(.*)$') match = _userprog.match(host) if match: return match.group(1, 2) return None, host
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _passwdprog = re.compile('^([^:]*):(.*)$')
import re _passwdprog = re.compile('^([^:]*):(.*)$')
def splitpasswd(user): global _passwdprog if _passwdprog is None: import re _passwdprog = re.compile('^([^:]*):(.*)$') match = _passwdprog.match(user) if match: return match.group(1, 2) return user, None
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _portprog = re.compile('^(.*):([0-9]+)$')
import re _portprog = re.compile('^(.*):([0-9]+)$')
def splitport(host): global _portprog if _portprog is None: import re _portprog = re.compile('^(.*):([0-9]+)$') match = _portprog.match(host) if match: return match.group(1, 2) return host, None
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _nportprog = re.compile('^(.*):(.*)$')
import re _nportprog = re.compile('^(.*):(.*)$')
def splitnport(host, defport=-1): global _nportprog if _nportprog is None: import re _nportprog = re.compile('^(.*):(.*)$') match = _nportprog.match(host) if match: host, port = match.group(1, 2) try: if not port: raise string.atoi_error, "no digits" nport = string.atoi(port) except string.atoi_error: nport = None ret...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
host, port = match.group(1, 2) try: if not port: raise string.atoi_error, "no digits" nport = string.atoi(port) except string.atoi_error: nport = None return host, nport
host, port = match.group(1, 2) try: if not port: raise string.atoi_error, "no digits" nport = string.atoi(port) except string.atoi_error: nport = None return host, nport
def splitnport(host, defport=-1): global _nportprog if _nportprog is None: import re _nportprog = re.compile('^(.*):(.*)$') match = _nportprog.match(host) if match: host, port = match.group(1, 2) try: if not port: raise string.atoi_error, "no digits" nport = string.atoi(port) except string.atoi_error: nport = None ret...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _queryprog = re.compile('^(.*)\?([^?]*)$')
import re _queryprog = re.compile('^(.*)\?([^?]*)$')
def splitquery(url): global _queryprog if _queryprog is None: import re _queryprog = re.compile('^(.*)\?([^?]*)$') match = _queryprog.match(url) if match: return match.group(1, 2) return url, None
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _tagprog = re.compile('^(.*)
import re _tagprog = re.compile('^(.*)
def splittag(url): global _tagprog if _tagprog is None: import re _tagprog = re.compile('^(.*)#([^#]*)$') match = _tagprog.match(url) if match: return match.group(1, 2) return url, None
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _valueprog = re.compile('^([^=]*)=(.*)$') match = _valueprog.match(attr)
import re _valueprog = re.compile('^([^=]*)=(.*)$') match = _valueprog.match(attr)
def splitvalue(attr): global _valueprog if _valueprog is None: import re _valueprog = re.compile('^([^=]*)=(.*)$') match = _valueprog.match(attr) if match: return match.group(1, 2) return attr, None
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
import re _quoteprog = re.compile('%[0-9a-fA-F][0-9a-fA-F]')
import re _quoteprog = re.compile('%[0-9a-fA-F][0-9a-fA-F]')
def unquote(s): global _quoteprog if _quoteprog is None: import re _quoteprog = re.compile('%[0-9a-fA-F][0-9a-fA-F]') i = 0 n = len(s) res = [] while 0 <= i < n: match = _quoteprog.search(s, i) if not match: res.append(s[i:]) break j = match.start(0) res.append(s[i:j] + chr(string.atoi(s[j+1:j+3], 16))) i = j+3 return...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
if '+' in s: s = string.join(string.split(s, '+'), ' ') return unquote(s)
if '+' in s: s = string.join(string.split(s, '+'), ' ') return unquote(s)
def unquote_plus(s): if '+' in s: # replace '+' with ' ' s = string.join(string.split(s, '+'), ' ') return unquote(s)
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
if ' ' in s: s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe)
if ' ' in s: s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe)
def quote_plus(s, safe = '/'): if ' ' in s: # replace ' ' with '+' s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe)
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
table = string.maketrans("", "") data = string.translate(data, table, "\r")
table = string.maketrans("", "") data = string.translate(data, table, "\r")
def test(): import sys args = sys.argv[1:] if not args: args = [ '/etc/passwd', 'file:/etc/passwd', 'file://localhost/etc/passwd', 'ftp://ftp.python.org/etc/passwd', 'gopher://gopher.micro.umn.edu/1/', 'http://www.python.org/index.html', ] try: for url in args: print '-'*10, url, '-'*10 fn, h = urlretrieve(url) print f...
7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py
- reuse_address
- allow_reuse_address
def handle_error(self, request, client_address): """Handle an error gracefully. May be overridden.
3aaad5079b6df05a34df64a26ca9e840f8685af1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3aaad5079b6df05a34df64a26ca9e840f8685af1/SocketServer.py
with private names and those defined in other modules. + C.__doc__ for all classes C in M.__dict__.values(), except those with private names and those defined in other modules.
defined in other modules. + C.__doc__ for all classes C in M.__dict__.values(), except those defined in other modules.
def _test(): import doctest, M # replace M with your module's name return doctest.testmod(M) # ditto
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
their contained methods and nested classes. Private names reached from M's globals are skipped, but all names reached from M.__test__ are searched. By default, a name is considered to be private if it begins with an underscore (like "_my_func") but doesn't both begin and end with (at least) two underscores (like "__i...
their contained methods and nested classes. All names reached from M.__test__ are searched. Optionally, functions with private names can be skipped (unless listed in M.__test__) by supplying a function to the "isprivate" argument that will identify private functions. For convenience, one such function is supplied. ...
def _test(): import doctest, M # replace M with your module's name return doctest.testmod(M) # ditto
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
whether a name is private. The default function is doctest.is_private; see its docs for details.
whether a name is private. The default function is to assume that no functions are private. The "isprivate" arg may be set to doctest.is_private in order to skip over functions marked as private using an underscore naming convention; see its docs for details.
def __init__(self, mod=None, globs=None, verbose=None, isprivate=None, optionflags=0): """mod=None, globs=None, verbose=None, isprivate=None,
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
isprivate = is_private
isprivate = lambda prefix, base: 0
def __init__(self, mod=None, globs=None, verbose=None, isprivate=None, optionflags=0): """mod=None, globs=None, verbose=None, isprivate=None,
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
>>> t = Tester(globs={}, verbose=0)
>>> t = Tester(globs={}, verbose=0, isprivate=is_private)
... def bar(self):
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
Again, but with a custom isprivate function allowing _f: >>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
Again, but with the default isprivate function allowing _f: >>> t = Tester(globs={}, verbose=0)
... def bar(self):
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
>>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
>>> t = Tester(globs={}, verbose=0)
... def bar(self):
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
>>> testmod(m1)
>>> testmod(m1, isprivate=is_private)
... def bar(self):
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
with m.__doc__. Private names are skipped.
with m.__doc__. Unless isprivate is specified, private names are not skipped.
def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0): """m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0 Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), sta...
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
doctest.is_private; see its docs for details.
treat all functions as public. Optionally, "isprivate" can be set to doctest.is_private to skip over functions marked as private using the underscore naming convention; see its docs for details.
def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0): """m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0 Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), sta...
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
if not _type_to_name_map:
if _type_to_name_map=={}:
def type_to_name(gtype): global _type_to_name_map if not _type_to_name_map: for name in _names: if name[:2] == 'A_': _type_to_name_map[eval(name)] = name[2:] if _type_to_name_map.has_key(gtype): return _type_to_name_map[gtype] return 'TYPE=' + `gtype`
d2dd9a8b7f3446b904600ec5de6945a2d9f5598c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d2dd9a8b7f3446b904600ec5de6945a2d9f5598c/gopherlib.py
return self.getdelimited('[', ']\r', 0)
return '[%s]' % self.getdelimited('[', ']\r', 0)
def getdomainliteral(self): """Parse an RFC-822 domain-literal.""" return self.getdelimited('[', ']\r', 0)
2ea2b1133eb9676454bc680450bf121e1493f7a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2ea2b1133eb9676454bc680450bf121e1493f7a4/rfc822.py
self.wfile = StringIO.StringIO(self.packet)
self.wfile = StringIO.StringIO()
def setup(self): import StringIO self.packet, self.socket = self.request self.rfile = StringIO.StringIO(self.packet) self.wfile = StringIO.StringIO(self.packet)
beae4777673fa2a749d326b4860c6a2b0b1ffa12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/beae4777673fa2a749d326b4860c6a2b0b1ffa12/SocketServer.py
SetDialogItemText(text_h, "Progress...")
SetDialogItemText(text_h, label)
def __init__(self, label="Working...", maxval=100): self.label = label self.maxval = maxval self.curval = -1 self.d = GetNewDialog(259, -1) tp, text_h, rect = self.d.GetDialogItem(2) SetDialogItemText(text_h, "Progress...") self._update(0)
3a4b3b0132a553444b29bbb9a04b28af71852660 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a4b3b0132a553444b29bbb9a04b28af71852660/EasyDialogs.py
Qd.PaintRect(inner_rect) l, t, r, b = inner_rect r = int(l + (r-l)*value/self.maxval) inner_rect = l, t, r, b Qd.ForeColor(QuickDraw.blackColor) Qd.BackColor(QuickDraw.blackColor) Qd.PaintRect(inner_rect)
Qd.PaintRect((int(l + (r-l)*value/self.maxval), t, r, b))
def _update(self, value): tp, h, bar_rect = self.d.GetDialogItem(3) Qd.SetPort(self.d) Qd.FrameRect(bar_rect) # Draw outline inner_rect = Qd.InsetRect(bar_rect, 1, 1) Qd.ForeColor(QuickDraw.whiteColor) Qd.BackColor(QuickDraw.whiteColor) Qd.PaintRect(inner_rect) # Clear internal l, t, r, b = inner_rect r = int(l + (r...
3a4b3b0132a553444b29bbb9a04b28af71852660 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a4b3b0132a553444b29bbb9a04b28af71852660/EasyDialogs.py
level = 0 if "absolute_import" in self.futures else -1
level = 0 if self.graph.checkFlag(CO_FUTURE_ABSIMPORT) else -1
def visitImport(self, node): self.set_lineno(node) level = 0 if "absolute_import" in self.futures else -1 for name, alias in node.names: if VERSION > 1: self.emit('LOAD_CONST', level) self.emit('LOAD_CONST', None) self.emit('IMPORT_NAME', name) mod = name.split(".")[0] if alias: self._resolveDots(name) self.storeName(a...
d4e30357016f0b2e2a5093d810b7edea33501cd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d4e30357016f0b2e2a5093d810b7edea33501cd3/pycodegen.py
if level == 0 and "absolute_import" not in self.futures:
if level == 0 and not self.graph.checkFlag(CO_FUTURE_ABSIMPORT):
def visitFrom(self, node): self.set_lineno(node) level = node.level if level == 0 and "absolute_import" not in self.futures: level = -1 fromlist = map(lambda (name, alias): name, node.names) if VERSION > 1: self.emit('LOAD_CONST', level) self.emit('LOAD_CONST', tuple(fromlist)) self.emit('IMPORT_NAME', node.modname) fo...
d4e30357016f0b2e2a5093d810b7edea33501cd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d4e30357016f0b2e2a5093d810b7edea33501cd3/pycodegen.py
if self.debuglevel > 0: print 'connect:', (host, port)
if self.debuglevel > 0: print>>stderr, 'connect:', (host, port)
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
if self.debuglevel > 0: print 'connect:', (host, port)
if self.debuglevel > 0: print>>stderr, 'connect:', (host, port)
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
if self.debuglevel > 0: print 'connect fail:', (host, port)
if self.debuglevel > 0: print>>stderr, 'connect fail:', (host, port)
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
if self.debuglevel > 0: print "connect:", msg
if self.debuglevel > 0: print>>stderr, "connect:", msg
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
if self.debuglevel > 0: print 'send:', repr(str)
if self.debuglevel > 0: print>>stderr, 'send:', repr(str)
def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', repr(str) if self.sock: try: self.sock.sendall(str) except socket.error: self.close() raise SMTPServerDisconnected('Server not connected') else: raise SMTPServerDisconnected('please run connect() first')
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
if self.debuglevel > 0: print 'reply:', repr(line)
if self.debuglevel > 0: print>>stderr, 'reply:', repr(line)
def getreply(self): """Get a reply from the server.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
print 'reply: retcode (%s); Msg: %s' % (errcode,errmsg)
print>>stderr, 'reply: retcode (%s); Msg: %s' % (errcode,errmsg)
def getreply(self): """Get a reply from the server.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
if self.debuglevel >0 : print "data:", (code,repl)
if self.debuglevel >0 : print>>stderr, "data:", (code,repl)
def data(self,msg): """SMTP 'DATA' command -- sends message data to server.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
if self.debuglevel >0 : print "data:", (code,msg)
if self.debuglevel >0 : print>>stderr, "data:", (code,msg)
def data(self,msg): """SMTP 'DATA' command -- sends message data to server.
e6f8a89d1a7f530d68a69b9867535d4fd7707846 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6f8a89d1a7f530d68a69b9867535d4fd7707846/smtplib.py
des = "_%s__%s" % (klass.__name__, name)
des = "1"
def adaptgetter(name, klass, getter): kind, des = getter if kind == 1: # AV happens when stepping from this line to next if des == "": des = "_%s__%s" % (klass.__name__, name) return lambda obj: getattr(obj, des)
ccae8377a329fe60193a605697b5ffefb4734960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ccae8377a329fe60193a605697b5ffefb4734960/test_scope.py
print "20. eval with free variables"
print "20. eval and exec with free variables"
def adaptgetter(name, klass, getter): kind, des = getter if kind == 1: # AV happens when stepping from this line to next if des == "": des = "_%s__%s" % (klass.__name__, name) return lambda obj: getattr(obj, des)
ccae8377a329fe60193a605697b5ffefb4734960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ccae8377a329fe60193a605697b5ffefb4734960/test_scope.py
self._color = color
self._set_color(color)
def color(self, *args): if not args: raise Error, "no color arguments" if len(args) == 1: color = args[0] if type(color) == type(""): # Test the color first try: id = self._canvas.create_line(0, 0, 0, 0, fill=color) except Tkinter.TclError: raise Error, "bad color string: %s" % `color` self._color = color return try: r...
3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e/turtle.py
self._color = "
self._set_color(" def _set_color(self,color): self._color = color self._draw_turtle()
def color(self, *args): if not args: raise Error, "no color arguments" if len(args) == 1: color = args[0] if type(color) == type(""): # Test the color first try: id = self._canvas.create_line(0, 0, 0, 0, fill=color) except Tkinter.TclError: raise Error, "bad color string: %s" % `color` self._color = color return try: r...
3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e/turtle.py
if self._tracing:
if self._tracing:
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...
3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e/turtle.py
arrow="last",
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...
3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c7a25a4d9ea07f2aa8e4b70fecd84e33de82c2e/turtle.py
effective = (effective / tabwidth + 1) * tabwidth
effective = (int(effective / tabwidth) + 1) * tabwidth
def classifyws(s, tabwidth): raw = effective = 0 for ch in s: if ch == ' ': raw = raw + 1 effective = effective + 1 elif ch == '\t': raw = raw + 1 effective = (effective / tabwidth + 1) * tabwidth else: break return raw, effective
4509168dbf56a3b400db6cddfe12796aaa00e36b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4509168dbf56a3b400db6cddfe12796aaa00e36b/AutoIndent.py
try: unicode(u'decoding unicode is not supported', 'utf-8', 'strict') except TypeError: pass else: raise TestFailed, "decoding unicode should NOT be supported"
if not sys.platform.startswith('java'): try: unicode(u'decoding unicode is not supported', 'utf-8', 'strict') except TypeError: pass else: raise TestFailed, "decoding unicode should NOT be supported"
def __str__(self): return self.x
2b29cb2593c2ca96eb4a0b32b1a6167ce5f18b7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b29cb2593c2ca96eb4a0b32b1a6167ce5f18b7c/test_unicode.py
verify(unicode(buffer('character buffers are decoded to unicode'), 'utf-8', 'strict') == u'character buffers are decoded to unicode')
if not sys.platform.startswith('java'): verify(unicode(buffer('character buffers are decoded to unicode'), 'utf-8', 'strict') == u'character buffers are decoded to unicode')
def __str__(self): return self.x
2b29cb2593c2ca96eb4a0b32b1a6167ce5f18b7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b29cb2593c2ca96eb4a0b32b1a6167ce5f18b7c/test_unicode.py
return data[:-3] + '\n'
return data.replace('\r\r\n', '\n')
def normalize_output(data): # Some operating systems do conversions on newline. We could possibly # fix that by doing the appropriate termios.tcsetattr()s. I couldn't # figure out the right combo on Tru64 and I don't have an IRIX box. # So just normalize the output and doc the problem O/Ses by allowing # certain comb...
9cc3b1ccef8f348ebfc36a13ec54e78423e9b4ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9cc3b1ccef8f348ebfc36a13ec54e78423e9b4ff/test_pty.py
return data[:-2] + '\n'
return data.replace('\r\n', '\n')
def normalize_output(data): # Some operating systems do conversions on newline. We could possibly # fix that by doing the appropriate termios.tcsetattr()s. I couldn't # figure out the right combo on Tru64 and I don't have an IRIX box. # So just normalize the output and doc the problem O/Ses by allowing # certain comb...
9cc3b1ccef8f348ebfc36a13ec54e78423e9b4ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9cc3b1ccef8f348ebfc36a13ec54e78423e9b4ff/test_pty.py
self.read_multi()
self.read_multi(environ, keep_blank_values, strict_parsing)
def __init__(self, fp=None, headers=None, outerboundary="", environ=os.environ, keep_blank_values=0, strict_parsing=0): """Constructor. Read multipart/* until last part.
f5745008d2c78d3830e62cbd4e8f223fe69977c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5745008d2c78d3830e62cbd4e8f223fe69977c5/cgi.py
def read_multi(self):
def read_multi(self, environ, keep_blank_values, strict_parsing):
def read_multi(self): """Internal: read a part that is itself multipart.""" self.list = [] part = self.__class__(self.fp, {}, self.innerboundary) # Throw first part away while not part.done: headers = rfc822.Message(self.fp) part = self.__class__(self.fp, headers, self.innerboundary) self.list.append(part) self.skip_li...
f5745008d2c78d3830e62cbd4e8f223fe69977c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5745008d2c78d3830e62cbd4e8f223fe69977c5/cgi.py
part = self.__class__(self.fp, {}, self.innerboundary)
part = self.__class__(self.fp, {}, self.innerboundary, environ, keep_blank_values, strict_parsing)
def read_multi(self): """Internal: read a part that is itself multipart.""" self.list = [] part = self.__class__(self.fp, {}, self.innerboundary) # Throw first part away while not part.done: headers = rfc822.Message(self.fp) part = self.__class__(self.fp, headers, self.innerboundary) self.list.append(part) self.skip_li...
f5745008d2c78d3830e62cbd4e8f223fe69977c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5745008d2c78d3830e62cbd4e8f223fe69977c5/cgi.py
part = self.__class__(self.fp, headers, self.innerboundary)
part = self.__class__(self.fp, headers, self.innerboundary, environ, keep_blank_values, strict_parsing)
def read_multi(self): """Internal: read a part that is itself multipart.""" self.list = [] part = self.__class__(self.fp, {}, self.innerboundary) # Throw first part away while not part.done: headers = rfc822.Message(self.fp) part = self.__class__(self.fp, headers, self.innerboundary) self.list.append(part) self.skip_li...
f5745008d2c78d3830e62cbd4e8f223fe69977c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5745008d2c78d3830e62cbd4e8f223fe69977c5/cgi.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...
1ae32466792dde8eab7cafc933f1dbb5984847f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ae32466792dde8eab7cafc933f1dbb5984847f6/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."""
1ae32466792dde8eab7cafc933f1dbb5984847f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ae32466792dde8eab7cafc933f1dbb5984847f6/core.py
filter = callable
filter = template
def _subn(pattern, template, string, count=0): # internal: pattern.subn implementation hook if callable(template): filter = callable else: # FIXME: prepare template def filter(match, template=template): return _expand(match, template) n = i = 0 s = [] append = s.append c = pattern.cursor(string) while not count or n < ...
e8d52af54bb90459d941ecdd683bc8416bc47b48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e8d52af54bb90459d941ecdd683bc8416bc47b48/sre.py
def test_original_excepthook(self): savestderr = sys.stderr err = cStringIO.StringIO() sys.stderr = err
e7028ac56cb34b6ec4757308afdd588611a82db6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e7028ac56cb34b6ec4757308afdd588611a82db6/test_sys.py
print exc_type_name + ':', repr.repr(exc_value)
print exc_type_name + ':', _saferepr(exc_value)
def user_exception(self, frame, (exc_type, exc_value, exc_traceback)): """This function is called if an exception occurs, but only if we are to stop at or just below this level.""" frame.f_locals['__exception__'] = exc_type, exc_value if type(exc_type) == type(''): exc_type_name = exc_type else: exc_type_name = exc_typ...
6f8ee59653261731d73f0e16bd3f667db57133bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6f8ee59653261731d73f0e16bd3f667db57133bd/pdb.py
for attr in dir(self.metadata): meth_name = "get_" + attr setattr(self, meth_name, getattr(self.metadata, meth_name))
method_basenames = dir(self.metadata) + \ ['fullname', 'contact', 'contact_email'] for basename in method_basenames: method_name = "get_" + basename setattr(self, method_name, getattr(self.metadata, method_name))
def __init__ (self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then uses 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some nu...
4982f98bc919d2a6377e3e0e82c186bc5b1d70ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4982f98bc919d2a6377e3e0e82c186bc5b1d70ff/dist.py
if hasattr(os, 'chmod'):
if hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin':
def test_rmtree_errors(self): # filename is guaranteed not to exist filename = tempfile.mktemp() self.assertRaises(OSError, shutil.rmtree, filename)
8e6f2ded301055b3e8b61018175cd758ec4ad150 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8e6f2ded301055b3e8b61018175cd758ec4ad150/test_shutil.py
def dump(*stuff): sys.__stdout__.write(string.join(map(str, stuff), " ") + "\n")
9428fa607b6edc7c5ef46814cd869291a8b4619e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9428fa607b6edc7c5ef46814cd869291a8b4619e/PyParse.py
(?: \s+ | ( [^\s[\](){} )+
[^[\](){}
def dump(*stuff): sys.__stdout__.write(string.join(map(str, stuff), " ") + "\n")
9428fa607b6edc7c5ef46814cd869291a8b4619e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9428fa607b6edc7c5ef46814cd869291a8b4619e/PyParse.py
i = m.end(1) - 1
p = m.end() i = p-1 while i >= 0 and str[i] in " \t\n": i = i-1
def _study2(self, _rfind=string.rfind, _find=string.find, _ws=string.whitespace): if self.study_level >= 2: return self._study1() self.study_level = 2
9428fa607b6edc7c5ef46814cd869291a8b4619e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9428fa607b6edc7c5ef46814cd869291a8b4619e/PyParse.py
p = m.end()
def _study2(self, _rfind=string.rfind, _find=string.find, _ws=string.whitespace): if self.study_level >= 2: return self._study1() self.study_level = 2
9428fa607b6edc7c5ef46814cd869291a8b4619e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9428fa607b6edc7c5ef46814cd869291a8b4619e/PyParse.py
else: raise ValueError, "zero step for randrange()"
else: raise ValueError, "zero step for randrange()"
def randrange(self, start, stop=None, step=1, # Do not supply the following arguments int=int, default=None): # This code is a bit messy to make it fast for the # common case while still doing adequate error checking istart = int(start) if istart != start: raise ValueError, "non-integer arg 1 for randrange()" if stop i...
cc221c470fc51ab318ed3976119ab51c12a1d01c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc221c470fc51ab318ed3976119ab51c12a1d01c/whrandom.py
if n <= 0: raise ValueError, "empty range for randrange()" return istart + istep*int(self.random() * n)
if n <= 0: raise ValueError, "empty range for randrange()" return istart + istep*int(self.random() * n)
def randrange(self, start, stop=None, step=1, # Do not supply the following arguments int=int, default=None): # This code is a bit messy to make it fast for the # common case while still doing adequate error checking istart = int(start) if istart != start: raise ValueError, "non-integer arg 1 for randrange()" if stop i...
cc221c470fc51ab318ed3976119ab51c12a1d01c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc221c470fc51ab318ed3976119ab51c12a1d01c/whrandom.py
other = HMAC("")
other = HMAC(_secret_backdoor_key)
def copy(self): """Return a separate copy of this hashing object.
934d31b1d340f1d309d6ec6a861fa94077033b0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/934d31b1d340f1d309d6ec6a861fa94077033b0f/hmac.py
exclude=0, single=0, randomize=0, leakdebug=0,
exclude=0, single=0, randomize=0, findleaks=0,
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
d569f23da94babd616751cd46eea38963e4edfa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d569f23da94babd616751cd46eea38963e4edfa1/regrtest.py
single, randomize, and leakdebug) allow programmers calling main()
single, randomize, and findleaks) allow programmers calling main()
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
d569f23da94babd616751cd46eea38963e4edfa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d569f23da94babd616751cd46eea38963e4edfa1/regrtest.py
if o == '-l': leakdebug = 1
if o == '-l': findleaks = 1
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
d569f23da94babd616751cd46eea38963e4edfa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d569f23da94babd616751cd46eea38963e4edfa1/regrtest.py
if leakdebug:
if findleaks:
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
d569f23da94babd616751cd46eea38963e4edfa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d569f23da94babd616751cd46eea38963e4edfa1/regrtest.py
gc.set_debug(gc.DEBUG_LEAK)
gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = []
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, leakdebug=0, use_large_resources=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the dir...
d569f23da94babd616751cd46eea38963e4edfa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d569f23da94babd616751cd46eea38963e4edfa1/regrtest.py
if self.distribution.has_ext_modules():
if not self.skip_build and self.distribution.has_ext_modules():
def finalize_options (self): if self.bdist_dir is None: bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'wininst') if not self.target_version: self.target_version = "" if self.distribution.has_ext_modules(): short_version = get_python_version() if self.target_versio...
a19cdad6dc2815f6044c56601e8dd81d9c219631 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a19cdad6dc2815f6044c56601e8dd81d9c219631/bdist_wininst.py