rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def __init__(self,parent,pageNames,**kw):
def __init__(self,parent,pageNames=[],**kw):
def __init__(self,parent,pageNames,**kw): """ pageNames - a list of strings, each string will be the dictionary key to a page's data, and the name displayed on the page's tab. Should be specified in desired page order. The first page will be the default and first active page. """ Frame.__init__(self, parent, kw) self.g...
fd0c7693beb8def1f7e8ebe5f457ae8557da7e12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fd0c7693beb8def1f7e8ebe5f457ae8557da7e12/tabpage.py
def testmod(m, name=None, globs=None, verbose=None, isprivate=None,
def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None,
def testmod(m, name=None, globs=None, verbose=None, isprivate=None, report=1): """m, name=None, globs=None, verbose=None, isprivate=None, report=1 Test examples in docstrings in functions and classes reachable from module m, starting with m.__doc__. Private names are skipped. Also test examples reachable from dict m...
652cefa4283abe0571eb669d4ac31f5c12efdd9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/652cefa4283abe0571eb669d4ac31f5c12efdd9e/doctest.py
"""m, name=None, globs=None, verbose=None, isprivate=None, report=1 Test examples in docstrings in functions and classes reachable from module m, starting with m.__doc__. Private names are skipped.
"""m=None, name=None, globs=None, verbose=None, isprivate=None, report=1 Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), starting with m.__doc__. Private names are skipped.
def testmod(m, name=None, globs=None, verbose=None, isprivate=None, report=1): """m, name=None, globs=None, verbose=None, isprivate=None, report=1 Test examples in docstrings in functions and classes reachable from module m, starting with m.__doc__. Private names are skipped. Also test examples reachable from dict m...
652cefa4283abe0571eb669d4ac31f5c12efdd9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/652cefa4283abe0571eb669d4ac31f5c12efdd9e/doctest.py
ignores.append(regex.compile(a))
ignores.append(re.compile(a))
def main(): global filedict opts, args = getopt.getopt(sys.argv[1:], 'i:') for o, a in opts: if o == '-i': ignores.append(regex.compile(a)) if not args: args = ['-'] for filename in args: if filename == '-': sys.stdout.write('# Generated by h2py from stdin\n') process(sys.stdin, sys.stdout) else: fp = open(filename, 'r...
a1716593948986027263f70e0a7bd401d6d1e5d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1716593948986027263f70e0a7bd401d6d1e5d7/h2py.py
i = string.rfind(outfile, '.')
i = outfile.rfind('.')
def main(): global filedict opts, args = getopt.getopt(sys.argv[1:], 'i:') for o, a in opts: if o == '-i': ignores.append(regex.compile(a)) if not args: args = ['-'] for filename in args: if filename == '-': sys.stdout.write('# Generated by h2py from stdin\n') process(sys.stdin, sys.stdout) else: fp = open(filename, 'r...
a1716593948986027263f70e0a7bd401d6d1e5d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1716593948986027263f70e0a7bd401d6d1e5d7/h2py.py
outfile = string.upper(outfile) outfile = outfile + '.py'
modname = outfile.upper() outfile = modname + '.py'
def main(): global filedict opts, args = getopt.getopt(sys.argv[1:], 'i:') for o, a in opts: if o == '-i': ignores.append(regex.compile(a)) if not args: args = ['-'] for filename in args: if filename == '-': sys.stdout.write('# Generated by h2py from stdin\n') process(sys.stdin, sys.stdout) else: fp = open(filename, 'r...
a1716593948986027263f70e0a7bd401d6d1e5d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1716593948986027263f70e0a7bd401d6d1e5d7/h2py.py
if p_include.match(line) >= 0: regs = p_include.regs
match = p_include.match(line) if match: regs = match.regs
stmt = 'def %s(%s): return %s\n' % (macro, arg, body)
a1716593948986027263f70e0a7bd401d6d1e5d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1716593948986027263f70e0a7bd401d6d1e5d7/h2py.py
if not filedict.has_key(filename):
if importable.has_key(filename): outfp.write('import %s\n' % importable[filename]) elif not filedict.has_key(filename):
stmt = 'def %s(%s): return %s\n' % (macro, arg, body)
a1716593948986027263f70e0a7bd401d6d1e5d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1716593948986027263f70e0a7bd401d6d1e5d7/h2py.py
inclfp = open(dir + '/' + filename, 'r')
inclfp = open(dir + '/' + filename)
stmt = 'def %s(%s): return %s\n' % (macro, arg, body)
a1716593948986027263f70e0a7bd401d6d1e5d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1716593948986027263f70e0a7bd401d6d1e5d7/h2py.py
try: execv(tempfile.mktemp(), ())
try: execv(tempfile.mktemp(), ('blah',))
def _execvpe(file, args, env=None): if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath PATH = envpat...
3f996ffc3a2eaf849c4d87073c04a9deee96ac1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3f996ffc3a2eaf849c4d87073c04a9deee96ac1b/os.py
code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.import_hook(name, m) except Impo...
self.scan_code(co, m)
def load_module(self, fqname, fp, pathname, (suffix, mode, type)): self.msgin(2, "load_module", fqname, fp and "fp", pathname) if type == imp.PKG_DIRECTORY: m = self.load_package(fqname, pathname) self.msgout(2, "load_module ->", m) return m if type == imp.PY_SOURCE: co = compile(fp.read(), pathname, 'exec') elif type ...
407085a2d36d8ce65efa4cc399a4b7e04eb7747e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/407085a2d36d8ce65efa4cc399a4b7e04eb7747e/modulefinder.py
Output("self->ob_type->tp_base->tp_dealloc((PyObject *)self);")
Output("%s.tp_dealloc((PyObject *)self);", self.basetype)
def outputDealloc(self): Output() Output("static void %s_dealloc(%s *self)", self.prefix, self.objecttype) OutLbrace() self.outputCleanupStructMembers() if self.basetype: Output("self->ob_type->tp_base->tp_dealloc((PyObject *)self);") elif hasattr(self, 'output_tp_free'): # This is a new-style object with tp_free slot ...
0e78d1e9186cbe57f5c4e7ebfcf5ac3c60865dc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0e78d1e9186cbe57f5c4e7ebfcf5ac3c60865dc5/bgenObjectDefinition.py
Output("if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;")
if self.basetype: Output("if (%s.tp_new)", self.basetype) OutLbrace() Output("if ( (*%s.tp_init)(_self, _args, _kwds) == NULL) return NULL;", self.basetype) Dedent() Output("} else {") Indent() Output("if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;") OutRbrace() else: Output("if ((_self = type->tp_alloc(ty...
def output_tp_newBody(self): Output("PyObject *_self;"); Output("%s itself;", self.itselftype); Output("char *kw[] = {\"itself\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"O&\", kw, %s_Convert, &itself)) return NULL;", self.prefix); Output("if ((_self = type->tp_alloc(type, 0)) == NULL) re...
0e78d1e9186cbe57f5c4e7ebfcf5ac3c60865dc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0e78d1e9186cbe57f5c4e7ebfcf5ac3c60865dc5/bgenObjectDefinition.py
result = pdb.Pdb.trace_dispatch(self, *args) sys.stdout = save_stdout return result
try: return pdb.Pdb.trace_dispatch(self, *args) finally: sys.stdout = save_stdout
def trace_dispatch(self, *args): # Redirect stdout to the given stream. save_stdout = sys.stdout sys.stdout = self.__out # Call Pdb's trace dispatch method. result = pdb.Pdb.trace_dispatch(self, *args) # Restore stdout. sys.stdout = save_stdout return result
61857246256f3487c4af37c171d011ebc63d5ca4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/61857246256f3487c4af37c171d011ebc63d5ca4/doctest.py
print "source", nodelist[-1]
def factor(self, nodelist): elt = nodelist[0] t = elt[0] print "source", nodelist[-1] node = self.com_node(nodelist[-1]) # need to handle (unary op)constant here... if t == token.PLUS: node = UnaryAdd(node) node.lineno = elt[2] elif t == token.MINUS: print node node = UnarySub(node) node.lineno = elt[2] elif t == token...
20d48748eb8fe08a35d56bb93a2f3178f7eab3e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20d48748eb8fe08a35d56bb93a2f3178f7eab3e8/transformer.py
print node
def factor(self, nodelist): elt = nodelist[0] t = elt[0] print "source", nodelist[-1] node = self.com_node(nodelist[-1]) # need to handle (unary op)constant here... if t == token.PLUS: node = UnaryAdd(node) node.lineno = elt[2] elif t == token.MINUS: print node node = UnarySub(node) node.lineno = elt[2] elif t == token...
20d48748eb8fe08a35d56bb93a2f3178f7eab3e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20d48748eb8fe08a35d56bb93a2f3178f7eab3e8/transformer.py
(?P<escaped>%(delim)s{2}) | %(delim)s(?P<named>%(id)s) | %(delim)s{(?P<braced>%(id)s)} | (?P<invalid>%(delim)s)
%(delim)s(?: (?P<escaped>%(delim)s) | (?P<named>%(id)s) | {(?P<braced>%(id)s)} | (?P<invalid>) )
def __getitem__(self, key): try: return self._primary[key] except KeyError: return self._secondary[key]
b628b6dac78157753897cacbe4b82ff7ea0984ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b628b6dac78157753897cacbe4b82ff7ea0984ad/string.py
if froms == '*': froms = theMod.__dict__.keys() for item in froms: (envLocals or envGlobals)[item] = theMod.__dict__[item]
while froms: item = froms[0]; del froms[0] if item == '*': froms = theMod.__dict__.keys() + froms else: try: (envLocals or envGlobals)[item] = theMod.__dict__[item] except KeyError: raise ImportError, ("name '%s' not found in module %s" % (item, theMod.__name__))
def import_module(name, envLocals=None, envGlobals=None, froms=None, inPkg=None): """Primary service routine implementing 'import' with package nesting.""" # The job is divided into a few distinct steps: # # - Look for either an already loaded module or a file to be loaded. # * if neither loaded module nor prospect ...
6d1743a2c7577642d431e0a9b0198af67770573a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6d1743a2c7577642d431e0a9b0198af67770573a/newimp.py
def read(self, size=-1, chars=-1):
def read(self, size=-1, chars=-1, firstline=False):
def read(self, size=-1, chars=-1):
027542bf97f91868a12206db4f0f75685721665b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/027542bf97f91868a12206db4f0f75685721665b/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):
027542bf97f91868a12206db4f0f75685721665b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/027542bf97f91868a12206db4f0f75685721665b/codecs.py
data = self.read(readsize)
data = self.read(readsize, firstline=True)
def readline(self, size=None, keepends=True):
027542bf97f91868a12206db4f0f75685721665b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/027542bf97f91868a12206db4f0f75685721665b/codecs.py
attrs['script_name'] = sys.argv[0]
attrs['script_name'] = os.path.basename(sys.argv[0])
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...
b789d695f8c2819013e5b7248bfd8910fe99cf16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b789d695f8c2819013e5b7248bfd8910fe99cf16/core.py
x = self.dict[headerseen] + "\n " + line.strip()
def readheaders(self): """Read header lines.
d04a5d080684cc2c8968c815e719808f094c279e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d04a5d080684cc2c8968c815e719808f094c279e/httplib.py
conn = self.msg.getheader('connection') if conn: conn = conn.lower() self.will_close = conn.find('close') != -1 or \ ( self.version != 11 and \ not self.msg.getheader('keep-alive') ) else: self.will_close = self.version != 11 and \ not self.msg.getheader('keep-alive')
self.will_close = self._check_close()
def begin(self): if self.msg is not None: # we've already started reading the response return
d04a5d080684cc2c8968c815e719808f094c279e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d04a5d080684cc2c8968c815e719808f094c279e/httplib.py
"setparameters%r: returned %r" % (config + result))
"setparameters%r: returned %r" % (config, result))
def test_setparameters(dsp): # Two configurations for testing: # config1 (8-bit, mono, 8 kHz) should work on even the most # ancient and crufty sound card, but maybe not on special- # purpose high-end hardware # config2 (16-bit, stereo, 44.1kHz) should work on all but the # most ancient and crufty ha...
8130abde0f580d334c02cc68e76de4961c12eba2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8130abde0f580d334c02cc68e76de4961c12eba2/test_ossaudiodev.py
"setparameters%r: returned %r" % (config + result))
"setparameters%r: returned %r" % (config, result))
def test_setparameters(dsp): # Two configurations for testing: # config1 (8-bit, mono, 8 kHz) should work on even the most # ancient and crufty sound card, but maybe not on special- # purpose high-end hardware # config2 (16-bit, stereo, 44.1kHz) should work on all but the # most ancient and crufty ha...
8130abde0f580d334c02cc68e76de4961c12eba2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8130abde0f580d334c02cc68e76de4961c12eba2/test_ossaudiodev.py
self.sock.send(str)
sendptr = 0 while sendptr < len(str): sendptr = sendptr + self.sock.send(str[sendptr:])
def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', `str` if self.sock: try: self.sock.send(str) except socket.error: raise SMTPServerDisconnected('Server not connected') else: raise SMTPServerDisconnected('please run connect() first')
ec1a5b0bd873efe706eeb6095bbacbe893ab01d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ec1a5b0bd873efe706eeb6095bbacbe893ab01d6/smtplib.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)
f96be18c96227314245eeada33c8d6c651affe0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f96be18c96227314245eeada33c8d6c651affe0c/BuildCGIApplet.py
d0 = base.replace(minute=3, tzinfo=OperandDependentOffset()) d1 = base.replace(minute=9, tzinfo=OperandDependentOffset()) d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: got = cmp(x, y) if (x is d0 or x is d1) and (y is d0 or y is d1): expected = 0 elif x is y is ...
if cls is not timetz: d0 = base.replace(minute=3, tzinfo=OperandDependentOffset()) d1 = base.replace(minute=9, tzinfo=OperandDependentOffset()) d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: got = cmp(x, y) if (x is d0 or x is d1) and (y is d0 or y is d1): exp...
def utcoffset(self, t): if t.minute < 10: return t.minute # d0 and d1 equal after adjustment else: return 59 # d2 off in the weeds
cd73c366f625e42404293557f1b530d011d4b74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd73c366f625e42404293557f1b530d011d4b74a/test_datetime.py
if dt is None or isinstance(dt, time) or dt.tzinfo is None:
if dt is None or dt.tzinfo is None:
def dst(self, dt): if dt is None or isinstance(dt, time) or dt.tzinfo is None: # An exception instead may be sensible here, in one or more of # the cases. return ZERO
cd73c366f625e42404293557f1b530d011d4b74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cd73c366f625e42404293557f1b530d011d4b74a/test_datetime.py
user_pass = base64.encode_string(unquote(user_passw)).strip() req.addheader('Proxy-Authorization', user_pass)
user_pass = base64.encodestring(unquote(user_pass)).strip() req.add_header('Proxy-Authorization', 'Basic '+user_pass)
def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) user_pass = base64.encode_string(unquote(user_passw)).strip() req.addheader('Proxy-Authorization', user_pass) host = unquote(host) req.set...
5bde527db1a7e1610cc6f794a0c0d6ce509f0e90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bde527db1a7e1610cc6f794a0c0d6ce509f0e90/urllib2.py
host = req.get_host()
host = urlparse.urlparse(req.get_full_url())[1]
def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given')
5bde527db1a7e1610cc6f794a0c0d6ce509f0e90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bde527db1a7e1610cc6f794a0c0d6ce509f0e90/urllib2.py
h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data))
if not req.headers.has_key('Content-type'): h.putheader('Content-type', 'application/x-www-form-urlencoded') if not req.headers.has_key('Content-length'): h.putheader('Content-length', '%d' % len(data))
def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given')
5bde527db1a7e1610cc6f794a0c0d6ce509f0e90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bde527db1a7e1610cc6f794a0c0d6ce509f0e90/urllib2.py
def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given')
5bde527db1a7e1610cc6f794a0c0d6ce509f0e90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5bde527db1a7e1610cc6f794a0c0d6ce509f0e90/urllib2.py
if hasattr(x, 'im_func'): x = x.im_func if hasattr(x, 'func_code'): x = x.func_code if hasattr(x, 'co_code'): disassemble(x) else: raise TypeError, \ "don't know how to disassemble %s objects" % \ type(x).__name__
raise TypeError, \ "don't know how to disassemble %s objects" % \ type(x).__name__
def dis(x=None): """Disassemble classes, methods, functions, or code. With no argument, disassemble the last traceback. """ if not x: distb() return if type(x) is types.InstanceType: x = x.__class__ if hasattr(x, '__dict__'): items = x.__dict__.items() items.sort() for name, x1 in items: if type(x1) in (types.MethodT...
076f79a092a49da86f2aef388993d0a6270ec375 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/076f79a092a49da86f2aef388993d0a6270ec375/dis.py
user,pw = self.passwd.find_user_password(realm, host)
user, pw = self.passwd.find_user_password(realm, req.get_full_url())
def retry_http_basic_auth(self, host, req, realm): user,pw = self.passwd.find_user_password(realm, host) if pw is not None: raw = "%s:%s" % (user, pw) auth = 'Basic %s' % base64.encodestring(raw).strip() if req.headers.get(self.auth_header, None) == auth: return None req.add_header(self.auth_header, auth) return self.p...
bfa1d5817e0123624ee4d85ca075e5c84453f7c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bfa1d5817e0123624ee4d85ca075e5c84453f7c6/urllib2.py
base = base + ', opaque="%s"' % opaque
base += ', opaque="%s"' % opaque
def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None
bfa1d5817e0123624ee4d85ca075e5c84453f7c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bfa1d5817e0123624ee4d85ca075e5c84453f7c6/urllib2.py
base = base + ', digest="%s"' % entdig if algorithm != 'MD5': base = base + ', algorithm="%s"' % algorithm
base += ', digest="%s"' % entdig base += ', algorithm="%s"' % algorithm
def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None
bfa1d5817e0123624ee4d85ca075e5c84453f7c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bfa1d5817e0123624ee4d85ca075e5c84453f7c6/urllib2.py
base = base + ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce)
base += ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce)
def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None
bfa1d5817e0123624ee4d85ca075e5c84453f7c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bfa1d5817e0123624ee4d85ca075e5c84453f7c6/urllib2.py
if type(ob)==types.ClassType:
if type(ob) in (types.ClassType, types.TypeType):
def get_arg_text(ob): """Get a string describing the arguments for the given object""" argText = "" if ob is not None: argOffset = 0 if type(ob)==types.ClassType: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: argOffset = 1 elif type(ob)==types.M...
81b9abbfc1b273dd9e4c79523003941ea1fc04d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/81b9abbfc1b273dd9e4c79523003941ea1fc04d7/CallTips.py
lines = f.readlines()
lines = [] line = f.readline() while line: lines.append(line.strip()) line = f.readline()
def read(self): opener = URLopener() f = opener.open(self.url) lines = f.readlines() self.errcode = opener.errcode if self.errcode == 401 or self.errcode == 403: self.disallow_all = 1 _debug("disallow all") elif self.errcode >= 400: self.allow_all = 1 _debug("allow all") elif self.errcode == 200 and lines: _debug("pars...
1177e8a880d3f9827b821dcacc99e2e21519b57d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1177e8a880d3f9827b821dcacc99e2e21519b57d/robotparser.py
line = line.strip()
def parse(self, lines): """parse the input lines from a robot.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.""" state = 0 linenumber = 0 entry = Entry()
1177e8a880d3f9827b821dcacc99e2e21519b57d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1177e8a880d3f9827b821dcacc99e2e21519b57d/robotparser.py
self.tries = 0 self.maxtries = 10
def __init__(self, *args): apply(urllib.FancyURLopener.__init__, (self,) + args) self.errcode = 200 self.tries = 0 self.maxtries = 10
1177e8a880d3f9827b821dcacc99e2e21519b57d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1177e8a880d3f9827b821dcacc99e2e21519b57d/robotparser.py
def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): self.tries += 1 if self.tries >= self.maxtries: return self.http_error_default(url, fp, 500, "Internal Server Error: Redirect Recursion", headers) result = urllib.FancyURLopener.http_error_302(self, url, fp, errcode, errmsg, headers, data) self.tr...
def http_error_default(self, url, fp, errcode, errmsg, headers): self.errcode = errcode return urllib.FancyURLopener.http_error_default(self, url, fp, errcode, errmsg, headers)
1177e8a880d3f9827b821dcacc99e2e21519b57d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1177e8a880d3f9827b821dcacc99e2e21519b57d/robotparser.py
formlength = formlength - 8 - chunk.chunksize if chunk.chunksize & 1: formlength = formlength - 1
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ...
d5e487709f4c6e2aacee5677e1c110b4a128ef25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d5e487709f4c6e2aacee5677e1c110b4a128ef25/aifc.py
level = 0 if "absolute_import" in self.futures else -1
level = 0 if self.graph.checkFlag(CO_FUTURE_ABSIMPORT) else -1
def visitImport(self, node): self.set_lineno(node) level = 0 if "absolute_import" in self.futures else -1 for name, alias in node.names: if VERSION > 1: self.emit('LOAD_CONST', level) self.emit('LOAD_CONST', None) self.emit('IMPORT_NAME', name) mod = name.split(".")[0] if alias: self._resolveDots(name) self.storeName(a...
df9ab0c27c43d0ac3f3778805274580f21756a20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df9ab0c27c43d0ac3f3778805274580f21756a20/pycodegen.py
if level == 0 and "absolute_import" not in self.futures:
if level == 0 and not self.graph.checkFlag(CO_FUTURE_ABSIMPORT):
def visitFrom(self, node): self.set_lineno(node) level = node.level if level == 0 and "absolute_import" not in self.futures: level = -1 fromlist = map(lambda (name, alias): name, node.names) if VERSION > 1: self.emit('LOAD_CONST', level) self.emit('LOAD_CONST', tuple(fromlist)) self.emit('IMPORT_NAME', node.modname) fo...
df9ab0c27c43d0ac3f3778805274580f21756a20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df9ab0c27c43d0ac3f3778805274580f21756a20/pycodegen.py
if self.addr == types.TupleType:
if type(self.addr) == types.TupleType:
def __repr__ (self): try: status = [] if self.accepting and self.addr: status.append ('listening') elif self.connected: status.append ('connected') if self.addr: if self.addr == types.TupleType: status.append ('%s:%d' % self.addr) else: status.append (self.addr) return '<%s %s at %x>' % (self.__class__.__name__, ' '.jo...
c5ab672395a53db60e2793755c78dfef5d7ddf6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c5ab672395a53db60e2793755c78dfef5d7ddf6e/asyncore.py
import httplib tries = 0 while tries<5: connection = httplib.HTTP(self.host) connection.putrequest("GET", self.path) connection.putheader("Host", self.host) connection.endheaders() status, text, mime = connection.getreply() if status in [301,302] and mime: tries = tries + 1 newurl = mime.get("Location", mime.get("Uri",...
opener = URLopener() f = opener.open(self.url) lines = f.readlines() self.errcode = opener.errcode if self.errcode == 401 or self.errcode == 403:
def read(self): import httplib tries = 0 while tries<5: connection = httplib.HTTP(self.host) connection.putrequest("GET", self.path) connection.putheader("Host", self.host) connection.endheaders() status, text, mime = connection.getreply() if status in [301,302] and mime: tries = tries + 1 newurl = mime.get("Location",...
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
elif status>=400:
_debug("disallow all") elif self.errcode >= 400:
def read(self): import httplib tries = 0 while tries<5: connection = httplib.HTTP(self.host) connection.putrequest("GET", self.path) connection.putheader("Host", self.host) connection.endheaders() status, text, mime = connection.getreply() if status in [301,302] and mime: tries = tries + 1 newurl = mime.get("Location",...
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
else: self.parse(connection.getfile().readlines())
_debug("allow all") elif self.errcode == 200 and lines: _debug("parse lines") self.parse(lines)
def read(self): import httplib tries = 0 while tries<5: connection = httplib.HTTP(self.host) connection.putrequest("GET", self.path) connection.putheader("Host", self.host) connection.endheaders() status, text, mime = connection.getreply() if status in [301,302] and mime: tries = tries + 1 newurl = mime.get("Location",...
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
_debug("Checking robot.txt allowance for\n%s\n%s" % (useragent, url))
_debug("Checking robot.txt allowance for:\n user agent: %s\n url: %s" % (useragent, url))
def can_fetch(self, useragent, url): """using the parsed robots.txt decide if useragent can fetch url""" _debug("Checking robot.txt allowance for\n%s\n%s" % (useragent, url)) if self.disallow_all: return 0 if self.allow_all: return 1 # search for given user agent matches # the first match counts useragent = useragent.l...
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
useragent = useragent.lower() url = urllib.quote(urlparse.urlparse(url)[2])
url = urllib.quote(urlparse.urlparse(url)[2]) or "/"
def can_fetch(self, useragent, url): """using the parsed robots.txt decide if useragent can fetch url""" _debug("Checking robot.txt allowance for\n%s\n%s" % (useragent, url)) if self.disallow_all: return 0 if self.allow_all: return 1 # search for given user agent matches # the first match counts useragent = useragent.l...
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
"check if this entry applies to the specified agent"
"""check if this entry applies to the specified agent""" useragent = useragent.split("/")[0].lower()
def applies_to(self, useragent): "check if this entry applies to the specified agent" for agent in self.useragents: if agent=="*": return 1 if re.match(agent, useragent): return 1 return 0
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
if agent=="*":
if agent=='*':
def applies_to(self, useragent): "check if this entry applies to the specified agent" for agent in self.useragents: if agent=="*": return 1 if re.match(agent, useragent): return 1 return 0
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
if re.match(agent, useragent):
agent = agent.lower() if re.search(re.escape(useragent), agent):
def applies_to(self, useragent): "check if this entry applies to the specified agent" for agent in self.useragents: if agent=="*": return 1 if re.match(agent, useragent): return 1 return 0
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
if len(sys.argv) <= 1: rp.set_url('http://www.musi-cal.com/robots.txt') rp.read() else: rp.parse(open(sys.argv[1]).readlines()) print rp.can_fetch('*', 'http://www.musi-cal.com/') print rp.can_fetch('Musi-Cal-Robot/1.0',
rp.set_url('http://www.musi-cal.com/robots.txt') rp.read() _check(rp.can_fetch('*', 'http://www.musi-cal.com/'), 1) _check(rp.can_fetch('', 'http://www.musi-cal.com/'), 0) _check(rp.can_fetch('CherryPickerSE',
def _test(): global debug import sys rp = RobotFileParser() debug = 1 if len(sys.argv) <= 1: rp.set_url('http://www.musi-cal.com/robots.txt') rp.read() else: rp.parse(open(sys.argv[1]).readlines()) print rp.can_fetch('*', 'http://www.musi-cal.com/') print rp.can_fetch('Musi-Cal-Robot/1.0', 'http://www.musi-cal.com/cgi-...
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
'?city=San+Francisco')
'?city=San+Francisco'), 0) _check(rp.can_fetch('CherryPickerSE/1.0', 'http://www.musi-cal.com/cgi-bin/event-search' '?city=San+Francisco'), 0) _check(rp.can_fetch('CherryPickerSE/1.5', 'http://www.musi-cal.com/cgi-bin/event-search' '?city=San+Francisco'), 0) _check(rp.can_fetch('ExtractorPro', 'http://www.musi-cal.com...
def _test(): global debug import sys rp = RobotFileParser() debug = 1 if len(sys.argv) <= 1: rp.set_url('http://www.musi-cal.com/robots.txt') rp.read() else: rp.parse(open(sys.argv[1]).readlines()) print rp.can_fetch('*', 'http://www.musi-cal.com/') print rp.can_fetch('Musi-Cal-Robot/1.0', 'http://www.musi-cal.com/cgi-...
a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a4da0263739b0f1a95d34e7acaf3e6b7a1a0fd5e/robotparser.py
def grid_slaves(self, master, row=None, column=None): args = (master,)
def grid_slaves(self, row=None, column=None): args = ()
def grid_slaves(self, master, row=None, column=None): args = (master,) if row: args = args + ('-row', row) if column: args = args + ('-column', column) return map(self._nametowidget, self.tk.splitlist( apply(self.tk.call, ('grid', 'slaves', self._w) + args)))
6b09d018d485cb74cf8a3a10aa38b03b7ddc7d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b09d018d485cb74cf8a3a10aa38b03b7ddc7d13/Tkinter.py
return self.tk.call(self._w, 'entrycget', '-' + option)
return self.tk.call(self._w, 'entrycget', index, '-' + option)
def entrycget(self, index, option): return self.tk.call(self._w, 'entrycget', '-' + option)
6b09d018d485cb74cf8a3a10aa38b03b7ddc7d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6b09d018d485cb74cf8a3a10aa38b03b7ddc7d13/Tkinter.py
if _active:
if _active is not None:
def __del__(self): # In case the child hasn't been waited on, check if it's done. self.poll(_deadstate=sys.maxint) if self.sts < 0: if _active: # Child is still running, keep us alive until we can wait on it. _active.append(self)
3c4457ea0e16a31c66b3fe135050a15ec3d7f1c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3c4457ea0e16a31c66b3fe135050a15ec3d7f1c9/popen2.py
if size < 0: size = sys.maxint bufs = [] readsize = min(100, size)
if size < 0: size = sys.maxint readsize = self.min_readsize else: readsize = size bufs = ""
def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line
0bad1f821b8419d53dfcfeb05d061c69ee8d82e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0bad1f821b8419d53dfcfeb05d061c69ee8d82e9/gzip.py
if size == 0: return "".join(bufs)
if size == 0: return bufs
def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line
0bad1f821b8419d53dfcfeb05d061c69ee8d82e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0bad1f821b8419d53dfcfeb05d061c69ee8d82e9/gzip.py
if size is not None: if i==-1 and len(c) > size: i=size-1 elif size <= i: i = size -1
def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line
0bad1f821b8419d53dfcfeb05d061c69ee8d82e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0bad1f821b8419d53dfcfeb05d061c69ee8d82e9/gzip.py
bufs.append(c[:i+1]) self._unread(c[i+1:]) return ''.join(bufs) bufs.append(c) size = size - len(c) readsize = min(size, readsize * 2)
if size <= i: i = size - 1 self._unread(c[i+1:]) return bufs + c[:i+1] else: if len(c) > size: i = size - 1 bufs = bufs + c size = size - len(c) readsize = min(size, int(readsize * 1.1)) if readsize > self.min_readsize: self.min_readsize = readsize
def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line
0bad1f821b8419d53dfcfeb05d061c69ee8d82e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0bad1f821b8419d53dfcfeb05d061c69ee8d82e9/gzip.py
def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (a, b)
import test.test_support, unittest
def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (a, b)
9cbf1912696c98d00dade45266db7c69f735e1b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9cbf1912696c98d00dade45266db7c69f735e1b7/test_charmapcodec.py
check(unicode('abc', codecname), u'abc') check(unicode('xdef', codecname), u'abcdef') check(unicode('defx', codecname), u'defabc') check(unicode('dxf', codecname), u'dabcf') check(unicode('dxfx', codecname), u'dabcfabc')
class CharmapCodecTest(unittest.TestCase): def test_constructorx(self): self.assertEquals(unicode('abc', codecname), u'abc') self.assertEquals(unicode('xdef', codecname), u'abcdef') self.assertEquals(unicode('defx', codecname), u'defabc') self.assertEquals(unicode('dxf', codecname), u'dabcf') self.assertEquals(unicode(...
def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (a, b)
9cbf1912696c98d00dade45266db7c69f735e1b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9cbf1912696c98d00dade45266db7c69f735e1b7/test_charmapcodec.py
check(u'abc'.encode(codecname), 'abc') check(u'xdef'.encode(codecname), 'abcdef') check(u'defx'.encode(codecname), 'defabc') check(u'dxf'.encode(codecname), 'dabcf') check(u'dxfx'.encode(codecname), 'dabcfabc')
def test_encodex(self): self.assertEquals(u'abc'.encode(codecname), 'abc') self.assertEquals(u'xdef'.encode(codecname), 'abcdef') self.assertEquals(u'defx'.encode(codecname), 'defabc') self.assertEquals(u'dxf'.encode(codecname), 'dabcf') self.assertEquals(u'dxfx'.encode(codecname), 'dabcfabc')
def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (a, b)
9cbf1912696c98d00dade45266db7c69f735e1b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9cbf1912696c98d00dade45266db7c69f735e1b7/test_charmapcodec.py
check(unicode('ydef', codecname), u'def') check(unicode('defy', codecname), u'def') check(unicode('dyf', codecname), u'df') check(unicode('dyfy', codecname), u'df')
def test_constructory(self): self.assertEquals(unicode('ydef', codecname), u'def') self.assertEquals(unicode('defy', codecname), u'def') self.assertEquals(unicode('dyf', codecname), u'df') self.assertEquals(unicode('dyfy', codecname), u'df')
def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (a, b)
9cbf1912696c98d00dade45266db7c69f735e1b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9cbf1912696c98d00dade45266db7c69f735e1b7/test_charmapcodec.py
try: unicode('abc\001', codecname) except UnicodeError: print '\\001 maps to undefined: OK' else: print '*** check failed: \\001 does not map to undefined'
def test_maptoundefined(self): self.assertRaises(UnicodeError, unicode, 'abc\001', codecname) def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(CharmapCodecTest)) test.test_support.run_suite(suite) if __name__ == "__main__": test_main()
def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (a, b)
9cbf1912696c98d00dade45266db7c69f735e1b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9cbf1912696c98d00dade45266db7c69f735e1b7/test_charmapcodec.py
def testWriteXML(): pass
def testWriteXML(): str = '<a b="c"/>' dom = parseString(str) domstr = dom.toxml() dom.unlink() confirm(str == domstr)
def testWriteXML(): pass
df99f016ee23bdc3d5c91048db1239b9a4d114f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df99f016ee23bdc3d5c91048db1239b9a4d114f0/test_minidom.py
"Strange! filename %s has two different module names" % \ (key, modules[key], other_module[key])
"Strange! filename %s has two different module " \ "names: %s and %s" % \ (key, modules[key], other_modules[key])
def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts other_counts = other.counts modules = self.modules other_modules = other.modules
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
save_counts = 0):
save_counts = 0, summary = 0, coverdir = None):
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = per_file.get(filename, {}) line...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
fndir = os.path.dirname(filename) if filename[:1] == os.sep: coverpath = os.path.join(dirname, "."+fndir) else: coverpath = os.path.join(dirname, fndir)
modulename = os.path.split(results.modules[key])[1]
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = per_file.get(filename, {}) line...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
sys.stderr.write("%s: Could not open %s for reading " \ "because: %s - skipping\n" % \ ("trace", `filename`, err.strerror)) continue modulename = os.path.split(results.modules[key])[1] listfilename = os.path.join(coverpath, modulename + ".cover")
print >> sys.stderr, "trace: Could not open %s for reading " \ "because: %s - skipping" % (`filename`, err.strerror) continue
def create_results_log(results, dirname = ".", show_missing = 1, save_counts = 0): import re # turn the counts data ("(filename, lineno) = count") into something # accessible on a per-file basis per_file = {} for filename, lineno in results.counts.keys(): lines_hit = per_file[filename] = per_file.get(filename, {}) line...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
modulename = frame.f_globals["__name__"]
try: modulename = frame.f_globals["__name__"] except KeyError: modulename = None
def trace(self, frame, why, arg): if why == 'line': # something is fishy about getting the file name filename = frame.f_globals.get("__file__", None) if filename is None: filename = frame.f_code.co_filename modulename = frame.f_globals["__name__"]
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
self.files = {'<string>': None}
self.files = {'<string>': None}
def __init__(self, ignore = Ignore()): self.ignore = ignore self.ignore_names = ignore._ignore # access ignore's cache (speed hack)
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
modulename = frame.f_globals["__name__"]
try: modulename = frame.f_globals["__name__"] except KeyError: modulename = None
def trace(self, frame, why, arg): if why == 'line': filename = frame.f_code.co_filename modulename = frame.f_globals["__name__"]
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
def trace(self, frame, why, arg): if why == 'line': filename = frame.f_code.co_filename modulename = frame.f_globals["__name__"]
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
sys.stderr.write("%s: %s\n" % (sys.argv[0], msg))
print >> sys.stderr, "%s: %s" % (sys.argv[0], msg)
def _err_exit(msg): sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.exit(1)
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m",
opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:",
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir="]) except getopt.error, msg: sys.stderr.write("%s: %s\n" % (sys.a...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
"ignore-module=", "ignore-dir="])
"ignore-module=", "ignore-dir=", "coverdir="])
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir="]) except getopt.error, msg: sys.stderr.write("%s: %s\n" % (sys.a...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.stderr.write("Try `%s --help' for more information\n" % sys.argv[0])
print >> sys.stderr, "%s: %s" % (sys.argv[0], msg) print >> sys.stderr, "Try `%s --help' for more information" \ % sys.argv[0]
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir="]) except getopt.error, msg: sys.stderr.write("%s: %s\n" % (sys.a...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
create_results_log(results, logdir, missing)
create_results_log(results, logdir, missing, summary=summary, coverdir=coverdir)
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir="]) except getopt.error, msg: sys.stderr.write("%s: %s\n" % (sys.a...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
create_results_log(results, logdir, missing)
create_results_log(results, logdir, missing, summary=summary, coverdir=coverdir)
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir="]) except getopt.error, msg: sys.stderr.write("%s: %s\n" % (sys.a...
894961335102d1da3e013a6c403542d89fcb4d40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/894961335102d1da3e013a6c403542d89fcb4d40/trace.py
write32(self.fileobj, self.crc)
write32u(self.fileobj, LOWU32(self.crc))
def close(self): if self.mode == WRITE: self.fileobj.write(self.compress.flush()) write32(self.fileobj, self.crc) # self.size may exceed 2GB, or even 4GB write32u(self.fileobj, LOWU32(self.size)) self.fileobj = None elif self.mode == READ: self.fileobj = None if self.myfileobj: self.myfileobj.close() self.myfileobj = N...
5a0f3b213f6c58b11348530e90299cc939d47076 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5a0f3b213f6c58b11348530e90299cc939d47076/gzip.py
self._do('tag_lower', belowThis)
self._do('lower', belowThis)
def lower(self, belowThis=None): self._do('tag_lower', belowThis)
44deb0ea45b10d773b1882c11cbd6a3e96b166ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44deb0ea45b10d773b1882c11cbd6a3e96b166ab/Canvas.py
self._do('tag_raise', aboveThis)
self._do('raise', aboveThis)
def tkraise(self, aboveThis=None): self._do('tag_raise', aboveThis)
44deb0ea45b10d773b1882c11cbd6a3e96b166ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44deb0ea45b10d773b1882c11cbd6a3e96b166ab/Canvas.py
def compare_generic_iter(make_it,match):
def compare_generic_iter(test, make_it, match):
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
5c6c1d1fccc04e80919354f3fe065d48e77e4f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c6c1d1fccc04e80919354f3fe065d48e77e4f9c/test_wsgiref.py
assert it[n]==item
test.assertEqual(it[n], item)
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
5c6c1d1fccc04e80919354f3fe065d48e77e4f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c6c1d1fccc04e80919354f3fe065d48e77e4f9c/test_wsgiref.py
assert iter(it) is it
test.assert_(iter(it) is it)
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
5c6c1d1fccc04e80919354f3fe065d48e77e4f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c6c1d1fccc04e80919354f3fe065d48e77e4f9c/test_wsgiref.py
assert it.next()==item try: it.next() except StopIteration: pass else: raise AssertionError("Too many items from .next()",it)
test.assertEqual(it.next(), item) test.assertRaises(StopIteration, it.next)
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
5c6c1d1fccc04e80919354f3fe065d48e77e4f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c6c1d1fccc04e80919354f3fe065d48e77e4f9c/test_wsgiref.py
compare_generic_iter(make_it,match)
compare_generic_iter(self, make_it, match)
def make_it(text=text,size=size): return util.FileWrapper(StringIO(text),size)
5c6c1d1fccc04e80919354f3fe065d48e77e4f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c6c1d1fccc04e80919354f3fe065d48e77e4f9c/test_wsgiref.py
assert h.environ.has_key(key)
self.assert_(h.environ.has_key(key))
def testCGIEnviron(self): h = BaseCGIHandler(None,None,None,{}) h.setup_environ() for key in 'wsgi.url_scheme', 'wsgi.input', 'wsgi.errors': assert h.environ.has_key(key)
5c6c1d1fccc04e80919354f3fe065d48e77e4f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c6c1d1fccc04e80919354f3fe065d48e77e4f9c/test_wsgiref.py
print 'cwd', os.getcwd() print 'fsspec', macfs.FSSpec(fullname) raise
print '*** Copy failed mysteriously, try again' print '*** cwd', os.getcwd() print '*** fsspec', macfs.FSSpec(fullname) try: i = 1 / 0 except: pass macostools.copy(fullname, os.path.join(destprefix, dest), 1)
def rundir(self, path, destprefix, doit): files = os.listdir(path) todo = [] rv = 1 for f in files: if self.exc.match(f): continue fullname = os.path.join(path, f) if os.path.isdir(fullname): todo.append(fullname) else: dest = self.inc.match(fullname) if dest == None: print 'Not yet resolved:', fullname rv = 0 if dest:...
b5b4b9cd3b80e38f2f85d09376a17604d9cf2b0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b5b4b9cd3b80e38f2f85d09376a17604d9cf2b0c/MkDistr.py
counter = 0
def gettempprefix(): """Function to calculate a prefix of the filename to use.""" global template, _pid if os.name == 'posix' and _pid and _pid != os.getpid(): # Our pid changed; we must have forked -- zap the template template = None if template is None: if os.name == 'posix': _pid = os.getpid() template = '@' + `_pid...
7f79d9c62a6c1697def31d916e7ba896252ba4c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7f79d9c62a6c1697def31d916e7ba896252ba4c5/tempfile.py
global counter
def mktemp(suffix=""): """User-callable function to return a unique temporary file name.""" global counter dir = gettempdir() pre = gettempprefix() while 1: counter = counter + 1 file = os.path.join(dir, pre + `counter` + suffix) if not os.path.exists(file): return file
7f79d9c62a6c1697def31d916e7ba896252ba4c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7f79d9c62a6c1697def31d916e7ba896252ba4c5/tempfile.py
counter = counter + 1 file = os.path.join(dir, pre + `counter` + suffix)
i = _counter.get_next() file = os.path.join(dir, pre + str(i) + suffix)
def mktemp(suffix=""): """User-callable function to return a unique temporary file name.""" global counter dir = gettempdir() pre = gettempprefix() while 1: counter = counter + 1 file = os.path.join(dir, pre + `counter` + suffix) if not os.path.exists(file): return file
7f79d9c62a6c1697def31d916e7ba896252ba4c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7f79d9c62a6c1697def31d916e7ba896252ba4c5/tempfile.py
print 'XXXX boolean:', `data`
def _decode_boolean(data, key): print 'XXXX boolean:', `data` return ord(data[0])
f79725939e2f5a682078db49abb904094ae5cead /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f79725939e2f5a682078db49abb904094ae5cead/ic.py
return addinfourl(fp, headers, url)
return addinfourl(fp, headers, "https:" + url)
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None if type(url) is types.StringType: 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 ...
40d4209991217368e7732cfddbe14c6769310fa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/40d4209991217368e7732cfddbe14c6769310fa6/urllib.py