rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
list of strings (???) containing version numbers; the list will be
list of strings containing version numbers; the list will be
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings (???) containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found. (XXX is...
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
found. (XXX is this correct???)"""
found."""
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings (???) containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found. (XXX is...
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
"""Get a devstudio path (include, lib or path)."""
"""Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found."""
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a devstudio path (include, lib or path).""" try: import win32api import win32con except ImportError: return None L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Compo...
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
return None
return []
def get_msvc_paths (path, version='6.0', platform='x86'): """Get a devstudio path (include, lib or path).""" try: import win32api import win32con except ImportError: return None L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Compo...
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
def _find_exe(exe): for v in get_devstudio_versions(): for p in get_msvc_paths('path',v): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn try: for p in string.split(os.environ['Path'],';'): fn=os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn except: pass return exe d...
def find_exe (exe, version_number): """Try to find an MSVC executable program 'exe' (from version 'version_number' of MSVC) in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is kno...
def _find_exe(exe): for v in get_devstudio_versions(): for p in get_msvc_paths('path',v): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn #didn't find it; try existing path try: for p in string.split(os.environ['Path'],';'): fn=os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): retu...
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
os.environ[n] = string.join(p,';')
os.environ[name]=string.join(p,';')
def _do_SET(n): p = _find_SET(n) if p: os.environ[n] = string.join(p,';')
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
self.cc = _find_exe("cl.exe") self.link = _find_exe("link.exe") _do_SET('lib') _do_SET('include') path=_find_SET('path') try: for p in string.split(os.environ['path'],';'): path.append(p) except KeyError: pass os.environ['path'] = string.join(path,';')
vNum = get_devstudio_versions () if vNum: vNum = vNum[0] self.cc = _find_exe("cl.exe", vNum) self.link = _find_exe("link.exe", vNum) _do_SET('lib', vNum) _do_SET('include', vNum) path=_find_SET('path', vNum) try: for p in string.split(os.environ['path'],';'): path.append(p) except KeyError: pass os.environ['path'] ...
def __init__ (self, verbose=0, dry_run=0, force=0):
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
self.compile_options = [ '/nologo', '/Ox', '/MD' ]
self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3' ]
def __init__ (self, verbose=0, dry_run=0, force=0):
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
'/nologo', '/Od', '/MDd', '/Z7', '/D_DEBUG'
'/nologo', '/Od', '/MDd', '/W3', '/Z7', '/D_DEBUG'
def __init__ (self, verbose=0, dry_run=0, force=0):
01c6453268730f0196a5451bf42b6f997496e60d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/01c6453268730f0196a5451bf42b6f997496e60d/msvccompiler.py
#ifdef WITHOUT_FRAMEWORKS
e6677828ed425694f83f25779f5c454e66cd9c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6677828ed425694f83f25779f5c454e66cd9c0b/filesupport.py
if ( PyString_Check(args) ) { OSStatus err;
if ( PyString_Check(v) ) {
#ifdef WITHOUT_FRAMEWORKS
e6677828ed425694f83f25779f5c454e66cd9c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6677828ed425694f83f25779f5c454e66cd9c0b/filesupport.py
PyErr_Mac(ErrorObject, err);
PyMac_Error(err);
#ifdef WITHOUT_FRAMEWORKS
e6677828ed425694f83f25779f5c454e66cd9c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6677828ed425694f83f25779f5c454e66cd9c0b/filesupport.py
if (FSpMakeFSRef(&((FSSpecObject *)v)->ob_itself, fsr))
if ((err=FSpMakeFSRef(&((FSSpecObject *)v)->ob_itself, fsr)) == 0)
#ifdef WITHOUT_FRAMEWORKS
e6677828ed425694f83f25779f5c454e66cd9c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6677828ed425694f83f25779f5c454e66cd9c0b/filesupport.py
getsetlist = [ ("data", """int size; PyObject *rv; size = GetHandleSize((Handle)self->ob_itself); HLock((Handle)self->ob_itself); rv = PyString_FromStringAndSize(*(Handle)self->ob_itself, size); HUnlock((Handle)self->ob_itself); return rv; """, None, "Raw data of the alias object" ) ]
def output_tp_initBody(self): Output("PyObject *v;") Output("char *kw[] = {\"itself\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(args, kwds, \"O\", kw, &v))") Output("return -1;") Output("if (myPyMac_GetFSRef(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) Output("return -1;")
e6677828ed425694f83f25779f5c454e66cd9c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6677828ed425694f83f25779f5c454e66cd9c0b/filesupport.py
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff, longname=LONGMODNAME)
def parseArgumentList(self, args): args0, arg1, argsrest = args[:1], args[1], args[2:] t0, n0, m0 = arg1 args = args0 + argsrest if m0 != InMode: raise ValueError, "method's 'self' must be 'InMode'" self.itself = Variable(t0, "_self->ob_itself", SelfMode) FunctionGenerator.parseArgumentList(self, args) self.argumentLis...
e6677828ed425694f83f25779f5c454e66cd9c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6677828ed425694f83f25779f5c454e66cd9c0b/filesupport.py
self.compile = None self.no_compile = None
self.compile = 0
def initialize_options (self):
97c3abdc12ddc74881181bf9acee6258de862479 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97c3abdc12ddc74881181bf9acee6258de862479/install.py
import sys
if debug_stderr: sys.stderr = debug_stderr
def __init__(self): self.preffilepath = ":Python:PythonIDE preferences" Wapplication.Application.__init__(self, 'Pide') from Carbon import AE from Carbon import AppleEvents AE.AEInstallEventHandler(AppleEvents.kCoreEventClass, AppleEvents.kAEOpenApplication, self.ignoreevent) AE.AEInstallEventHandler(AppleEvents.kCore...
903ada48ccb8cf2b1e0ae6f853c7a0e197235dc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/903ada48ccb8cf2b1e0ae6f853c7a0e197235dc9/PythonIDEMain.py
self.filename = filename
self.filename = _normpath(filename)
def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)): self.filename = filename # Name of the file in the archive self.date_time = date_time # year, month, day, hour, min, sec # Standard values: self.compress_type = ZIP_STORED # Type of compression for the file self.comment = "" # ...
9a1c2c1570f3f7af994952e01e1b98f805970e38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9a1c2c1570f3f7af994952e01e1b98f805970e38/zipfile.py
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None):
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None):
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.called...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.called...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.called...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
if key != 'calledfuncs':
if key != 'calledfuncs':
def update(self, other): """Merge in the data from another CoverageResults""" counts = self.counts calledfuncs = self.calledfuncs other_counts = other.counts other_calledfuncs = other.calledfuncs
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None):
def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None):
def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just output a list o...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
@param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just output a list of (filename, modulename, funcname,) for functions that were called at least once; This overrides `count' and `tr...
@param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just output a list of (filename, modulename, funcname,) for functions that were called at least once; This overrides `count' and `tr...
def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just output a list o...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
@param ignoredirs a list of the names of directories to ignore all of the (recursive) contents of @param infile file from which to read stored counts to be added into the results
@param ignoredirs a list of the names of directories to ignore all of the (recursive) contents of @param infile file from which to read stored counts to be added into the results
def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each line is executed @param trace true iff it should print out each line that is being counted @param countfuncs true iff it should just output a list o...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
key = (filename, lineno,)
key = filename, lineno
def localtrace_trace_and_count(self, frame, why, arg): if why == 'line': # record the file name and line number of every trace # XXX I wish inspect offered me an optimized # `getfilename(frame)' to use in place of the presumably # heavier `getframeinfo()'. --Zooko 2001-10-14 filename, lineno, funcname, context, linei...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
listfuncs = false
listfuncs = False
def main(argv=None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:l", ["help", "version", "trace", "count", "report", "no-report", "file=", "missing", "ignore-module=", "ignore-dir=", "coverdir=", "listfuncs",]) except getopt.error, msg: sys.stderr.write("...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
listfuncs = true
listfuncs = True
def main(argv=None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:l", ["help", "version", "trace", "count", "report", "no-report", "file=", "missing", "ignore-module=", "ignore-dir=", "coverdir=", "listfuncs",]) except getopt.error, msg: sys.stderr.write("...
9340d0d72de79fcdacc1995974f82fcd6e43dd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9340d0d72de79fcdacc1995974f82fcd6e43dd51/trace.py
if isdir(name) and not islink(name):
st = os.lstat(name) if stat.S_ISDIR(st[stat.ST_MODE]):
def walk(top, func, arg): """walk(top,func,arg) calls func(arg, d, files) for each directory "d"
e2cdfc7593294ee121dfa8def76f3ed7cebf12f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e2cdfc7593294ee121dfa8def76f3ed7cebf12f3/posixpath.py
self.socket.close()
def process_request(self, request, client_address): """Fork a new subprocess to process the request.""" self.collect_children() pid = os.fork() if pid: # Parent process if self.active_children is None: self.active_children = [] self.active_children.append(pid) return else: # Child process. # This must never return, hen...
ec8886119967e9f2e1f1672f4249000027964f5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ec8886119967e9f2e1f1672f4249000027964f5b/SocketServer.py
def __init__(self, s): self.__lines = s.split('\n')
def __init__(self, name, data, files=(), dirs=()): self.__name = name self.__data = data self.__files = files self.__dirs = dirs self.__lines = None def __setup(self): if self.__lines: return data = None for dir in self.__dirs: for file in self.__files: file = os.path.join(dir, file) try: fp = open(file) data = fp.rea...
def __init__(self, s): self.__lines = s.split('\n') self.__linecnt = len(self.__lines)
936b2dd45c6958b9ddb514189b0b133eb507cfd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/936b2dd45c6958b9ddb514189b0b133eb507cfd8/site.py
return '' __builtin__.copyright = _Printer(sys.copyright) __builtin__.credits = _Printer( '''Python development is led by BeOpen PythonLabs (www.pythonlabs.com).''') def make_license(filename): try: return _Printer(open(filename).read()) except IOError: return None
__builtin__.copyright = _Printer("copyright", sys.copyright) __builtin__.credits = _Printer("credits", "Python development is led by BeOpen PythonLabs (www.pythonlabs.com).")
def __repr__(self): prompt = 'Hit Return for more, or q (and Return) to quit: ' lineno = 0 while 1: try: for i in range(lineno, lineno + self.MAXLINES): print self.__lines[i] except IndexError: break else: lineno += self.MAXLINES key = None while key is None: key = raw_input(prompt) if key not in ('', 'q'): key = None ...
936b2dd45c6958b9ddb514189b0b133eb507cfd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/936b2dd45c6958b9ddb514189b0b133eb507cfd8/site.py
for dir in here, os.path.join(here, os.pardir), os.curdir: for file in "LICENSE.txt", "LICENSE": lic = make_license(os.path.join(dir, file)) if lic: break if lic: __builtin__.license = lic break else: __builtin__.license = _Printer('See http://hdl.handle.net/1895.22/1012')
__builtin__.license = _Printer( "license", "See http://www.pythonlabs.com/products/python2.0/license.html", ["LICENSE.txt", "LICENSE"], [here, os.path.join(here, os.pardir), os.curdir])
def make_license(filename): try: return _Printer(open(filename).read()) except IOError: return None
936b2dd45c6958b9ddb514189b0b133eb507cfd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/936b2dd45c6958b9ddb514189b0b133eb507cfd8/site.py
adlist = None
adlist = ""
def getrouteaddr(self): """Parse a route address (Return-path value).
0de8b68c4aecfa7b908aee9f677f90c6b8a7ed06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0de8b68c4aecfa7b908aee9f677f90c6b8a7ed06/rfc822.py
result.append('\\') result.append(char)
if char == '\000': result.append(r'\000') else: result.append('\\' + char) else: result.append(char)
def escape(pattern): "Escape all non-alphanumeric characters in pattern." result = [] alphanum=string.letters+'_'+string.digits for char in pattern: if char not in alphanum: result.append('\\') result.append(char) return string.join(result, '')
e2e045c918de0dd788e1260b0023a9e9052a0ab5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e2e045c918de0dd788e1260b0023a9e9052a0ab5/re.py
while not self.state:
if not self.state:
def wait(self): self.posted.acquire() while not self.state: self.posted.wait() self.posted.release()
3fdee996bec2a84eaa9b98292719bad2a4b0629c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3fdee996bec2a84eaa9b98292719bad2a4b0629c/sync.py
self.plist.CFBundleExecutable = self.name
def preProcess(self): self.plist.CFBundleExecutable = self.name resdir = pathjoin("Contents", "Resources") if self.executable is not None: if self.mainprogram is None: execpath = pathjoin(self.execdir, self.name) else: execpath = pathjoin(resdir, os.path.basename(self.executable)) self.files.append((self.executable, ex...
42fffc1d3be00aca96bdd2fc2006ce5494ca3fea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/42fffc1d3be00aca96bdd2fc2006ce5494ca3fea/bundlebuilder.py
python [options] command
python bundlebuilder.py [options] command
def pathjoin(*args): """Safe wrapper for os.path.join: asserts that all but the first argument are relative paths.""" for seg in args[1:]: assert seg[0] != "/" return os.path.join(*args)
42fffc1d3be00aca96bdd2fc2006ce5494ca3fea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/42fffc1d3be00aca96bdd2fc2006ce5494ca3fea/bundlebuilder.py
b = (12,) c = (6, 6) d = (4, 4, 4) e = (3, 3, 3, 3)
b = (1,) c = (1, 2) d = (1, 2, 3) e = (1, 2, 3, 4)
def test_short_tuples(self): a = () b = (12,) c = (6, 6) d = (4, 4, 4) e = (3, 3, 3, 3) for proto in 0, 1, 2: for x in a, b, c, d, e: s = self.dumps(x, proto) y = self.loads(s) self.assertEqual(x, y, (proto, x, s, y))
90047b42269f22d4350f00483f5587cf6e9e2566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90047b42269f22d4350f00483f5587cf6e9e2566/pickletester.py
if not debugger:
if not debugger and \ self.editwin.getvar("<<toggle-jit-stack-viewer>>"):
def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file...
c95ed37697a4fd9cee14a0f83706e6d7f31f26bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c95ed37697a4fd9cee14a0f83706e6d7f31f26bd/ScriptBinding.py
to_convert = to_convert[:] to_convert.sort(key=len, reverse=True)
def __seqToRE(self, to_convert, directive): """Convert a list to a regex string for matching a directive.
7c1215df0e3d60cb25d1a75a496c926e5d6061f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7c1215df0e3d60cb25d1a75a496c926e5d6061f4/_strptime.py
def test_main():
def test_basic():
def test_main(): test_support.requires('network') if not hasattr(socket, "ssl"): raise test_support.TestSkipped("socket module has no ssl support") import urllib socket.RAND_status() try: socket.RAND_egd(1) except TypeError: pass else: print "didn't raise TypeError" socket.RAND_add("this is a random string", 75.0) f...
6aac0ca4d27b8f47b25120a63c9dcbe6074634d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6aac0ca4d27b8f47b25120a63c9dcbe6074634d7/test_socket_ssl.py
if not self._dict['Download-URL']:
if not self._dict.get('Download-URL'):
def prerequisites(self): """Return a list of prerequisites for this package. The list contains 2-tuples, of which the first item is either a PimpPackage object or None, and the second is a descriptive string. The first item can be None if this package depends on something that isn't pimp-installable, in which case the...
b1785136efdb8a4326b51b960cd628a20e7712f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b1785136efdb8a4326b51b960cd628a20e7712f4/pimp.py
fp = os.popen(cmd, "r")
dummy, fp = os.popen4(cmd, "r") dummy.close()
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 fp = os.popen(cmd, "r") while 1: line = fp.readline() if not line: break if output: output.write(l...
b1785136efdb8a4326b51b960cd628a20e7712f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b1785136efdb8a4326b51b960cd628a20e7712f4/pimp.py
cast = "(PyObject*(*)(void*))"
self.emit("{", depth) self.emit("int i, n = asdl_seq_LEN(%s);" % value, depth+1) self.emit("value = PyList_New(n);", depth+1) self.emit("if (!value) goto failed;", depth+1) self.emit("for(i = 0; i < n; i++)", depth+1) self.emit("PyList_SET_ITEM(value, i, ast2obj_%s((%s_ty)asdl_seq_GET(%s, i)));" % (field.type, field...
def set(self, field, value, depth): if field.seq: if field.type.value == "cmpop": # XXX check that this cast is safe, i.e. works independent on whether # sizeof(cmpop_ty) != sizeof(void*) cast = "(PyObject*(*)(void*))" else: cast = "" self.emit("value = ast2obj_list(%s, %sast2obj_%s);" % (value, cast, field.type), dept...
d7625dcb7aa3a06e0f767089841c5250c72d8cd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d7625dcb7aa3a06e0f767089841c5250c72d8cd7/asdl_c.py
cast = "" self.emit("value = ast2obj_list(%s, %sast2obj_%s);" % (value, cast, field.type), depth)
self.emit("value = ast2obj_list(%s, ast2obj_%s);" % (value, field.type), depth)
def set(self, field, value, depth): if field.seq: if field.type.value == "cmpop": # XXX check that this cast is safe, i.e. works independent on whether # sizeof(cmpop_ty) != sizeof(void*) cast = "(PyObject*(*)(void*))" else: cast = "" self.emit("value = ast2obj_list(%s, %sast2obj_%s);" % (value, cast, field.type), dept...
d7625dcb7aa3a06e0f767089841c5250c72d8cd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d7625dcb7aa3a06e0f767089841c5250c72d8cd7/asdl_c.py
if not string.find(value, "%("):
if string.find(value, "%(") >= 0:
def get(self, section, option, raw=0, vars=None): """Get an option value for a given section.
176e00333c9e869d226e3352b20e89b6db5d4019 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/176e00333c9e869d226e3352b20e89b6db5d4019/ConfigParser.py
onoff = 0 else: onoff = 255 if self.barx: self.barx.HiliteControl(onoff) if self.bary: self.bary.HiliteControl(onoff)
if self.barx and self.barx_enabled: self.barx.HiliteControl(0) if self.bary and self.bary_enabled: self.bary.HiliteControl(0) else: if self.barx: self.barx.HiliteControl(255) if self.bary: self.bary.HiliteControl(255)
def do_activate(self, onoff, event): if onoff: onoff = 0 else: onoff = 255 if self.barx: self.barx.HiliteControl(onoff) if self.bary: self.bary.HiliteControl(onoff)
3a0a0cb6a1371459e2660311fc8c04740045404b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3a0a0cb6a1371459e2660311fc8c04740045404b/FrameWork.py
self.barx.SetControlValue(vx)
if vx == None: self.barx.HiliteControl(255) self.barx_enabled = 0 else: if not self.barx_enabled: self.barx_enabled = 1 if self.activated: self.barx.HiliteControl(0) self.barx.SetControlValue(vx)
def updatescrollbars(self): SetPort(self.wid) vx, vy = self.getscrollbarvalues() if self.barx: self.barx.SetControlValue(vx) if self.bary: self.bary.SetControlValue(vy)
3a0a0cb6a1371459e2660311fc8c04740045404b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3a0a0cb6a1371459e2660311fc8c04740045404b/FrameWork.py
self.bary.SetControlValue(vy)
if vy == None: self.bary.HiliteControl(255) self.bary_enabled = 0 else: if not self.bary_enabled: self.bary_enabled = 1 if self.activated: self.bary.HiliteControl(0) self.bary.SetControlValue(vy) def scalebarvalue(self, absmin, absmax, curmin, curmax): if curmin <= absmin and curmax >= absmax: return None if curmin ...
def updatescrollbars(self): SetPort(self.wid) vx, vy = self.getscrollbarvalues() if self.barx: self.barx.SetControlValue(vx) if self.bary: self.bary.SetControlValue(vy)
3a0a0cb6a1371459e2660311fc8c04740045404b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3a0a0cb6a1371459e2660311fc8c04740045404b/FrameWork.py
for i in range(3):
for count in range(3):
def test_trashcan(): # "trashcan" is a hack to prevent stack overflow when deallocating # very deeply nested tuples etc. It works in part by abusing the # type pointer and refcount fields, and that can yield horrible # problems when gc tries to traverse the structures. # If this test fails (as it does in 2.0, 2.1 and ...
20979fcfa9b77a87a8feb76ab0e876750535db3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20979fcfa9b77a87a8feb76ab0e876750535db3a/test_gc.py
if s1[-2:] == "\r\n": s1 = s1[:-2] + "\n" sys.stdout.write(s1)
sys.stdout.write(s1.replace("\r\n", "\n"))
def debug(msg): pass
b8c865079bb9b6ad5413c1651f04cbc95e8ee832 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8c865079bb9b6ad5413c1651f04cbc95e8ee832/test_pty.py
if s2[-2:] == "\r\n": s2 = s2[:-2] + "\n" sys.stdout.write(s2)
sys.stdout.write(s2.replace("\r\n", "\n"))
def debug(msg): pass
b8c865079bb9b6ad5413c1651f04cbc95e8ee832 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8c865079bb9b6ad5413c1651f04cbc95e8ee832/test_pty.py
"""Reset the list of warnings filters to its default state."""
"""Clear the list of warning filters, so that no filters are active."""
def resetwarnings(): """Reset the list of warnings filters to its default state.""" filters[:] = []
33fa94b43504d9a37ce9e060a17fe174b17937de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33fa94b43504d9a37ce9e060a17fe174b17937de/warnings.py
pid, status = os.wait()
exited_pid, status = os.waitpid(pid, 0)
def test_lock_conflict(self): # Fork off a subprocess that will lock the file for 2 seconds, # unlock it, and then exit. if not hasattr(os, 'fork'): return pid = os.fork() if pid == 0: # In the child, lock the mailbox. self._box.lock() time.sleep(2) self._box.unlock() os._exit(0)
32d40170bd00aad9ee16629400aefbd5e6ee7ba4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/32d40170bd00aad9ee16629400aefbd5e6ee7ba4/test_mailbox.py
(typ, [data]) = <instance>.search(charset, criterium, ...)
(typ, [data]) = <instance>.search(charset, criterion, ...)
def search(self, charset, *criteria): """Search mailbox for matching messages.
078199e1f0290a4bca5c1b4445c9cdad1a292955 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/078199e1f0290a4bca5c1b4445c9cdad1a292955/imaplib.py
self.fp.write(struct.pack("<lll", zinfo.CRC, zinfo.compress_size,
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
def write(self, filename, arcname=None, compress_type=None): """Put the bytes from filename into the archive under the name arcname.""" st = os.stat(filename) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information if arcname is None: zinfo = ZipInfo(filename, date...
d5ad59d11aca2ea7e4b85e9b3fc9d264e5679815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d5ad59d11aca2ea7e4b85e9b3fc9d264e5679815/zipfile.py
self.fp.write(struct.pack("<lll", zinfo.CRC, zinfo.compress_size,
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
def writestr(self, zinfo_or_arcname, bytes): """Write a file into the archive. The contents is the string 'bytes'. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.""" if not isinstance(zinfo_or_arcname, ZipInfo): zinfo = ZipInfo(filename=zinfo_or_arcname, date_time=time.localtim...
d5ad59d11aca2ea7e4b85e9b3fc9d264e5679815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d5ad59d11aca2ea7e4b85e9b3fc9d264e5679815/zipfile.py
incomment = ''
instr = '' brackets = 0
def checkline(self, filename, lineno): """Return line number of first line at or after input argument such that if the input points to a 'def', the returned line number is the first non-blank/non-comment line to follow. If the input points to a blank or comment line, return 0. At end of file, also return 0."""
323f97436d8fb14c49eb896cfe36a491b673ec1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/323f97436d8fb14c49eb896cfe36a491b673ec1f/pdb.py
if incomment: if len(line) < 3: continue if (line[-3:] == incomment): incomment = '' continue
def checkline(self, filename, lineno): """Return line number of first line at or after input argument such that if the input points to a 'def', the returned line number is the first non-blank/non-comment line to follow. If the input points to a blank or comment line, return 0. At end of file, also return 0."""
323f97436d8fb14c49eb896cfe36a491b673ec1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/323f97436d8fb14c49eb896cfe36a491b673ec1f/pdb.py
if len(line) >= 3: if (line[:3] == '"""' or line[:3] == "'''"): if line[-3:] == line[:3]: continue incomment = line[:3] continue if line[0] != '
if brackets <= 0 and line[0] not in (' break
def checkline(self, filename, lineno): """Return line number of first line at or after input argument such that if the input points to a 'def', the returned line number is the first non-blank/non-comment line to follow. If the input points to a blank or comment line, return 0. At end of file, also return 0."""
323f97436d8fb14c49eb896cfe36a491b673ec1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/323f97436d8fb14c49eb896cfe36a491b673ec1f/pdb.py
f.write("<title>Directory listing for %s</title>\n" % self.path) f.write("<h2>Directory listing for %s</h2>\n" % self.path)
displaypath = cgi.escape(urllib.unquote(self.path)) f.write("<title>Directory listing for %s</title>\n" % displaypath) f.write("<h2>Directory listing for %s</h2>\n" % displaypath)
def list_directory(self, path): """Helper to produce a directory listing (absent index.html).
db213a3d7cae4d97d5e1463a665ca2a1e462205c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db213a3d7cae4d97d5e1463a665ca2a1e462205c/SimpleHTTPServer.py
print msg % args
if not args: print msg else: print msg % args
def _log(self, level, msg, args): if level >= self.threshold: print msg % args sys.stdout.flush()
4d827c3bdcc9e72bfa3f5bbbc628bfd74ef2d33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d827c3bdcc9e72bfa3f5bbbc628bfd74ef2d33c/log.py
key = (message, category, lineno)
if isinstance(message, Warning): text = str(message) category = message.__class__ else: text = message message = category(message) key = (text, category, lineno)
def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: module = filename if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: registry = {} key = (message, category, lineno) # Quick test for common case if registry....
4b5db8774e9e35b3dbd80e62527491c251496ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b5db8774e9e35b3dbd80e62527491c251496ac9/warnings.py
if (msg.match(message) and
if (msg.match(text) and
def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: module = filename if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: registry = {} key = (message, category, lineno) # Quick test for common case if registry....
4b5db8774e9e35b3dbd80e62527491c251496ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b5db8774e9e35b3dbd80e62527491c251496ac9/warnings.py
raise category(message)
raise message
def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: module = filename if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: registry = {} key = (message, category, lineno) # Quick test for common case if registry....
4b5db8774e9e35b3dbd80e62527491c251496ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b5db8774e9e35b3dbd80e62527491c251496ac9/warnings.py
oncekey = (message, category)
oncekey = (text, category)
def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: module = filename if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: registry = {} key = (message, category, lineno) # Quick test for common case if registry....
4b5db8774e9e35b3dbd80e62527491c251496ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b5db8774e9e35b3dbd80e62527491c251496ac9/warnings.py
altkey = (message, category, 0)
altkey = (text, category, 0)
def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: module = filename if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: registry = {} key = (message, category, lineno) # Quick test for common case if registry....
4b5db8774e9e35b3dbd80e62527491c251496ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b5db8774e9e35b3dbd80e62527491c251496ac9/warnings.py
exts.append( Extension('cPickle', ['cPickle.c']) )
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
db5185a1a85cbca29ce61fcae3f1ab228b074f9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db5185a1a85cbca29ce61fcae3f1ab228b074f9d/setup.py
def _strxor(s1, s2): """Utility method. XOR the two strings s1 and s2 (must have same length). """ return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2))
trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)]) trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)])
def _strxor(s1, s2): """Utility method. XOR the two strings s1 and s2 (must have same length). """ return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2))
19fd5d6556b975e2dfffc7ea32bc2251fc254594 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19fd5d6556b975e2dfffc7ea32bc2251fc254594/hmac.py
ipad = "\x36" * blocksize opad = "\x5C" * blocksize
def __init__(self, key, msg = None, digestmod = None): """Create a new HMAC object.
19fd5d6556b975e2dfffc7ea32bc2251fc254594 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19fd5d6556b975e2dfffc7ea32bc2251fc254594/hmac.py
self.outer.update(_strxor(key, opad)) self.inner.update(_strxor(key, ipad))
self.outer.update(key.translate(trans_5C)) self.inner.update(key.translate(trans_36))
def __init__(self, key, msg = None, digestmod = None): """Create a new HMAC object.
19fd5d6556b975e2dfffc7ea32bc2251fc254594 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19fd5d6556b975e2dfffc7ea32bc2251fc254594/hmac.py
use_statcache -- Do not stat() each file directly: go through the statcache module for more efficiency.
use_statcache -- obsolete argument.
def cmp(f1, f2, shallow=1, use_statcache=0): """Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- Just check stat signature (do not read the files). defaults to 1. use_statcache -- Do not stat() each file directly: go through the statcache module for more efficiency. Return val...
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
Of course, if 'use_statcache' is true, this mechanism is defeated, and the cache will never grow stale.
def cmp(f1, f2, shallow=1, use_statcache=0): """Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- Just check stat signature (do not read the files). defaults to 1. use_statcache -- Do not stat() each file directly: go through the statcache module for more efficiency. Return val...
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
if use_statcache: stat_function = statcache.stat else: stat_function = os.stat s1 = _sig(stat_function(f1)) s2 = _sig(stat_function(f2))
s1 = _sig(os.stat(f1)) s2 = _sig(os.stat(f2))
def cmp(f1, f2, shallow=1, use_statcache=0): """Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- Just check stat signature (do not read the files). defaults to 1. use_statcache -- Do not stat() each file directly: go through the statcache module for more efficiency. Return val...
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
a_stat = statcache.stat(a_path)
a_stat = os.stat(a_path)
def phase2(self): # Distinguish files, directories, funnies self.common_dirs = [] self.common_files = [] self.common_funny = []
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
b_stat = statcache.stat(b_path)
b_stat = os.stat(b_path)
def phase2(self): # Distinguish files, directories, funnies self.common_dirs = [] self.common_files = [] self.common_funny = []
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
use_statcache -- if true, use statcache.stat() instead of os.stat()
use_statcache -- obsolete argument
def cmpfiles(a, b, common, shallow=1, use_statcache=0): """Compare common files in two directories. a, b -- directory names common -- list of file names found in both directories shallow -- if true, do comparison based solely on stat() information use_statcache -- if true, use statcache.stat() instead of os.stat() Re...
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
res[_cmp(ax, bx, shallow, use_statcache)].append(x)
res[_cmp(ax, bx, shallow)].append(x)
def cmpfiles(a, b, common, shallow=1, use_statcache=0): """Compare common files in two directories. a, b -- directory names common -- list of file names found in both directories shallow -- if true, do comparison based solely on stat() information use_statcache -- if true, use statcache.stat() instead of os.stat() Re...
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
def _cmp(a, b, sh, st):
def _cmp(a, b, sh):
def _cmp(a, b, sh, st): try: return not abs(cmp(a, b, sh, st)) except os.error: return 2
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
return not abs(cmp(a, b, sh, st))
return not abs(cmp(a, b, sh))
def _cmp(a, b, sh, st): try: return not abs(cmp(a, b, sh, st)) except os.error: return 2
5431895243cb65d1e342bf9e2509299153917607 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5431895243cb65d1e342bf9e2509299153917607/filecmp.py
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP)
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP) os.chown(p, -1, gid)
def buildPython(): print "Building a universal python" buildDir = os.path.join(WORKDIR, '_bld', 'python') rootDir = os.path.join(WORKDIR, '_root') if os.path.exists(buildDir): shutil.rmtree(buildDir) if os.path.exists(rootDir): shutil.rmtree(rootDir) os.mkdir(buildDir) os.mkdir(rootDir) os.mkdir(os.path.join(rootDir,...
e31d2b6c38a808633a54b26c053bad00dd2f36f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e31d2b6c38a808633a54b26c053bad00dd2f36f8/build-installer.py
else: raise ValueError, "zero step for randrange()"
else: raise ValueError, "zero step for randrange()"
def randrange(self, start, stop=None, step=1, # Do not supply the following arguments int=int, default=None): # This code is a bit messy to make it fast for the # common case while still doing adequate error checking istart = int(start) if istart != start: raise ValueError, "non-integer arg 1 for randrange()" if stop i...
26407823b5acb5818812c7b910e107a3df035903 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/26407823b5acb5818812c7b910e107a3df035903/whrandom.py
if n <= 0: raise ValueError, "empty range for randrange()" return istart + istep*int(self.random() * n)
if n <= 0: raise ValueError, "empty range for randrange()" return istart + istep*int(self.random() * n)
def randrange(self, start, stop=None, step=1, # Do not supply the following arguments int=int, default=None): # This code is a bit messy to make it fast for the # common case while still doing adequate error checking istart = int(start) if istart != start: raise ValueError, "non-integer arg 1 for randrange()" if stop i...
26407823b5acb5818812c7b910e107a3df035903 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/26407823b5acb5818812c7b910e107a3df035903/whrandom.py
print '%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
print >> DEBUGSTREAM, \ '%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
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(...
b245089c177ff545f3a46232d597df0d56ad62bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b245089c177ff545f3a46232d597df0d56ad62bd/smtpd.py
if (not rframe is frame) and rcur:
if (rframe is frame) and rcur:
def trace_dispatch_exception(self, frame, t): rt, rtt, rct, rfn, rframe, rcur = self.cur if (not rframe is frame) and rcur: return self.trace_dispatch_return(rframe, t) return 0
f9d3358e38a378bd257ee42cc2d9fe0e383091b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f9d3358e38a378bd257ee42cc2d9fe0e383091b3/profile.py
def newgroups(self, date, time):
def newgroups(self, date, time, file=None):
def newgroups(self, date, time): """Process a NEWGROUPS command. Arguments: - date: string 'yymmdd' indicating the date - time: string 'hhmmss' indicating the time Return: - resp: server response if successful - list: list of newsgroup names"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
return self.longcmd('NEWGROUPS ' + date + ' ' + time) def newnews(self, group, date, time):
return self.longcmd('NEWGROUPS ' + date + ' ' + time, file) def newnews(self, group, date, time, file=None):
def newgroups(self, date, time): """Process a NEWGROUPS command. Arguments: - date: string 'yymmdd' indicating the date - time: string 'hhmmss' indicating the time Return: - resp: server response if successful - list: list of newsgroup names"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
return self.longcmd(cmd) def list(self):
return self.longcmd(cmd, file) def list(self, file=None):
def newnews(self, group, date, time): """Process a NEWNEWS command. Arguments: - group: group name or '*' - date: string 'yymmdd' indicating the date - time: string 'hhmmss' indicating the time Return: - resp: server response if successful - list: list of article ids"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
resp, list = self.longcmd('LIST')
resp, list = self.longcmd('LIST', file)
def list(self): """Process a LIST command. Return: - resp: server response if successful - list: list of (group, last, first, flag) (strings)"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
def help(self):
def help(self, file=None):
def help(self): """Process a HELP command. Returns: - resp: server response if successful - list: list of strings"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
return self.longcmd('HELP')
return self.longcmd('HELP',file)
def help(self): """Process a HELP command. Returns: - resp: server response if successful - list: list of strings"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
def xhdr(self, hdr, str):
def xhdr(self, hdr, str, file=None):
def xhdr(self, hdr, str): """Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 Returns: - resp: server response if successful - list: list of (nr, value) strings"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
resp, lines = self.longcmd('XHDR ' + hdr + ' ' + str)
resp, lines = self.longcmd('XHDR ' + hdr + ' ' + str, file)
def xhdr(self, hdr, str): """Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 Returns: - resp: server response if successful - list: list of (nr, value) strings"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
def xover(self,start,end):
def xover(self, start, end, file=None):
def xover(self,start,end): """Process an XOVER command (optional server extension) Arguments: - start: start of range - end: end of range Returns: - resp: server response if successful - list: list of (art-nr, subject, poster, date, id, references, size, lines)"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
resp, lines = self.longcmd('XOVER ' + start + '-' + end)
resp, lines = self.longcmd('XOVER ' + start + '-' + end, file)
def xover(self,start,end): """Process an XOVER command (optional server extension) Arguments: - start: start of range - end: end of range Returns: - resp: server response if successful - list: list of (art-nr, subject, poster, date, id, references, size, lines)"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
def xgtitle(self, group):
def xgtitle(self, group, file=None):
def xgtitle(self, group): """Process an XGTITLE command (optional server extension) Arguments: - group: group name wildcard (i.e. news.*) Returns: - resp: server response if successful - list: list of (name,title) strings"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
resp, raw_lines = self.longcmd('XGTITLE ' + group)
resp, raw_lines = self.longcmd('XGTITLE ' + group, file)
def xgtitle(self, group): """Process an XGTITLE command (optional server extension) Arguments: - group: group name wildcard (i.e. news.*) Returns: - resp: server response if successful - list: list of (name,title) strings"""
bf414590658c8878c0a27cbcf1dda4738d4ce7e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf414590658c8878c0a27cbcf1dda4738d4ce7e0/nntplib.py
if isinstance(s, StringType):
if isinstance(s, str):
def _is8bitstring(s): if isinstance(s, StringType): try: unicode(s, 'us-ascii') except UnicodeError: return True return False
06f820621b37df5c977e2d2239c494cb51a805fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/06f820621b37df5c977e2d2239c494cb51a805fb/Generator.py
self.__maxheaderlen = maxheaderlen
self._maxheaderlen = maxheaderlen
def __init__(self, outfp, mangle_from_=True, maxheaderlen=78): """Create the generator for message flattening.
06f820621b37df5c977e2d2239c494cb51a805fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/06f820621b37df5c977e2d2239c494cb51a805fb/Generator.py