rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def run (self): | ed8a0e0f21360abbe907a3b80e47c854a443eb13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ed8a0e0f21360abbe907a3b80e47c854a443eb13/install_lib.py | ||
out_fn = string.replace (f, '.py', '.pyc') | out_fn = f + (__debug__ and "c" or "o") compile_msg = "byte-compiling %s to %s" % \ (f, os.path.basename (out_fn)) skip_msg = "byte-compilation of %s skipped" % f | def run (self): | ed8a0e0f21360abbe907a3b80e47c854a443eb13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ed8a0e0f21360abbe907a3b80e47c854a443eb13/install_lib.py |
"byte-compiling %s" % f, "byte-compilation of %s skipped" % f) | compile_msg, skip_msg) | def run (self): | ed8a0e0f21360abbe907a3b80e47c854a443eb13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ed8a0e0f21360abbe907a3b80e47c854a443eb13/install_lib.py |
def append(self, s, charset=None): """Append a string to the MIME header. | 0c358258c9c4b61659867f7feb140a6ac0e54ed1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c358258c9c4b61659867f7feb140a6ac0e54ed1/Header.py | ||
def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings. Given a list of pairs (string, charset), return a MIME-encoded string suitable for use in a header field. Each pair may have different charsets and/or encodings, and the resulting header will accurately reflect each setti... | def _encode_chunks(self, newchunks): | def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings. | 0c358258c9c4b61659867f7feb140a6ac0e54ed1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c358258c9c4b61659867f7feb140a6ac0e54ed1/Header.py |
for header, charset in self._chunks: | for header, charset in newchunks: | def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings. | 0c358258c9c4b61659867f7feb140a6ac0e54ed1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c358258c9c4b61659867f7feb140a6ac0e54ed1/Header.py |
self._chunks = newchunks return self._encode_chunks() | return self._encode_chunks(newchunks) | def encode(self): """Encode a message header into an RFC-compliant format. | 0c358258c9c4b61659867f7feb140a6ac0e54ed1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c358258c9c4b61659867f7feb140a6ac0e54ed1/Header.py |
self.local_hostname = local_hostname | self.local_hostname = local_hostname | def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance. | 13e34f7a192d6f262a5bc000a3547c1d5ce59bee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13e34f7a192d6f262a5bc000a3547c1d5ce59bee/smtplib.py |
self.local_hostname = socket.getfqdn() | fqdn = socket.getfqdn() if '.' in fqdn: self.local_hostname = fqdn else: addr = socket.gethostbyname(socket.gethostname()) self.local_hostname = '[%s]' % addr | def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance. | 13e34f7a192d6f262a5bc000a3547c1d5ce59bee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13e34f7a192d6f262a5bc000a3547c1d5ce59bee/smtplib.py |
return url2pathname(splithost(url1)[1]), None | return url2pathname(splithost(url1)[1]), hdrs | 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, ... | b5916ab065408111cec262e12dbecbce58daf6ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5916ab065408111cec262e12dbecbce58daf6ec/urllib.py |
filename = tempfile.mktemp() | garbage, path = splittype(url) print (garbage, path) garbage, path = splithost(path or "") print (garbage, path) path, garbage = splitquery(path or "") print (path, garbage) path, garbage = splitattr(path or "") print (path, garbage) suffix = os.path.splitext(path)[1] filename = tempfile.mktemp(suffix) | 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, ... | b5916ab065408111cec262e12dbecbce58daf6ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5916ab065408111cec262e12dbecbce58daf6ec/urllib.py |
noheaders(), 'file:'+file) | headers, 'file:'+file) | def open_local_file(self, url): host, file = splithost(url) if not host: return addinfourl( open(url2pathname(file), 'rb'), noheaders(), 'file:'+file) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfourl( open(url2pathname(file), '... | b5916ab065408111cec262e12dbecbce58daf6ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5916ab065408111cec262e12dbecbce58daf6ec/urllib.py |
noheaders(), 'file:'+file) | headers, 'file:'+file) | def open_local_file(self, url): host, file = splithost(url) if not host: return addinfourl( open(url2pathname(file), 'rb'), noheaders(), 'file:'+file) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfourl( open(url2pathname(file), '... | b5916ab065408111cec262e12dbecbce58daf6ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5916ab065408111cec262e12dbecbce58daf6ec/urllib.py |
{'message' : 'foo', 'args' : ('foo',)}), | {'message' : 'foo', 'args' : ('foo',), 'filename' : None, 'errno' : None, 'strerror' : None}), | def testAttributes(self): # test that exception attributes are happy | 506cc189a97a468180ee18e4c4cd1b4e81242222 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/506cc189a97a468180ee18e4c4cd1b4e81242222/test_exceptions.py |
{'message' : '', 'args' : ('foo', 'bar')}), | {'message' : '', 'args' : ('foo', 'bar'), 'filename' : None, 'errno' : 'foo', 'strerror' : 'bar'}), | def testAttributes(self): # test that exception attributes are happy | 506cc189a97a468180ee18e4c4cd1b4e81242222 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/506cc189a97a468180ee18e4c4cd1b4e81242222/test_exceptions.py |
{'message' : '', 'args' : ('foo', 'bar')}), | {'message' : '', 'args' : ('foo', 'bar'), 'filename' : 'baz', 'errno' : 'foo', 'strerror' : 'bar'}), (IOError, ('foo', 'bar', 'baz', 'quux'), {'message' : '', 'args' : ('foo', 'bar', 'baz', 'quux')}), | def testAttributes(self): # test that exception attributes are happy | 506cc189a97a468180ee18e4c4cd1b4e81242222 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/506cc189a97a468180ee18e4c4cd1b4e81242222/test_exceptions.py |
if module not in save_modules: | if module not in save_modules and module.startswith("test."): | def main(tests=None, testdir=None): """Execute a test suite. This also parses command-line options and modifies its behaviour accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly w... | 51931144427faa001a6db3cfc37380526be256b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/51931144427faa001a6db3cfc37380526be256b6/regrtest.py |
input = text_file.TextFile('Modules/Setup', join_lines=1) | def build_extensions(self): | e08fa29d0e5bf02006ae30d79c31a6fd02d62068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e08fa29d0e5bf02006ae30d79c31a6fd02d62068/setup.py | |
while 1: line = input.readline() if not line: break line = line.split() remove_modules.append( line[0] ) input.close() | for filename in ('Modules/Setup', 'Modules/Setup.local'): input = text_file.TextFile(filename, join_lines=1) while 1: line = input.readline() if not line: break line = line.split() remove_modules.append(line[0]) input.close() | def build_extensions(self): | e08fa29d0e5bf02006ae30d79c31a6fd02d62068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e08fa29d0e5bf02006ae30d79c31a6fd02d62068/setup.py |
'HTTPS')) | 'HTTPS', 'HTTP11')) | def test_others(self): cm = self.checkModule | 547a3167be9a49ce1199be00544011707d367d6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/547a3167be9a49ce1199be00544011707d367d6f/test_pyclbr.py |
usage(2, msg) | usage(msg) return 2 | def main(): try: opts, args = getopt.getopt(sys.argv[1:], "h") except getopt.error, msg: usage(2, msg) for o, a in opts: if o == "-h": help() if not args: usage(2, "at least one file argument is required") if args[1:]: sys.stderr.write("%s: extra file arguments ignored\n", sys.argv[0]) readwarnings(args[0]) | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
help() | print __doc__ return | def main(): try: opts, args = getopt.getopt(sys.argv[1:], "h") except getopt.error, msg: usage(2, msg) for o, a in opts: if o == "-h": help() if not args: usage(2, "at least one file argument is required") if args[1:]: sys.stderr.write("%s: extra file arguments ignored\n", sys.argv[0]) readwarnings(args[0]) | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
usage(2, "at least one file argument is required") | usage("at least one file argument is required") return 2 | def main(): try: opts, args = getopt.getopt(sys.argv[1:], "h") except getopt.error, msg: usage(2, msg) for o, a in opts: if o == "-h": help() if not args: usage(2, "at least one file argument is required") if args[1:]: sys.stderr.write("%s: extra file arguments ignored\n", sys.argv[0]) readwarnings(args[0]) | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
readwarnings(args[0]) def usage(exit, msg=None): if msg: sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) | warnings = readwarnings(args[0]) if warnings is None: return 1 files = warnings.keys() if not files: print "No classic division warnings read from", args[0] return files.sort() exit = None for file in files: x = process(file, warnings[file]) exit = exit or x return exit def usage(msg): sys.stderr.write("%s: %s\n" % (s... | def main(): try: opts, args = getopt.getopt(sys.argv[1:], "h") except getopt.error, msg: usage(2, msg) for o, a in opts: if o == "-h": help() if not args: usage(2, "at least one file argument is required") if args[1:]: sys.stderr.write("%s: extra file arguments ignored\n", sys.argv[0]) readwarnings(args[0]) | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
sys.exit(exit) def help(): print __doc__ sys.exit(0) | PATTERN = ("^(.+?):(\d+): DeprecationWarning: " "classic (int|long|float|complex) division$") | def usage(exit, msg=None): if msg: sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.stderr.write("Usage: %s warnings\n" % sys.argv[0]) sys.stderr.write("Try `%s -h' for more information.\n" % sys.argv[0]) sys.exit(exit) | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
pat = re.compile( "^(.+?):(\d+): DeprecationWarning: classic ([a-z]+) division$") | prog = re.compile(PATTERN) | def readwarnings(warningsfile): pat = re.compile( "^(.+?):(\d+): DeprecationWarning: classic ([a-z]+) division$") try: f = open(warningsfile) except IOError, msg: sys.stderr.write("can't open: %s\n" % msg) return warnings = {} while 1: line = f.readline() if not line: break m = pat.match(line) if not m: if line.find("d... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
m = pat.match(line) | m = prog.match(line) | def readwarnings(warningsfile): pat = re.compile( "^(.+?):(\d+): DeprecationWarning: classic ([a-z]+) division$") try: f = open(warningsfile) except IOError, msg: sys.stderr.write("can't open: %s\n" % msg) return warnings = {} while 1: line = f.readline() if not line: break m = pat.match(line) if not m: if line.find("d... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
files = warnings.keys() files.sort() for file in files: process(file, warnings[file]) | return warnings | def readwarnings(warningsfile): pat = re.compile( "^(.+?):(\d+): DeprecationWarning: classic ([a-z]+) division$") try: f = open(warningsfile) except IOError, msg: sys.stderr.write("can't open: %s\n" % msg) return warnings = {} while 1: line = f.readline() if not line: break m = pat.match(line) if not m: if line.find("d... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
if not list: sys.stderr.write("no division warnings for %s\n" % file) return | assert list | def process(file, list): print "-"*70 if not list: sys.stderr.write("no division warnings for %s\n" % file) return try: fp = open(file) except IOError, msg: sys.stderr.write("can't open: %s\n" % msg) return print "Processing:", file f = FileContext(fp) list.sort() index = 0 # list[:index] has been processed, list[index... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
return print "Processing:", file | return 1 print "Index:", file | def process(file, list): print "-"*70 if not list: sys.stderr.write("no division warnings for %s\n" % file) return try: fp = open(file) except IOError, msg: sys.stderr.write("can't open: %s\n" % msg) return print "Processing:", file f = FileContext(fp) list.sort() index = 0 # list[:index] has been processed, list[index... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
orphans = [] unknown = [] | def process(file, list): print "-"*70 if not list: sys.stderr.write("no division warnings for %s\n" % file) return try: fp = open(file) except IOError, msg: sys.stderr.write("can't open: %s\n" % msg) return print "Processing:", file f = FileContext(fp) list.sort() index = 0 # list[:index] has been processed, list[index... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py | |
report(slashes, "Unexecuted code") | report(slashes, "No conclusive evidence") | def process(file, list): print "-"*70 if not list: sys.stderr.write("no division warnings for %s\n" % file) return try: fp = open(file) except IOError, msg: sys.stderr.write("can't open: %s\n" % msg) return print "Processing:", file f = FileContext(fp) list.sort() index = 0 # list[:index] has been processed, list[index... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
def scanline(g): slashes = [] startlineno = None endlineno = None for type, token, start, end, line in g: endlineno = end[0] if startlineno is None: startlineno = endlineno if token in ("/", "/="): slashes.append((start, line)) ## if type in (tokenize.NEWLINE, tokenize.NL, tokenize.COMMENT): if type == tokenize.NEWLINE... | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py | ||
main() | sys.exit(main()) | def chop(line): if line.endswith("\n"): return line[:-1] else: return line | 13c51ecb8c5b70f83f746db9af759b9d6a590769 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13c51ecb8c5b70f83f746db9af759b9d6a590769/fixdiv.py |
__slots__ = ['_hash'] | __slots__ = ['_hashcode'] | def _compute_hash(self): # Calculate hash code for a set by xor'ing the hash codes of # the elements. This algorithm ensures that the hash code # does not depend on the order in which elements are added to # the code. This is not called __hash__ because a BaseSet # should not be hashable; only an ImmutableSet is hash... | 0b650d756572e33c923eb4998224da2d95dffaac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0b650d756572e33c923eb4998224da2d95dffaac/sets.py |
def buffer_inherit(): import binascii if verbose: print "Testing that buffer interface is inherited ..." class MyStr(str): pass base = 'abc' m = MyStr(base) vereq(binascii.b2a_hex(m), binascii.b2a_hex(base)) class MyUni(unicode): pass base = u'abc' m = MyUni(base) vereq(binascii.b2a_hex(m), binascii.b2a_hex(bas... | def __getattr__(self, name): if name in ("spam", "foo", "bar"): return "hello" raise AttributeError, name | fc57ccb98248b4a8f4ba4debdf3791970b136c4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fc57ccb98248b4a8f4ba4debdf3791970b136c4d/test_descr.py | |
Technically, only a <mailbox> is allowed. In addition, email addresses without a domain are permitted. Addresses will not be modified if they are already quoted (actually if they begin with '<' and end with '>'.""" if re.match('(?s)\A<.*>\Z', addr): | Should be able to handle anything rfc822.parseaddr can handle.""" m=None try: m=rfc822.parseaddr(addr)[1] except AttributeError: pass if not m: | def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Technically, only a <mailbox> is allowed. In addition, email addresses without a domain are permitted. Addresses will not be modified if they are already quoted (actually if they begin with '<' and end with '>'.""" if re.match('(?s)\A<... | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
localpart = None domain = '' try: at = string.rindex(addr, '@') localpart = addr[:at] domain = addr[at:] except ValueError: localpart = addr pat = re.compile(r'([<>()\[\]\\,;:@\"\001-\037\177])') return '<%s%s>' % (pat.sub(r'\\\1', localpart), domain) | else: return "<%s>" % m | def quoteaddr(addr): """Quote a subset of the email addresses defined by RFC 821. Technically, only a <mailbox> is allowed. In addition, email addresses without a domain are permitted. Addresses will not be modified if they are already quoted (actually if they begin with '<' and end with '>'.""" if re.match('(?s)\A<... | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
Double leading '.', and change Unix newline '\n' into | Double leading '.', and change Unix newline '\n', or Mac '\r' into | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data)) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
re.sub(r'\r?\n', CRLF, data)) | re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data)) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
"""This class manages a connection to an SMTP or ESMTP server.""" | """This class manages a connection to an SMTP or ESMTP server. SMTP Objects: SMTP objects have the following attributes: helo_resp This is the message given by the server in responce to the most recent HELO command. ehlo_resp This is the message given by the server in responce to the most recent EHLO command. This is ... | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data)) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
esmtp_features = [] | does_esmtp = 0 | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n' into Internet CRLF end-of-line.""" return re.sub(r'(?m)^\.', '..', re.sub(r'\r?\n', CRLF, data)) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
def verify(self, address): """ SMTP 'verify' command. Checks for address validity. """ self.putcmd("vrfy", address) return self.getreply() | def verify(self, address): """ SMTP 'verify' command. Checks for address validity. """ self.putcmd("vrfy", address) return self.getreply() | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py | |
that suffix will be stripped off and the number interpreted as the port number to use. | and there is no port specified, that suffix will be stripped off and the number interpreted as the port number to use. | def connect(self, host='localhost', port = 0): """Connect to a host on a given port. | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
self.sock.send(str) | try: self.sock.send(str) except socket.error: raise SMTPServerDisconnected | def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', `str` if self.sock: self.sock.send(str) else: raise SMTPServerDisconnected | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
def getreply(self, linehook=None): | def getreply(self): | def getreply(self, linehook=None): """Get a reply from the server. Returns a tuple consisting of: - server response code (e.g. '250', or such, if all goes well) Note: returns -1 if it can't read response code. - server response string corresponding to response code (note : multiline responses converted to a single, mu... | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
elif linehook: linehook(line) | def getreply(self, linehook=None): """Get a reply from the server. Returns a tuple consisting of: - server response code (e.g. '250', or such, if all goes well) Note: returns -1 if it can't read response code. - server response string corresponding to response code (note : multiline responses converted to a single, mu... | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py | |
defaults to the FQDN of the local host """ | defaults to the FQDN of the local host. """ | def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply(self.ehlo_hook) self.ehlo_resp=msg return code | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
(code,msg)=self.getreply(self.ehlo_hook) | (code,msg)=self.getreply() if code == -1 and len(msg) == 0: raise SMTPServerDisconnected | def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply(self.ehlo_hook) self.ehlo_resp=msg return code | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
def ehlo_hook(self, line): if line[4] in string.uppercase+string.digits: self.esmtp_features.append(string.lower(string.strip(line)[4:])) def has_option(self, opt): """Does the server support a given SMTP option?""" return opt in self.esmtp_features | def has_extn(self, opt): """Does the server support a given SMTP service extension?""" return self.esmtp_features.has_key(string.lower(opt)) | def ehlo_hook(self, line): # Interpret EHLO response lines if line[4] in string.uppercase+string.digits: self.esmtp_features.append(string.lower(string.strip(line)[4:])) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
if options: options = " " + string.joinfields(options, ' ') else: options = '' self.putcmd("mail", "from:" + quoteaddr(sender) + options) | optionlist = '' if options and self.does_esmtp: optionlist = string.join(options, ' ') self.putcmd("mail", "FROM:%s %s" % (quoteaddr(sender) ,optionlist)) | def mail(self,sender,options=[]): """ SMTP 'mail' command. Begins mail xfer session. """ if options: options = " " + string.joinfields(options, ' ') else: options = '' self.putcmd("mail", "from:" + quoteaddr(sender) + options) return self.getreply() | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
def rcpt(self,recip): | def rcpt(self,recip,options=[]): | def rcpt(self,recip): """ SMTP 'rcpt' command. Indicates 1 recipient for this mail. """ self.putcmd("rcpt","to:%s" % quoteaddr(recip)) return self.getreply() | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
self.putcmd("rcpt","to:%s" % quoteaddr(recip)) | optionlist = '' if options and self.does_esmtp: optionlist = string.join(options, ' ') self.putcmd("rcpt","TO:%s %s" % (quoteaddr(recip),optionlist)) | def rcpt(self,recip): """ SMTP 'rcpt' command. Indicates 1 recipient for this mail. """ self.putcmd("rcpt","to:%s" % quoteaddr(recip)) return self.getreply() | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
def sendmail(self,from_addr,to_addrs,msg,options=[]): | def sendmail(self,from_addr,to_addrs,msg,mail_options=[],rcpt_options=[]): | def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
- encoding : list of ESMTP options (such as 8bitmime) | - mail_options : list of ESMTP options (such as 8bitmime) for the mail command - rcpt_options : List of ESMTP options (such as DSN commands) for all the rcpt commands | def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
size and each of the specified options will be passed to it (if the option is in the feature set the server advertises). If EHLO fails, HELO will be tried and ESMTP options suppressed. | size and each of the specified options will be passed to it. If EHLO fails, HELO will be tried and ESMTP options suppressed. | def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
if self.esmtp_features: self.esmtp_features.append('7bit') | def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py | |
if 'size' in self.esmtp_features: esmtp_opts.append("size=" + `len(msg)`) for option in options: if option in self.esmtp_features: | if self.does_esmtp: if self.has_extn('size'): esmtp_opts.append("size=" + `len(msg)`) for option in mail_options: | def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
(code,resp)=self.rcpt(each) | (code,resp)=self.rcpt(each, rcpt_options) | def sendmail(self,from_addr,to_addrs,msg,options=[]): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. - encoding : list of ESMTP options (such as 8bitmime) | fcfb6323fb0030467d67b071654b342b7725727f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcfb6323fb0030467d67b071654b342b7725727f/smtplib.py |
c = cmp(dict1, dict2) | if random.random() < 0.5: c = cmp(dict1, dict2) else: c = dict1 == dict2 | def test_one(n): global mutate, dict1, dict2, dict1keys, dict2keys # Fill the dicts without mutating them. mutate = 0 dict1keys = fill_dict(dict1, range(n), n) dict2keys = fill_dict(dict2, range(n), n) # Enable mutation, then compare the dicts so long as they have the # same size. mutate = 1 if verbose: print "trying... | d3da7d394a64f3894b625842da4e5cc2f13bac08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3da7d394a64f3894b625842da4e5cc2f13bac08/test_mutants.py |
all, scheme, rfc, selfdot, name = match.groups() | all, scheme, rfc, pep, selfdot, name = match.groups() | def markup(self, text, escape=None, funcs={}, classes={}, methods={}): """Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.""" escape = escape or self.escape results = [] here = 0 pattern = re.compile(r'\b((http|ftp)://\S+[\w/]|' r'RFC[- ]?(\d+)|... | f78a81b47baa04c78ca29ff4f4a8236297e852a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f78a81b47baa04c78ca29ff4f4a8236297e852a0/pydoc.py |
url = 'http://www.rfc-editor.org/rfc/rfc%s.txt' % rfc | url = 'http://www.rfc-editor.org/rfc/rfc%d.txt' % int(rfc) results.append('<a href="%s">%s</a>' % (url, escape(all))) elif pep: url = 'http://www.python.org/peps/pep-%04d.html' % int(pep) | def markup(self, text, escape=None, funcs={}, classes={}, methods={}): """Mark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.""" escape = escape or self.escape results = [] here = 0 pattern = re.compile(r'\b((http|ftp)://\S+[\w/]|' r'RFC[- ]?(\d+)|... | f78a81b47baa04c78ca29ff4f4a8236297e852a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f78a81b47baa04c78ca29ff4f4a8236297e852a0/pydoc.py |
if cache.has_key(path) and cache[path] != info: module = reload(module) | if cache.get(path) == info: continue module = reload(module) | def freshimport(name, cache={}): """Import a module, reloading it if the source file has changed.""" topmodule = __import__(name) module = None for component in split(name, '.'): if module == None: module = topmodule path = split(name, '.')[0] else: module = getattr(module, component) path = path + '.' + component if h... | f78a81b47baa04c78ca29ff4f4a8236297e852a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f78a81b47baa04c78ca29ff4f4a8236297e852a0/pydoc.py |
return '''To get help on a Python object, call help(object). | return '''Welcome to Python %s! To get help on a Python object, call help(object). | def __repr__(self): return '''To get help on a Python object, call help(object). | f78a81b47baa04c78ca29ff4f4a8236297e852a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f78a81b47baa04c78ca29ff4f4a8236297e852a0/pydoc.py |
help(module) or call help('modulename').''' | help(module) or call help('modulename').''' % sys.version[:3] | def __repr__(self): return '''To get help on a Python object, call help(object). | f78a81b47baa04c78ca29ff4f4a8236297e852a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f78a81b47baa04c78ca29ff4f4a8236297e852a0/pydoc.py |
if platform not in ['cygwin']: exts.append( Extension('resource', ['resource.c']) ) | exts.append( Extension('resource', ['resource.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | fda3c3ddae776dc23e55327e481d3bd5bec0536a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fda3c3ddae776dc23e55327e481d3bd5bec0536a/setup.py |
last = last + 1 | last = min(self.maxx, last+1) | def _end_of_line(self, y): "Go to the location of the first blank on the given line." last = self.maxx while 1: if ascii.ascii(self.win.inch(y, last)) != ascii.SP: last = last + 1 break elif last == 0: break last = last - 1 return last | 76276177dea7d3e1412390e36a2c260f3f8107cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/76276177dea7d3e1412390e36a2c260f3f8107cb/textpad.py |
def get_python_inc(plat_specific=0): | def get_python_inc(plat_specific=0, prefix=None): | def get_python_inc(plat_specific=0): """Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely config.h). """ pr... | d38e6f763797bec120ba110cd6e416d903c071b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d38e6f763797bec120ba110cd6e416d903c071b9/sysconfig.py |
prefix = (plat_specific and EXEC_PREFIX or PREFIX) | if prefix is None: prefix = (plat_specific and EXEC_PREFIX or PREFIX) | def get_python_inc(plat_specific=0): """Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely config.h). """ pr... | d38e6f763797bec120ba110cd6e416d903c071b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d38e6f763797bec120ba110cd6e416d903c071b9/sysconfig.py |
def get_python_lib(plat_specific=0, standard_lib=0): | def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): | def get_python_lib(plat_specific=0, standard_lib=0): """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 platform-shar... | d38e6f763797bec120ba110cd6e416d903c071b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d38e6f763797bec120ba110cd6e416d903c071b9/sysconfig.py |
prefix = (plat_specific and EXEC_PREFIX or PREFIX) | if prefix is None: prefix = (plat_specific and EXEC_PREFIX or PREFIX) | def get_python_lib(plat_specific=0, standard_lib=0): """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 platform-shar... | d38e6f763797bec120ba110cd6e416d903c071b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d38e6f763797bec120ba110cd6e416d903c071b9/sysconfig.py |
p = subprocess.Popen([sys.executable, "-c", "import os; os.abort()"]) | old_limit = self._suppress_core_files() try: p = subprocess.Popen([sys.executable, "-c", "import os; os.abort()"]) finally: self._unsuppress_core_files(old_limit) | def test_run_abort(self): # returncode handles signal termination p = subprocess.Popen([sys.executable, "-c", "import os; os.abort()"]) p.wait() self.assertEqual(-p.returncode, signal.SIGABRT) | 86e1e38059c7f2a1d8bdc4123a1600bc7b7a0f79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/86e1e38059c7f2a1d8bdc4123a1600bc7b7a0f79/test_subprocess.py |
f(1, 2, 3, *UserList([4, 5]) | f(1, 2, 3, *UserList([4, 5])) | def h(j=1, a=2, h=3): print j, a, h | 003663d78372a33ddbc57594d0176fa39996a84d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/003663d78372a33ddbc57594d0176fa39996a84d/test_extcall.py |
addr = socket.gethostbyname(socket.gethostname()) | addr = '127.0.0.1' try: addr = socket.gethostbyname(socket.gethostname()) except socket.gaierror: pass | def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance. | dcdfd22bb411ebf0d58bba135455c4abf2bc9ce1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dcdfd22bb411ebf0d58bba135455c4abf2bc9ce1/smtplib.py |
class BadException: | class BadException(Exception): | def ckmsg(src, msg): try: compile(src, '<fragment>', 'exec') except SyntaxError, e: print e.msg if e.msg == msg: print "ok" else: print "expected:", msg else: print "failed to get expected SyntaxError" | 303de6a25b4dc4874eded29c34c719a3bd6a4f40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/303de6a25b4dc4874eded29c34c719a3bd6a4f40/test_exceptions.py |
def grid_location(self, x, y): """Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.""" return self._getints( self.tk.call( 'grid', 'location', self._w, x, y)) or None location = grid_location | location = grid_location = Misc.grid_location | def grid_location(self, x, y): """Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.""" return self._getints( self.tk.call( 'grid', 'location', self._w, x, y)) or None | dc5790932335cebb5a9baa03b46e52e06d4bb24a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc5790932335cebb5a9baa03b46e52e06d4bb24a/Tkinter.py |
xid = self.unpack_uint(xid) | xid = self.unpack_uint() | def unpack_callheader(self): xid = self.unpack_uint(xid) temp = self.unpack_enum() if temp <> CALL: raise BadRPCFormat, 'no CALL but %r' % (temp,) temp = self.unpack_uint() if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) prog = self.unpack_uint() vers = self.unpack_uint() proc = self.unpack_... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if temp <> CALL: | if temp != CALL: | def unpack_callheader(self): xid = self.unpack_uint(xid) temp = self.unpack_enum() if temp <> CALL: raise BadRPCFormat, 'no CALL but %r' % (temp,) temp = self.unpack_uint() if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) prog = self.unpack_uint() vers = self.unpack_uint() proc = self.unpack_... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) | if temp != RPCVERSION: raise BadRPCVersion, 'bad RPC version %r' % (temp,) | def unpack_callheader(self): xid = self.unpack_uint(xid) temp = self.unpack_enum() if temp <> CALL: raise BadRPCFormat, 'no CALL but %r' % (temp,) temp = self.unpack_uint() if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) prog = self.unpack_uint() vers = self.unpack_uint() proc = self.unpack_... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if mtype <> REPLY: | if mtype != REPLY: | def unpack_replyheader(self): xid = self.unpack_uint() mtype = self.unpack_enum() if mtype <> REPLY: raise RuntimeError, 'no REPLY but %r' % (mtype,) stat = self.unpack_enum() if stat == MSG_DENIED: stat = self.unpack_enum() if stat == RPC_MISMATCH: low = self.unpack_uint() high = self.unpack_uint() raise RuntimeError,... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if stat <> MSG_ACCEPTED: | if stat != MSG_ACCEPTED: | def unpack_replyheader(self): xid = self.unpack_uint() mtype = self.unpack_enum() if mtype <> REPLY: raise RuntimeError, 'no REPLY but %r' % (mtype,) stat = self.unpack_enum() if stat == MSG_DENIED: stat = self.unpack_enum() if stat == RPC_MISMATCH: low = self.unpack_uint() high = self.unpack_uint() raise RuntimeError,... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if stat <> SUCCESS: | if stat != SUCCESS: | def unpack_replyheader(self): xid = self.unpack_uint() mtype = self.unpack_enum() if mtype <> REPLY: raise RuntimeError, 'no REPLY but %r' % (mtype,) stat = self.unpack_enum() if stat == MSG_DENIED: stat = self.unpack_enum() if stat == RPC_MISMATCH: low = self.unpack_uint() high = self.unpack_uint() raise RuntimeError,... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if errno <> 114: | if errno != 114: | def bindresvport(sock, host): global last_resv_port_tried FIRST, LAST = 600, 1024 # Range of ports to try if last_resv_port_tried == None: import os last_resv_port_tried = FIRST + os.getpid() % (LAST-FIRST) for i in range(last_resv_port_tried, LAST) + \ range(FIRST, last_resv_port_tried): last_resv_port_tried = i try: ... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if xid <> self.lastxid: | if xid != self.lastxid: | def do_call(self): call = self.packer.get_buf() sendrecord(self.sock, call) reply = recvrecord(self.sock) u = self.unpacker u.reset(reply) xid, verf = u.unpack_replyheader() if xid <> self.lastxid: # Can't really happen since this is TCP... raise RuntimeError, 'wrong xid in reply %r instead of %r' % ( xid, self.lastxid... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if xid <> self.lastxid: | if xid != self.lastxid: | def do_call(self): call = self.packer.get_buf() self.sock.send(call) try: from select import select except ImportError: print 'WARNING: select not found, RPC may hang' select = None BUFSIZE = 8192 # Max UDP buffer size timeout = 1 count = 5 while 1: r, w, x = [self.sock], [], [] if select: r, w, x = select(r, w, x, tim... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if xid <> self.lastxid: | if xid != self.lastxid: | def dummy(): pass | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if temp <> CALL: | if temp != CALL: | def handle(self, call): # Don't use unpack_header but parse the header piecewise # XXX I have no idea if I am using the right error responses! self.unpacker.reset(call) self.packer.reset() xid = self.unpacker.unpack_uint() self.packer.pack_uint(xid) temp = self.unpacker.unpack_enum() if temp <> CALL: return None # Not ... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if temp <> RPCVERSION: | if temp != RPCVERSION: | def handle(self, call): # Don't use unpack_header but parse the header piecewise # XXX I have no idea if I am using the right error responses! self.unpacker.reset(call) self.packer.reset() xid = self.unpacker.unpack_uint() self.packer.pack_uint(xid) temp = self.unpacker.unpack_enum() if temp <> CALL: return None # Not ... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if prog <> self.prog: | if prog != self.prog: | def handle(self, call): # Don't use unpack_header but parse the header piecewise # XXX I have no idea if I am using the right error responses! self.unpacker.reset(call) self.packer.reset() xid = self.unpacker.unpack_uint() self.packer.pack_uint(xid) temp = self.unpacker.unpack_enum() if temp <> CALL: return None # Not ... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if vers <> self.vers: | if vers != self.vers: | def handle(self, call): # Don't use unpack_header but parse the header piecewise # XXX I have no idea if I am using the right error responses! self.unpacker.reset(call) self.packer.reset() xid = self.unpacker.unpack_uint() self.packer.pack_uint(xid) temp = self.unpacker.unpack_enum() if temp <> CALL: return None # Not ... | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
if reply <> None: | if reply != None: | def session(self): call, host_port = self.sock.recvfrom(8192) reply = self.handle(call) if reply <> None: self.sock.sendto(reply, host_port) | c672f8c377b9befd49fed010441b025deace386a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c672f8c377b9befd49fed010441b025deace386a/rpc.py |
np = lambda *f: norm(self.tempdir, *f) | def test_glob_literal(self): eq = self.assertSequencesEqual_noorder np = lambda *f: norm(self.tempdir, *f) eq(self.glob('a'), [self.norm('a')]) eq(self.glob('a', 'D'), [self.norm('a', 'D')]) eq(self.glob('aab'), [self.norm('aab')]) eq(self.glob('zymurgy'), []) | d4e48b7f61a767dd32195ccc91949017bbef5a05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d4e48b7f61a767dd32195ccc91949017bbef5a05/test_glob.py | |
np = lambda *f: norm(self.tempdir, *f) | def test_glob_one_directory(self): eq = self.assertSequencesEqual_noorder np = lambda *f: norm(self.tempdir, *f) eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa'])) eq(self.glob('*a'), map(self.norm, ['a', 'aaa'])) eq(self.glob('aa?'), map(self.norm, ['aaa', 'aab'])) eq(self.glob('aa[ab]'), map(self.norm, ['aaa', ... | d4e48b7f61a767dd32195ccc91949017bbef5a05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d4e48b7f61a767dd32195ccc91949017bbef5a05/test_glob.py | |
np = lambda *f: norm(self.tempdir, *f) | def test_glob_nested_directory(self): eq = self.assertSequencesEqual_noorder np = lambda *f: norm(self.tempdir, *f) if os.path.normcase("abCD") == "abCD": # case-sensitive filesystem eq(self.glob('a', 'bcd', 'E*'), [self.norm('a', 'bcd', 'EF')]) else: # case insensitive filesystem eq(self.glob('a', 'bcd', 'E*'), [self.... | d4e48b7f61a767dd32195ccc91949017bbef5a05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d4e48b7f61a767dd32195ccc91949017bbef5a05/test_glob.py | |
np = lambda *f: norm(self.tempdir, *f) | def test_glob_directory_names(self): eq = self.assertSequencesEqual_noorder np = lambda *f: norm(self.tempdir, *f) eq(self.glob('*', 'D'), [self.norm('a', 'D')]) eq(self.glob('*', '*a'), []) eq(self.glob('a', '*', '*', '*a'), [self.norm('a', 'bcd', 'efg', 'ha')]) eq(self.glob('?a?', '*F'), map(self.norm, [os.path.join(... | d4e48b7f61a767dd32195ccc91949017bbef5a05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d4e48b7f61a767dd32195ccc91949017bbef5a05/test_glob.py | |
The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~') | The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs and spaces are always encoded, as per RFC 1521. """ if c in ' \t': return quotetabs return c == ESCAPE or not (' ' <= c <= '~') | def needsquoting(c, quotetabs): """Decide whether a particular character needs to be quoted. The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~') | 9b630a50200e44e16acfe3dee4052b3d0b0677e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b630a50200e44e16acfe3dee4052b3d0b0677e4/quopri.py |
The 'quotetabs' flag indicates whether tabs should be quoted. """ | The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs and spaces are always encoded, as per RFC 1521. """ def write(s, output=output, lineEnd='\n'): if s and s[-1:] in ' \t': output.write(s[:-1] + quote(s[-1]) + lineEnd) else: output.write(s + lineEnd) prevline... | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 9b630a50200e44e16acfe3dee4052b3d0b0677e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b630a50200e44e16acfe3dee4052b3d0b0677e4/quopri.py |
new = '' last = line[-1:] if last == '\n': | outline = [] stripped = '' if line[-1:] == '\n': | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 9b630a50200e44e16acfe3dee4052b3d0b0677e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b630a50200e44e16acfe3dee4052b3d0b0677e4/quopri.py |
else: last = '' prev = '' | stripped = '\n' | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 9b630a50200e44e16acfe3dee4052b3d0b0677e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b630a50200e44e16acfe3dee4052b3d0b0677e4/quopri.py |
if len(new) + len(c) >= MAXLINESIZE: output.write(new + ESCAPE + '\n') new = '' new = new + c prev = c if prev in (' ', '\t'): output.write(new + ESCAPE + '\n\n') else: output.write(new + '\n') | if linelen + len(c) >= MAXLINESIZE: if prevline is not None: write(prevline) prevline = EMPTYSTRING.join(outline) linelen = 0 outline = [] outline.append(c) linelen += len(c) if prevline is not None: write(prevline) prevline = EMPTYSTRING.join(outline) linelen = 0 outline = [] if prevline is not None: write(prevlin... | def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-... | 9b630a50200e44e16acfe3dee4052b3d0b0677e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b630a50200e44e16acfe3dee4052b3d0b0677e4/quopri.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.