rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
exec cmd in dict, dict
exec cmd in globals, locals
def runctx(self, cmd, globals=None, locals=None): if globals is None: globals = {} if locals is None: locals = {} if not self.donothing: sys.settrace(gself.lobaltrace) try: exec cmd in dict, dict finally: if not self.donothing: sys.settrace(None)
11d6242ee8b30c5a8f3639283522c47d378dc063 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11d6242ee8b30c5a8f3639283522c47d378dc063/trace.py
ignore_it = self.ignore.names(filename, modulename) if not ignore_it: if self.trace: print " --- modulename: %s, funcname: %s" % (modulename, funcname,) return self.localtrace
if modulename is not None: ignore_it = self.ignore.names(filename, modulename) if not ignore_it: if self.trace: print " --- modulename: %s, funcname: %s" % (modulename, funcname,) return self.localtrace
def globaltrace_lt(self, frame, why, arg): """ Handles `call' events (why == 'call') and if the code block being entered is to be ignored then it returns `None', else it returns `self.localtrace'. """ if why == 'call': (filename, lineno, funcname, context, lineindex,) = inspect.getframeinfo(frame, 0) # if DEBUG_MODE an...
11d6242ee8b30c5a8f3639283522c47d378dc063 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11d6242ee8b30c5a8f3639283522c47d378dc063/trace.py
try: print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass
if context is not None: try: print "%s(%d): %s" % (bname, lineno, context[lineindex],), except IndexError: pass else: print "%s(???): ???" % bname
def localtrace_trace(self, frame, why, arg): if why == 'line': # XXX shouldn't do the count increment when arg is exception? But be careful to return self.localtrace when arg is exception! ? --Zooko 2001-10-14 # record the file name and line number of every trace # XXX I wish inspect offered me an optimized `getfilen...
11d6242ee8b30c5a8f3639283522c47d378dc063 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11d6242ee8b30c5a8f3639283522c47d378dc063/trace.py
if host[0] == '[' and host[-1] == ']':
if host and host[0] == '[' and host[-1] == ']':
def _set_hostport(self, host, port): if port is None: i = host.rfind(':') j = host.rfind(']') # ipv6 addresses have [...] if i > j: try: port = int(host[i+1:]) except ValueError: raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) host = host[:i] else: port = self.default_port if host[0] == '[' and host[-1] ...
aae0426a7b2ceee10956d9f3ec55f745de53b2a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aae0426a7b2ceee10956d9f3ec55f745de53b2a5/httplib.py
"<function <lambda> at 0x"))
"<function <lambda"))
def test_lambda(self): self.failUnless(repr(lambda x: x).startswith( "<function <lambda> at 0x")) # XXX anonymous functions? see func_repr
ccea6d5680d2e68084812daaabc266cd5e2f962b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ccea6d5680d2e68084812daaabc266cd5e2f962b/test_repr.py
except string.atoi_error: pass
except string.atoi_error: raise socket.error, "nonnumeric port"
def connect(self, host, port = 0): if not port: i = string.find(host, ':') if i >= 0: host, port = host[:i], host[i+1:] try: port = string.atoi(port) except string.atoi_error: pass if not port: port = HTTP_PORT self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if self.debuglevel > 0: print 'connect:', (host...
8a4083d5a984d9616f618e04209bdf0263617501 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8a4083d5a984d9616f618e04209bdf0263617501/httplib.py
gotone, evt = Evt.WaitNextEvent(-1, 0)
gotone, evt = Evt.WaitNextEvent(0xffff, 0)
def main(): print 'hello world' # XXXX # skip the toolbox initializations, already done # XXXX Should use gestalt here to check for quicktime version Qt.EnterMovies() # Get the movie file fss, ok = macfs.StandardGetFile(QuickTime.MovieFileType) if not ok: sys.exit(0) # Open the window bounds = (175, 75, 175+160, 75+1...
3b991855f1e9e8b5e82c539a98081eae999b09ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b991855f1e9e8b5e82c539a98081eae999b09ac/VerySimplePlayer.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...
ba3276af0ff6287f40f3018eeef37d3ac742b621 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ba3276af0ff6287f40f3018eeef37d3ac742b621/core.py
except AttrinuteError:
except AttributeError:
def do_mouseDown(self, event): (what, message, when, where, modifiers) = event partcode, window = FindWindow(where) if partname.has_key(partcode): name = "do_" + partname[partcode] else: name = "do_%d" % partcode try: handler = getattr(self, name) except AttrinuteError: handler = self.do_unknownpartcode handler(partcod...
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "Should close window:", window
if DEBUG: print "Should close window:", window
def do_close(self, window): print "Should close window:", window
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "SystemClick", event, window
MacOS.HandleEvent(event)
def do_inSysWindow(self, partcode, window, event): print "SystemClick", event, window # SystemClick(event, window) # XXX useless, window is None
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "inDesk"
def do_inDesk(self, partcode, window, event): print "inDesk" # XXX what to do with it?
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "FindControl(%s, %s) -> (%s, %s)" % \
if DEBUG: print "FindControl(%s, %s) -> (%s, %s)" % \
def do_inContent(self, partcode, window, event): (what, message, when, where, modifiers) = event local = GlobalToLocal(where) ctltype, control = FindControl(local, window) if ctltype and control: pcode = control.TrackControl(local) if pcode: self.do_controlhit(window, control, pcode, event) else: print "FindControl(%s,...
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "control hit in", window, "on", control, "; pcode =", pcode
if DEBUG: print "control hit in", window, "on", control, "; pcode =", pcode
def do_controlhit(self, window, control, pcode, event): print "control hit in", window, "on", control, "; pcode =", pcode
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "Mouse down at global:", where print "\tUnknown part code:", partcode
if DEBUG: print "Mouse down at global:", where if DEBUG: print "\tUnknown part code:", partcode MacOS.HandleEvent(event)
def do_unknownpartcode(self, partcode, window, event): (what, message, when, where, modifiers) = event print "Mouse down at global:", where print "\tUnknown part code:", partcode
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print 'Command-W without front window'
if DEBUG: print 'Command-W without front window'
def do_key(self, event): (what, message, when, where, modifiers) = event c = chr(message & charCodeMask) if modifiers & cmdKey: if c == '.': raise self else: result = MenuKey(ord(c)) id = (result>>16) & 0xffff # Hi word item = result & 0xffff # Lo word if id: self.do_rawmenu(id, item, None, event) elif c == 'w': w = F...
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "Command-" +`c`
if DEBUG: print "Command-" +`c`
def do_key(self, event): (what, message, when, where, modifiers) = event c = chr(message & charCodeMask) if modifiers & cmdKey: if c == '.': raise self else: result = MenuKey(ord(c)) id = (result>>16) & 0xffff # Hi word item = result & 0xffff # Lo word if id: self.do_rawmenu(id, item, None, event) elif c == 'w': w = F...
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "Character", `c`
if DEBUG: print "Character", `c`
def do_char(self, c, event): print "Character", `c`
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "do_update", self.printevent(event)
if DEBUG: print "do_update", self.printevent(event)
def do_updateEvt(self, event): print "do_update", self.printevent(event) window = FrontWindow() # XXX This is wrong! if window: self.do_rawupdate(window, event) else: print "no window for do_updateEvt"
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "no window for do_updateEvt"
MacOS.HandleEvent(event)
def do_updateEvt(self, event): print "do_update", self.printevent(event) window = FrontWindow() # XXX This is wrong! if window: self.do_rawupdate(window, event) else: print "no window for do_updateEvt"
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "raw update for", window
if DEBUG: print "raw update for", window
def do_rawupdate(self, window, event): print "raw update for", window window.BeginUpdate() self.do_update(window, event) DrawControls(window) window.DrawGrowIcon() window.EndUpdate()
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "High Level Event:", self.printevent(event)
if DEBUG: print "High Level Event:", self.printevent(event)
def do_kHighLevelEvent(self, event): (what, message, when, where, modifiers) = event print "High Level Event:", self.printevent(event) try: AEProcessAppleEvent(event) except: print "AEProcessAppleEvent error:" traceback.print_exc()
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
print "MenuBar.dispatch(%d, %d, %s, %s)" % \
if DEBUG: print "MenuBar.dispatch(%d, %d, %s, %s)" % \
def dispatch(self, id, item, window, event): if self.menus.has_key(id): self.menus[id].dispatch(id, item, window, event) else: print "MenuBar.dispatch(%d, %d, %s, %s)" % \ (id, item, window, event)
62092368395e2928a1a1027a33b6cb9078768e6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62092368395e2928a1a1027a33b6cb9078768e6f/FrameWork.py
src_extensions = _c_extensions + _cpp_extensions
src_extensions = (_c_extensions + _cpp_extensions + _rc_extensions + _mc_extensions) res_extension = '.res'
def set_path_env_var (name, version_number): """Set environment variable 'name' to an MSVC path type value obtained from 'get_msvc_paths()'. This is equivalent to a SET command prior to execution of spawned commands.""" p = get_msvc_paths (name, version_number) if p: os.environ[name] = string.join (p,';')
7b54f60d68d058f89b956aa7ae74853c9df5a562 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7b54f60d68d058f89b956aa7ae74853c9df5a562/msvccompiler.py
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):
7b54f60d68d058f89b956aa7ae74853c9df5a562 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7b54f60d68d058f89b956aa7ae74853c9df5a562/msvccompiler.py
status.append ('%s:%d' % self.addr) return '<%s %s at %x>' % ( self.__class__.__name__, ' '.join (status), id(self) )
if self.addr == types.TupleType: status.append ('%s:%d' % self.addr) else: status.append (self.addr) return '<%s %s at %x>' % (self.__class__.__name__, ' '.join (status), id (self))
def __repr__ (self): try: status = [] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr: status.append ('%s:%d' % self.addr) return '<%s %s at %x>' % ( self.__class__.__name__, ' '.join (status), id(self) ) except: try: ar = repr(self.addr) except...
7bf9bb492eb88686c5c082563c02ca39dabb7b70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7bf9bb492eb88686c5c082563c02ca39dabb7b70/asyncore.py
try: ar = repr(self.addr) except: ar = 'no self.addr!' return '<__repr__ (self) failed for object at %x (addr=%s)>' % (id(self),ar)
pass try: ar = repr (self.addr) except AttributeError: ar = 'no self.addr!' return '<__repr__() failed for %s instance at %x (addr=%s)>' % \ (self.__class__.__name__, id (self), ar)
def __repr__ (self): try: status = [] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr: status.append ('%s:%d' % self.addr) return '<%s %s at %x>' % ( self.__class__.__name__, ' '.join (status), id(self) ) except: try: ar = repr(self.addr) except...
7bf9bb492eb88686c5c082563c02ca39dabb7b70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7bf9bb492eb88686c5c082563c02ca39dabb7b70/asyncore.py
return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "config.h")
return os.path.join(sys.exec_prefix, "include", "python" + sys.version[:3], "config.h")
def get_config_h_filename(): """Return full pathname of installed config.h file.""" return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "config.h")
71a7cdf68137463753b6d428444fe3448eae3ac8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/71a7cdf68137463753b6d428444fe3448eae3ac8/sysconfig.py
applemenu.AppendMenu("All about cgitest...;(-")
applemenu.AppendMenu("About %s...;(-" % self.__class__.__name__)
def __init__(self): self.quitting = 0 # Initialize menu self.appleid = 1 self.quitid = 2 Menu.ClearMenuBar() self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024") applemenu.AppendMenu("All about cgitest...;(-") applemenu.AppendResMenu('DRVR') applemenu.InsertMenu(0) self.quitmenu = Menu.NewMenu(self.quitid, "...
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
def __del__(self): self.close()
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
def close(self): pass
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
def mainloop(self, mask = everyEvent, timeout = 60*60): while not self.quitting: self.dooneevent(mask, timeout)
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
if c == '.' and modifiers & cmdKey: raise KeyboardInterrupt, "Command-period"
if modifiers & cmdKey: if c == '.': raise KeyboardInterrupt, "Command-period" if c == 'q': self.quitting = 1
def lowlevelhandler(self, event): what, message, when, where, modifiers = event h, v = where if what == kHighLevelEvent: msg = "High Level Event: %s %s" % \ (`code(message)`, `code(h | (v<<16))`) try: AE.AEProcessAppleEvent(event) except AE.Error, err: print 'AE error: ', err print 'in', msg traceback.print_exc() retur...
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
EasyDialogs.Message("cgitest - First cgi test") return
EasyDialogs.Message(self.getabouttext())
def lowlevelhandler(self, event): what, message, when, where, modifiers = event h, v = where if what == kHighLevelEvent: msg = "High Level Event: %s %s" % \ (`code(message)`, `code(h | (v<<16))`) try: AE.AEProcessAppleEvent(event) except AE.Error, err: print 'AE error: ', err print 'in', msg traceback.print_exc() retur...
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
name = self.applemenu.GetItem(item) Qd.OpenDeskAcc(name) return if id == self.quitid and item == 1: print "Menu-requested QUIT"
name = self.applemenu.GetMenuItemText(item) Menu.OpenDeskAcc(name) elif id == self.quitid and item == 1:
def lowlevelhandler(self, event): what, message, when, where, modifiers = event h, v = where if what == kHighLevelEvent: msg = "High Level Event: %s %s" % \ (`code(message)`, `code(h | (v<<16))`) try: AE.AEProcessAppleEvent(event) except AE.Error, err: print 'AE error: ', err print 'in', msg traceback.print_exc() retur...
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
MacOS.HandleEvent(event)
Menu.HiliteMenu(0) else: MacOS.HandleEvent(event) def getabouttext(self): return self.__class__.__name__
def lowlevelhandler(self, event): what, message, when, where, modifiers = event h, v = where if what == kHighLevelEvent: msg = "High Level Event: %s %s" % \ (`code(message)`, `code(h | (v<<16))`) try: AE.AEProcessAppleEvent(event) except AE.Error, err: print 'AE error: ', err print 'in', msg traceback.print_exc() retur...
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
def __init__(self): self.ae_handlers = {}
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
def close(self): for classe, type in self.ae_handlers.keys(): AE.AERemoveEventHandler(classe, type)
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
def callback_wrapper(self, _request, _reply): _parameters, _attributes = aetools.unpackevent(_request) _class = _attributes['evcl'].type _type = _attributes['evid'].type if self.ae_handlers.has_key((_class, _type)): _function = self.ae_handlers[(_class, _type)] elif self.ae_handlers.has_key((_class, '****')): _functio...
d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8f31b0a362267fc4fc69e59d3a6da78cf83e4c1/MiniAEFrame.py
self._version = _read_long(chunk)
self._version = _read_ulong(chunk)
def initfp(self, file): self._version = 0 self._decomp = None self._convert = None self._markers = [] self._soundpos = 0 self._file = Chunk(file) if self._file.getname() != 'FORM': raise Error, 'file does not start with FORM id' formdata = self._file.read(4) if formdata == 'AIFF': self._aifc = 0 elif formdata == 'AIFC'...
d4438429ddda6b3d80909d14527fb5384b8d4612 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d4438429ddda6b3d80909d14527fb5384b8d4612/aifc.py
self.message(" possible to distinguish between from \"package import submodule\" ", 1)
self.message(" possible to distinguish between \"from package " "import submodule\" ", 1)
def reportMissing(self): missing = [name for name in self.missingModules if name not in MAYMISS_MODULES] if self.maybeMissingModules: maybe = self.maybeMissingModules else: maybe = [name for name in missing if "." in name] missing = [name for name in missing if "." not in name] missing.sort() maybe.sort() if maybe: sel...
607ff65f0acba6486322dd45f69ab4fc0106be3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/607ff65f0acba6486322dd45f69ab4fc0106be3b/bundlebuilder.py
@bigmemtest(minsize=_2G // 2 + 2, memuse=8)
@bigmemtest(minsize=_2G // 2 + 2, memuse=24)
def basic_test_inplace_concat(self, size): l = [sys.stdout] * size l += l self.assertEquals(len(l), size * 2) self.failUnless(l[0] is l[-1]) self.failUnless(l[size - 1] is l[size + 1])
b0ebd21134a0b3d4db8ae1587aad1bfaa2c28948 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0ebd21134a0b3d4db8ae1587aad1bfaa2c28948/test_bigmem.py
@bigmemtest(minsize=_2G + 2, memuse=8)
@bigmemtest(minsize=_2G + 2, memuse=24)
def test_inplace_concat_small(self, size): return self.basic_test_inplace_concat(size)
b0ebd21134a0b3d4db8ae1587aad1bfaa2c28948 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b0ebd21134a0b3d4db8ae1587aad1bfaa2c28948/test_bigmem.py
self.__frame = Frame(parent) self.__frame.pack(expand=YES, fill=BOTH)
self.__frame = Frame(parent, relief=GROOVE, borderwidth=2) self.__frame.pack()
def __init__(self, switchboard, parent=None): self.__sb = switchboard self.__frame = Frame(parent) self.__frame.pack(expand=YES, fill=BOTH) # create the chip that will display the currently selected color # exactly self.__sframe = Frame(self.__frame) self.__sframe.grid(row=0, column=0) self.__selected = ChipWidget(self...
6ccb2b80150ecf148bdcf1ae1bd7a025ae318829 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ccb2b80150ecf148bdcf1ae1bd7a025ae318829/ChipViewer.py
attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd]
attempdirs = ['/tmp', '/var/tmp', '/usr/tmp', pwd]
def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0,...
bd8dc8bb697b84d7669092d2029f93ac6fe6d0d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bd8dc8bb697b84d7669092d2029f93ac6fe6d0d9/tempfile.py
if not iscode(co): raise TypeError, 'arg is not a code object'
if not iscode(co): raise TypeError('arg is not a code object')
def getargs(co): """Get information about the arguments accepted by a code object. Three things are returned: (args, varargs, varkw), where 'args' is a list of argument names (possibly containing nested lists), and 'varargs' and 'varkw' are the names of the * and ** arguments or None.""" if not iscode(co): raise TypeE...
8cd1a0aaff3375b10b5ddbfb15182e95a3bb7202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cd1a0aaff3375b10b5ddbfb15182e95a3bb7202/inspect.py
'defaults' is an n-tuple of the default values of the last n arguments.""" if not isfunction(func): raise TypeError, 'arg is not a Python function'
'defaults' is an n-tuple of the default values of the last n arguments. """ if ismethod(func): func = func.im_func if not isfunction(func): raise TypeError('arg is not a Python function')
def getargspec(func): """Get the names and default values of a function's arguments. A tuple of four things is returned: (args, varargs, varkw, defaults). 'args' is a list of the argument names (it may contain nested lists). 'varargs' and 'varkw' are the names of the * and ** arguments or None. 'defaults' is an n-tupl...
8cd1a0aaff3375b10b5ddbfb15182e95a3bb7202 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cd1a0aaff3375b10b5ddbfb15182e95a3bb7202/inspect.py
'raw_unicode_escape', 'unicode_escape', 'unicode_internal'):
'unicode_escape', 'unicode_internal'):
def __str__(self): return self.x
c78244a559287b4dfb20730fc4774e1113f43c65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c78244a559287b4dfb20730fc4774e1113f43c65/test_unicode.py
self.headers.update(headers)
for key, value in headers.iteritems(): self.add_header(key, value)
def __init__(self, url, data=None, headers={}): # unwrap('<URL:type://host/path>') --> 'type://host/path' self.__original = unwrap(url) self.type = None # self.__r_type is what's left after doing the splittype self.host = None self.port = None self.data = data self.headers = {} self.headers.update(headers)
4a475db0fc3dcf0df82a9a200f2e376b30c16cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4a475db0fc3dcf0df82a9a200f2e376b30c16cf4/urllib2.py
self.headers[key] = val
self.headers[key.capitalize()] = val
def add_header(self, key, val): # useful for something like authentication self.headers[key] = val
4a475db0fc3dcf0df82a9a200f2e376b30c16cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4a475db0fc3dcf0df82a9a200f2e376b30c16cf4/urllib2.py
for type, url in proxies.items():
for type, url in proxies.iteritems():
def __init__(self, proxies=None): if proxies is None: proxies = getproxies() assert hasattr(proxies, 'has_key'), "proxies must be a mapping" self.proxies = proxies for type, url in proxies.items(): setattr(self, '%s_open' % type, lambda r, proxy=url, type=type, meth=self.proxy_open: \ meth(r, proxy, type))
4a475db0fc3dcf0df82a9a200f2e376b30c16cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4a475db0fc3dcf0df82a9a200f2e376b30c16cf4/urllib2.py
for uris, authinfo in domains.items():
for uris, authinfo in domains.iteritems():
def find_user_password(self, realm, authuri): domains = self.passwd.get(realm, {}) authuri = self.reduce_uri(authuri) for uris, authinfo in domains.items(): for uri in uris: if self.is_suburi(uri, authuri): return authinfo return None, None
4a475db0fc3dcf0df82a9a200f2e376b30c16cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4a475db0fc3dcf0df82a9a200f2e376b30c16cf4/urllib2.py
for k, v in req.headers.items():
for k, v in req.headers.iteritems():
def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given')
4a475db0fc3dcf0df82a9a200f2e376b30c16cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4a475db0fc3dcf0df82a9a200f2e376b30c16cf4/urllib2.py
for k, v in self.timeout.items():
for k, v in self.timeout.iteritems():
def check_cache(self): # first check for old ones t = time.time() if self.soonest <= t: for k, v in self.timeout.items(): if v < t: self.cache[k].close() del self.cache[k] del self.timeout[k] self.soonest = min(self.timeout.values())
4a475db0fc3dcf0df82a9a200f2e376b30c16cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4a475db0fc3dcf0df82a9a200f2e376b30c16cf4/urllib2.py
for k, v in self.timeout.items():
for k, v in self.timeout.iteritems():
def check_cache(self): # first check for old ones t = time.time() if self.soonest <= t: for k, v in self.timeout.items(): if v < t: self.cache[k].close() del self.cache[k] del self.timeout[k] self.soonest = min(self.timeout.values())
4a475db0fc3dcf0df82a9a200f2e376b30c16cf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4a475db0fc3dcf0df82a9a200f2e376b30c16cf4/urllib2.py
Note: this functions only works if Mark Hammond's win32
Note: this function only works if Mark Hammond's win32
def win32_ver(release='',version='',csd='',ptype=''): """ Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level and OS type (multi/single processor). As a hint: ptype returns 'Uniprocessor Free' on single processor NT machines and 'M...
a570cc507a95958be263b730f0da62d65304354e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a570cc507a95958be263b730f0da62d65304354e/platform.py
self.__frame.grid(row=3, column=1, sticky='NS')
self.__frame.grid(row=3, column=1, sticky='NSEW')
def __init__(self, switchboard, master=None): # non-gui ivars self.__sb = switchboard optiondb = switchboard.optiondb() self.__hexp = BooleanVar() self.__hexp.set(optiondb.get('HEXTYPE', 0)) self.__uwtyping = BooleanVar() self.__uwtyping.set(optiondb.get('UPWHILETYPE', 0)) # create the gui self.__frame = Frame(master, ...
dd232b423b415889d9da51121b678c6fad9e017e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dd232b423b415889d9da51121b678c6fad9e017e/TypeinViewer.py
s = madstring("\x00" * 5) verify(str(s) == "\x00" * 5)
base = "\x00" * 5 s = madstring(base) verify(str(s) == base)
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__("".join(L)) return self._rev
a1092b1e868896f842cf63190156081acb43942b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1092b1e868896f842cf63190156081acb43942b/test_descr.py
self.socket.connect(address)
self.socket.connect(address)
def _connect_unixsocket(self, address): self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) # syslog may require either DGRAM or STREAM sockets try: self.socket.connect(address) except socket.error: self.socket.close() self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.socket.connect(addres...
a9f3cc5aca4fb5e14c3759b0e12ce8781ab418a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a9f3cc5aca4fb5e14c3759b0e12ce8781ab418a4/handlers.py
contents = contents[:i-1] + contents[i:]
if event.char: contents = contents[:i-1] + contents[i:] icursor = icursor-1
def __normalize(self, event=None): ew = event.widget contents = ew.get() icursor = ew.index(INSERT) if contents == '': contents = '0' # figure out what the contents value is in the current base try: if self.__hexp.get(): v = string.atoi(contents, 16) else: v = string.atoi(contents) except ValueError: v = None # if valu...
c2461ddd11df00e95f5c846c3f63041a878453fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2461ddd11df00e95f5c846c3f63041a878453fd/TypeinViewer.py
icursor = icursor-1
def __normalize(self, event=None): ew = event.widget contents = ew.get() icursor = ew.index(INSERT) if contents == '': contents = '0' # figure out what the contents value is in the current base try: if self.__hexp.get(): v = string.atoi(contents, 16) else: v = string.atoi(contents) except ValueError: v = None # if valu...
c2461ddd11df00e95f5c846c3f63041a878453fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2461ddd11df00e95f5c846c3f63041a878453fd/TypeinViewer.py
self.__x.delete(0, END) self.__y.delete(0, END) self.__z.delete(0, END) self.__x.insert(0, redstr) self.__y.insert(0, greenstr) self.__z.insert(0, bluestr)
x, y, z = self.__x, self.__y, self.__z xicursor = x.index(INSERT) yicursor = y.index(INSERT) zicursor = z.index(INSERT) x.delete(0, END) y.delete(0, END) z.delete(0, END) x.insert(0, redstr) y.insert(0, greenstr) z.insert(0, bluestr) x.icursor(xicursor) y.icursor(yicursor) z.icursor(zicursor)
def update_yourself(self, red, green, blue): if self.__hexp.get(): redstr, greenstr, bluestr = map(hex, (red, green, blue)) else: redstr, greenstr, bluestr = red, green, blue self.__x.delete(0, END) self.__y.delete(0, END) self.__z.delete(0, END) self.__x.insert(0, redstr) self.__y.insert(0, greenstr) self.__z.insert(0...
c2461ddd11df00e95f5c846c3f63041a878453fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c2461ddd11df00e95f5c846c3f63041a878453fd/TypeinViewer.py
except TypeError: pass else: raise TestFailed, 'expected TypeError'
except (AttributeError, TypeError): pass else: raise TestFailed, 'expected TypeError or AttributeError'
def b(): 'my docstring' pass
c7c1012045bf79ac48a43527b32ee5543013d951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7c1012045bf79ac48a43527b32ee5543013d951/test_funcattrs.py
except TypeError: pass
except (AttributeError, TypeError): pass
def b(): 'my docstring' pass
c7c1012045bf79ac48a43527b32ee5543013d951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7c1012045bf79ac48a43527b32ee5543013d951/test_funcattrs.py
except TypeError:
except (AttributeError, TypeError):
def cantset(obj, name, value): verify(hasattr(obj, name)) # Otherwise it's probably a typo try: setattr(obj, name, value) except TypeError: pass else: raise TestFailed, "shouldn't be able to set %s to %r" % (name, value) try: delattr(obj, name) except TypeError: pass else: raise TestFailed, "shouldn't be able to del %s...
c7c1012045bf79ac48a43527b32ee5543013d951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7c1012045bf79ac48a43527b32ee5543013d951/test_funcattrs.py
except TypeError:
except (AttributeError, TypeError):
def cantset(obj, name, value): verify(hasattr(obj, name)) # Otherwise it's probably a typo try: setattr(obj, name, value) except TypeError: pass else: raise TestFailed, "shouldn't be able to set %s to %r" % (name, value) try: delattr(obj, name) except TypeError: pass else: raise TestFailed, "shouldn't be able to del %s...
c7c1012045bf79ac48a43527b32ee5543013d951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7c1012045bf79ac48a43527b32ee5543013d951/test_funcattrs.py
dummy = (0, 0, 0, 0, "NULL")
dummy = (0, 0, 0, 0)
def maketable(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0, "NULL") table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) DECOMPOSITION = [""] for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY...
3b2819871af6994be5f5d3966414f615a8697edd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b2819871af6994be5f5d3966414f615a8697edd/makeunicodedata.py
DECOMPOSITION = [""]
def maketable(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0, "NULL") table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) DECOMPOSITION = [""] for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY...
3b2819871af6994be5f5d3966414f615a8697edd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b2819871af6994be5f5d3966414f615a8697edd/makeunicodedata.py
if record[5]: decomposition = '"%s"' % record[5] else: decomposition = "NULL"
def maketable(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0, "NULL") table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) DECOMPOSITION = [""] for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY...
3b2819871af6994be5f5d3966414f615a8697edd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b2819871af6994be5f5d3966414f615a8697edd/makeunicodedata.py
category, combining, bidirectional, mirrored, decomposition
category, combining, bidirectional, mirrored
def maketable(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0, "NULL") table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) DECOMPOSITION = [""] for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY...
3b2819871af6994be5f5d3966414f615a8697edd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b2819871af6994be5f5d3966414f615a8697edd/makeunicodedata.py
decomp_data = [""] decomp_index = [0] * len(unicode.chars) for char in unicode.chars: record = unicode.table[char] if record: if record[5]: try: i = decomp_data.index(record[5]) except ValueError: i = len(decomp_data) decomp_data.append(record[5]) else: i = 0 decomp_index[char] = i
def maketable(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0, "NULL") table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) DECOMPOSITION = [""] for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY...
3b2819871af6994be5f5d3966414f615a8697edd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b2819871af6994be5f5d3966414f615a8697edd/makeunicodedata.py
print " {%d, %d, %d, %d, %s}," % item
print " {%d, %d, %d, %d}," % item
def maketable(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0, "NULL") table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) DECOMPOSITION = [""] for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY...
3b2819871af6994be5f5d3966414f615a8697edd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3b2819871af6994be5f5d3966414f615a8697edd/makeunicodedata.py
include_dirs = ['Modules/expat']
include_dirs = [expatinc]
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
30396e728c0ba40e35d00586080c421de9240334 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30396e728c0ba40e35d00586080c421de9240334/setup.py
(sys.platform.startswith('linux') and
((sys.platform.startswith('linux') or sys.platform.startswith('gnu')) and
def finalize_options (self): from distutils import sysconfig
b59eb29c322815f01fbc337647195e4b7a7618d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b59eb29c322815f01fbc337647195e4b7a7618d9/build_ext.py
self.assertRaises(TypeError, setattr, X.x, "offset", 92) self.assertRaises(TypeError, setattr, X.x, "size", 92)
self.assertRaises(AttributeError, setattr, X.x, "offset", 92) self.assertRaises(AttributeError, setattr, X.x, "size", 92)
def test_fields(self): # test the offset and size attributes of Structure/Unoin fields. class X(Structure): _fields_ = [("x", c_int), ("y", c_char)]
e38858a96415476550a167886c76e33047010eba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e38858a96415476550a167886c76e33047010eba/test_structures.py
self.assertRaises(TypeError, setattr, X.x, "offset", 92) self.assertRaises(TypeError, setattr, X.x, "size", 92)
self.assertRaises(AttributeError, setattr, X.x, "offset", 92) self.assertRaises(AttributeError, setattr, X.x, "size", 92)
def test_fields(self): # test the offset and size attributes of Structure/Unoin fields. class X(Structure): _fields_ = [("x", c_int), ("y", c_char)]
e38858a96415476550a167886c76e33047010eba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e38858a96415476550a167886c76e33047010eba/test_structures.py
from Carbon import AE AE.AEInteractWithUser(50000000)
def quitevent(self, theAppleEvent, theReply): from Carbon import AE AE.AEInteractWithUser(50000000) self._quit()
e8d0140d6dd4abb341c697f62c0a7bcf31fd0107 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e8d0140d6dd4abb341c697f62c0a7bcf31fd0107/PythonIDEMain.py
test_exc('%d', '1', TypeError, "int argument required") test_exc('%g', '1', TypeError, "float argument required")
test_exc('%d', '1', TypeError, "int argument required, not str") test_exc('%g', '1', TypeError, "float argument required, not str")
def test_exc(formatstr, args, exception, excmsg): try: testformat(formatstr, args) except exception, exc: if str(exc) == excmsg: if verbose: print "yes" else: if verbose: print 'no' print 'Unexpected ', exception, ':', repr(str(exc)) except: if verbose: print 'no' print 'Unexpected exception' raise else: raise TestFail...
fd9279e67cdb073d46485c2cb7ac1218af6c0400 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fd9279e67cdb073d46485c2cb7ac1218af6c0400/test_format.py
dirs_in_sys_path = {}
_dirs_in_sys_path = {}
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c/site.py
if not dirs_in_sys_path.has_key(dircase):
if not _dirs_in_sys_path.has_key(dircase):
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c/site.py
dirs_in_sys_path[dircase] = 1
_dirs_in_sys_path[dircase] = 1
def makepath(*paths): dir = os.path.abspath(os.path.join(*paths)) return dir, os.path.normcase(dir)
b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c/site.py
if not dirs_in_sys_path.has_key(sitedircase):
if not _dirs_in_sys_path.has_key(sitedircase):
def addsitedir(sitedir): sitedir, sitedircase = makepath(sitedir) if not dirs_in_sys_path.has_key(sitedircase): sys.path.append(sitedir) # Add path component try: names = os.listdir(sitedir) except os.error: return names.sort() for name in names: if name[-4:] == endsep + "pth": addpackage(sitedir, name)
b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c/site.py
if not dirs_in_sys_path.has_key(dircase) and os.path.exists(dir):
if not _dirs_in_sys_path.has_key(dircase) and os.path.exists(dir):
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dir...
b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c/site.py
dirs_in_sys_path[dircase] = 1
_dirs_in_sys_path[dircase] = 1 if reset: _dirs_in_sys_path = None
def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dir...
b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b68c1c0ec8bab05ec1aa55c4302f521a8e0b0e3c/site.py
if importer is None:
if importer in (None, True, False):
def get_importer(path_item): """Retrieve a PEP 302 importer for the given path item The returned importer is cached in sys.path_importer_cache if it was newly created by a path hook. If there is no importer, a wrapper around the basic import machinery is returned. This wrapper is never inserted into the importer cach...
0191d12f303fb7dde1c350444cac9fb0dd9129ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0191d12f303fb7dde1c350444cac9fb0dd9129ca/pkgutil.py
pass
importer = None
def get_importer(path_item): """Retrieve a PEP 302 importer for the given path item The returned importer is cached in sys.path_importer_cache if it was newly created by a path hook. If there is no importer, a wrapper around the basic import machinery is returned. This wrapper is never inserted into the importer cach...
0191d12f303fb7dde1c350444cac9fb0dd9129ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0191d12f303fb7dde1c350444cac9fb0dd9129ca/pkgutil.py
def cmp(f1, f2):
def cmp(f1, f2, shallow=1):
def cmp(f1, f2): # Compare two files, use the cache if possible. # Return 1 for identical files, 0 for different. # Raise exceptions if either file could not be statted, read, etc. s1, s2 = sig(os.stat(f1)), sig(os.stat(f2)) if s1[0] <> 8 or s2[0] <> 8: # Either is a not a plain file -- always report as different retur...
3575f65d89bd231d9b8b42cc96c742e1d197f045 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3575f65d89bd231d9b8b42cc96c742e1d197f045/cmp.py
if s1 == s2:
if shallow and s1 == s2:
def cmp(f1, f2): # Compare two files, use the cache if possible. # Return 1 for identical files, 0 for different. # Raise exceptions if either file could not be statted, read, etc. s1, s2 = sig(os.stat(f1)), sig(os.stat(f2)) if s1[0] <> 8 or s2[0] <> 8: # Either is a not a plain file -- always report as different retur...
3575f65d89bd231d9b8b42cc96c742e1d197f045 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3575f65d89bd231d9b8b42cc96c742e1d197f045/cmp.py
"""Implements a file object on top of a regular socket object."""
"""Faux file object attached to a socket object.""" default_bufsize = 8192
_s = "def %s(self, *args): return self._sock.%s(*args)\n\n"
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
self._mode = mode if bufsize <= 0: if bufsize == 0: bufsize = 1 else: bufsize = 8192 self._rbufsize = bufsize
self._mode = mode if bufsize < 0: bufsize = self.default_bufsize if bufsize == 0: self._rbufsize = 1 elif bufsize == 1: self._rbufsize = self.default_bufsize else: self._rbufsize = bufsize
def __init__(self, sock, mode='rb', bufsize=-1): self._sock = sock self._mode = mode if bufsize <= 0: if bufsize == 0: bufsize = 1 # Unbuffered mode else: bufsize = 8192 self._rbufsize = bufsize self._wbufsize = bufsize self._rbuf = [ ] self._wbuf = [ ]
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
self._rbuf = [ ] self._wbuf = [ ]
self._rbuf = [] self._wbuf = []
def __init__(self, sock, mode='rb', bufsize=-1): self._sock = sock self._mode = mode if bufsize <= 0: if bufsize == 0: bufsize = 1 # Unbuffered mode else: bufsize = 8192 self._rbufsize = bufsize self._wbufsize = bufsize self._rbuf = [ ] self._wbuf = [ ]
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
buffer = ''.join(self._wbuf)
buffer = "".join(self._wbuf) self._wbuf = []
def flush(self): if self._wbuf: buffer = ''.join(self._wbuf) self._sock.sendall(buffer) self._wbuf = [ ]
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
self._wbuf = [ ]
def flush(self): if self._wbuf: buffer = ''.join(self._wbuf) self._sock.sendall(buffer) self._wbuf = [ ]
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
self._wbuf.append (data) if self._wbufsize == 1: if '\n' in data: self.flush () elif self.__get_wbuf_len() >= self._wbufsize:
data = str(data) if not data: return self._wbuf.append(data) if (self._wbufsize == 0 or self._wbufsize == 1 and '\n' in data or self._get_wbuf_len() >= self._wbufsize):
def write(self, data): self._wbuf.append (data) # A _wbufsize of 1 means we're doing unbuffered IO. # Flush accordingly. if self._wbufsize == 1: if '\n' in data: self.flush () elif self.__get_wbuf_len() >= self._wbufsize: self.flush()
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
filter(self._sock.sendall, list) self.flush() def __get_wbuf_len (self):
self._wbuf.extend(filter(None, map(str, list))) if (self._wbufsize <= 1 or self._get_wbuf_len() >= self._wbufsize): self.flush() def _get_wbuf_len(self):
def writelines(self, list): filter(self._sock.sendall, list) self.flush()
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
for i in [len(x) for x in self._wbuf]: buf_len += i
for x in self._wbuf: buf_len += len(x)
def __get_wbuf_len (self): buf_len = 0 for i in [len(x) for x in self._wbuf]: buf_len += i return buf_len
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
def __get_rbuf_len(self):
def _get_rbuf_len(self):
def __get_rbuf_len(self): buf_len = 0 for i in [len(x) for x in self._rbuf]: buf_len += i return buf_len
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
for i in [len(x) for x in self._rbuf]: buf_len += i
for x in self._rbuf: buf_len += len(x)
def __get_rbuf_len(self): buf_len = 0 for i in [len(x) for x in self._rbuf]: buf_len += i return buf_len
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
buf_len = self.__get_rbuf_len() while size < 0 or buf_len < size: recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.append(data) data = ''.join(self._rbuf) self._rbuf = [ ] if buf_len > size and size >= 0:
if size < 0: if self._rbufsize <= 1: recv_size = self.default_bufsize else: recv_size = self._rbufsize while 1: data = self._sock.recv(recv_size) if not data: break self._rbuf.append(data) else: buf_len = self._get_rbuf_len() while buf_len < size: recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(...
def read(self, size=-1): buf_len = self.__get_rbuf_len() while size < 0 or buf_len < size: recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.append(data) # Clear the rbuf at the end so we're not affected by # an exception during a recv d...
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py
index = -1 buf_len = self.__get_rbuf_len() if self._rbuf: index = min([x.find('\n') for x in self._rbuf]) while index < 0 and (size < 0 or buf_len < size): recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.append(data) index = data.find(...
data_len = 0 for index, x in enumerate(self._rbuf): data_len += len(x) if '\n' in x or 0 <= size <= data_len: index += 1 data = "".join(self._rbuf[:index]) end = data.find('\n') if end < 0: end = len(data) else: end += 1 if 0 <= size < end: end = size data, rest = data[:end], data[end:] if rest: self._rbuf[:index] = [r...
def readline(self, size=-1): index = -1 buf_len = self.__get_rbuf_len() if self._rbuf: index = min([x.find('\n') for x in self._rbuf]) while index < 0 and (size < 0 or buf_len < size): recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.ap...
dee4f185d018d143d63db650d2b9ee53fe09c8e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dee4f185d018d143d63db650d2b9ee53fe09c8e9/socket.py