rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
expected = longx // longy got = x // y
expected = longx / longy got = x / y
def checkit(*args): # Heavy use of nested scopes here! verify(got == expected, "for %r expected %r got %r" % (args, expected, got))
3de245bd9e6e977edf0f52dd6adba5e57c0c3cdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3de245bd9e6e977edf0f52dd6adba5e57c0c3cdc/test_long.py
if importer in (None, True, False):
if importer is None:
def get_importer(path_item): """Retrieve a PEP 302 importer for the given path item The returned importer is cached in sys.path_importer_cache if it was newly created by a path hook. If there is no importer, a wrapper around the basic import machinery is returned. This wrapper is never inserted into the importer cach...
8a611a4b2a6cca42fdd7bf76558cc424bfcdab44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8a611a4b2a6cca42fdd7bf76558cc424bfcdab44/pkgutil.py
tcl_version = self.tk.getvar('tcl_version')
tcl_version = str(self.tk.getvar('tcl_version'))
def __init__(self, screenName=None, baseName=None, className='Tk'): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is given. CLA...
69bf992a9cc282c0d3fe42640cbbc6b944807671 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69bf992a9cc282c0d3fe42640cbbc6b944807671/Tkinter.py
except:
except ValueError:
def do_clear(self, arg): """Three possibilities, tried in this order: clear -> clear all breaks, ask for confirmation clear file:lineno -> clear all breaks at file:lineno clear bpno bpno ... -> clear breakpoints by number""" if not arg: try: reply = raw_input('Clear all breaks? ') except EOFError: reply = 'no' reply = ...
d7c47443e344fd8563ed4632ded41d604c43f436 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d7c47443e344fd8563ed4632ded41d604c43f436/pdb.py
del context[objid]
del context[objid]
def __format(self, object, stream, indent, allowance, context, level): level = level + 1 if context.has_key(id(object)): object = _Recursion(object) self.__recursive = 1 rep = self.__repr(object, context, level - 1) objid = id(object) context[objid] = 1 typ = type(object) sepLines = len(rep) > (self.__width - 1 - inden...
deaab478cf979ca5099b3fc2f8eb5d1bba4014e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/deaab478cf979ca5099b3fc2f8eb5d1bba4014e2/pprint.py
def test_monotonic(self): data = hamlet_scene * 8 * 16 last = length = len(zlib.compress(data, 0)) self.failUnless(last > len(data), "compress level 0 always expands") for level in range(10): length = len(zlib.compress(data, level)) self.failUnless(length <= last, 'compress level %d more effective than %d!' % ( level-...
def test_monotonic(self): # higher compression levels should not expand compressed size data = hamlet_scene * 8 * 16 last = length = len(zlib.compress(data, 0)) self.failUnless(last > len(data), "compress level 0 always expands") for level in range(10): length = len(zlib.compress(data, level)) self.failUnless(length <=...
a8accbc986b049cf9c4115d93a8afbee1e8b4084 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a8accbc986b049cf9c4115d93a8afbee1e8b4084/test_zlib.py
def urlencode(dict): """Encode a dictionary of form entries into a URL query string."""
def urlencode(dict,doseq=0): """Encode a dictionary of form entries into a URL query string. If any values in the dict are sequences and doseq is true, each sequence element is converted to a separate parameter. """
def urlencode(dict): """Encode a dictionary of form entries into a URL query string.""" l = [] for k, v in dict.items(): k = quote_plus(str(k)) v = quote_plus(str(v)) l.append(k + '=' + v) return '&'.join(l)
dc96718325c24bb87c4eb4e181acb45ca3ecc26e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dc96718325c24bb87c4eb4e181acb45ca3ecc26e/urllib.py
for k, v in dict.items(): k = quote_plus(str(k)) v = quote_plus(str(v)) l.append(k + '=' + v)
if not doseq: for k, v in dict.items(): k = quote_plus(str(k)) v = quote_plus(str(v)) l.append(k + '=' + v) else: for k, v in dict.items(): k = quote_plus(str(k)) if type(v) == types.StringType: v = quote_plus(v) l.append(k + '=' + v) elif type(v) == types.UnicodeType: v = quote_plus(v.encode("ASCII","replace")) l....
def urlencode(dict): """Encode a dictionary of form entries into a URL query string.""" l = [] for k, v in dict.items(): k = quote_plus(str(k)) v = quote_plus(str(v)) l.append(k + '=' + v) return '&'.join(l)
dc96718325c24bb87c4eb4e181acb45ca3ecc26e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dc96718325c24bb87c4eb4e181acb45ca3ecc26e/urllib.py
def _get_tagged_response(self, tag):
381ebd9c81ad673a385463386d53d9af3ce7a1fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/381ebd9c81ad673a385463386d53d9af3ce7a1fc/imaplib.py
_mesg('abort exception ignored: %s' % val)
def _get_tagged_response(self, tag):
381ebd9c81ad673a385463386d53d9af3ce7a1fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/381ebd9c81ad673a385463386d53d9af3ce7a1fc/imaplib.py
code = compile(line + '\n', '<stdin>', 'single')
def default(self, line): if line[:1] == '!': line = line[1:] locals = self.curframe.f_locals globals = self.curframe.f_globals globals['__privileged__'] = 1 code = compile(line + '\n', '<stdin>', 'single') try: exec code in globals, locals except: if type(sys.exc_type) == type(''): exc_type_name = sys.exc_type else: ex...
ca512bb388cb3d32f989c6cf7c1aca0ffc0f9ee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca512bb388cb3d32f989c6cf7c1aca0ffc0f9ee7/pdb.py
""" Check whether 'str' contains ANY of the chars in 'set' """
"""Check whether 'str' contains ANY of the chars in 'set'"""
def containsAny(str, set): """ Check whether 'str' contains ANY of the chars in 'set' """ return 1 in [c in str for c in set]
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
""" Helper for getFilesForName(). """
"""Helper for getFilesForName()."""
def _visit_pyfiles(list, dirname, names): """ Helper for getFilesForName(). """ # get extension for python source files if not globals().has_key('_py_ext'): import imp global _py_ext _py_ext = [triple[0] for triple in imp.get_suffixes() if triple[2] == imp.PY_SOURCE][0] # don't recurse into CVS directories if 'CVS' in...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
import imp
def _visit_pyfiles(list, dirname, names): """ Helper for getFilesForName(). """ # get extension for python source files if not globals().has_key('_py_ext'): import imp global _py_ext _py_ext = [triple[0] for triple in imp.get_suffixes() if triple[2] == imp.PY_SOURCE][0] # don't recurse into CVS directories if 'CVS' in...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
_py_ext = [triple[0] for triple in imp.get_suffixes() if triple[2] == imp.PY_SOURCE][0]
_py_ext = [triple[0] for triple in imp.get_suffixes() if triple[2] == imp.PY_SOURCE][0]
def _visit_pyfiles(list, dirname, names): """ Helper for getFilesForName(). """ # get extension for python source files if not globals().has_key('_py_ext'): import imp global _py_ext _py_ext = [triple[0] for triple in imp.get_suffixes() if triple[2] == imp.PY_SOURCE][0] # don't recurse into CVS directories if 'CVS' in...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
[os.path.join(dirname, file) for file in names if os.path.splitext(file)[1] == _py_ext])
[os.path.join(dirname, file) for file in names if os.path.splitext(file)[1] == _py_ext] )
def _visit_pyfiles(list, dirname, names): """ Helper for getFilesForName(). """ # get extension for python source files if not globals().has_key('_py_ext'): import imp global _py_ext _py_ext = [triple[0] for triple in imp.get_suffixes() if triple[2] == imp.PY_SOURCE][0] # don't recurse into CVS directories if 'CVS' in...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
""" Get the filesystem path for a module or a package. Return the file system path to a file for a module, and to a directory for a package. Return None if the name is not found, or is a builtin or extension module.
"""Get the filesystem path for a module or a package. Return the file system path to a file for a module, and to a directory for a package. Return None if the name is not found, or is a builtin or extension module.
def _get_modpkg_path(dotted_name, pathlist=None): """ Get the filesystem path for a module or a package. Return the file system path to a file for a module, and to a directory for a package. Return None if the name is not found, or is a builtin or extension module. """ import imp # split off top-most name parts = dot...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
import imp
def _get_modpkg_path(dotted_name, pathlist=None): """ Get the filesystem path for a module or a package. Return the file system path to a file for a module, and to a directory for a package. Return None if the name is not found, or is a builtin or extension module. """ import imp # split off top-most name parts = dot...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
file, pathname, description = imp.find_module(dotted_name, pathlist) if file: file.close()
file, pathname, description = imp.find_module( dotted_name, pathlist) if file: file.close()
def _get_modpkg_path(dotted_name, pathlist=None): """ Get the filesystem path for a module or a package. Return the file system path to a file for a module, and to a directory for a package. Return None if the name is not found, or is a builtin or extension module. """ import imp # split off top-most name parts = dot...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
""" Get a list of module files for a filename, a module or package name, or a directory.
"""Get a list of module files for a filename, a module or package name, or a directory.
def getFilesForName(name): """ Get a list of module files for a filename, a module or package name, or a directory. """ import imp if not os.path.exists(name): # check for glob chars if containsAny(name, "*?[]"): import glob files = glob.glob(name) list = [] for file in files: list.extend(getFilesForName(file)) return...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
import imp
def getFilesForName(name): """ Get a list of module files for a filename, a module or package name, or a directory. """ import imp if not os.path.exists(name): # check for glob chars if containsAny(name, "*?[]"): import glob files = glob.glob(name) list = [] for file in files: list.extend(getFilesForName(file)) return...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
import glob
def getFilesForName(name): """ Get a list of module files for a filename, a module or package name, or a directory. """ import imp if not os.path.exists(name): # check for glob chars if containsAny(name, "*?[]"): import glob files = glob.glob(name) list = [] for file in files: list.extend(getFilesForName(file)) return...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
def __openseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == ')': # We've seen the last of the translatable strings. Record the # line number of the first line of the strings and update the list # of messages seen. Reset state for the next batch. If there # were no strings inside _(), then ju...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
print >>sys.stderr, _('*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"') % { 'token': tstring, 'file': self.__curfile, 'lineno': self.__lineno}
print >> sys.stderr, _( '*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"' ) % { 'token': tstring, 'file': self.__curfile, 'lineno': self.__lineno }
def __openseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == ')': # We've seen the last of the translatable strings. Record the # line number of the first line of the strings and update the list # of messages seen. Reset state for the next batch. If there # were no strings inside _(), then ju...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
_('*** Seen unexpected token "%(token)s"' % {'token': 'test'})
_('*** Seen unexpected token "%(token)s"') % {'token': 'test'}
def main(): global default_keywords try: opts, args = getopt.getopt( sys.argv[1:], 'ad:DEhk:Kno:p:S:Vvw:x:X:', ['extract-all', 'default-domain=', 'escape', 'help', 'keyword=', 'no-default-keywords', 'add-location', 'no-location', 'output=', 'output-dir=', 'style=', 'verbose', 'version', 'width=', 'exclude-file=', 'docs...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
def main(): global default_keywords try: opts, args = getopt.getopt( sys.argv[1:], 'ad:DEhk:Kno:p:S:Vvw:x:X:', ['extract-all', 'default-domain=', 'escape', 'help', 'keyword=', 'no-default-keywords', 'add-location', 'no-location', 'output=', 'output-dir=', 'style=', 'verbose', 'version', 'width=', 'exclude-file=', 'docs...
580440e357ef5697439695d88ac36c3974e15cf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/580440e357ef5697439695d88ac36c3974e15cf7/pygettext.py
self.assertEqual(stderr, "pineapple")
self.assert_(stderr.startswith("pineapple"))
def test_communicate_stderr(self): p = subprocess.Popen([sys.executable, "-c", 'import sys; sys.stderr.write("pineapple")'], stderr=subprocess.PIPE) (stdout, stderr) = p.communicate() self.assertEqual(stdout, None) self.assertEqual(stderr, "pineapple")
e3a8f9040be952cae93076c022c8f8e8c961460c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e3a8f9040be952cae93076c022c8f8e8c961460c/test_subprocess.py
import string if len(id) == 0:
global _idprog if not _idprog: _idprog = compile(r"[a-zA-Z_]\w*$") if _idprog.match(id): return 1 else:
def valid_identifier(id): import string if len(id) == 0: return 0 if id[0] not in string.letters+'_': return 0 for char in id[1:]: if not syntax_table[char] & word: return 0 return 1
3ecf7f8d6d93ee941473697dc2f24ded3433bc19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3ecf7f8d6d93ee941473697dc2f24ded3433bc19/re.py
if id[0] not in string.letters+'_': return 0 for char in id[1:]: if not syntax_table[char] & word: return 0 return 1
def valid_identifier(id): import string if len(id) == 0: return 0 if id[0] not in string.letters+'_': return 0 for char in id[1:]: if not syntax_table[char] & word: return 0 return 1
3ecf7f8d6d93ee941473697dc2f24ded3433bc19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3ecf7f8d6d93ee941473697dc2f24ded3433bc19/re.py
without effecting this threads data:
without affecting this thread's data:
... def squared(self):
642ab44f8cfdab09a749bf3537064951b54a76e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/642ab44f8cfdab09a749bf3537064951b54a76e4/_threading_local.py
pass
pass
def __del__(self): key = __getattribute__(self, '_local__key')
642ab44f8cfdab09a749bf3537064951b54a76e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/642ab44f8cfdab09a749bf3537064951b54a76e4/_threading_local.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.
7d46c47eab6c902fba69e0e7d4a9178135ea9d55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d46c47eab6c902fba69e0e7d4a9178135ea9d55/httplib.py
'Header', 'Iterators', 'MIMEAudio', 'MIMEBase', 'MIMEImage', 'MIMEMessage', 'MIMEText', 'Message', 'Parser', 'Utils', 'base64MIME',
'Header', 'Iterators', 'MIMEAudio', 'MIMEBase', 'MIMEImage', 'MIMEMessage', 'MIMEMultipart', 'MIMENonMultipart', 'MIMEText', 'Message', 'Parser', 'Utils', 'base64MIME',
def test__all__(self): module = __import__('email') all = module.__all__ all.sort() self.assertEqual(all, ['Charset', 'Encoders', 'Errors', 'Generator', 'Header', 'Iterators', 'MIMEAudio', 'MIMEBase', 'MIMEImage', 'MIMEMessage', 'MIMEText', 'Message', 'Parser', 'Utils', 'base64MIME', 'message_from_file', 'message_from_...
2c460f432978ae90ba6149b5ff553a340bde7087 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2c460f432978ae90ba6149b5ff553a340bde7087/test_email.py
test_support.run_unittest(TestSFbugs) test_support.run_doctest(difflib)
Doctests = doctest.DocTestSuite(difflib) test_support.run_unittest(TestSFbugs, Doctests)
def test_ratio_for_null_seqn(self): # Check clearing of SF bug 763023 s = difflib.SequenceMatcher(None, [], []) self.assertEqual(s.ratio(), 1) self.assertEqual(s.quick_ratio(), 1) self.assertEqual(s.real_quick_ratio(), 1)
8f350650e1a8c3adb15418c560c9818eca2663d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8f350650e1a8c3adb15418c560c9818eca2663d5/test_difflib.py
self.badmodules[name] = {m.__name__:None}
if not self.badmodules.has_key(name): self.badmodules[name] = {} self.badmodules[name][m.__name__] = None
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
a83f608141cb2ac6f06e8d2fe5d067d901860b34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a83f608141cb2ac6f06e8d2fe5d067d901860b34/modulefinder.py
self.badmodules[fullname] = {m.__name__:None}
if not self.badmodules.has_key(fullname): self.badmodules[fullname] = {} self.badmodules[fullname][m.__name__] = None
def scan_code(self, co, m): code = co.co_code n = len(code) i = 0 lastname = None while i < n: c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 if op == IMPORT_NAME: name = lastname = co.co_names[oparg] if not self.badmodules.has_key(lastname): try: self.impo...
a83f608141cb2ac6f06e8d2fe5d067d901860b34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a83f608141cb2ac6f06e8d2fe5d067d901860b34/modulefinder.py
def AskPassword(prompt, default='', id=264):
def AskPassword(prompt, default='', id=264, ok=None, cancel=None):
def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitt...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
h = d.GetDialogItemAsControl(3)
h = d.GetDialogItemAsControl(3)
def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitt...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
h = d.GetDialogItemAsControl(4)
pwd = d.GetDialogItemAsControl(4)
def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitt...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
SetDialogItemText(h, bullets ) d.SelectDialogItemText(4, 999, 999)
SetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag, default) d.SelectDialogItemText(4, 0, 999) Ctl.SetKeyboardFocus(d, pwd, kControlEditTextPart) if ok != None: h = d.GetDialogItemAsControl(1) h.SetControlTitle(ok) if cancel != None: h = d.GetDialogItemAsControl(2) h.SetControlTitle(cancel)
def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitt...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
string = default oldschedparams = MacOS.SchedParams(0,0)
def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitt...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
ready,ev = Evt.WaitNextEvent(Events.everyEvent, 6) if not ready: continue what,msg,when,where,mod = ev if what == 0 : Dlg.DialogSelect(ev) elif Dlg.IsDialogEvent(ev): if what in (Events.keyDown, Events.autoKey): charcode = msg & Events.charCodeMask if ( mod & Events.cmdKey ): MacOS.SysBeep() continue else: if charcode ...
n = ModalDialog(None) if n == 1: h = d.GetDialogItemAsControl(4) return cr2lf(GetControlData(pwd, kControlEditTextPart, kControlEditTextPasswordTag)) if n == 2: return None
def AskPassword(prompt, default='', id=264): """Display a PROMPT string and a text entry field with a DEFAULT string. The string is displayed as bullets only. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitt...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
ok = AskYesNoCancel("Do you want to identify?", yes="Indentify", no="Don't identify")
ok = AskYesNoCancel("Do you want to identify?", yes="Identify", no="No")
def test(): import time Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") ok = AskYesNoCancel("Do you want to identify?", yes="Indentify", no="Don't identify") if ok > 0: s = AskString("Enter your first name", "Joe") Message("Thank you,\n%s" % `s`) text = ( "Working Hard...", "Hardly Worki...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
Message("Thank you,\n%s" % `s`)
s2 = AskPassword("Okay %s, tell us your nickname"%s, s, cancel="None") if not s2: Message("%s has no secret nickname"%s) else: Message("Hello everybody!!\nThe secret nickname of %s is %s!!!"%(s, s2))
def test(): import time Message("Testing EasyDialogs.") ok = AskYesNoCancel("Do you want to proceed?") ok = AskYesNoCancel("Do you want to identify?", yes="Indentify", no="Don't identify") if ok > 0: s = AskString("Enter your first name", "Joe") Message("Thank you,\n%s" % `s`) text = ( "Working Hard...", "Hardly Worki...
90b0ea2d82f49ab29f867e46e030f3c20954eaef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90b0ea2d82f49ab29f867e46e030f3c20954eaef/EasyDialogs.py
if not _urandomfd:
if _urandomfd is None:
def urandom(n): """urandom(n) -> str
734803df98a59a8355624c248a09169de60741f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/734803df98a59a8355624c248a09169de60741f2/os.py
pos = [-42] def negposreturn(exc): pos[0] += 1 return (u"?", pos[0]) codecs.register_error("test.negposreturn", negposreturn) "\xff".decode("ascii", "test.negposreturn") def hugeposreturn(exc): return (u"?", 424242) codecs.register_error("test.hugeposreturn", hugeposreturn) "\xff".decode("ascii", "test.hugeposreturn")...
handler = PosReturn() codecs.register_error("test.posreturn", handler.handle) handler.pos = -1 self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?>0") handler.pos = -2 self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?><?>") handler.pos = -3 self.assertRaises(IndexError, "\xff0".decod...
def baddecodereturn2(exc): return (u"?", None)
e1cd2c8d4bb9ad5181f6f5329f3d25fc05d33afc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1cd2c8d4bb9ad5181f6f5329f3d25fc05d33afc/test_codeccallbacks.py
pos = [-42] def negposreturn(exc): pos[0] += 1 return (u"?", pos[0]) codecs.register_error("test.negposreturn", negposreturn) u"\xff".encode("ascii", "test.negposreturn") def hugeposreturn(exc): return (u"?", 424242) codecs.register_error("test.hugeposreturn", hugeposreturn) u"\xff".encode("ascii", "test.hugeposreturn...
handler = PosReturn() codecs.register_error("test.posreturn", handler.handle) handler.pos = -1 self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?>0") handler.pos = -2 self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?><?>") handler.pos = -3 self.assertRaises(IndexError, u"\xff0".enco...
def badencodereturn2(exc): return (u"?", None)
e1cd2c8d4bb9ad5181f6f5329f3d25fc05d33afc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1cd2c8d4bb9ad5181f6f5329f3d25fc05d33afc/test_codeccallbacks.py
for err in ("strict", "replace", "xmlcharrefreplace", "backslashreplace", "test.hugeposreturn"):
for err in ("strict", "replace", "xmlcharrefreplace", "backslashreplace", "test.posreturn"):
def __getitem__(self, key): raise ValueError
e1cd2c8d4bb9ad5181f6f5329f3d25fc05d33afc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e1cd2c8d4bb9ad5181f6f5329f3d25fc05d33afc/test_codeccallbacks.py
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
07683bc0c0ab3dd07c79614ef50514582b1114f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/07683bc0c0ab3dd07c79614ef50514582b1114f2/test_unicode.py
class String: x = '' def __str__(self): return self.x o = String() o.x = 'abc' verify(unicode(o) == u'abc') verify(str(o) == 'abc') o.x = u'abc' verify(unicode(o) == u'abc') verify(str(o) == 'abc') for obj in (123, 123.45, 123L): verify(unicode(obj) == unicode(str(obj)))
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
07683bc0c0ab3dd07c79614ef50514582b1114f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/07683bc0c0ab3dd07c79614ef50514582b1114f2/test_unicode.py
"""Decide whether a particular character needs to be quoted.
"""Decide whether a particular character needs to be quoted.
def needsquoting(c, quotetabs): """Decide whether a particular character needs to be quoted. The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~')
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~')
The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~')
def needsquoting(c, quotetabs): """Decide whether a particular character needs to be quoted. The 'quotetabs' flag indicates whether tabs should be quoted.""" if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~')
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
"""Quote a single character.""" if c == ESCAPE: return ESCAPE * 2 else: i = ord(c) return ESCAPE + HEX[i/16] + HEX[i%16]
"""Quote a single character.""" i = ord(c) return ESCAPE + HEX[i/16] + HEX[i%16]
def quote(c): """Quote a single character.""" if c == ESCAPE: return ESCAPE * 2 else: i = ord(c) return ESCAPE + HEX[i/16] + HEX[i%16]
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
"""Read 'input', apply quoted-printable encoding, and write to 'output'.
"""Read 'input', apply quoted-printable encoding, and write to 'output'.
def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted.""" while 1: line = input.readline() if not line: break new = '' last = line[-1...
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted.""" while 1: line = input.readline() if not line: break new = '' last = line[-1:] if last == '\n': line = line[:-1] else: last = '' prev = '' for c in line: if needsquoting(c, quotetabs): c =...
'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted. """ while 1: line = input.readline() if not line: break new = '' last = line[-1:] if last == '\n': line = line[:-1] else: last = '' prev = '' for c in line: if needsquoting(c, quotetabs): c ...
def encode(input, output, quotetabs): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether tabs should be quoted.""" while 1: line = input.readline() if not line: break new = '' last = line[-1...
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
"""Read 'input', apply quoted-printable decoding, and write to 'output'.
"""Read 'input', apply quoted-printable decoding, and write to 'output'.
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...
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
'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 while n > 0 and line[n-1] in (' ', '\t'): n = n-1 else: partial = 1 while i < n: c = line[i] if c <> ESCAPE: new =...
'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 while n > 0 and line[n-1] in (' ', '\t'): n = n-1 else: partial = 1 while i < n: c = line[i] if c <> ESCAPE: new =...
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...
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
"""Return true if the character 'c' is a hexadecimal digit.""" return '0' <= c <= '9' or 'a' <= c <= 'f' or 'A' <= c <= 'F'
"""Return true if the character 'c' is a hexadecimal digit.""" return '0' <= c <= '9' or 'a' <= c <= 'f' or 'A' <= c <= 'F'
def ishex(c): """Return true if the character 'c' is a hexadecimal digit.""" return '0' <= c <= '9' or 'a' <= c <= 'f' or 'A' <= c <= 'F'
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
"""Get the integer value of a hexadecimal number.""" bits = 0 for c in s: if '0' <= c <= '9': i = ord('0') elif 'a' <= c <= 'f': i = ord('a')-10 elif 'A' <= c <= 'F': i = ord('A')-10 else: break bits = bits*16 + (ord(c) - i) return bits
"""Get the integer value of a hexadecimal number.""" bits = 0 for c in s: if '0' <= c <= '9': i = ord('0') elif 'a' <= c <= 'f': i = ord('a')-10 elif 'A' <= c <= 'F': i = ord('A')-10 else: break bits = bits*16 + (ord(c) - i) return bits
def unhex(s): """Get the integer value of a hexadecimal number.""" bits = 0 for c in s: if '0' <= c <= '9': i = ord('0') elif 'a' <= c <= 'f': i = ord('a')-10 elif 'A' <= c <= 'F': i = ord('A')-10 else: break bits = bits*16 + (ord(c) - i) return bits
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
import sys import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'td') except getopt.error, msg: sys.stdout = sys.stderr print msg print "usage: quopri [-t | -d] [file] ..." print "-t: quote tabs" print "-d: decode; default encode" sys.exit(2) deco = 0 tabs = 0 for o, a in opts: if o == '-t': tabs = 1 if o == '-d...
import sys import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'td') except getopt.error, msg: sys.stdout = sys.stderr print msg print "usage: quopri [-t | -d] [file] ..." print "-t: quote tabs" print "-d: decode; default encode" sys.exit(2) deco = 0 tabs = 0 for o, a in opts: if o == '-t': tabs = 1 if o == '-d...
def test(): import sys import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'td') except getopt.error, msg: sys.stdout = sys.stderr print msg print "usage: quopri [-t | -d] [file] ..." print "-t: quote tabs" print "-d: decode; default encode" sys.exit(2) deco = 0 tabs = 0 for o, a in opts: if o == '-t': tabs = 1...
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
test()
test()
def test(): import sys import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'td') except getopt.error, msg: sys.stdout = sys.stderr print msg print "usage: quopri [-t | -d] [file] ..." print "-t: quote tabs" print "-d: decode; default encode" sys.exit(2) deco = 0 tabs = 0 for o, a in opts: if o == '-t': tabs = 1...
f526971f3bf2401625c1aaa9a44fb6b7af11aee7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f526971f3bf2401625c1aaa9a44fb6b7af11aee7/quopri.py
_LegalCharsPatt = r"[\w\d!
_LegalCharsPatt = r"[\w\d!
def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append
7437fc6f856bd54cce45880bf43ca993c607371d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7437fc6f856bd54cce45880bf43ca993c607371d/Cookie.py
""+ _LegalCharsPatt +"+"
""+ _LegalCharsPatt +"+?"
def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append
7437fc6f856bd54cce45880bf43ca993c607371d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7437fc6f856bd54cce45880bf43ca993c607371d/Cookie.py
if sys.platform == 'win32':
if sys.platform == 'win32' or sys.platform.startswith('os2'):
def getpager(): """Decide what method to use for paging through text.""" if type(sys.stdout) is not types.FileType: return plainpager if not sys.stdin.isatty() or not sys.stdout.isatty(): return plainpager if os.environ.get('TERM') in ['dumb', 'emacs']: return plainpager if os.environ.has_key('PAGER'): if sys.platform ...
9a3b03036f32150474aead3231141b2bf779ff0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9a3b03036f32150474aead3231141b2bf779ff0e/pydoc.py
initialcolor = None,
def __init__(self, master = None, initialcolor = None, databasefile = None, initfile = None, ignore = None, wantspec = None): self.__master = master self.__initialcolor = initialcolor self.__databasefile = databasefile self.__initfile = initfile or os.path.expanduser('~/.pynche') self.__ignore = ignore self.__pw = None...
ee22b4b2157dec6c104cfea17f304073fb74fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ee22b4b2157dec6c104cfea17f304073fb74fd5a/pyColorChooser.py
self.__initialcolor = initialcolor
def __init__(self, master = None, initialcolor = None, databasefile = None, initfile = None, ignore = None, wantspec = None): self.__master = master self.__initialcolor = initialcolor self.__databasefile = databasefile self.__initfile = initfile or os.path.expanduser('~/.pynche') self.__ignore = ignore self.__pw = None...
ee22b4b2157dec6c104cfea17f304073fb74fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ee22b4b2157dec6c104cfea17f304073fb74fd5a/pyColorChooser.py
def show(self):
def show(self, color=None): if not self.__master: from Tkinter import Tk self.__master = Tk()
def show(self): if not self.__pw: self.__pw, self.__sb = \ Main.build(master = self.__master, initialcolor = self.__initialcolor, initfile = self.__initfile, ignore = self.__ignore) Main.run(self.__pw, self.__sb) rgbtuple = self.__sb.current_rgb() self.__pw.withdraw() # check to see if the cancel button was pushed if s...
ee22b4b2157dec6c104cfea17f304073fb74fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ee22b4b2157dec6c104cfea17f304073fb74fd5a/pyColorChooser.py
initialcolor = self.__initialcolor,
def show(self): if not self.__pw: self.__pw, self.__sb = \ Main.build(master = self.__master, initialcolor = self.__initialcolor, initfile = self.__initfile, ignore = self.__ignore) Main.run(self.__pw, self.__sb) rgbtuple = self.__sb.current_rgb() self.__pw.withdraw() # check to see if the cancel button was pushed if s...
ee22b4b2157dec6c104cfea17f304073fb74fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ee22b4b2157dec6c104cfea17f304073fb74fd5a/pyColorChooser.py
colordb = self.__sb.colordb()
def show(self): if not self.__pw: self.__pw, self.__sb = \ Main.build(master = self.__master, initialcolor = self.__initialcolor, initfile = self.__initfile, ignore = self.__ignore) Main.run(self.__pw, self.__sb) rgbtuple = self.__sb.current_rgb() self.__pw.withdraw() # check to see if the cancel button was pushed if s...
ee22b4b2157dec6c104cfea17f304073fb74fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ee22b4b2157dec6c104cfea17f304073fb74fd5a/pyColorChooser.py
return apply(Chooser, (), options).show()
global _chooser if not _chooser: _chooser = apply(Chooser, (), options) return _chooser.show(color)
def askcolor(color = None, **options): """Ask for a color""" return apply(Chooser, (), options).show()
ee22b4b2157dec6c104cfea17f304073fb74fd5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ee22b4b2157dec6c104cfea17f304073fb74fd5a/pyColorChooser.py
exts.append( Extension('_locale', ['_localemodule.c']) )
if platform in ['cygwin']: locale_libs = ['intl'] else: locale_libs = [] exts.append( Extension('_locale', ['_localemodule.c'], libraries=locale_libs ) )
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')
91ba94dc4a1d8c425f5aa824e1245646b5d904e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/91ba94dc4a1d8c425f5aa824e1245646b5d904e1/setup.py
if sys.platform == 'darwin' and g.has_key('CONFIGURE_MACOSX_DEPLOYMENT_TARGET'): cfg_target = g['CONFIGURE_MACOSX_DEPLOYMENT_TARGET'] cur_target = os.getenv('MACOSX_DEPLOYMENT_TARGET', '') if cfg_target != cur_target: my_msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configure' % (cur_target,...
def _init_posix(): """Initialize the module as appropriate for POSIX systems.""" g = {} # load the installed Makefile: try: filename = get_makefile_filename() parse_makefile(filename, g) except IOError, msg: my_msg = "invalid Python installation: unable to open %s" % filename if hasattr(msg, "strerror"): my_msg = my_ms...
1a70973edce6b76755851f4aba2629de8826664f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1a70973edce6b76755851f4aba2629de8826664f/sysconfig.py
rounding = context.rounding
def __pow__(self, n, modulo = None, context=None): """Return self ** n (mod modulo)
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.py
shouldround = context._rounding_decision == ALWAYS_ROUND
def __pow__(self, n, modulo = None, context=None): """Return self ** n (mod modulo)
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.py
if shouldround:
if context._rounding_decision == ALWAYS_ROUND:
def __pow__(self, n, modulo = None, context=None): """Return self ** n (mod modulo)
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.py
out = 0
def _rescale(self, exp, rounding=None, context=None, watchexp=1): """Rescales so that the exponent is exp.
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.py
prevexact = context.flags[Inexact]
def _rescale(self, exp, rounding=None, context=None, watchexp=1): """Rescales so that the exponent is exp.
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.py
count = 1
def sqrt(self, context=None): """Return the square root of self.
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.py
context._rounding_decision == ALWAYS_ROUND return ans._fix(context)
if context._rounding_decision == ALWAYS_ROUND: return ans._fix(context) return ans
def max(self, other, context=None): """Returns the larger value.
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.py
context._rounding_decision == ALWAYS_ROUND return ans._fix(context)
if context._rounding_decision == ALWAYS_ROUND: return ans._fix(context) return ans
def min(self, other, context=None): """Returns the smaller value.
8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ba896ad541ea1d2fc9fe67ed0a591eccacd10c5/decimal.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')
56db06ced700d2e4bed6781847d6262f143f1340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/56db06ced700d2e4bed6781847d6262f143f1340/setup.py
if c not in '123': raise error_proto, resp return resp
raise error_proto, resp
def getresp(self): resp = self.getmultiline() if self.debugging: print '*resp*', self.sanitize(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
0c5eac883ea9d53f54e55ccf224c50b7b2951488 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c5eac883ea9d53f54e55ccf224c50b7b2951488/ftplib.py
if resp[:3] <> '229':
if resp[:3] != '229':
def parse229(resp, peer): '''Parse the '229' response for a EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] <> '229': raise error_reply, resp left = resp.find('(') if left < 0: raise error_proto, resp right = resp.find(')', left + 1) if ...
0c5eac883ea9d53f54e55ccf224c50b7b2951488 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c5eac883ea9d53f54e55ccf224c50b7b2951488/ftplib.py
if resp[left + 1] <> resp[right - 1]:
if resp[left + 1] != resp[right - 1]:
def parse229(resp, peer): '''Parse the '229' response for a EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] <> '229': raise error_reply, resp left = resp.find('(') if left < 0: raise error_proto, resp right = resp.find(')', left + 1) if ...
0c5eac883ea9d53f54e55ccf224c50b7b2951488 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c5eac883ea9d53f54e55ccf224c50b7b2951488/ftplib.py
if len(parts) <> 5:
if len(parts) != 5:
def parse229(resp, peer): '''Parse the '229' response for a EPSV request. Raises error_proto if it does not contain '(|||port|)' Return ('host.addr.as.numbers', port#) tuple.''' if resp[:3] <> '229': raise error_reply, resp left = resp.find('(') if left < 0: raise error_proto, resp right = resp.find(')', left + 1) if ...
0c5eac883ea9d53f54e55ccf224c50b7b2951488 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c5eac883ea9d53f54e55ccf224c50b7b2951488/ftplib.py
Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...'''
Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ... -d dir -l list -p password ''' if len(sys.argv) < 2: print test.__doc__ sys.exit(0)
def test(): '''Test program. Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...''' debugging = 0 rcfile = None while sys.argv[1] == '-d': debugging = debugging+1 del sys.argv[1] if sys.argv[1][:2] == '-r': # get name of alternate ~/.netrc file: rcfile = sys.argv[1][2:] del sys.argv[1] host = sys.argv[...
0c5eac883ea9d53f54e55ccf224c50b7b2951488 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c5eac883ea9d53f54e55ccf224c50b7b2951488/ftplib.py
archive_basename = os.path.join(self.bdist_dir, "%s.win32" % fullname)
def run (self): if (sys.platform != "win32" and (self.distribution.has_ext_modules() or self.distribution.has_c_libraries())): raise DistutilsPlatformError \ ("distribution contains extensions and/or C libraries; " "must be compiled on a Windows 32 platform")
7a5de2ab3001cbaa7d54395274a8580d4e75e621 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7a5de2ab3001cbaa7d54395274a8580d4e75e621/bdist_wininst.py
if audioop.lin2ulaw(data[0], 1) != '\377\347\333' or \ audioop.lin2ulaw(data[1], 2) != '\377\377\377' or \ audioop.lin2ulaw(data[2], 4) != '\377\377\377':
if audioop.lin2ulaw(data[0], 1) != '\xff\xe7\xdb' or \ audioop.lin2ulaw(data[1], 2) != '\xff\xff\xff' or \ audioop.lin2ulaw(data[2], 4) != '\xff\xff\xff':
def testlin2ulaw(data): if verbose: print 'lin2ulaw' if audioop.lin2ulaw(data[0], 1) != '\377\347\333' or \ audioop.lin2ulaw(data[1], 2) != '\377\377\377' or \ audioop.lin2ulaw(data[2], 4) != '\377\377\377': return 0 return 1
54d99dab72aad0665e98e2bf193eed9903f9fa3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54d99dab72aad0665e98e2bf193eed9903f9fa3e/test_audioop.py
testme[:42] testme[:42] = "The Answer" del testme[:42]
import sys if sys.platform[:4] != 'java': testme[:42] testme[:42] = "The Answer" del testme[:42] else: print "__getitem__: (slice(0, 42, None),)" print "__setitem__: (slice(0, 42, None), 'The Answer')" print "__delitem__: (slice(0, 42, None),)"
exec """def __%(method)s__(self, *args): print "__%(method)s__:", args
a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef/test_class.py
int(testme) long(testme) float(testme) oct(testme) hex(testme)
if sys.platform[:4] != 'java': int(testme) long(testme) float(testme) oct(testme) hex(testme) else: print "__int__: ()" print "__long__: ()" print "__float__: ()" print "__oct__: ()" print "__hex__: ()"
exec """def __%(method)s__(self, *args): print "__%(method)s__:", args
a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef/test_class.py
if sys.platform[:4] == 'java': import java java.lang.System.gc()
exec """def __%(method)s__(self, *args): print "__%(method)s__:", args
a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef/test_class.py
raise DistutilsFileErorr, \
raise DistutilsFileError, \
def check_package (self, package, package_dir):
ff4623fc34b34c5d75aa9fd1b7f6b6f5a3ed1b5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff4623fc34b34c5d75aa9fd1b7f6b6f5a3ed1b5c/build_py.py
if self._debugging > 1: print '*put*', `line`
def _putline(self, line): #if self._debugging > 1: print '*put*', `line` self.sock.send('%s%s' % (line, CRLF))
bec4f7c0e0ba80fd44523a3b144e35daad26b868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bec4f7c0e0ba80fd44523a3b144e35daad26b868/poplib.py
if self._debugging: print '*cmd*', `line`
def _putcmd(self, line): #if self._debugging: print '*cmd*', `line` self._putline(line)
bec4f7c0e0ba80fd44523a3b144e35daad26b868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bec4f7c0e0ba80fd44523a3b144e35daad26b868/poplib.py
if self._debugging > 1: print '*get*', `line`
def _getline(self): line = self.file.readline() #if self._debugging > 1: print '*get*', `line` if not line: raise error_proto('-ERR EOF') octets = len(line) # server can send any combination of CR & LF # however, 'readline()' returns lines ending in LF # so only possibilities are ...LF, ...CRLF, CR...LF if line[-2:] ==...
bec4f7c0e0ba80fd44523a3b144e35daad26b868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bec4f7c0e0ba80fd44523a3b144e35daad26b868/poplib.py
if self._debugging > 1: print '*resp*', `resp`
def _getresp(self): resp, o = self._getline() #if self._debugging > 1: print '*resp*', `resp` c = resp[:1] if c != '+': raise error_proto(resp) return resp
bec4f7c0e0ba80fd44523a3b144e35daad26b868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bec4f7c0e0ba80fd44523a3b144e35daad26b868/poplib.py
if self._debugging: print '*stat*', `rets`
def stat(self): """Get mailbox status.
bec4f7c0e0ba80fd44523a3b144e35daad26b868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bec4f7c0e0ba80fd44523a3b144e35daad26b868/poplib.py
self.assertRaises(OverflowError, xrange, 1e100, 1e101, 1e101)
self.assertRaises(TypeError, xrange, 0.0, 2, 1) self.assertRaises(TypeError, xrange, 1, 2.0, 1) self.assertRaises(TypeError, xrange, 1, 2, 1.0) self.assertRaises(TypeError, xrange, 1e100, 1e101, 1e101)
def test_xrange(self): self.assertEqual(list(xrange(3)), [0, 1, 2]) self.assertEqual(list(xrange(1, 5)), [1, 2, 3, 4]) self.assertEqual(list(xrange(0)), []) self.assertEqual(list(xrange(-3)), []) self.assertEqual(list(xrange(1, 10, 3)), [1, 4, 7]) self.assertEqual(list(xrange(5, -5, -3)), [5, 2, -1, -4])
d6a3915e3f51ca5ff906dd049e3959d8cb692c0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6a3915e3f51ca5ff906dd049e3959d8cb692c0a/test_xrange.py
self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG' ]
if self.__version >= 7: self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG' ] else: self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG' ]
def __init__ (self, verbose=0, dry_run=0, force=0): CCompiler.__init__ (self, verbose, dry_run, force) self.__version = get_build_version() if self.__version >= 7: self.__root = r"Software\Microsoft\VisualStudio" self.__macros = MacroExpander(self.__version) else: self.__root = r"Software\Microsoft\Devstudio" self.__pa...
e268924ca91d33ebbd25bd7931efb957313ee551 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e268924ca91d33ebbd25bd7931efb957313ee551/msvccompiler.py
return codecs.mbs_encode(input,self.errors)[0]
return codecs.mbcs_encode(input,self.errors)[0]
def encode(self, input, final=False): return codecs.mbs_encode(input,self.errors)[0]
73d09e6e47e37bc2c1926f4c829d4acdd37e9e2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/73d09e6e47e37bc2c1926f4c829d4acdd37e9e2a/mbcs.py