rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
_cache[alias] = entry | if not aliases.aliases.has_key(alias): aliases.aliases[alias] = modname | def search_function(encoding): # Cache lookup entry = _cache.get(encoding,_unknown) if entry is not _unknown: return entry # Import the module modname = encoding.replace('-', '_') modname = aliases.aliases.get(modname,modname) try: mod = __import__(modname,globals(),locals(),'*') except ImportError,why: _cache[encodi... | 988ad2bdff836665f004c285fb09182c35775fd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/988ad2bdff836665f004c285fb09182c35775fd6/__init__.py |
if do_copy: macostools.copy(os.path.join(sys.exec_prefix, src), dst) else: macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) | try: if do_copy: macostools.copy(os.path.join(sys.exec_prefix, src), dst) else: macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) except IOError: return 0 | def mkcorealias(src, altsrc): import string import macostools version = string.split(sys.version)[0] dst = getextensiondirfile(src+ ' ' + version) if not dst: return 0 if not os.path.exists(os.path.join(sys.exec_prefix, src)): if not os.path.exists(os.path.join(sys.exec_prefix, altsrc)): return 0 src = altsrc try: os.u... | 2a42c3a8d3b9989aacc2d7bfcdcae4bdd97649e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2a42c3a8d3b9989aacc2d7bfcdcae4bdd97649e5/ConfigurePython.py |
ad = self.getaddress() if ad: return ad + self.getaddrlist() else: return [] | result = [] while 1: ad = self.getaddress() if ad: result += ad else: break return result | def getaddrlist(self): """Parse all addresses. | f1fd282f137952644a8c2a0330e3379e27a40582 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1fd282f137952644a8c2a0330e3379e27a40582/rfc822.py |
version_number = float(version.split('/', 1)[1]) except ValueError: | base_version_number = version.split('/', 1)[1] version_number = base_version_number.split(".") if len(version_number) != 2: raise ValueError version_number = int(version_number[0]), int(version_number[1]) except (ValueError, IndexError): | def parse_request(self): """Parse a request (internal). | 2de97d398d5a66307228b1269812da94e65e20a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2de97d398d5a66307228b1269812da94e65e20a3/BaseHTTPServer.py |
if version_number >= 1.1 and self.protocol_version >= "HTTP/1.1": | if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1": | def parse_request(self): """Parse a request (internal). | 2de97d398d5a66307228b1269812da94e65e20a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2de97d398d5a66307228b1269812da94e65e20a3/BaseHTTPServer.py |
if version_number >= 2.0: | if version_number >= (2, 0): | def parse_request(self): """Parse a request (internal). | 2de97d398d5a66307228b1269812da94e65e20a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2de97d398d5a66307228b1269812da94e65e20a3/BaseHTTPServer.py |
"Invalid HTTP Version (%f)" % version_number) | "Invalid HTTP Version (%s)" % base_version_number) | def parse_request(self): """Parse a request (internal). | 2de97d398d5a66307228b1269812da94e65e20a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2de97d398d5a66307228b1269812da94e65e20a3/BaseHTTPServer.py |
def simple_err(func, *args): try: apply(func, args) except struct.error: pass else: raise TestFailed, "%s%s did not raise struct.error" % ( func.__name__, args) | 7a3bfc3a472dafc42d20845389eb79db8af0b046 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a3bfc3a472dafc42d20845389eb79db8af0b046/test_struct.py | ||
simple_err(struct.pack, "Q", -1) | any_err(struct.pack, "Q", -1) | def simple_err(func, *args): try: apply(func, args) except struct.error: pass else: raise TestFailed, "%s%s did not raise struct.error" % ( func.__name__, args) | 7a3bfc3a472dafc42d20845389eb79db8af0b046 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a3bfc3a472dafc42d20845389eb79db8af0b046/test_struct.py |
chars = list(value) chars.reverse() return "".join(chars) if has_native_qQ: | else: return string_reverse(value) def test_native_qQ(): | def bigendian_to_native(value): if isbigendian: return value chars = list(value) chars.reverse() return "".join(chars) | 7a3bfc3a472dafc42d20845389eb79db8af0b046 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a3bfc3a472dafc42d20845389eb79db8af0b046/test_struct.py |
cmd = form.getvalue("cmd") or "view" page = form.getvalue("page") or "FrontPage" | cmd = form.getvalue("cmd", "view") page = form.getvalue("page", "FrontPage") | def main(): form = cgi.FieldStorage() print "Content-type: text/html" print cmd = form.getvalue("cmd") or "view" page = form.getvalue("page") or "FrontPage" wiki = WikiPage(page) wiki.load() method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view method(form) | 48123b266cd8d041ca6d66f148c3a6c054b2cc00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48123b266cd8d041ca6d66f148c3a6c054b2cc00/cgi3.py |
homedir = os.path.dirname(sys.argv[0]) | homedir = "/tmp" | def main(): form = cgi.FieldStorage() print "Content-type: text/html" print cmd = form.getvalue("cmd") or "view" page = form.getvalue("page") or "FrontPage" wiki = WikiPage(page) wiki.load() method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view method(form) | 48123b266cd8d041ca6d66f148c3a6c054b2cc00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48123b266cd8d041ca6d66f148c3a6c054b2cc00/cgi3.py |
print "<p>", self.mklink("edit", self.name, "Edit this page") + "," | print "<p>", self.mklink("edit", self.name, "Edit this page") + ";" | def cmd_view(self, form): print "<h1>", escape(self.splitwikiword(self.name)), "</h1>" print "<p>" for line in self.data.splitlines(): line = line.rstrip() if not line: print "<p>" continue words = re.split('(\W+)', line) for i in range(len(words)): word = words[i] if self.iswikiword(word): if os.path.isfile(self.mkfil... | 48123b266cd8d041ca6d66f148c3a6c054b2cc00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48123b266cd8d041ca6d66f148c3a6c054b2cc00/cgi3.py |
self.store() self.cmd_view(form) | error = self.store() if error: print "<h1>I'm sorry. That didn't work</h1>" print "<p>An error occurred while attempting to write the file:" print "<p>", escape(error) else: self.cmd_view(form) | def cmd_create(self, form): self.data = form.getvalue("text", "").strip() self.store() self.cmd_view(form) | 48123b266cd8d041ca6d66f148c3a6c054b2cc00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48123b266cd8d041ca6d66f148c3a6c054b2cc00/cgi3.py |
assert flags == 0 | def search(pattern, string, flags=0): assert flags == 0 return compile(pattern, _fixflags(flags)).search(string) | 1b6aecb08c5496402189f455c4f07654902a8a51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b6aecb08c5496402189f455c4f07654902a8a51/sre.py | |
print time.strftime("expires=%a, %d-%b-%x %X GMT", gmt) | print time.strftime("expires=%a, %d-%b-%y %X GMT", gmt) | def send_my_cookie(ui): name = COOKIE_NAME value = "%s/%s/%s" % (ui.author, ui.email, ui.password) import urllib value = urllib.quote(value) then = now + COOKIE_LIFETIME gmt = time.gmtime(then) print "Set-Cookie: %s=%s; path=/cgi-bin/;" % (name, value), print time.strftime("expires=%a, %d-%b-%x %X GMT", gmt) | 48b1cdea455f6d041ce853cad59b48f779cf9f18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/48b1cdea455f6d041ce853cad59b48f779cf9f18/faqwiz.py |
self.recall(sel) | self.recall(sel, event) | def enter_callback(self, event): if self.executing and not self.reading: return # Let the default binding (insert '\n') take over # If some text is selected, recall the selection # (but only if this before the I/O mark) try: sel = self.text.get("sel.first", "sel.last") if sel: if self.text.compare("sel.last", "<=", "io... | a7daba6866136d1c554ba6bf278e9ddaf52ecac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a7daba6866136d1c554ba6bf278e9ddaf52ecac6/PyShell.py |
self.recall(self.text.get(prev[0], prev[1])) | self.recall(self.text.get(prev[0], prev[1]), event) | def enter_callback(self, event): if self.executing and not self.reading: return # Let the default binding (insert '\n') take over # If some text is selected, recall the selection # (but only if this before the I/O mark) try: sel = self.text.get("sel.first", "sel.last") if sel: if self.text.compare("sel.last", "<=", "io... | a7daba6866136d1c554ba6bf278e9ddaf52ecac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a7daba6866136d1c554ba6bf278e9ddaf52ecac6/PyShell.py |
self.recall(self.text.get(next[0], next[1])) | self.recall(self.text.get(next[0], next[1]), event) | def enter_callback(self, event): if self.executing and not self.reading: return # Let the default binding (insert '\n') take over # If some text is selected, recall the selection # (but only if this before the I/O mark) try: sel = self.text.get("sel.first", "sel.last") if sel: if self.text.compare("sel.last", "<=", "io... | a7daba6866136d1c554ba6bf278e9ddaf52ecac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a7daba6866136d1c554ba6bf278e9ddaf52ecac6/PyShell.py |
self.recall(line) | self.recall(line, event) | def enter_callback(self, event): if self.executing and not self.reading: return # Let the default binding (insert '\n') take over # If some text is selected, recall the selection # (but only if this before the I/O mark) try: sel = self.text.get("sel.first", "sel.last") if sel: if self.text.compare("sel.last", "<=", "io... | a7daba6866136d1c554ba6bf278e9ddaf52ecac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a7daba6866136d1c554ba6bf278e9ddaf52ecac6/PyShell.py |
def recall(self, s): if self.history: self.history.recall(s) | def recall(self, s, event): self.text.undo_block_start() try: self.text.tag_remove("sel", "1.0", "end") self.text.mark_set("insert", "end-1c") s = s.strip() lines = s.split('\n') if lines: prefix = self.text.get("insert linestart","insert").rstrip() if prefix and prefix[-1]==':': self.newline_and_indent_event(event) s... | def recall(self, s): if self.history: self.history.recall(s) | a7daba6866136d1c554ba6bf278e9ddaf52ecac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a7daba6866136d1c554ba6bf278e9ddaf52ecac6/PyShell.py |
except (DistutilsExecError, DistutilsFileError, DistutilsOptionError, | except (DistutilsError, | 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; find and parse config files; parse the command line; run each Distutils command found there, customized by the options supplied to 'setup... | 91e77536e8285bd2276a40bb891efc9001b9f8a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/91e77536e8285bd2276a40bb891efc9001b9f8a6/core.py |
y = _reconstruct(x, reductor(), 1) | y = _reconstruct(x, reductor(), 1, memo) | def deepcopy(x, memo = None): """Deep copy operation on arbitrary Python objects. See the module's __doc__ string for more info. """ if memo is None: memo = {} d = id(x) if memo.has_key(d): return memo[d] try: copierfunction = _deepcopy_dispatch[type(x)] except KeyError: try: copier = x.__deepcopy__ except AttributeE... | 1e91c1444a9c8b8b58310cffbe4252698527a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e91c1444a9c8b8b58310cffbe4252698527a31e/copy.py |
def _reconstruct(x, info, deep): | def _reconstruct(x, info, deep, memo=None): | def _reconstruct(x, info, deep): if isinstance(info, str): return x assert isinstance(info, tuple) n = len(info) assert n in (2, 3) callable, args = info[:2] if n > 2: state = info[2] else: state = {} if deep: args = deepcopy(args) y = callable(*args) if state: if deep: state = deepcopy(state) y.__dict__.update(state) ... | 1e91c1444a9c8b8b58310cffbe4252698527a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e91c1444a9c8b8b58310cffbe4252698527a31e/copy.py |
args = deepcopy(args) | args = deepcopy(args, memo) | def _reconstruct(x, info, deep): if isinstance(info, str): return x assert isinstance(info, tuple) n = len(info) assert n in (2, 3) callable, args = info[:2] if n > 2: state = info[2] else: state = {} if deep: args = deepcopy(args) y = callable(*args) if state: if deep: state = deepcopy(state) y.__dict__.update(state) ... | 1e91c1444a9c8b8b58310cffbe4252698527a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e91c1444a9c8b8b58310cffbe4252698527a31e/copy.py |
state = deepcopy(state) | state = deepcopy(state, memo) | def _reconstruct(x, info, deep): if isinstance(info, str): return x assert isinstance(info, tuple) n = len(info) assert n in (2, 3) callable, args = info[:2] if n > 2: state = info[2] else: state = {} if deep: args = deepcopy(args) y = callable(*args) if state: if deep: state = deepcopy(state) y.__dict__.update(state) ... | 1e91c1444a9c8b8b58310cffbe4252698527a31e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e91c1444a9c8b8b58310cffbe4252698527a31e/copy.py |
if os.name !='riscos': TESTFN = '@test' | if os.name == 'java': TESTFN = '$test' elif os.name != 'riscos': TESTFN = '@test' | def fcmp(x, y): # fuzzy comparison function if type(x) == type(0.0) or type(y) == type(0.0): try: x, y = coerce(x, y) fuzz = (abs(x) + abs(y)) * FUZZ if abs(x-y) <= fuzz: return 0 except: pass elif type(x) == type(y) and type(x) in (type(()), type([])): for i in range(min(len(x), len(y))): outcome = fcmp(x[i], y[i]) if... | 559f6680c27f346c89e6dd29ba3235f7719ea6a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/559f6680c27f346c89e6dd29ba3235f7719ea6a7/test_support.py |
TESTFN = 'test' | TESTFN = 'test' | def fcmp(x, y): # fuzzy comparison function if type(x) == type(0.0) or type(y) == type(0.0): try: x, y = coerce(x, y) fuzz = (abs(x) + abs(y)) * FUZZ if abs(x-y) <= fuzz: return 0 except: pass elif type(x) == type(y) and type(x) in (type(()), type([])): for i in range(min(len(x), len(y))): outcome = fcmp(x[i], y[i]) if... | 559f6680c27f346c89e6dd29ba3235f7719ea6a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/559f6680c27f346c89e6dd29ba3235f7719ea6a7/test_support.py |
self.tk.call(self._w, 'select', 'item') | return self.tk.call(self._w, 'select', 'item') or None | def select_item(self): """Return the item which has the selection.""" self.tk.call(self._w, 'select', 'item') | 58b63bf4e3e8ef082126c3687edd2cf75226303d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58b63bf4e3e8ef082126c3687edd2cf75226303d/Tkinter.py |
exit = 'Use Cmd-Q to quit.' | eof = 'Cmd-Q' | def setquit(): """Define new built-ins 'quit' and 'exit'. These are simply strings that display a hint on how to exit. """ if os.sep == ':': exit = 'Use Cmd-Q to quit.' elif os.sep == '\\': exit = 'Use Ctrl-Z plus Return to exit.' else: exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit... | 24cb053b158a3cd63f7be05ac27f47e45bb2f1b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24cb053b158a3cd63f7be05ac27f47e45bb2f1b3/site.py |
exit = 'Use Ctrl-Z plus Return to exit.' | eof = 'Ctrl-Z plus Return' | def setquit(): """Define new built-ins 'quit' and 'exit'. These are simply strings that display a hint on how to exit. """ if os.sep == ':': exit = 'Use Cmd-Q to quit.' elif os.sep == '\\': exit = 'Use Ctrl-Z plus Return to exit.' else: exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit... | 24cb053b158a3cd63f7be05ac27f47e45bb2f1b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24cb053b158a3cd63f7be05ac27f47e45bb2f1b3/site.py |
exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit | eof = 'Ctrl-D (i.e. EOF)' class Quitter(object): def __init__(self, name): self.name = name def __repr__(self): return 'Use %s() or %s to exit' % (self.name, eof) def __call__(self, code=None): raise SystemExit(code) __builtin__.quit = Quitter('quit') __builtin__.exit = Quitter('exit') | def setquit(): """Define new built-ins 'quit' and 'exit'. These are simply strings that display a hint on how to exit. """ if os.sep == ':': exit = 'Use Cmd-Q to quit.' elif os.sep == '\\': exit = 'Use Ctrl-Z plus Return to exit.' else: exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit... | 24cb053b158a3cd63f7be05ac27f47e45bb2f1b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24cb053b158a3cd63f7be05ac27f47e45bb2f1b3/site.py |
import string | def __init__(self, dirname): import string self.dirname = dirname | de3518e7cabf752cc2066878465957dcf552957d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de3518e7cabf752cc2066878465957dcf552957d/mailbox.py | |
import string | def _test(): import time import sys import string import os args = sys.argv[1:] if not args: for key in 'MAILDIR', 'MAIL', 'LOGNAME', 'USER': if os.environ.has_key(key): mbox = os.environ[key] break else: print "$MAIL, $LOGNAME nor $USER set -- who are you?" return else: mbox = args[0] if mbox[:1] == '+': mbox = os.en... | de3518e7cabf752cc2066878465957dcf552957d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de3518e7cabf752cc2066878465957dcf552957d/mailbox.py | |
num = string.atoi(args[1]) | num = int(args[1]) | def _test(): import time import sys import string import os args = sys.argv[1:] if not args: for key in 'MAILDIR', 'MAIL', 'LOGNAME', 'USER': if os.environ.has_key(key): mbox = os.environ[key] break else: print "$MAIL, $LOGNAME nor $USER set -- who are you?" return else: mbox = args[0] if mbox[:1] == '+': mbox = os.en... | de3518e7cabf752cc2066878465957dcf552957d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de3518e7cabf752cc2066878465957dcf552957d/mailbox.py |
self.mkpath (os.path.dirname (obj)) | self.mkpath(os.path.dirname(obj)) | def compile (self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
def compile (self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py | ||
ldflags = self.ldflags_shared_debug | ld_args = self.ldflags_shared_debug[:] | def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
ldflags = self.ldflags_shared | ld_args = self.ldflags_shared[:] objects = map(os.path.normpath, objects) | def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
libraries.append ('mypylib') | objects.insert(0, startup_obj) | def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
def_file = os.path.join (build_temp, '%s.def' % modname) f = open (def_file, 'w') f.write ('EXPORTS\n') | temp_dir = os.path.dirname(objects[0]) def_file = os.path.join (temp_dir, '%s.def' % modname) contents = ['EXPORTS'] | def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
f.write (' %s=_%s\n' % (sym, sym)) ld_args = ldflags + [startup_obj] + objects + \ [',%s,,' % output_filename] + \ libraries + [',' + def_file] | contents.append(' %s=_%s' % (sym, sym)) self.execute(write_file, (def_file, contents), "writing %s" % def_file) for l in library_dirs: ld_args.append("/L%s" % os.path.normpath(l)) ld_args.extend(objects) ld_args.extend([',',output_filename]) ld_args.extend([',', ',']) for lib in libraries: libfile = self.fin... | def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
ld_args.extend (extra_postargs) | ld_args.extend(extra_postargs) | def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
"don't know how to set runtime library search path for MSVC++" | ("don't know how to set runtime library search path " "for Borland C++") | def runtime_library_dir_option (self, dir): raise DistutilsPlatformError, \ "don't know how to set runtime library search path for MSVC++" | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
def find_library_file (self, dirs, lib): | def find_library_file (self, dirs, lib, debug=0): | def find_library_file (self, dirs, lib): | c58c5177419a3703cb2c6397471ab1e8756a6755 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c58c5177419a3703cb2c6397471ab1e8756a6755/bcppcompiler.py |
if not code1 and err1 == err2: | try: e1 = err1.__dict__ except AttributeError: e1 = err1 try: e2 = err2.__dict__ except AttributeError: e2 = err2 if not code1 and e1 == e2: | def compile_command(source, filename="<input>", symbol="single"): r"""Compile a command and determine whether it is incomplete. Arguments: source -- the source string; may contain \n characters filename -- optional filename from which source was read; default "<input>" symbol -- optional grammar start symbol; "single... | 8687164426da64ec03762c0e73daac91fba17927 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8687164426da64ec03762c0e73daac91fba17927/code.py |
def findnames(file, prefix=""): | def findnames(file, prefixes=()): | def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names | ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445/undoc_symbols.py |
for line in file.readlines(): | for line in file.xreadlines(): | def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names | ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445/undoc_symbols.py |
if name.startswith(prefix): | if prefixes: sw = name.startswith for prefix in prefixes: if sw(prefix): names[name] = tag else: | def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names | ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445/undoc_symbols.py |
fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, incfiles)) | fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, incfiles)) | def print_undoc_symbols(prefix, docdir, incdir): docs = [] for sect in DOCSECTIONS: for file in glob.glob(os.path.join(docdir, sect, "*.tex")): docs.append(open(file).read()) docs = "\n".join(docs) incfiles = os.path.join(incdir, INCLUDEPATTERN) fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, i... | ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445/undoc_symbols.py |
print_undoc_symbols(PREFIX, docdir, incdir) | print_undoc_symbols(PREFIXES, docdir, incdir) | def print_undoc_symbols(prefix, docdir, incdir): docs = [] for sect in DOCSECTIONS: for file in glob.glob(os.path.join(docdir, sect, "*.tex")): docs.append(open(file).read()) docs = "\n".join(docs) incfiles = os.path.join(incdir, INCLUDEPATTERN) fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, i... | ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea4d2c0241f3f32a7ff0fdc0b1b5c8e4bb58e445/undoc_symbols.py |
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' ) | add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') add_dir_to_list(self.compiler.library_dirs, sysconfig.get_config_var("LIBDIR")) add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) | 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' ) | 39230b3230783d55fd5b21c0f745ab5eec366fa5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/39230b3230783d55fd5b21c0f745ab5eec366fa5/setup.py |
def test_main(): test.test_support.run_unittest(BuiltinTest, TestSorted) | def test_main(verbose=None): test_classes = (BuiltinTest, TestSorted) run_unittest(*test_classes) if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in xrange(len(counts)): run_unittest(*test_classes) gc.collect() counts[i] = sys.gettotalrefcount() print counts | def test_main(): test.test_support.run_unittest(BuiltinTest, TestSorted) | 3b0c7c20a10349fbedeb3779582280363a46f087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3b0c7c20a10349fbedeb3779582280363a46f087/test_builtin.py |
test_main() | test_main(verbose=True) | def test_main(): test.test_support.run_unittest(BuiltinTest, TestSorted) | 3b0c7c20a10349fbedeb3779582280363a46f087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3b0c7c20a10349fbedeb3779582280363a46f087/test_builtin.py |
for option in options: yield (option, d[option]) | return [(option, d[option]) for option in options] | def items(self, section, raw=False, vars=None): """Return a list of tuples with (name, value) for each option in the section. | 8c4da53afedd7b7fa49f7209582b2f61d80f457e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8c4da53afedd7b7fa49f7209582b2f61d80f457e/ConfigParser.py |
for option in options: yield (option, self._interpolate(section, option, d[option], d)) | return [(option, self._interpolate(section, option, d[option], d)) for option in options] | def items(self, section, raw=False, vars=None): """Return a list of tuples with (name, value) for each option in the section. | 8c4da53afedd7b7fa49f7209582b2f61d80f457e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8c4da53afedd7b7fa49f7209582b2f61d80f457e/ConfigParser.py |
def __init__(self, locale_time=LocaleTime()): | def __init__(self, locale_time=None): | def __init__(self, locale_time=LocaleTime()): """Init inst with non-locale regexes and store LocaleTime object.""" #XXX: Does 'Y' need to worry about having less or more than 4 digits? base = super(TimeRE, self) base.__init__({ # The " \d" option is to make %c from ANSI C work 'd': r"(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| ... | 2c24d42d329ad48cc7c92bfed935c28e8fcdd188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2c24d42d329ad48cc7c92bfed935c28e8fcdd188/_strptime.py |
self.locale_time = locale_time | if locale_time: self.locale_time = locale_time else: self.locale_time = LocaleTime() | def __init__(self, locale_time=LocaleTime()): """Init inst with non-locale regexes and store LocaleTime object.""" #XXX: Does 'Y' need to worry about having less or more than 4 digits? base = super(TimeRE, self) base.__init__({ # The " \d" option is to make %c from ANSI C work 'd': r"(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| ... | 2c24d42d329ad48cc7c92bfed935c28e8fcdd188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2c24d42d329ad48cc7c92bfed935c28e8fcdd188/_strptime.py |
print "Failing syntax tree:" pprint.pprint(t) raise | raise TestFailed, s | def roundtrip(f, s): st1 = f(s) t = st1.totuple() try: st2 = parser.sequence2ast(t) except parser.ParserError: print "Failing syntax tree:" pprint.pprint(t) raise | e3fb18c1c47bda766c8e234368f4884cec1189ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3fb18c1c47bda766c8e234368f4884cec1189ce/test_parser.py |
roundtrip(suite, open(filename).read()) | roundtrip(parser.suite, open(filename).read()) | def roundtrip_fromfile(filename): roundtrip(suite, open(filename).read()) | e3fb18c1c47bda766c8e234368f4884cec1189ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3fb18c1c47bda766c8e234368f4884cec1189ce/test_parser.py |
roundtrip(expr, s) | roundtrip(parser.expr, s) | def test_expr(s): print "expr:", s roundtrip(expr, s) | e3fb18c1c47bda766c8e234368f4884cec1189ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3fb18c1c47bda766c8e234368f4884cec1189ce/test_parser.py |
roundtrip(suite, s) | roundtrip(parser.suite, s) | def test_suite(s): print "suite:", s roundtrip(suite, s) | e3fb18c1c47bda766c8e234368f4884cec1189ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3fb18c1c47bda766c8e234368f4884cec1189ce/test_parser.py |
sequence2ast(tree) | parser.sequence2ast(tree) | def check_bad_tree(tree, label): print print label try: sequence2ast(tree) except parser.ParserError: print "caught expected exception for invalid tree" pass else: print "test failed: did not properly detect invalid tree:" pprint.pprint(tree) | e3fb18c1c47bda766c8e234368f4884cec1189ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3fb18c1c47bda766c8e234368f4884cec1189ce/test_parser.py |
pass | def check_bad_tree(tree, label): print print label try: sequence2ast(tree) except parser.ParserError: print "caught expected exception for invalid tree" pass else: print "test failed: did not properly detect invalid tree:" pprint.pprint(tree) | e3fb18c1c47bda766c8e234368f4884cec1189ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e3fb18c1c47bda766c8e234368f4884cec1189ce/test_parser.py | |
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings (???) containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found. (XXX is... | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py | ||
list of strings (???) containing version numbers; the list will be | list of strings containing version numbers; the list will be | def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings (???) containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found. (XXX is... | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
found. (XXX is this correct???)""" | found.""" | def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings (???) containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found. (XXX is... | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
"""Get a devstudio path (include, lib or path).""" | """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a devstudio path (include, lib or path).""" try: import win32api import win32con except ImportError: return None L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Compo... | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
return None | return [] | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a devstudio path (include, lib or path).""" try: import win32api import win32con except ImportError: return None L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Compo... | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
def _find_exe(exe): for v in get_devstudio_versions(): for p in get_msvc_paths('path',v): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn try: for p in string.split(os.environ['Path'],';'): fn=os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn except: pass return exe d... | def find_exe (exe, version_number): """Try to find an MSVC executable program 'exe' (from version 'version_number' of MSVC) in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is kno... | def _find_exe(exe): for v in get_devstudio_versions(): for p in get_msvc_paths('path',v): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn #didn't find it; try existing path try: for p in string.split(os.environ['Path'],';'): fn=os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): retu... | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
os.environ[n] = string.join(p,';') | os.environ[name]=string.join(p,';') | def _do_SET(n): p = _find_SET(n) if p: os.environ[n] = string.join(p,';') | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
self.cc = _find_exe("cl.exe") self.link = _find_exe("link.exe") _do_SET('lib') _do_SET('include') path=_find_SET('path') try: for p in string.split(os.environ['path'],';'): path.append(p) except KeyError: pass os.environ['path'] = string.join(path,';') | vNum = get_devstudio_versions () if vNum: vNum = vNum[0] self.cc = _find_exe("cl.exe", vNum) self.link = _find_exe("link.exe", vNum) _do_SET('lib', vNum) _do_SET('include', vNum) path=_find_SET('path', vNum) try: for p in string.split(os.environ['path'],';'): path.append(p) except KeyError: pass os.environ['path'] ... | def __init__ (self, verbose=0, dry_run=0, force=0): | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
self.compile_options = [ '/nologo', '/Ox', '/MD' ] | self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3' ] | def __init__ (self, verbose=0, dry_run=0, force=0): | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
'/nologo', '/Od', '/MDd', '/Z7', '/D_DEBUG' | '/nologo', '/Od', '/MDd', '/W3', '/Z7', '/D_DEBUG' | def __init__ (self, verbose=0, dry_run=0, force=0): | 699880931e52bf7d77326f3308151b37cee42dfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/699880931e52bf7d77326f3308151b37cee42dfe/msvccompiler.py |
spawn(("gpg", "--detach-sign", "-a", filename), | gpg_args = ["gpg", "--detach-sign", "-a", filename] if self.identity: gpg_args[2:2] = ["--local-user", self.identity] spawn(gpg_args, | def upload_file(self, command, pyversion, filename): # Sign if requested if self.sign: spawn(("gpg", "--detach-sign", "-a", filename), dry_run=self.dry_run) | 2e550b3dd2a9c8a90e0811ce9f0f05690ecf05cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e550b3dd2a9c8a90e0811ce9f0f05690ecf05cb/upload.py |
while args and args[0][:1] == '-' and args[0] != '-': | while args and args[0].startswith('-') and args[0] != '-': | def getopt(args, shortopts, longopts = []): """getopt(args, options[, long_options]) -> opts, args Parses command line options and parameter list. args is the argument list to be parsed, without the leading reference to the running program. Typically, this means "sys.argv[1:]". shortopts is the string of option let... | dd699b62c59d8fdbdf97a219a2a1125b691e5a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dd699b62c59d8fdbdf97a219a2a1125b691e5a98/getopt.py |
opt, optarg = opt[:i], opt[i+1:] | def do_longs(opts, opt, longopts, args): try: i = opt.index('=') opt, optarg = opt[:i], opt[i+1:] except ValueError: optarg = None has_arg, opt = long_has_args(opt, longopts) if has_arg: if optarg is None: if not args: raise GetoptError('option --%s requires argument' % opt, opt) optarg, args = args[0], args[1:] elif ... | dd699b62c59d8fdbdf97a219a2a1125b691e5a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dd699b62c59d8fdbdf97a219a2a1125b691e5a98/getopt.py | |
optlen = len(opt) | def long_has_args(opt, longopts): optlen = len(opt) for i in range(len(longopts)): x, y = longopts[i][:optlen], longopts[i][optlen:] if opt != x: continue if y != '' and y != '=' and i+1 < len(longopts): if opt == longopts[i+1][:optlen]: raise GetoptError('option --%s not a unique prefix' % opt, opt) if longopts[i][-1:... | dd699b62c59d8fdbdf97a219a2a1125b691e5a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dd699b62c59d8fdbdf97a219a2a1125b691e5a98/getopt.py | |
x, y = longopts[i][:optlen], longopts[i][optlen:] if opt != x: continue if y != '' and y != '=' and i+1 < len(longopts): if opt == longopts[i+1][:optlen]: raise GetoptError('option --%s not a unique prefix' % opt, opt) if longopts[i][-1:] in ('=', ): return 1, longopts[i][:-1] return 0, longopts[i] raise GetoptError('o... | if longopts[i].startswith(opt): break else: raise GetoptError('option --%s not recognized' % opt, opt) j = i+1 while j < len(longopts) and longopts[j].startswith(opt): j += 1 possibilities = longopts[i:j] if opt in possibilities: return 0, opt elif opt + '=' in possibilities: return 1, opt if len(possibilities) > 1... | def long_has_args(opt, longopts): optlen = len(opt) for i in range(len(longopts)): x, y = longopts[i][:optlen], longopts[i][optlen:] if opt != x: continue if y != '' and y != '=' and i+1 < len(longopts): if opt == longopts[i+1][:optlen]: raise GetoptError('option --%s not a unique prefix' % opt, opt) if longopts[i][-1:... | dd699b62c59d8fdbdf97a219a2a1125b691e5a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dd699b62c59d8fdbdf97a219a2a1125b691e5a98/getopt.py |
cur = self._make_iter_cursor() | try: cur = self._make_iter_cursor() except AttributeError: return | def iteritems(self): try: cur = self._make_iter_cursor() | 26caeba35a34afb1ff5ce5104d8598b395b87716 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26caeba35a34afb1ff5ce5104d8598b395b87716/__init__.py |
return paramre.split(value)[0].lower().strip() | ctype = paramre.split(value)[0].lower().strip() if ctype.count('/') <> 1: return 'text/plain' return ctype | def get_content_type(self): """Returns the message's content type. | f36d804b3b5a73814287535bbc840c3df33d9e2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f36d804b3b5a73814287535bbc840c3df33d9e2d/Message.py |
if ctype.count('/') <> 1: raise ValueError, 'No maintype found in: %s' % ctype | def get_content_maintype(self): """Returns the message's main content type. | f36d804b3b5a73814287535bbc840c3df33d9e2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f36d804b3b5a73814287535bbc840c3df33d9e2d/Message.py | |
if ctype.count('/') <> 1: raise ValueError, 'No subtype found in: %s' % ctype | def get_content_subtype(self): """Returns the message's sub content type. | f36d804b3b5a73814287535bbc840c3df33d9e2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f36d804b3b5a73814287535bbc840c3df33d9e2d/Message.py | |
result = self.__class__([]) | result = self.__class__() | def copy(self): """Return a shallow copy of a set.""" result = self.__class__([]) result._data.update(self._data) return result | fa1480f6863729102ccf276e0fa8b9ea585b37c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1480f6863729102ccf276e0fa8b9ea585b37c5/sets.py |
result = self.__class__([]) | result = self.__class__() | def __deepcopy__(self, memo): """Return a deep copy of a set; used by copy module.""" # This pre-creates the result and inserts it in the memo # early, in case the deep copy recurses into another reference # to this same set. A set can't be an element of itself, but # it can certainly contain an object that has a refe... | fa1480f6863729102ccf276e0fa8b9ea585b37c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1480f6863729102ccf276e0fa8b9ea585b37c5/sets.py |
result = self.__class__([]) | result = self.__class__() | def __and__(self, other): """Return the intersection of two sets as a new set. | fa1480f6863729102ccf276e0fa8b9ea585b37c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1480f6863729102ccf276e0fa8b9ea585b37c5/sets.py |
result = self.__class__([]) | result = self.__class__() | def __xor__(self, other): """Return the symmetric difference of two sets as a new set. | fa1480f6863729102ccf276e0fa8b9ea585b37c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1480f6863729102ccf276e0fa8b9ea585b37c5/sets.py |
result = self.__class__([]) | result = self.__class__() | def __sub__(self, other): """Return the difference of two sets as a new Set. | fa1480f6863729102ccf276e0fa8b9ea585b37c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1480f6863729102ccf276e0fa8b9ea585b37c5/sets.py |
class _TemporarilyImmutableSet(object): | class _TemporarilyImmutableSet(BaseSet): | def _as_temporarily_immutable(self): # Return self wrapped in a temporarily immutable set return _TemporarilyImmutableSet(self) | fa1480f6863729102ccf276e0fa8b9ea585b37c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1480f6863729102ccf276e0fa8b9ea585b37c5/sets.py |
def __eq__(self, other): return self._set == other def __ne__(self, other): return self._set != other def _test(): red = Set() assert `red` == "Set([])", "Empty set: %s" % `red` green = Set((0,)) assert `green` == "Set([0])", "Unit set: %s" % `green` blue = Set([0, 1, 2]) assert blue._repr(True) == "Set([0,... | def __hash__(self): if self._hashcode is None: self._hashcode = self._set._compute_hash() return self._hashcode | fa1480f6863729102ccf276e0fa8b9ea585b37c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa1480f6863729102ccf276e0fa8b9ea585b37c5/sets.py | |
except: | except NameError: | def _init_categories(categories=categories): for k,v in globals().items(): if k[:3] == 'LC_': categories[k] = v | 0897f0c4f8034fa656cf2be3cda93bfb067d0a65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0897f0c4f8034fa656cf2be3cda93bfb067d0a65/locale.py |
def read(self, n = 0): if n <= 0: | def read(self, n = -1): if n < 0: | def read(self, n = 0): if n <= 0: newpos = len(self.buf) else: newpos = min(self.pos+n, len(self.buf)) r = self.buf[self.pos:newpos] self.pos = newpos return r | f7476c5088e6f459f866901219e1b5b084fb0750 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f7476c5088e6f459f866901219e1b5b084fb0750/StringIO.py |
del ce | del riscos | def _get_exports_list(module): try: return list(module.__all__) except AttributeError: return [n for n in dir(module) if n[0] != '_'] | 81e4b1c5c8307285c89952c3ee9c9f5c3d4896f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81e4b1c5c8307285c89952c3ee9c9f5c3d4896f3/os.py |
run_unittest(StatAttributeTests) | def test_main(): run_unittest(TemporaryFileTests) | 98bf58f1c61a1d6d8a21f75527c8ad7a7d47ef67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/98bf58f1c61a1d6d8a21f75527c8ad7a7d47ef67/test_os.py | |
def test_filter_subclasses(self): # test, that filter() never returns tuple, str or unicode subclasses # and that the result always go's through __getitem__ # FIXME: For tuple currently it doesn't go through __getitem__ funcs = (None, lambda x: True) class tuple2(tuple): def __getitem__(self, index): return 2*tuple.__g... | 8dd19321bbb3b4f94d15ca3a405053265b99e91e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8dd19321bbb3b4f94d15ca3a405053265b99e91e/test_builtin.py | ||
tuple2: {(): (), (1, 2, 3): (1, 2, 3)}, | tuple2: {(): (), (1, 2, 3): (2, 4, 6)}, | def __getitem__(self, index): return 2*str.__getitem__(self, index) | 8dd19321bbb3b4f94d15ca3a405053265b99e91e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8dd19321bbb3b4f94d15ca3a405053265b99e91e/test_builtin.py |
pos = [-42] def negposreturn(exc): pos[0] += 1 return (u"?", pos[0]) codecs.register_error("test.negposreturn", negposreturn) "\xff".decode("ascii", "test.negposreturn") def hugeposreturn(exc): return (u"?", 424242) codecs.register_error("test.hugeposreturn", hugeposreturn) "\xff".decode("ascii", "test.hugeposreturn")... | handler = PosReturn() codecs.register_error("test.posreturn", handler.handle) handler.pos = -1 self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?>0") handler.pos = -2 self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?><?>") handler.pos = -3 self.assertRaises(IndexError, "\xff0".decod... | def baddecodereturn2(exc): return (u"?", None) | 2e0b18af3092a24c9689f72af898083ebfd9aec7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e0b18af3092a24c9689f72af898083ebfd9aec7/test_codeccallbacks.py |
pos = [-42] def negposreturn(exc): pos[0] += 1 return (u"?", pos[0]) codecs.register_error("test.negposreturn", negposreturn) u"\xff".encode("ascii", "test.negposreturn") def hugeposreturn(exc): return (u"?", 424242) codecs.register_error("test.hugeposreturn", hugeposreturn) u"\xff".encode("ascii", "test.hugeposreturn... | handler = PosReturn() codecs.register_error("test.posreturn", handler.handle) handler.pos = -1 self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?>0") handler.pos = -2 self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?><?>") handler.pos = -3 self.assertRaises(IndexError, u"\xff0".enco... | def badencodereturn2(exc): return (u"?", None) | 2e0b18af3092a24c9689f72af898083ebfd9aec7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e0b18af3092a24c9689f72af898083ebfd9aec7/test_codeccallbacks.py |
for err in ("strict", "replace", "xmlcharrefreplace", "backslashreplace", "test.hugeposreturn"): | for err in ("strict", "replace", "xmlcharrefreplace", "backslashreplace", "test.posreturn"): | def __getitem__(self, key): raise ValueError | 2e0b18af3092a24c9689f72af898083ebfd9aec7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2e0b18af3092a24c9689f72af898083ebfd9aec7/test_codeccallbacks.py |
self.pimpinstaller = pimp.PimpInstaller(self.pimpdb) | def setuppimp(self, url): self.pimpprefs = pimp.PimpPreferences() self.pimpdb = pimp.PimpDatabase(self.pimpprefs) self.pimpinstaller = pimp.PimpInstaller(self.pimpdb) if not url: url = self.pimpprefs.pimpDatabase try: self.pimpdb.appendURL(url) except IOError, arg: rv = "Cannot open %s: %s\n" % (url, arg) rv += "\nSee ... | 40b2e839246aa74f08eea1c2abb60e5ca93ecab0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40b2e839246aa74f08eea1c2abb60e5ca93ecab0/PackageManager.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.