rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if self.debugging > 1: print '*put*', `line`
if self.debugging > 1: print '*put*', self.sanitize(line)
def putline(self, line): line = line + CRLF if self.debugging > 1: print '*put*', `line` self.sock.send(line)
ebaf104665158f0dd215062b699e7f1a2b4580b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebaf104665158f0dd215062b699e7f1a2b4580b7/ftplib.py
if self.debugging: print '*cmd*', `line`
if self.debugging: print '*cmd*', self.sanitize(line)
def putcmd(self, line): if self.debugging: print '*cmd*', `line` self.putline(line)
ebaf104665158f0dd215062b699e7f1a2b4580b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebaf104665158f0dd215062b699e7f1a2b4580b7/ftplib.py
print '*get*', `line`
print '*get*', self.sanitize(line)
def getline(self): line = self.file.readline() if self.debugging > 1: print '*get*', `line` if not line: raise EOFError if line[-2:] == CRLF: line = line[:-2] elif line[-1:] in CRLF: line = line[:-1] return line
ebaf104665158f0dd215062b699e7f1a2b4580b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebaf104665158f0dd215062b699e7f1a2b4580b7/ftplib.py
if self.debugging: print '*resp*', `resp`
if self.debugging: print '*resp*', self.sanitize(resp)
def getresp(self): resp = self.getmultiline() if self.debugging: print '*resp*', `resp` self.lastresp = resp[:3] c = resp[:1] if c == '4': raise error_temp, resp if c == '5': raise error_perm, resp if c not in '123': raise error_proto, resp return resp
ebaf104665158f0dd215062b699e7f1a2b4580b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebaf104665158f0dd215062b699e7f1a2b4580b7/ftplib.py
if self.debugging > 1: print '*put urgent*', `line`
if self.debugging > 1: print '*put urgent*', self.sanitize(line)
def abort(self): line = 'ABOR' + CRLF if self.debugging > 1: print '*put urgent*', `line` self.sock.send(line, MSG_OOB) resp = self.getmultiline() if resp[:3] not in ('426', '226'): raise error_proto, resp
ebaf104665158f0dd215062b699e7f1a2b4580b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebaf104665158f0dd215062b699e7f1a2b4580b7/ftplib.py
os.close(r2w[rd])
os.close(r2w[rd]) ; os.close( rd ) p.unregister( r2w[rd] ) p.unregister( rd )
def test_poll1(): """Basic functional test of poll object Create a bunch of pipe and test that poll works with them. """ print 'Running poll test 1' p = select.poll() NUM_PIPES = 12 MSG = " This is a test." MSG_LEN = len(MSG) readers = [] writers = [] r2w = {} w2r = {} for i in range(NUM_PIPES): rd, wr = os.pipe() p...
d50a1877ee51a275a132c05d89bac12958811a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d50a1877ee51a275a132c05d89bac12958811a5d/test_poll.py
if fdlist[0] == (p.fileno(),select.POLLHUP):
fd, flags = fdlist[0] if flags & select.POLLHUP:
def test_poll2(): print 'Running poll test 2' cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') pollster = select.poll() pollster.register( p, select.POLLIN ) for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10: if verbose: print 'timeout =', tout fdlist = pollster.pol...
d50a1877ee51a275a132c05d89bac12958811a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d50a1877ee51a275a132c05d89bac12958811a5d/test_poll.py
elif fdlist[0] == (p.fileno(),select.POLLIN):
elif flags & select.POLLIN:
def test_poll2(): print 'Running poll test 2' cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') pollster = select.poll() pollster.register( p, select.POLLIN ) for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10: if verbose: print 'timeout =', tout fdlist = pollster.pol...
d50a1877ee51a275a132c05d89bac12958811a5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d50a1877ee51a275a132c05d89bac12958811a5d/test_poll.py
self.text = text = Text(text_frame, name='text', padx=5, wrap=None,
self.text = text = Text(text_frame, name='text', padx=5, wrap='none',
def __init__(self, flist=None, filename=None, key=None, root=None): currentTheme=idleConf.CurrentTheme() self.flist = flist root = root or flist.root self.root = root self.menubar = Menu(root) self.top = top = self.Toplevel(root, menu=self.menubar) if flist: self.vars = flist.vars #self.top.instanceDict makes flist.inv...
a1dee069831c5551dc28d90d495ab5de967c17d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a1dee069831c5551dc28d90d495ab5de967c17d5/EditorWindow.py
setattr (self, 'install_' + key, scheme[key])
attrname = 'install_' + key if getattr(self, attrname) is None: setattr(self, attrname, scheme[key])
def select_scheme (self, name): # it's the caller's problem if they supply a bad name! scheme = INSTALL_SCHEMES[name] for key in ('purelib', 'platlib', 'scripts', 'data'): setattr (self, 'install_' + key, scheme[key])
17f641c1439585d10a7d03cd22067e2dd0db3ccf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17f641c1439585d10a7d03cd22067e2dd0db3ccf/install.py
raise ValueError("time data did not match format")
raise ValueError("time data did not match format: data=%s fmt=%s" % (data_string, format))
def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string.""" global _locale_cache global _regex_cache locale_time = _locale_cache.locale_time # If the language changes, caches are invalidated, so clear them if locale_time.lang != _getlang(): _locale...
4a6302b6fe1a0acb85267677a9be2ee925cf8248 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4a6302b6fe1a0acb85267677a9be2ee925cf8248/_strptime.py
- list: list of article ids"""
- list: list of message ids"""
def newnews(self, group, date, time, file=None): """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"""
5dbda75a0208d1e1acd1d3bf26c4c44df0897dae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5dbda75a0208d1e1acd1d3bf26c4c44df0897dae/nntplib.py
- id: the article id"""
- id: the message id"""
def stat(self, id): """Process a STAT command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: the article number - id: the article id"""
5dbda75a0208d1e1acd1d3bf26c4c44df0897dae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5dbda75a0208d1e1acd1d3bf26c4c44df0897dae/nntplib.py
self.file = self.make_file('')
self.file = self.__file = StringIO()
def read_lines(self): """Internal: read lines until EOF or outerboundary.""" self.file = self.make_file('') if self.outerboundary: self.read_lines_to_outerboundary() else: self.read_lines_to_eof()
52b8c29ca7172b4a6821e3e34b293562f3ae9a3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/52b8c29ca7172b4a6821e3e34b293562f3ae9a3f/cgi.py
self.file.write(line)
self.__write(line)
def read_lines_to_eof(self): """Internal: read lines until EOF.""" while 1: line = self.fp.readline() if not line: self.done = -1 break self.file.write(line)
52b8c29ca7172b4a6821e3e34b293562f3ae9a3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/52b8c29ca7172b4a6821e3e34b293562f3ae9a3f/cgi.py
self.file.write(odelim + line)
self.__write(odelim + line)
def read_lines_to_outerboundary(self): """Internal: read lines until outerboundary.""" next = "--" + self.outerboundary last = next + "--" delim = "" while 1: line = self.fp.readline() if not line: self.done = -1 break if line[:2] == "--": strippedline = line.strip() if strippedline == next: break if strippedline == la...
52b8c29ca7172b4a6821e3e34b293562f3ae9a3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/52b8c29ca7172b4a6821e3e34b293562f3ae9a3f/cgi.py
if err[0] = errno.EINTR:
if err[0] == errno.EINTR:
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
f3623f310e92ddb499e020635fe4977aae38a719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f3623f310e92ddb499e020635fe4977aae38a719/httplib.py
[frozenmain_c, frozen_c], target)
[frozenmain_c, os.path.basename(frozen_c)], os.path.basename(target))
def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path[:] modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # modules that are imported by the Python runtime implicits = ...
31d53ed93c82419a9b640daa86d162a6edcdc129 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/31d53ed93c82419a9b640daa86d162a6edcdc129/freeze.py
format = ' %' + directive
format = '%' + directive strf_output = time.strftime(format, tt)
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed...
e042601251e74a1c5bac287c936daa076b1f9a80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e042601251e74a1c5bac287c936daa076b1f9a80/test_time.py
time.strptime(time.strftime(format, tt), format)
time.strptime(strf_output, format)
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed...
e042601251e74a1c5bac287c936daa076b1f9a80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e042601251e74a1c5bac287c936daa076b1f9a80/test_time.py
self.fail('conversion specifier: %r failed.' % format)
self.fail("conversion specifier %r failed with '%s' input." % (format, strf_output))
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed...
e042601251e74a1c5bac287c936daa076b1f9a80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e042601251e74a1c5bac287c936daa076b1f9a80/test_time.py
if type(commandlist) == type(()) and len(commandlist[0]) > 1:
if type(commandlist[0]) == type(()) and len(commandlist[0]) > 1:
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return
0bb0a90b200ef40f812b70c2623c7062cd39f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0bb0a90b200ef40f812b70c2623c7062cd39f3b3/EasyDialogs.py
if type(optionlist) == type(()): option = optionlist[idx][0] else: option = optionlist[idx]
option = optionlist[idx] if type(option) == type(()): option = option[0]
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return
0bb0a90b200ef40f812b70c2623c7062cd39f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0bb0a90b200ef40f812b70c2623c7062cd39f3b3/EasyDialogs.py
if 0 <= idx < len(commandlist) and type(commandlist) == type(()) and \
if 0 <= idx < len(commandlist) and type(commandlist[idx]) == type(()) and \
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return
0bb0a90b200ef40f812b70c2623c7062cd39f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0bb0a90b200ef40f812b70c2623c7062cd39f3b3/EasyDialogs.py
if type(commandlist) == type(()): stringstoadd = [commandlist[idx][0]] else: stringstoadd = [commandlist[idx]]
command = commandlist[idx] if type(command) == type(()): command = command[0] stringstoadd = [command]
def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfolder=1, id=ARGV_ID): d = GetNewDialog(id, -1) if not d: print "Can't get DLOG resource with id =", id return
0bb0a90b200ef40f812b70c2623c7062cd39f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0bb0a90b200ef40f812b70c2623c7062cd39f3b3/EasyDialogs.py
if not grouping:return s
if not grouping:return (s, 0)
def _group(s): conv=localeconv() grouping=conv['grouping'] if not grouping:return s result="" seps = 0 spaces = "" if s[-1] == ' ': sp = s.find(' ') spaces = s[sp:] s = s[:sp] while s and grouping: # if grouping is -1, we are done if grouping[0]==CHAR_MAX: break # 0: re-use last group ad infinitum elif grouping[0]!=0: ...
67addfe2a87d22458323e268d2bcc7406e6febc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/67addfe2a87d22458323e268d2bcc7406e6febc2/locale.py
print sys.exc_value
def test(name, input, output): f = getattr(strop, name) try: value = f(input) except: value = sys.exc_type print sys.exc_value if value != output: print f, `input`, `output`, `value`
6592f88fc0598aa465f214de0dd4eb5c58229976 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6592f88fc0598aa465f214de0dd4eb5c58229976/test_strop.py
if line == '?': line = 'help' elif line == '!':
if not line: return self.emptyline() elif line[0] == '?': line = 'help ' + line[1:] elif line[0] == '!':
def onecmd(self, line): line = string.strip(line) if line == '?': line = 'help' elif line == '!': if hasattr(self, 'do_shell'): line = 'shell' else: return self.default(line) elif not line: return self.emptyline() self.lastcmd = line i, n = 0, len(line) while i < n and line[i] in self.identchars: i = i+1 cmd, arg = lin...
5f1b27084aacc2975b3f94e7b225215066f4e1e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f1b27084aacc2975b3f94e7b225215066f4e1e2/cmd.py
line = 'shell'
line = 'shell ' + line[1:]
def onecmd(self, line): line = string.strip(line) if line == '?': line = 'help' elif line == '!': if hasattr(self, 'do_shell'): line = 'shell' else: return self.default(line) elif not line: return self.emptyline() self.lastcmd = line i, n = 0, len(line) while i < n and line[i] in self.identchars: i = i+1 cmd, arg = lin...
5f1b27084aacc2975b3f94e7b225215066f4e1e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f1b27084aacc2975b3f94e7b225215066f4e1e2/cmd.py
elif not line: return self.emptyline()
def onecmd(self, line): line = string.strip(line) if line == '?': line = 'help' elif line == '!': if hasattr(self, 'do_shell'): line = 'shell' else: return self.default(line) elif not line: return self.emptyline() self.lastcmd = line i, n = 0, len(line) while i < n and line[i] in self.identchars: i = i+1 cmd, arg = lin...
5f1b27084aacc2975b3f94e7b225215066f4e1e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f1b27084aacc2975b3f94e7b225215066f4e1e2/cmd.py
SyntaxError: 'yield' outside function (<doctest test.test_generators.__test__.coroutine[10]>, line 1)
SyntaxError: 'yield' outside function (<doctest test.test_generators.__test__.coroutine[21]>, line 1)
>>> def f(): list(i for i in [(yield 26)])
0d62a062066a4cbc8aabab9c305d60ebf7922c8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0d62a062066a4cbc8aabab9c305d60ebf7922c8c/test_generators.py
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.coroutine[11]>, line 1)
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.coroutine[22]>, line 1)
>>> def f(): return lambda x=(yield): 1
0d62a062066a4cbc8aabab9c305d60ebf7922c8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0d62a062066a4cbc8aabab9c305d60ebf7922c8c/test_generators.py
SyntaxError: assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[12]>, line 1)
SyntaxError: assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[23]>, line 1) >>> def f(): (yield bar) = y Traceback (most recent call last): ... SyntaxError: can't assign to yield expression (<doctest test.test_generators.__test__.coroutine[24]>, line 1) >>> def f(): (yield...
>>> def f(): x = yield = y
0d62a062066a4cbc8aabab9c305d60ebf7922c8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0d62a062066a4cbc8aabab9c305d60ebf7922c8c/test_generators.py
g['SO'] = '.ppc.slb'
g['SO'] = '.ppc.slb'
def _init_mac(): """Initialize the module as appropriate for Macintosh systems""" g = {} # set basic install directories g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1) g['BINLIBDEST'] = get_python_lib(plat_specific=1, standard_lib=1) # XXX hmmm.. a normal install puts include files here g['INCLUDEPY'] ...
99f9baa33190482784900970fd3e1c76e7cb48d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/99f9baa33190482784900970fd3e1c76e7cb48d6/sysconfig.py
libraries, extradirs, extraexportsymbols)
libraries, extradirs, extraexportsymbols, outputdir)
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier...
7586b049ba2cfbf6a67b2deaeadb36603a1bb346 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7586b049ba2cfbf6a67b2deaeadb36603a1bb346/genpluginprojects.py
libraries, extradirs, extraexportsymbols)
libraries, extradirs, extraexportsymbols, outputdir)
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier...
7586b049ba2cfbf6a67b2deaeadb36603a1bb346 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7586b049ba2cfbf6a67b2deaeadb36603a1bb346/genpluginprojects.py
genpluginproject("ppc", "Icn", libraries=["IconServicesLib"])
genpluginproject("ppc", "Icn", libraries=["IconServicesLib"], outputdir="::Lib:Carbon")
def genpluginproject(architecture, module, project=None, projectdir=None, sources=[], sourcedirs=[], libraries=[], extradirs=[], extraexportsymbols=[], outputdir=":::Lib:lib-dynload"): if architecture == "all": # For the time being we generate two project files. Not as nice as # a single multitarget project, but easier...
7586b049ba2cfbf6a67b2deaeadb36603a1bb346 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7586b049ba2cfbf6a67b2deaeadb36603a1bb346/genpluginprojects.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...
1baa22aff0a9cde81e2b19b36662e7987b83356b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1baa22aff0a9cde81e2b19b36662e7987b83356b/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
1baa22aff0a9cde81e2b19b36662e7987b83356b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1baa22aff0a9cde81e2b19b36662e7987b83356b/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
1baa22aff0a9cde81e2b19b36662e7987b83356b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1baa22aff0a9cde81e2b19b36662e7987b83356b/tempfile.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
bad8ff089a04372465c3143a3567b9712673c155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bad8ff089a04372465c3143a3567b9712673c155/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
bad8ff089a04372465c3143a3567b9712673c155 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bad8ff089a04372465c3143a3567b9712673c155/test_datetime.py
cdll.load('libGL.so', mode=RTLD_GLOBAL) cdll.load('libGLU.so')
if os.path.exists('/usr/lib/libGL.so'): cdll.load('libGL.so', mode=RTLD_GLOBAL) if os.path.exists('/usr/lib/libGLU.so'): cdll.load('libGLU.so')
def test_GL(self): cdll.load('libGL.so', mode=RTLD_GLOBAL) cdll.load('libGLU.so')
23e408603cffc2c1e515230deb7239e95f6173cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/23e408603cffc2c1e515230deb7239e95f6173cb/test_posix.py
gp.pixmode(GL.PM_RTOL, 1)
gl.pixmode(GL.PM_RTOL, 1)
def showpartframe(self, data, chromdata, (x,y,w,h)): pmsize = self.bpp xpf, ypf = self.xpf, self.ypf if self.upside_down: gl.pixmode(GL.PM_TTOB, 1) if self.mirror_image: gp.pixmode(GL.PM_RTOL, 1) if self.format in ('jpeg', 'jpeggrey'): import jpeg data, width, height, bytes = jpeg.decompress(data) pmsize = bytes*8 elif...
f993d287946d9fc4d9d7172bf66cce44c253851e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f993d287946d9fc4d9d7172bf66cce44c253851e/VFile.py
def testPackageRequire(self): tcl = self.interp tcl.eval('package require Tclx') tcl.eval('keylset a b.c 1') self.assertEqual(tcl.eval('keylget a b.c'),'1')
def testPackageRequire(self): tcl = self.interp tcl.eval('package require Tclx') tcl.eval('keylset a b.c 1') self.assertEqual(tcl.eval('keylget a b.c'),'1')
1c5701d36ce4185f2a7dec408d1dc75abb87bca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5701d36ce4185f2a7dec408d1dc75abb87bca6/test_tcl.py
if sys.platform.startswith('win'):
if sys.platform.startswith('win') or sys.platform.startswith('darwin'):
def testLoadTkFailure(self): import os old_display = None import sys if sys.platform.startswith('win'): return # no failure possible on windows? if 'DISPLAY' in os.environ: old_display = os.environ['DISPLAY'] del os.environ['DISPLAY'] # on some platforms, deleting environment variables # doesn't actually carry through ...
1c5701d36ce4185f2a7dec408d1dc75abb87bca6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c5701d36ce4185f2a7dec408d1dc75abb87bca6/test_tcl.py
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')
5399c6d3d4cf9496b46ce9f37975d6c8107a743d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5399c6d3d4cf9496b46ce9f37975d6c8107a743d/setup.py
env_val = os.getenv(env_var)
env_val = sysconfig.get_config_var(env_var)
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')
5399c6d3d4cf9496b46ce9f37975d6c8107a743d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5399c6d3d4cf9496b46ce9f37975d6c8107a743d/setup.py
elif sys.platform[:5] == "hp-ux":
elif sys.platform[:5] == "hp-ux":
def runtime_library_dir_option(self, dir): # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # d...
19c0d943e952b57ded7c7dbad228092b347649b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19c0d943e952b57ded7c7dbad228092b347649b2/unixccompiler.py
elif compiler[:3] == "gcc" or compiler[:3] == "g++":
elif compiler[:3] == "gcc" or compiler[:3] == "g++":
def runtime_library_dir_option(self, dir): # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # d...
19c0d943e952b57ded7c7dbad228092b347649b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19c0d943e952b57ded7c7dbad228092b347649b2/unixccompiler.py
def __init__(self):
def __init__(self, allow_none):
def __init__(self): self.funcs = {} self.instance = None
10a16dea7422a578a2d49a778c5aceb54d2126d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10a16dea7422a578a2d49a778c5aceb54d2126d2/SimpleXMLRPCServer.py
response = xmlrpclib.dumps(response, methodresponse=1)
response = xmlrpclib.dumps(response, methodresponse=1, allow_none = self.allow_none)
def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data.
10a16dea7422a578a2d49a778c5aceb54d2126d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10a16dea7422a578a2d49a778c5aceb54d2126d2/SimpleXMLRPCServer.py
logRequests=1):
logRequests=1, allow_none=False):
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.logRequests = logRequests
10a16dea7422a578a2d49a778c5aceb54d2126d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10a16dea7422a578a2d49a778c5aceb54d2126d2/SimpleXMLRPCServer.py
SimpleXMLRPCDispatcher.__init__(self)
SimpleXMLRPCDispatcher.__init__(self, allow_none)
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=1): self.logRequests = logRequests
10a16dea7422a578a2d49a778c5aceb54d2126d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10a16dea7422a578a2d49a778c5aceb54d2126d2/SimpleXMLRPCServer.py
def __init__(self): SimpleXMLRPCDispatcher.__init__(self)
def __init__(self, allow_none=False): SimpleXMLRPCDispatcher.__init__(self, allow_none)
def __init__(self): SimpleXMLRPCDispatcher.__init__(self)
10a16dea7422a578a2d49a778c5aceb54d2126d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10a16dea7422a578a2d49a778c5aceb54d2126d2/SimpleXMLRPCServer.py
def test_getitem(self): class GetItem(object):
def _getitem_helper(self, base): class GetItem(base):
def test_getitem(self): class GetItem(object): def __len__(self): return maxint def __getitem__(self, key): return key def __getslice__(self, i, j): return i, j x = GetItem() self.assertEqual(x[self.pos], self.pos) self.assertEqual(x[self.neg], self.neg) self.assertEqual(x[self.neg:self.pos], (-1, maxint)) self.assertE...
1872b1c01f343f4cbfa7696ce95beae8278ce210 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1872b1c01f343f4cbfa7696ce95beae8278ce210/test_index.py
def __div__(self, other): return "B.__div__" def __rdiv__(self, other): return "B.__rdiv__" vereq(B(1) / 1, "B.__div__") vereq(1 / B(1), "B.__rdiv__")
def __floordiv__(self, other): return "B.__floordiv__" def __rfloordiv__(self, other): return "B.__rfloordiv__" vereq(B(1) // 1, "B.__floordiv__") vereq(1 // B(1), "B.__rfloordiv__")
def __div__(self, other): return "B.__div__"
f389c7727362321a91dbaff13b7e1cef6cbaa3d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f389c7727362321a91dbaff13b7e1cef6cbaa3d8/test_descr.py
def __div__(self, other): return "C.__div__" def __rdiv__(self, other): return "C.__rdiv__" vereq(C() / 1, "C.__div__") vereq(1 / C(), "C.__rdiv__")
def __floordiv__(self, other): return "C.__floordiv__" def __rfloordiv__(self, other): return "C.__rfloordiv__" vereq(C() // 1, "C.__floordiv__") vereq(1 // C(), "C.__rfloordiv__")
def __div__(self, other): return "C.__div__"
f389c7727362321a91dbaff13b7e1cef6cbaa3d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f389c7727362321a91dbaff13b7e1cef6cbaa3d8/test_descr.py
def __div__(self, other): return "D.__div__" def __rdiv__(self, other): return "D.__rdiv__" vereq(D() / C(), "D.__div__") vereq(C() / D(), "D.__rdiv__")
def __floordiv__(self, other): return "D.__floordiv__" def __rfloordiv__(self, other): return "D.__rfloordiv__" vereq(D() // C(), "D.__floordiv__") vereq(C() // D(), "D.__rfloordiv__")
def __div__(self, other): return "D.__div__"
f389c7727362321a91dbaff13b7e1cef6cbaa3d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f389c7727362321a91dbaff13b7e1cef6cbaa3d8/test_descr.py
vereq(E.__rdiv__, C.__rdiv__) vereq(E() / 1, "C.__div__") vereq(1 / E(), "C.__rdiv__") vereq(E() / C(), "C.__div__") vereq(C() / E(), "C.__div__")
vereq(E.__rfloordiv__, C.__rfloordiv__) vereq(E() // 1, "C.__floordiv__") vereq(1 // E(), "C.__rfloordiv__") vereq(E() // C(), "C.__floordiv__") vereq(C() // E(), "C.__floordiv__")
def __rdiv__(self, other): return "D.__rdiv__"
f389c7727362321a91dbaff13b7e1cef6cbaa3d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f389c7727362321a91dbaff13b7e1cef6cbaa3d8/test_descr.py
timeout = int(timeout*1000)
if timeout is not None: timeout = int(timeout*1000)
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.items(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.append ((fd, flags)) r = poll.pol...
f6cc07cffe902d8faef5f3cce7a2ea8cda939e02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f6cc07cffe902d8faef5f3cce7a2ea8cda939e02/asyncore.py
timeout = int(timeout*1000)
if timeout is not None: timeout = int(timeout*1000)
def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.POLLIN if obj.writable(): ...
f6cc07cffe902d8faef5f3cce7a2ea8cda939e02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f6cc07cffe902d8faef5f3cce7a2ea8cda939e02/asyncore.py
"".join(map(lambda i: "0123456789ABCDEF"[i], digits)) + "L"
"".join(map(lambda i: "0123456789abcdef"[i], digits)) + "L"
def slow_format(self, x, base): if (x, base) == (0, 8): # this is an oddball! return "0L" digits = [] sign = 0 if x < 0: sign, x = 1, -x while x: x, r = divmod(x, base) digits.append(int(r)) digits.reverse() digits = digits or [0] return '-'[:sign] + \ {8: '0', 10: '', 16: '0x'}[base] + \ "".join(map(lambda i: "0123456...
3296e696db4e46f63f7a5348ac977b2b0a32ecbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3296e696db4e46f63f7a5348ac977b2b0a32ecbc/test_long.py
if not self.have_fork: for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE'): env.setdefault(k, "")
for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH', 'HTTP_USER_AGENT', 'HTTP_COOKIE'): env.setdefault(k, "")
def run_cgi(self): """Execute a CGI script.""" dir, rest = self.cgi_info i = rest.rfind('?') if i >= 0: rest, query = rest[:i], rest[i+1:] else: query = '' i = rest.find('/') if i >= 0: script, rest = rest[:i], rest[i:] else: script, rest = rest, '' scriptname = dir + '/' + script scriptfile = self.translate_path(scrip...
70ec0b42b581014f5c8c9092720a26a1988ce0e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/70ec0b42b581014f5c8c9092720a26a1988ce0e9/CGIHTTPServer.py
'UNICODE': ('ref/unicode', 'encodings unicode TYPES STRING'),
'UNICODE': ('ref/strings', 'encodings unicode TYPES STRING'),
def writedocs(dir, pkgpath='', done=None): """Write out HTML documentation for all modules in a directory tree.""" if done is None: done = {} for file in os.listdir(dir): path = os.path.join(dir, file) if ispackage(path): writedocs(path, pkgpath + file + '.', done) elif os.path.isfile(path): modname = inspect.getmodule...
f98159c376bd133a0e66a7f8ebf25a0a4516d955 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f98159c376bd133a0e66a7f8ebf25a0a4516d955/pydoc.py
'BOOLEAN': ('ref/lambda', 'EXPRESSIONS TRUTHVALUE'),
'BOOLEAN': ('ref/Booleans', 'EXPRESSIONS TRUTHVALUE'),
'METHODS': ('lib/typesmethods', 'class def CLASSES TYPES'),
f98159c376bd133a0e66a7f8ebf25a0a4516d955 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f98159c376bd133a0e66a7f8ebf25a0a4516d955/pydoc.py
self.fileobj.write(struct.pack("<L", self.pos))
self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFFL))
def close(self): """Close the _Stream object. No operation should be done on it afterwards. """ if self.closed: return
10a444965dd537f4fc0483e960941cfdac8b2e11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10a444965dd537f4fc0483e960941cfdac8b2e11/tarfile.py
exts.append( Extension('_md5', ['md5module.c', 'md5c.c']) )
exts.append( Extension('_md5', ['md5module.c', 'md5.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')
8e39ec78bcede7291e0573fc522425221eb05475 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8e39ec78bcede7291e0573fc522425221eb05475/setup.py
return HEAD % self.variables
s = HEAD % self.variables if self.uplink: if self.uptitle: link = ('<link rel="up" href="%s" title="%s">' % (self.uplink, self.uptitle)) else: link = '<link rel="up" href="%s">' % self.uplink repl = " %s\n</head>" % link s = s.replace("</head>", repl, 1) return s
def get_header(self): return HEAD % self.variables
f10584cb112c89da87d7d4b524851226ee7f9406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f10584cb112c89da87d7d4b524851226ee7f9406/support.py
urllib.urlopen, "http://www.sadflkjsasadf.com/")
urllib.urlopen, "http://www.python.invalid/")
def test_bad_address(self): # Make sure proper exception is raised when connecting to a bogus # address. self.assertRaises(IOError, urllib.urlopen, "http://www.sadflkjsasadf.com/")
0aab0020573771e224ebc0e94b2c5adf565fb4f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0aab0020573771e224ebc0e94b2c5adf565fb4f6/test_urllibnet.py
test(r"""sre.match(r"\%03o" % i, chr(i)) != None""", 1) test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") != None""", 1) test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1) test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match(r"\x...
test(r"""sre.match(r"\%03o" % i, chr(i)) is not None""", 1) test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") is not None""", 1) test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") is not None""", 1) test(r"""sre.match(r"\x%02x" % i, chr(i)) is not None""", 1) test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") is not None""", 1) tes...
def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_...
538f05c94dcf9e4ebe4779ccdc86ba238d885dc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/538f05c94dcf9e4ebe4779ccdc86ba238d885dc6/test_sre.py
test(r"""sre.match(sre.escape(chr(i)), chr(i)) != None""", 1)
test(r"""sre.match(sre.escape(chr(i)), chr(i)) is not None""", 1)
def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1)
538f05c94dcf9e4ebe4779ccdc86ba238d885dc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/538f05c94dcf9e4ebe4779ccdc86ba238d885dc6/test_sre.py
test(r"""pat.match(p) != None""", 1)
test(r"""pat.match(p) is not None""", 1)
def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1)
538f05c94dcf9e4ebe4779ccdc86ba238d885dc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/538f05c94dcf9e4ebe4779ccdc86ba238d885dc6/test_sre.py
def _verify(name, expected): computed = eval(name)
def _verify(name, computed, expected):
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
dc47a89ff19b932c1c794422a5223847b4e64f0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc47a89ff19b932c1c794422a5223847b4e64f0e/random.py
_verify('NV_MAGICCONST', 1.71552776992141)
_verify('NV_MAGICCONST', NV_MAGICCONST, 1.71552776992141)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
dc47a89ff19b932c1c794422a5223847b4e64f0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc47a89ff19b932c1c794422a5223847b4e64f0e/random.py
_verify('TWOPI', 6.28318530718)
_verify('TWOPI', TWOPI, 6.28318530718)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
dc47a89ff19b932c1c794422a5223847b4e64f0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc47a89ff19b932c1c794422a5223847b4e64f0e/random.py
_verify('LOG4', 1.38629436111989)
_verify('LOG4', LOG4, 1.38629436111989)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
dc47a89ff19b932c1c794422a5223847b4e64f0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc47a89ff19b932c1c794422a5223847b4e64f0e/random.py
_verify('SG_MAGICCONST', 2.50407739677627)
_verify('SG_MAGICCONST', SG_MAGICCONST, 2.50407739677627)
def _verify(name, expected): computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( "computed value for %s deviates too much " "(computed %g, expected %g)" % (name, computed, expected))
dc47a89ff19b932c1c794422a5223847b4e64f0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dc47a89ff19b932c1c794422a5223847b4e64f0e/random.py
(code, resp) = self.docmd(encode_base64(user, eol=""))
(code, resp) = self.docmd(encode_base64(password, eol=""))
def encode_plain(user, password): return encode_base64("%s\0%s\0%s" % (user, user, password), eol="")
49c05d39e3a5f609a13322bbbbd507a2bc3fc252 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/49c05d39e3a5f609a13322bbbbd507a2bc3fc252/smtplib.py
class IEEEOperationsTestCase(unittest.TestCase): if float.__getformat__("double").startswith("IEEE"): def test_double_infinity(self): big = 4.8e159 pro = big*big self.assertEquals(repr(pro), 'inf') sqr = big**2 self.assertEquals(repr(sqr), 'inf')
def test_float_specials_do_unpack(self): for fmt, data in [('>f', BE_FLOAT_INF), ('>f', BE_FLOAT_NAN), ('<f', LE_FLOAT_INF), ('<f', LE_FLOAT_NAN)]: struct.unpack(fmt, data)
348dc88097412cc229254f20f2759ce4cd192261 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/348dc88097412cc229254f20f2759ce4cd192261/test_float.py
IEEEFormatTestCase, IEEEOperationsTestCase, )
IEEEFormatTestCase)
def test_main(): test_support.run_unittest( FormatFunctionsTestCase, UnknownFormatTestCase, IEEEFormatTestCase, IEEEOperationsTestCase, )
348dc88097412cc229254f20f2759ce4cd192261 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/348dc88097412cc229254f20f2759ce4cd192261/test_float.py
element = _encode(element)
def beginElement(self, element): self.stack.append(element) element = _encode(element) self.writeln("<%s>" % element) self.indentLevel += 1
10263d6e6b14fb55bca63735f2508ee8e269526c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10263d6e6b14fb55bca63735f2508ee8e269526c/plistlib.py
element = _encode(element)
def simpleElement(self, element, value=None): if value: element = _encode(element) value = _encode(value) self.writeln("<%s>%s</%s>" % (element, value, element)) else: self.writeln("<%s/>" % element)
10263d6e6b14fb55bca63735f2508ee8e269526c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10263d6e6b14fb55bca63735f2508ee8e269526c/plistlib.py
"""Dict wrapper for convenient acces of values through attributes."""
"""Dict wrapper for convenient access of values through attributes."""
def writeArray(self, array): self.beginElement("array") for value in array: self.writeValue(value) self.endElement("array")
10263d6e6b14fb55bca63735f2508ee8e269526c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10263d6e6b14fb55bca63735f2508ee8e269526c/plistlib.py
Foo="Doodah", aList=["A", "B", 12, 32.1, [1, 2, 3]], aFloat = 0.1, anInt = 728, aDict=Dict( aString="<hello & hi there!>", SomeUnicodeValue=u'M\xe4ssig, Ma\xdf', someTrueValue=True, someFalseValue=False, ), someData = Data("hello there!"), someMoreData = Data("hello there! " * 10), aDate = Date(time.mktime(time.gmtime(...
aString="Doodah", aList=["A", "B", 12, 32.1, [1, 2, 3]], aFloat = 0.1, anInt = 728, aDict=Dict( anotherString="<hello & hi there!>", aUnicodeValue=u'M\xe4ssig, Ma\xdf', aTrueValue=True, aFalseValue=False, ), someData = Data("<binary gunk>"), someMoreData = Data("<lots of binary gunk>" * 10), aDate = Date(time.mktime(ti...
def __repr__(self): if self: return "True" else: return "False"
10263d6e6b14fb55bca63735f2508ee8e269526c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10263d6e6b14fb55bca63735f2508ee8e269526c/plistlib.py
while n > 0 and line[n-1] in (' ', '\t'):
while n > 0 and line[n-1] in " \t\r":
def decode(input, output): """Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods.""" new = '' while 1: line = input.readline() if not line: break i, n = 0, len(line) if n > 0 and line[n-1] == '\n': partial = 0; n = n-1 # Strip traili...
14b90a498ff4c06c9879b9362542a263ae0b9b05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/14b90a498ff4c06c9879b9362542a263ae0b9b05/quopri.py
data, width, height, bytesperpixel = jpeg.decompress(data)
data, width, height, bytesperpixel = jpeg.decompress(img)
def jpeggrey2grey(img, width, height): import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 1: raise RuntimeError, 'not grayscale jpeg' return data
be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39/imgconv.py
data, width, height, bytesperpixel = jpeg.decompress(data)
data, width, height, bytesperpixel = jpeg.decompress(img)
def jpeg2rgb(img, width, height): import cl, CL import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 4: raise RuntimeError, 'not rgb jpeg' return data
be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39/imgconv.py
('grey', 'jpeggrey',grey2jpeggrey, NOT_LOSSY), \
('grey', 'jpeggrey',grey2jpeggrey, LOSSY), \
def jpeg2rgb(img, width, height): import cl, CL import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 4: raise RuntimeError, 'not rgb jpeg' return data
be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39/imgconv.py
('rgb', 'jpeg', rgb2jpeg, NOT_LOSSY), \
('rgb', 'jpeg', rgb2jpeg, LOSSY), \
def jpeg2rgb(img, width, height): import cl, CL import jpeg data, width, height, bytesperpixel = jpeg.decompress(data) if bytesperpixel <> 4: raise RuntimeError, 'not rgb jpeg' return data
be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/be6d77a9b8b4e97ff2892eddb9c54c5d81a79e39/imgconv.py
[3:] intact. [0] = Time that needs to be charged to the parent frame's function. It is used so that a function call will not have to access the timing data for the parent frame. [1] = Total time spent in this frame's function, excluding time in subfunctions [2] = Cumulative time spent in this frame's function, includi...
[-2:] intact (frame and previous tuple). In case an internal error is detected, the -3 element is used as the function name. [ 0] = Time that needs to be charged to the parent frame's function. It is used so that a function call will not have to access the timing data for the parent frame. [ 1] = Total time spent in ...
def _get_time_times(timer=os.times): t = timer() return t[0] + t[1]
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
self.timings[]. The index is always the name stored in self.cur[4].
self.timings[]. The index is always the name stored in self.cur[-3].
def _get_time_times(timer=os.times): t = timer() return t[0] + t[1]
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
if self.cur and frame.f_back is not self.cur[4]:
if self.cur and frame.f_back is not self.cur[-2]:
def trace_dispatch_call(self, frame, t): if self.cur and frame.f_back is not self.cur[4]: rt, rtt, rct, rfn, rframe, rcur = self.cur if not isinstance(rframe, Profile.fake_frame): if rframe.f_back is not frame.f_back: print rframe, rframe.f_back print frame, frame.f_back raise "Bad call", self.cur[3] self.trace_dispatc...
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
raise "Bad call", self.cur[3]
raise "Bad call", self.cur[-3]
def trace_dispatch_call(self, frame, t): if self.cur and frame.f_back is not self.cur[4]: rt, rtt, rct, rfn, rframe, rcur = self.cur if not isinstance(rframe, Profile.fake_frame): if rframe.f_back is not frame.f_back: print rframe, rframe.f_back print frame, frame.f_back raise "Bad call", self.cur[3] self.trace_dispatc...
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
if self.cur and frame.f_back is not self.cur[4]: raise "Bad call[2]", self.cur[3]
if self.cur and frame.f_back is not self.cur[-2]: raise "Bad call[2]", self.cur[-3]
def trace_dispatch_call(self, frame, t): if self.cur and frame.f_back is not self.cur[4]: rt, rtt, rct, rfn, rframe, rcur = self.cur if not isinstance(rframe, Profile.fake_frame): if rframe.f_back is not frame.f_back: print rframe, rframe.f_back print frame, frame.f_back raise "Bad call", self.cur[3] self.trace_dispatc...
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
if frame is not self.cur[4]: if frame is self.cur[4].f_back: self.trace_dispatch_return(self.cur[4], 0)
if frame is not self.cur[-2]: if frame is self.cur[-2].f_back: self.trace_dispatch_return(self.cur[-2], 0)
def trace_dispatch_return(self, frame, t): if frame is not self.cur[4]: if frame is self.cur[4].f_back: self.trace_dispatch_return(self.cur[4], 0) else: raise "Bad return", self.cur[3]
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
raise "Bad return", self.cur[3]
raise "Bad return", self.cur[-3]
def trace_dispatch_return(self, frame, t): if frame is not self.cur[4]: if frame is self.cur[4].f_back: self.trace_dispatch_return(self.cur[4], 0) else: raise "Bad return", self.cur[3]
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
if self.cur[5]: return
if self.cur[-1]: return
def set_cmd(self, cmd): if self.cur[5]: return # already set self.cmd = cmd self.simulate_call(cmd)
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
pframe = self.cur[4]
pframe = self.cur[-2]
def simulate_call(self, name): code = self.fake_code('profile', 0, name) if self.cur: pframe = self.cur[4] else: pframe = None frame = self.fake_frame(code, pframe) a = self.dispatch['call'](self, frame, 0) return
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py
while self.cur[5]:
while self.cur[-1]:
def simulate_cmd_complete(self): get_time = self.get_time t = get_time() - self.t while self.cur[5]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! a = self.dispatch['return'](self, self.cur[4], t) t = 0 self.t = get_time() - t
df5cfd884d5da8a9a0b620b232f9ecfea6f77224 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df5cfd884d5da8a9a0b620b232f9ecfea6f77224/profile.py