rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if doc: doc = '<small><tt>' + doc + '<br>&nbsp;</tt></small>'
if doc: doc = '<small><tt>' + doc + '</tt></small>'
def docclass(self, object, funcs={}, classes={}): """Produce HTML documentation for a class object.""" name = object.__name__ bases = object.__bases__ contents = ''
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def docmethod(self, object, funcs={}, classes={}, methods={}, clname=''): """Produce HTML documentation for a method object.""" return self.document( object.im_func, funcs, classes, methods, clname)
def docclass(self, object, funcs={}, classes={}): """Produce HTML documentation for a class object.""" name = object.__name__ bases = object.__bases__ contents = ''
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def docfunction(self, object, funcs={}, classes={}, methods={}, clname=''): """Produce HTML documentation for a function object.""" args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) if object.__name__ == '<lambda>'...
def docroutine(self, object, funcs={}, classes={}, methods={}, clname=''): """Produce HTML documentation for a function or method object.""" if inspect.ismethod(object): object = object.im_func if inspect.isbuiltin(object): decl = '<a name="%s"><strong>%s</strong>(...)</a>\n' % ( clname + '-' + object.__name__, object....
def docfunction(self, object, funcs={}, classes={}, methods={}, clname=''): """Produce HTML documentation for a function object.""" args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue)
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
anchor = clname + '-' + object.__name__ decl = '<a name="%s"\n><strong>%s</strong>%s</a>\n' % ( anchor, object.__name__, argspec)
args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) if object.__name__ == '<lambda>': decl = '<em>lambda</em> ' + argspec[1:-1] else: anchor = clname + '-' + object.__name__ decl = '<a name="%s"\n><strong>%s</strong>...
def docfunction(self, object, funcs={}, classes={}, methods={}, clname=''): """Produce HTML documentation for a function object.""" args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue)
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def docbuiltin(self, object, *extras): """Produce HTML documentation for a built-in function.""" return '<dl><dt><strong>%s</strong>(...)</dl>' % object.__name__
def docbuiltin(self, object, *extras): """Produce HTML documentation for a built-in function.""" return '<dl><dt><strong>%s</strong>(...)</dl>' % object.__name__
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
return '''<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><title>Python: %s</title> <body bgcolor="
return ''' <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><title>Python: %s</title><body bgcolor="
def page(self, object): """Produce a complete HTML page of documentation for an object.""" return '''<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def docmethod(self, object): """Produce text documentation for a method object.""" return self.document(object.im_func)
def docmethod(self, object): """Produce text documentation for a method object.""" return self.document(object.im_func)
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def docfunction(self, object): """Produce text documentation for a function object.""" try:
def docroutine(self, object): """Produce text documentation for a function or method object.""" if inspect.ismethod(object): object = object.im_func if inspect.isbuiltin(object): decl = self.bold(object.__name__) + '(...)' else:
def docfunction(self, object): """Produce text documentation for a function object.""" try: args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) except TypeError: argspec = '(...)'
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
except TypeError: argspec = '(...)' if object.__name__ == '<lambda>': decl = '<lambda> ' + argspec[1:-1] else: decl = self.bold(object.__name__) + argspec
if object.__name__ == '<lambda>': decl = '<lambda> ' + argspec[1:-1] else: decl = self.bold(object.__name__) + argspec
def docfunction(self, object): """Produce text documentation for a function object.""" try: args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) except TypeError: argspec = '(...)'
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def docbuiltin(self, object): """Produce text documentation for a built-in function object.""" return (self.bold(object.__name__) + '(...)\n' + rstrip(self.indent(object.__doc__)) + '\n')
def docfunction(self, object): """Produce text documentation for a function object.""" try: args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) except TypeError: argspec = '(...)'
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
if hasattr(__builtins__, path): return None, getattr(__builtins__, path)
def locate(path): """Locate an object by name (or dotted path), importing as necessary.""" if not path: # special case: imp.find_module('') strangely succeeds return None, None if type(path) is not types.StringType: return None, path if hasattr(__builtins__, path): return None, getattr(__builtins__, path) parts = split...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def locate(path): """Locate an object by name (or dotted path), importing as necessary.""" if not path: # special case: imp.find_module('') strangely succeeds return None, None if type(path) is not types.StringType: return None, path if hasattr(__builtins__, path): return None, getattr(__builtins__, path) parts = split...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
print 'problem in %s - %s' % (value.filename, value.args)
print 'Problem in %s - %s' % (value.filename, value.args)
def doc(thing): """Display documentation on an object (for interactive use).""" if type(thing) is type(""): try: path, x = locate(thing) except DocImportError, value: print 'problem in %s - %s' % (value.filename, value.args) return if x: thing = x else: print 'could not find or import %s' % repr(thing) return desc = d...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
print 'could not find or import %s' % repr(thing)
print 'No Python documentation found for %s.' % repr(thing)
def doc(thing): """Display documentation on an object (for interactive use).""" if type(thing) is type(""): try: path, x = locate(thing) except DocImportError, value: print 'problem in %s - %s' % (value.filename, value.args) return if x: thing = x else: print 'could not find or import %s' % repr(thing) return desc = d...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def writedocs(path, pkgpath=''): if os.path.isdir(path): dir = path for file in os.listdir(dir): path = os.path.join(dir, file) if os.path.isdir(path): writedocs(path, file + '.' + pkgpath) if os.path.isfile(path): writedocs(path, pkgpath) if os.path.isfile(path): modname = modulename(path) if modname: writedoc(pkgpat...
def doc(thing): """Display documentation on an object (for interactive use).""" if type(thing) is type(""): try: path, x = locate(thing) except DocImportError, value: print 'problem in %s - %s' % (value.filename, value.args) return if x: thing = x else: print 'could not find or import %s' % repr(thing) return desc = d...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
print 'could not find or import %s' % repr(key)
print 'No Python documentation found for %s.' % repr(key) class Scanner: """A generic tree iterator.""" def __init__(self, roots, children, recurse): self.roots = roots[:] self.state = [] self.children = children self.recurse = recurse def next(self): if not self.state: if not self.roots: return None root = self.root...
def man(key): """Display documentation on an object in a form similar to man(1).""" path, object = locate(key) if object: title = 'Python Library Documentation: ' + describe(object) if path: title = title + ' in ' + path pager('\n' + title + '\n\n' + text.document(object)) found = 1 else: print 'could not find or impor...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
key = lower(key) for module in sys.builtin_module_names: desc = __import__(module).__doc__ or '' desc = split(desc, '\n')[0] if find(lower(module + ' ' + desc), key) >= 0: print module, '-', desc or '(no description)' modules = [] for dir in pathdirs(): for module, desc in index(dir): desc = desc or '' if module not in...
def callback(path, modname, desc): if modname[-9:] == '.__init__': modname = modname[:-9] + ' (package)' print modname, '-', desc or '(no description)' ModuleScanner().run(key, callback)
def apropos(key): """Print all the one-line module summaries that contain a substring.""" key = lower(key) for module in sys.builtin_module_names: desc = __import__(module).__doc__ or '' desc = split(desc, '\n')[0] if find(lower(module + ' ' + desc), key) >= 0: print module, '-', desc or '(no description)' modules = []...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def serve(address, callback=None): import BaseHTTPServer, mimetools
def serve(port, callback=None): import BaseHTTPServer, mimetools, select
def serve(address, callback=None): import BaseHTTPServer, mimetools # Patch up mimetools.Message so it doesn't break if rfc822 is reloaded. class Message(mimetools.Message): def __init__(self, fp, seekable=1): Message = self.__class__ Message.__bases__[0].__bases__[0].__init__(self, fp, seekable) self.encodingheader =...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write( '''<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><title>Python: %s</title><body bgcolor=" self.wfile.write(contents) self.wfile.write('</body></html>')
try: self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write(''' <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><title>Python: %s</title><body bgcolor=" %s </body></html>''' % (title, contents)) except IOError: pass
def send_document(self, title, contents): self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() self.wfile.write(
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
'problem with %s - %s' % (value.filename, value.args)))
'Problem in %s - %s' % (value.filename, value.args)))
def do_GET(self): path = self.path if path[-5:] == '.html': path = path[:-5] if path[:1] == '/': path = path[1:] if path and path != '.': try: p, x = locate(path) except DocImportError, value: self.send_document(path, html.escape( 'problem with %s - %s' % (value.filename, value.args))) return if x: self.send_document(d...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
'There is no Python module or object named "%s".' % path)
'No Python documentation found for %s.' % repr(path))
def do_GET(self): path = self.path if path[-5:] == '.html': path = path[:-5] if path[:1] == '/': path = path[1:] if path and path != '.': try: p, x = locate(path) except DocImportError, value: self.send_document(path, html.escape( 'problem with %s - %s' % (value.filename, value.args))) return if x: self.send_document(d...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
'<br><big><big><strong>&nbsp;' 'Python: Index of Modules' '</strong></big></big>', '
'<big><big><strong>Python: Index of Modules</strong></big></big>', '
def do_GET(self): path = self.path if path[-5:] == '.html': path = path[:-5] if path[:1] == '/': path = path[1:] if path and path != '.': try: p, x = locate(path) except DocImportError, value: self.send_document(path, html.escape( 'problem with %s - %s' % (value.filename, value.args))) return if x: self.send_document(d...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
self.send_document('Index of Modules', heading + join(indices))
contents = heading + join(indices) + """<p align=right> <small><small><font color=" pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font></small></small>""" self.send_document('Index of Modules', contents)
def do_GET(self): path = self.path if path[-5:] == '.html': path = path[:-5] if path[:1] == '/': path = path[1:] if path and path != '.': try: p, x = locate(path) except DocImportError, value: self.send_document(path, html.escape( 'problem with %s - %s' % (value.filename, value.args))) return if x: self.send_document(d...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def __init__(self, address, callback):
def __init__(self, port, callback): self.address = ('127.0.0.1', port) self.url = 'http://127.0.0.1:%d/' % port
def __init__(self, address, callback): self.callback = callback self.base.__init__(self, address, self.handler)
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
self.base.__init__(self, address, self.handler)
self.base.__init__(self, self.address, self.handler) def serve_until_quit(self): import select self.quit = 0 while not self.quit: rd, wr, ex = select.select([self.socket.fileno()], [], [], 1) if rd: self.handle_request()
def __init__(self, address, callback): self.callback = callback self.base.__init__(self, address, self.handler)
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
if self.callback: self.callback()
if self.callback: self.callback(self)
def server_activate(self): self.base.server_activate(self) if self.callback: self.callback()
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
DocServer(address, callback).serve_forever()
DocServer(port, callback).serve_until_quit() except (KeyboardInterrupt, select.error): pass print 'server stopped' def gui(): """Graphical interface (starts web server and pops up a control window).""" class GUI: def __init__(self, window, port=7464): self.window = window self.server = None self.scanner = None impo...
def server_activate(self): self.base.server_activate(self) if self.callback: self.callback()
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
print 'server stopped'
pass
def server_activate(self): self.base.server_activate(self) if self.callback: self.callback()
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
opts, args = getopt.getopt(sys.argv[1:], 'k:p:w')
if sys.platform in ['mac', 'win', 'win32', 'nt'] and not sys.argv[1:]: gui() return opts, args = getopt.getopt(sys.argv[1:], 'gk:p:w')
def cli(): import getopt class BadUsage: pass try: opts, args = getopt.getopt(sys.argv[1:], 'k:p:w') writing = 0 for opt, val in opts: if opt == '-k': apropos(lower(val)) break if opt == '-p': try: port = int(val) except ValueError: raise BadUsage def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % p...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
apropos(lower(val)) break
apropos(val) return
def cli(): import getopt class BadUsage: pass try: opts, args = getopt.getopt(sys.argv[1:], 'k:p:w') writing = 0 for opt, val in opts: if opt == '-k': apropos(lower(val)) break if opt == '-p': try: port = int(val) except ValueError: raise BadUsage def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % p...
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % port serve(('127.0.0.1', port), ready) break
def ready(server): print 'server ready at %s' % server.url serve(port, ready) return
def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % port
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
if not args: raise BadUsage
def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % port
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
else: if args: for arg in args: try: if os.path.isfile(arg): arg = importfile(arg) if writing: if os.path.isdir(arg): writedocs(arg) else: writedoc(arg) else: man(arg) except DocImportError, value: print 'problem in %s - %s' % ( value.filename, value.args) else: if sys.platform in ['mac', 'win', 'win32', 'nt']: import...
if not args: raise BadUsage for arg in args: try: if find(arg, os.sep) >= 0 and os.path.isfile(arg): arg = importfile(arg) if writing: writedoc(arg) else: man(arg) except DocImportError, value: print 'Problem in %s - %s' % (value.filename, value.args)
def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % port
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
print """%s <name> ... Show documentation on something. <name> may be the name of a Python function, module, or package, or a dotted reference to a class or function within a module or module in a package, or the filename of a Python module to import.
cmd = sys.argv[0] print """pydoc - the Python documentation tool %s <name> ... Show text documentation on something. <name> may be the name of a function, module, or package, or a dotted reference to a class or function within a module or module in a package. If <name> contains a '%s', it is used as the path to a Py...
def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % port
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
Search for a keyword in the synopsis lines of all modules.
Search for a keyword in the synopsis lines of all available modules.
def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % port
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
%s -w <module> ... Write out the HTML documentation for a module to a file. %s -w <moduledir> Write out the HTML documentation for all modules in the tree under a given directory to files in the current directory. """ % ((sys.argv[0],) * 5) if __name__ == '__main__': cli()
%s -g Pop up a graphical interface for serving and finding documentation. %s -w <name> ... Write out the HTML documentation for a module to a file in the current directory. If <name> contains a '%s', it is treated as a filename. """ % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep) if __name__ == '__main__': cli()
def ready(port=port): print 'server ready at http://127.0.0.1:%d/' % port
66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py
def find_module(self, name, path): if name in self.excludes: self.msgout(3, "find_module -> Excluded") raise ImportError, name
773c83be048ae66b7ed5329095d43e3321ac1780 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/773c83be048ae66b7ed5329095d43e3321ac1780/modulefinder.py
import _winreg from _winreg import HKEY_LOCAL_MACHINE try: pathname = _winreg.QueryValueEx(HKEY_LOCAL_MACHINE, \ "Software\\Python\\PythonCore\\%s\\Modules\\%s" % (sys.winver, name)) fp = open(pathname, "rb") stuff = "", "rb", imp.C_EXTENSION return fp, pathname, stuff except _winreg.error: pass
result = _try_registry(name) if result: return result
def find_module(self, name, path): if name in self.excludes: self.msgout(3, "find_module -> Excluded") raise ImportError, name
773c83be048ae66b7ed5329095d43e3321ac1780 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/773c83be048ae66b7ed5329095d43e3321ac1780/modulefinder.py
fullurl = unwrap(fullurl)
fullurl = unwrap(toBytes(fullurl))
def open(self, fullurl, data=None): """Use URLopener().open(file) instead of open(file, 'r').""" fullurl = unwrap(fullurl) if self.tempcache and self.tempcache.has_key(fullurl): filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') return addinfourl(fp, headers, fullurl) type, url = splittype(fullurl) i...
1d99433a58c8c69caa734acb884f274663885a17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d99433a58c8c69caa734acb884f274663885a17/urllib.py
type, url = splittype(fullurl) if not type: type = 'file' if self.proxies.has_key(type): proxy = self.proxies[type] type, proxyhost = splittype(proxy)
urltype, url = splittype(fullurl) if not urltype: urltype = 'file' if self.proxies.has_key(urltype): proxy = self.proxies[urltype] urltype, proxyhost = splittype(proxy)
def open(self, fullurl, data=None): """Use URLopener().open(file) instead of open(file, 'r').""" fullurl = unwrap(fullurl) if self.tempcache and self.tempcache.has_key(fullurl): filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') return addinfourl(fp, headers, fullurl) type, url = splittype(fullurl) i...
1d99433a58c8c69caa734acb884f274663885a17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d99433a58c8c69caa734acb884f274663885a17/urllib.py
name = 'open_' + type self.type = type
name = 'open_' + urltype self.type = urltype
def open(self, fullurl, data=None): """Use URLopener().open(file) instead of open(file, 'r').""" fullurl = unwrap(fullurl) if self.tempcache and self.tempcache.has_key(fullurl): filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') return addinfourl(fp, headers, fullurl) type, url = splittype(fullurl) i...
1d99433a58c8c69caa734acb884f274663885a17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d99433a58c8c69caa734acb884f274663885a17/urllib.py
url = unwrap(url)
url = unwrap(toBytes(url))
def retrieve(self, url, filename=None, reporthook=None, data=None): """retrieve(url) returns (filename, None) for a local object or (tempfilename, headers) for a remote object.""" url = unwrap(url) if self.tempcache and self.tempcache.has_key(url): return self.tempcache[url] type, url1 = splittype(url) if not filename ...
1d99433a58c8c69caa734acb884f274663885a17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d99433a58c8c69caa734acb884f274663885a17/urllib.py
if type(url) is type(""):
if type(url) is types.StringType:
def open_http(self, url, data=None): """Use HTTP protocol.""" import httplib user_passwd = None if type(url) is type(""): host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest user_passw...
1d99433a58c8c69caa734acb884f274663885a17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d99433a58c8c69caa734acb884f274663885a17/urllib.py
if type(url) is type(""):
if type(url) in types.StringTypes:
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None if type(url) is type(""): host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest user_pas...
1d99433a58c8c69caa734acb884f274663885a17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d99433a58c8c69caa734acb884f274663885a17/urllib.py
ref = Res.FSpOpenResFile(dst, 1)
ref = Res.FSpOpenResFile(dst, 2)
def buildone(template, wrapper, src, dst): buildtools.process(template, wrapper, dst, 1) # write source as a PYC resource into dst ref = Res.FSpOpenResFile(dst, 1) try: Res.UseResFile(ref) py_resource.frompyfile(src, "CGI_MAIN", preload=1) finally: Res.CloseResFile(ref)
c72d4cddc989a66da1f56f59bc3fc7c37df28915 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c72d4cddc989a66da1f56f59bc3fc7c37df28915/BuildCGIApplet.py
cmdclass = {'build_ext':PyBuildExt},
cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall},
def main(): setup(name = 'Python standard library', version = '%d.%d' % sys.version_info[:2], cmdclass = {'build_ext':PyBuildExt}, # The struct module is defined here, because build_ext won't be # called unless there's at least one extension module defined. ext_modules=[Extension('struct', ['structmodule.c'])], # Scri...
f52d27e52d289b99837b4555fb3f757f2c89f4ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f52d27e52d289b99837b4555fb3f757f2c89f4ad/setup.py
vereq(x.a, None)
verify(not hasattr(x, "a"))
def slots(): if verbose: print "Testing __slots__..." class C0(object): __slots__ = [] x = C0() verify(not hasattr(x, "__dict__")) verify(not hasattr(x, "foo")) class C1(object): __slots__ = ['a'] x = C1() verify(not hasattr(x, "__dict__")) vereq(x.a, None) x.a = 1 vereq(x.a, 1) del x.a vereq(x.a, None) class C3(obje...
6b70599450777a8b911f0eff44b18cd22f1c1e1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6b70599450777a8b911f0eff44b18cd22f1c1e1e/test_descr.py
vereq(x.a, None)
verify(not hasattr(x, "a"))
def slots(): if verbose: print "Testing __slots__..." class C0(object): __slots__ = [] x = C0() verify(not hasattr(x, "__dict__")) verify(not hasattr(x, "foo")) class C1(object): __slots__ = ['a'] x = C1() verify(not hasattr(x, "__dict__")) vereq(x.a, None) x.a = 1 vereq(x.a, 1) del x.a vereq(x.a, None) class C3(obje...
6b70599450777a8b911f0eff44b18cd22f1c1e1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6b70599450777a8b911f0eff44b18cd22f1c1e1e/test_descr.py
verify(x.a is None) verify(x.b is None) verify(x.c is None)
verify(not hasattr(x, 'a')) verify(not hasattr(x, 'b')) verify(not hasattr(x, 'c'))
def slots(): if verbose: print "Testing __slots__..." class C0(object): __slots__ = [] x = C0() verify(not hasattr(x, "__dict__")) verify(not hasattr(x, "foo")) class C1(object): __slots__ = ['a'] x = C1() verify(not hasattr(x, "__dict__")) vereq(x.a, None) x.a = 1 vereq(x.a, 1) del x.a vereq(x.a, None) class C3(obje...
6b70599450777a8b911f0eff44b18cd22f1c1e1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6b70599450777a8b911f0eff44b18cd22f1c1e1e/test_descr.py
self.saved_dbc_key = c.current(0,0,0)[0]
try: self.saved_dbc_key = c.current(0,0,0)[0] except db.DBError: pass
def _closeCursors(self, save=1): if self.dbc: c = self.dbc self.dbc = None if save: self.saved_dbc_key = c.current(0,0,0)[0] c.close() del c for cref in self._cursor_refs.values(): c = cref() if c is not None: c.close()
a223d2cb29a27ea25632cfe695401a4ced96ca06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a223d2cb29a27ea25632cfe695401a4ced96ca06/__init__.py
if not __debug__: expected = [ev for ev in expected if ev[0] != LINE]
def check_events(self, expected): events = self.get_events_wotime() if not __debug__: # Running under -O, so we don't get LINE events expected = [ev for ev in expected if ev[0] != LINE] if events != expected: self.fail( "events did not match expectation; got:\n%s\nexpected:\n%s" % (pprint.pformat(events), pprint.pforma...
80703c89308a2adbdece4c8c044e7ba4d3069f91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80703c89308a2adbdece4c8c044e7ba4d3069f91/test_hotshot.py
"'ascii' codec can't encode character '\\xfc' in position 1: ouch"
"'ascii' codec can't encode character u'\\xfc' in position 1: ouch"
def test_unicodeencodeerror(self): self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 4, "ouch"], "'ascii' codec can't encode characters...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"'ascii' codec can't encode character '\\xfc' in position 0: ouch"
"'ascii' codec can't encode character u'\\xfc' in position 0: ouch"
def test_unicodeencodeerror(self): self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 4, "ouch"], "'ascii' codec can't encode characters...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"'ascii' codec can't encode character '\\u0100' in position 0: ouch"
"'ascii' codec can't encode character u'\\u0100' in position 0: ouch"
def test_unicodeencodeerror(self): self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 4, "ouch"], "'ascii' codec can't encode characters...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"'ascii' codec can't encode character '\\uffff' in position 0: ouch"
"'ascii' codec can't encode character u'\\uffff' in position 0: ouch"
def test_unicodeencodeerror(self): self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 4, "ouch"], "'ascii' codec can't encode characters...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"'ascii' codec can't encode character '\\U00010000' in position 0: ouch"
"'ascii' codec can't encode character u'\\U00010000' in position 0: ouch"
def test_unicodeencodeerror(self): self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 4, "ouch"], "'ascii' codec can't encode characters...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"can't translate character '\\xfc' in position 1: ouch"
"can't translate character u'\\xfc' in position 1: ouch"
def test_unicodetranslateerror(self): self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], "can't translate character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\u0100rk", 1, 2, "ouch"], "can't translate character '\\u0100' in position 1: ouch...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"can't translate character '\\u0100' in position 1: ouch"
"can't translate character u'\\u0100' in position 1: ouch"
def test_unicodetranslateerror(self): self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], "can't translate character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\u0100rk", 1, 2, "ouch"], "can't translate character '\\u0100' in position 1: ouch...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"can't translate character '\\uffff' in position 1: ouch"
"can't translate character u'\\uffff' in position 1: ouch"
def test_unicodetranslateerror(self): self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], "can't translate character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\u0100rk", 1, 2, "ouch"], "can't translate character '\\u0100' in position 1: ouch...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
"can't translate character '\\U00010000' in position 1: ouch"
"can't translate character u'\\U00010000' in position 1: ouch"
def test_unicodetranslateerror(self): self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], "can't translate character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\u0100rk", 1, 2, "ouch"], "can't translate character '\\u0100' in position 1: ouch...
a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py
try: import win32api import win32con except ImportError:
if not _can_read_reg:
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.""" try: import...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
for base in (win32con.HKEY_CLASSES_ROOT, win32con.HKEY_LOCAL_MACHINE, win32con.HKEY_CURRENT_USER, win32con.HKEY_USERS):
for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS):
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.""" try: import...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
k = win32api.RegOpenKeyEx(base,K)
k = _RegOpenKeyEx(base,K)
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.""" try: import...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
p = win32api.RegEnumKey(k,i)
p = _RegEnumKey(k,i)
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.""" try: import...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
except win32api.error:
except _RegError:
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.""" try: import...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
except win32api.error:
except _RegError:
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.""" try: import...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
try: import win32api import win32con except ImportError:
if not _can_read_reg:
def get_msvc_paths (path, version='6.0', platform='x86'): """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.""" try: import win32api import win32con except ImportError: return [] L = [] i...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
for base in (win32con.HKEY_CLASSES_ROOT, win32con.HKEY_LOCAL_MACHINE, win32con.HKEY_CURRENT_USER, win32con.HKEY_USERS):
for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS):
def get_msvc_paths (path, version='6.0', platform='x86'): """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.""" try: import win32api import win32con except ImportError: return [] L = [] i...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
k = win32api.RegOpenKeyEx(base,K)
k = _RegOpenKeyEx(base,K)
def get_msvc_paths (path, version='6.0', platform='x86'): """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.""" try: import win32api import win32con except ImportError: return [] L = [] i...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
(p,v,t) = win32api.RegEnumValue(k,i)
(p,v,t) = _RegEnumValue(k,i)
def get_msvc_paths (path, version='6.0', platform='x86'): """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.""" try: import win32api import win32con except ImportError: return [] L = [] i...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
except win32api.error:
except _RegError:
def get_msvc_paths (path, version='6.0', platform='x86'): """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.""" try: import win32api import win32con except ImportError: return [] L = [] i...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
except win32api.error:
except _RegError:
def get_msvc_paths (path, version='6.0', platform='x86'): """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.""" try: import win32api import win32con except ImportError: return [] L = [] i...
7642f5cf3899d296b111d2a21d531cbd795215fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7642f5cf3899d296b111d2a21d531cbd795215fb/msvccompiler.py
def makefile(self, mode):
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket. This method offers only partial support for the makefile interface of a real socket. It only supports modes 'r' and 'rb' and the bufsize argument is ignored. The returned object contains *all* of the file data """
def makefile(self, mode): # hopefully, never have to write if mode != 'r' and mode != 'rb': raise UnimplementedFileMode()
4d746fca3d7f4f5008ec8b0e02c78a2936cddba7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4d746fca3d7f4f5008ec8b0e02c78a2936cddba7/httplib.py
print >> sys.stderr, _(__doc__) % globals()
print >> sys.stderr, __doc__ % globals()
def usage(code, msg=''): print >> sys.stderr, _(__doc__) % globals() if msg: print >> sys.stderr, msg sys.exit(code)
0d1fdea8efc48560d90374d8b785aee26ae82b70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0d1fdea8efc48560d90374d8b785aee26ae82b70/pygettext.py
elif ttype not in [tokenize.COMMENT, token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL]: print >>sys.stderr, _('*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"') % { 'token': tstring, 'file': self.__curfile, 'lineno': self.__lineno} self.__state = self.__waiting
def __openseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == ')': # We've seen the last of the translatable strings. Record the # line number of the first line of the strings and update the list # of messages seen. Reset state for the next batch. If there # were no strings inside _(), then ju...
0d1fdea8efc48560d90374d8b785aee26ae82b70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0d1fdea8efc48560d90374d8b785aee26ae82b70/pygettext.py
vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 dr = (0, 0, vr[2], 0)
x0, y0, x1, y1 = self.wid.GetWindowPort().portRect x0 = x0 + 4 y0 = y0 + 4 x1 = x1 - 20 y1 = y1 - 20 vr = dr = x0, y0, x1, y1
def open(self, path, name, data): self.path = path self.name = name r = windowbounds(400, 400) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 dr = (0, 0, vr[2], 0) Qd.SetPort(w) Qd.TextFont(4) Qd.TextSize(9) self.ted = TE.TENew(dr, vr) self.ted.TEAutoView(1) self....
ee8662febda4ac1ee9d3604e452220554c08ab23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ee8662febda4ac1ee9d3604e452220554c08ab23/ped.py
self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1)
self.set_reuse_addr()
def __init__(self, localaddr, remoteaddr): self._localaddr = localaddr self._remoteaddr = remoteaddr asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) # try to re-use a server port if possible self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt(...
93a6327adff7274cbfb47f3b8c73970f0605e787 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/93a6327adff7274cbfb47f3b8c73970f0605e787/smtpd.py
def read(self, size=-1, chars=-1):
def read(self, size=-1, chars=-1, firstline=False):
def read(self, size=-1, chars=-1):
56066d2e554b6b92375d3e276f2f02663526c087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/56066d2e554b6b92375d3e276f2f02663526c087/codecs.py
newchars, decodedbytes = self.decode(data, self.errors)
try: newchars, decodedbytes = self.decode(data, self.errors) except UnicodeDecodeError, exc: if firstline: newchars, decodedbytes = self.decode(data[:exc.start], self.errors) lines = newchars.splitlines(True) if len(lines)<=1: raise else: raise
def read(self, size=-1, chars=-1):
56066d2e554b6b92375d3e276f2f02663526c087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/56066d2e554b6b92375d3e276f2f02663526c087/codecs.py
data = self.read(readsize)
data = self.read(readsize, firstline=True)
def readline(self, size=None, keepends=True):
56066d2e554b6b92375d3e276f2f02663526c087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/56066d2e554b6b92375d3e276f2f02663526c087/codecs.py
(ccshared,opt) = sysconfig.get_config_vars('CCSHARED','OPT') args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared
(ccshared,opt,base) = sysconfig.get_config_vars('CCSHARED','OPT','BASECFLAGS') args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared + ' ' + base
def build_extensions(self):
decc6a47df823a988845d3753a4cfb7a85b80828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/decc6a47df823a988845d3753a4cfb7a85b80828/setup.py
user_passwd, host = splituser(host)
if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'https': realhost, rest = splithost(rest) user_passwd, r...
567ca8e732a75682adfdca08daaf2afa59582ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/567ca8e732a75682adfdca08daaf2afa59582ad9/urllib.py
if string.lower(urltype) == 'https':
url = rest user_passwd = None if string.lower(urltype) != 'https': realhost = None else:
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'https': realhost, rest = splithost(rest) user_passwd, r...
567ca8e732a75682adfdca08daaf2afa59582ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/567ca8e732a75682adfdca08daaf2afa59582ad9/urllib.py
user_passwd, realhost = splituser(realhost)
if realhost: user_passwd, realhost = splituser(realhost)
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'https': realhost, rest = splithost(rest) user_passwd, r...
567ca8e732a75682adfdca08daaf2afa59582ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/567ca8e732a75682adfdca08daaf2afa59582ad9/urllib.py
return self.http_error(url, fp, errcode, errmsg, headers)
if data is None: return self.http_error(url, fp, errcode, errmsg, headers) else: return self.http_error(url, fp, errcode, errmsg, headers, data)
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'https': realhost, rest = splithost(rest) user_passwd, r...
567ca8e732a75682adfdca08daaf2afa59582ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/567ca8e732a75682adfdca08daaf2afa59582ad9/urllib.py
if match: return match.group(1, 2)
if match: return map(unquote, match.group(1, 2))
def splituser(host): """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" global _userprog if _userprog is None: import re _userprog = re.compile('^([^@]*)@(.*)$') match = _userprog.match(host) if match: return match.group(1, 2) return None, host
567ca8e732a75682adfdca08daaf2afa59582ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/567ca8e732a75682adfdca08daaf2afa59582ad9/urllib.py
r.append(name, value)
r.append((name, value))
def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument. Arguments: qs: URL-encoded query string to be parsed keep_blank_values: flag indicating whether blank values in URL encoded queries should be treated as blank strings. A true value inicates that blanks should be re...
3af7b050a33b4d22260c01ce6b6700e1159edce0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3af7b050a33b4d22260c01ce6b6700e1159edce0/cgi.py
def randrange(n): """Return a random shuffle of range(n)."""
def randfloats(n): """Return a list of n random floats in [0, 1)."""
def randrange(n): """Return a random shuffle of range(n).""" fn = os.path.join(td, "rr%06d" % n) try: fp = open(fn, "rb") except IOError: result = [] for i in range(n): result.append(random.random()) try: try: fp = open(fn, "wb") marshal.dump(result, fp) fp.close() fp = None finally: if fp: try: os.unlink(fn) except os...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
result = [] for i in range(n): result.append(random.random())
r = random.random result = [r() for i in xrange(n)]
def randrange(n): """Return a random shuffle of range(n).""" fn = os.path.join(td, "rr%06d" % n) try: fp = open(fn, "rb") except IOError: result = [] for i in range(n): result.append(random.random()) try: try: fp = open(fn, "wb") marshal.dump(result, fp) fp.close() fp = None finally: if fp: try: os.unlink(fn) except os...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
def randrange(n): """Return a random shuffle of range(n).""" fn = os.path.join(td, "rr%06d" % n) try: fp = open(fn, "rb") except IOError: result = [] for i in range(n): result.append(random.random()) try: try: fp = open(fn, "wb") marshal.dump(result, fp) fp.close() fp = None finally: if fp: try: os.unlink(fn) except os...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
i = random.randrange(0, n)
i = random.randrange(n)
def randrange(n): """Return a random shuffle of range(n).""" fn = os.path.join(td, "rr%06d" % n) try: fp = open(fn, "rb") except IOError: result = [] for i in range(n): result.append(random.random()) try: try: fp = open(fn, "wb") marshal.dump(result, fp) fp.close() fp = None finally: if fp: try: os.unlink(fn) except os...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
result[len(result):] = temp
result.extend(temp)
def randrange(n): """Return a random shuffle of range(n).""" fn = os.path.join(td, "rr%06d" % n) try: fp = open(fn, "rb") except IOError: result = [] for i in range(n): result.append(random.random()) try: try: fp = open(fn, "wb") marshal.dump(result, fp) fp.close() fp = None finally: if fp: try: os.unlink(fn) except os...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
def fl():
def flush():
def fl(): sys.stdout.flush()
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
fl()
flush()
def doit(L): t0 = time.clock() L.sort() t1 = time.clock() print "%6.2f" % (t1-t0), fl()
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
-sort: all equal
=sort: all equal
def tabulate(r): """Tabulate sort speed for lists of various sizes. The sizes are 2**i for i in r (the argument, a list). The output displays i, 2**i, and the time to sort arrays of 2**i floating point numbers with the following properties: *sort: random data \sort: descending data /sort: ascending data ~sort: many ...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
cases = ("*sort", "\\sort", "/sort", "~sort", "-sort", "!sort") fmt = ("%2s %6s" + " %6s"*len(cases))
cases = ("*sort", "\\sort", "/sort", "~sort", "=sort", "!sort") fmt = ("%2s %7s" + " %6s"*len(cases))
def tabulate(r): """Tabulate sort speed for lists of various sizes. The sizes are 2**i for i in r (the argument, a list). The output displays i, 2**i, and the time to sort arrays of 2**i floating point numbers with the following properties: *sort: random data \sort: descending data /sort: ascending data ~sort: many ...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
n = 1<<i L = randrange(n) print "%2d %6d" % (i, n), fl()
n = 1 << i L = randfloats(n) print "%2d %7d" % (i, n), flush()
def tabulate(r): """Tabulate sort speed for lists of various sizes. The sizes are 2**i for i in r (the argument, a list). The output displays i, 2**i, and the time to sort arrays of 2**i floating point numbers with the following properties: *sort: random data \sort: descending data /sort: ascending data ~sort: many ...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
L = L*(n/4)
L = L * (n // 4)
def tabulate(r): """Tabulate sort speed for lists of various sizes. The sizes are 2**i for i in r (the argument, a list). The output displays i, 2**i, and the time to sort arrays of 2**i floating point numbers with the following properties: *sort: random data \sort: descending data /sort: ascending data ~sort: many ...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
L = map(abs, [-0.5]*n) doit(L) L = range(n/2-1, -1, -1) L[len(L):] = range(n/2)
L = map(abs, [-0.5] * n) doit(L) del L half = n // 2 L = range(half - 1, -1, -1) L.extend(range(half)) L = map(float, L)
def tabulate(r): """Tabulate sort speed for lists of various sizes. The sizes are 2**i for i in r (the argument, a list). The output displays i, 2**i, and the time to sort arrays of 2**i floating point numbers with the following properties: *sort: random data \sort: descending data /sort: ascending data ~sort: many ...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py
k2 = 19
k2 = 20
def main(): """Main program when invoked as a script. One argument: tabulate a single row. Two arguments: tabulate a range (inclusive). Extra arguments are used to seed the random generator. """ # default range (inclusive) k1 = 15 k2 = 19 if sys.argv[1:]: # one argument: single point k1 = k2 = int(sys.argv[1]) if sys...
8b6ec79b74284873696b24ab979fb1cb579b86f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b6ec79b74284873696b24ab979fb1cb579b86f8/sortperf.py