rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
"""SMTP 'verify' command. Checks for address validity."""
"""SMTP 'verify' command -- checks for address validity."""
def verify(self, address): """SMTP 'verify' command. Checks for address validity.""" self.putcmd("vrfy", quoteaddr(address)) return self.getreply()
58a0b3fcac35fd85d6794fbcb62a4f4925cb00da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58a0b3fcac35fd85d6794fbcb62a4f4925cb00da/smtplib.py
"""SMTP 'verify' command. Checks for address validity."""
"""SMTP 'verify' command -- checks for address validity."""
def expn(self, address): """SMTP 'verify' command. Checks for address validity.""" self.putcmd("expn", quoteaddr(address)) return self.getreply()
58a0b3fcac35fd85d6794fbcb62a4f4925cb00da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58a0b3fcac35fd85d6794fbcb62a4f4925cb00da/smtplib.py
makefile_in = os.path.join(exec_prefix, 'Modules', 'Makefile')
makefile_in = os.path.join(exec_prefix, 'Makefile')
def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] exclude = [] # settable with -x option addn_link = [] # settable with -l, but only honored under Windows. path = sys.p...
5f8e4896b53d4de9b29f1bbd488026c74edcbf54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5f8e4896b53d4de9b29f1bbd488026c74edcbf54/freeze.py
for key in makevars.keys(): somevars[key] = makevars[key]
for key in makevars.keys(): somevars[key] = makevars[key]
def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] exclude = [] # settable with -x option addn_link = [] # settable with -l, but only honored under Windows. path = sys.p...
5f8e4896b53d4de9b29f1bbd488026c74edcbf54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5f8e4896b53d4de9b29f1bbd488026c74edcbf54/freeze.py
ef = codecs.EncodedFile(f, 'utf-16', 'utf-8')
ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8')
def test_basic(self): f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80') ef = codecs.EncodedFile(f, 'utf-16', 'utf-8') self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae')
e4cc181031b7a5d95083edefdaf1e64bcc4055f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e4cc181031b7a5d95083edefdaf1e64bcc4055f7/test_codecs.py
self.compiler = new_compiler ( compiler="msvc",
self.compiler = new_compiler (compiler=self.compiler,
def run (self):
f60bef333ef8ad447c5473c4762d823cc8b8b159 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f60bef333ef8ad447c5473c4762d823cc8b8b159/build_ext.py
extra_args = ext.extra_compile_args
extra_args = ext.extra_compile_args or []
def build_extensions (self):
f60bef333ef8ad447c5473c4762d823cc8b8b159 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f60bef333ef8ad447c5473c4762d823cc8b8b159/build_ext.py
extra_args = ext.extra_link_args
extra_args = ext.extra_link_args or []
def build_extensions (self):
f60bef333ef8ad447c5473c4762d823cc8b8b159 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f60bef333ef8ad447c5473c4762d823cc8b8b159/build_ext.py
xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)),
xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)),
def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data.
b303381c9c144da95fae19f5665221483f2a6696 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b303381c9c144da95fae19f5665221483f2a6696/SimpleXMLRPCServer.py
'faultString' : "%s:%s" % (sys.exc_type, sys.exc_value)}
'faultString' : "%s:%s" % (exc_type, exc_value)}
def system_multicall(self, call_list): """system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => \
b303381c9c144da95fae19f5665221483f2a6696 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b303381c9c144da95fae19f5665221483f2a6696/SimpleXMLRPCServer.py
if i < 0: return None data[0] = data[0][i+1:]
if i >= 0: data[0] = data[0][i+1:]
def parsedate_tz(data): """Convert a date string to a time tuple. Accounts for military timezones. """ data = data.split() # The FWS after the comma after the day-of-week is optional, so search and # adjust for this. if data[0].endswith(',') or data[0].lower() in _daynames: # There's a dayname here. Skip it del data[0...
bc0bf14de3689b8c264266e301eb219beb1ec19e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc0bf14de3689b8c264266e301eb219beb1ec19e/_parseaddr.py
tester('ntpath.splitdrive("\\\\conky\\mountpoint\\foo\\bar")', ('\\\\conky\\mountpoint', '\\foo\\bar'))
tester('ntpath.splitunc("\\\\conky\\mountpoint\\foo\\bar")', ('\\\\conky\\mountpoint', '\\foo\\bar'))
def tester(fn, wantResult): fn = string.replace(fn, "\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(wantResult) print " returned: " + str(gotResult) print "" global errors errors = errors + 1
754dfbd207e5f65cc11d757aae86f5b3d51a1ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/754dfbd207e5f65cc11d757aae86f5b3d51a1ff9/test_ntpath.py
tester('ntpath.splitdrive("//conky/mountpoint/foo/bar")', ('//conky/mountpoint', '/foo/bar'))
tester('ntpath.splitunc("//conky/mountpoint/foo/bar")', ('//conky/mountpoint', '/foo/bar'))
def tester(fn, wantResult): fn = string.replace(fn, "\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(wantResult) print " returned: " + str(gotResult) print "" global errors errors = errors + 1
754dfbd207e5f65cc11d757aae86f5b3d51a1ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/754dfbd207e5f65cc11d757aae86f5b3d51a1ff9/test_ntpath.py
tester('ntpath.split("\\\\conky\\mountpoint\\")', ('\\\\conky\\mountpoint\\', ''))
tester('ntpath.split("\\\\conky\\mountpoint\\")', ('\\\\conky\\mountpoint', ''))
def tester(fn, wantResult): fn = string.replace(fn, "\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(wantResult) print " returned: " + str(gotResult) print "" global errors errors = errors + 1
754dfbd207e5f65cc11d757aae86f5b3d51a1ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/754dfbd207e5f65cc11d757aae86f5b3d51a1ff9/test_ntpath.py
tester('ntpath.split("//conky/mountpoint/")', ('//conky/mountpoint/', ''))
tester('ntpath.split("//conky/mountpoint/")', ('//conky/mountpoint', ''))
def tester(fn, wantResult): fn = string.replace(fn, "\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(wantResult) print " returned: " + str(gotResult) print "" global errors errors = errors + 1
754dfbd207e5f65cc11d757aae86f5b3d51a1ff9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/754dfbd207e5f65cc11d757aae86f5b3d51a1ff9/test_ntpath.py
if name in ('os2', ):
if name in ('os2', 'nt', 'dos'):
def _execvpe(file, args, env = None): if env: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath import string PATH = st...
f4e72db40428bd47f54ddfb3fd610276a11c72f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f4e72db40428bd47f54ddfb3fd610276a11c72f5/os.py
key = string.upper(key)
def __setitem__(self, key, item): key = string.upper(key) putenv(key, item) self.data[key] = item
f4e72db40428bd47f54ddfb3fd610276a11c72f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f4e72db40428bd47f54ddfb3fd610276a11c72f5/os.py
def __getitem__(self, key): return self.data[string.upper(key)] else: class _Environ(UserDict.UserDict): def __init__(self, environ): UserDict.UserDict.__init__(self) self.data = environ def __getinitargs__(self): import copy return (copy.copy(self.data),) def __setitem__(self, key, item): putenv(key, item) self.data[...
def __getitem__(self, key): return self.data[string.upper(key)]
f4e72db40428bd47f54ddfb3fd610276a11c72f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f4e72db40428bd47f54ddfb3fd610276a11c72f5/os.py
from distutils.core import DEBUG
def parse_config_files (self, filenames=None):
a68503516cad098c6448d0a4ae33c57e288bbf26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a68503516cad098c6448d0a4ae33c57e288bbf26/dist.py
from distutils.core import DEBUG
def get_command_obj (self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return None. """ from distutils.core impo...
a68503516cad098c6448d0a4ae33c57e288bbf26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a68503516cad098c6448d0a4ae33c57e288bbf26/dist.py
from distutils.core import DEBUG
def _set_command_options (self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command').
a68503516cad098c6448d0a4ae33c57e288bbf26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a68503516cad098c6448d0a4ae33c57e288bbf26/dist.py
for key, val in dict.items():
for key in dict.keys():
def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st...
85afe3cf7b6468e27cbca4451e87bfc49d31ebb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/85afe3cf7b6468e27cbca4451e87bfc49d31ebb0/xmllib.py
key = key[6:] start, end = self.elements.get(key, (None, None))
tag = key[6:] start, end = self.elements.get(tag, (None, None))
def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st...
85afe3cf7b6468e27cbca4451e87bfc49d31ebb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/85afe3cf7b6468e27cbca4451e87bfc49d31ebb0/xmllib.py
self.elements[key] = val, end
self.elements[tag] = getattr(self, key), end
def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st...
85afe3cf7b6468e27cbca4451e87bfc49d31ebb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/85afe3cf7b6468e27cbca4451e87bfc49d31ebb0/xmllib.py
key = key[4:] start, end = self.elements.get(key, (None, None))
tag = key[4:] start, end = self.elements.get(tag, (None, None))
def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st...
85afe3cf7b6468e27cbca4451e87bfc49d31ebb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/85afe3cf7b6468e27cbca4451e87bfc49d31ebb0/xmllib.py
self.elements[key] = start, val
self.elements[tag] = start, getattr(self, key)
def __fixdict(self, dict): for key, val in dict.items(): if key[:6] == 'start_': key = key[6:] start, end = self.elements.get(key, (None, None)) if start is None: self.elements[key] = val, end elif key[:4] == 'end_': key = key[4:] start, end = self.elements.get(key, (None, None)) if end is None: self.elements[key] = st...
85afe3cf7b6468e27cbca4451e87bfc49d31ebb0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/85afe3cf7b6468e27cbca4451e87bfc49d31ebb0/xmllib.py
def pop (self): if self.list: result = self.list[0] del self.list[0] return (1, result) else: return (0, None)
75cfc1004de146eee2cc17f8b0ac6ed4c72c15e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/75cfc1004de146eee2cc17f8b0ac6ed4c72c15e8/asynchat.py
def pop (self): if self.list: result = self.list[0] del self.list[0] return (1, result) else: return (0, None)
75cfc1004de146eee2cc17f8b0ac6ed4c72c15e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/75cfc1004de146eee2cc17f8b0ac6ed4c72c15e8/asynchat.py
i = 0 while i < len(line) and line[i].isspace(): i = i+1 list.append(' %s\n' % line.strip()) if offset is not None: s = ' ' for c in line[i:offset-1]: if c.isspace(): s = s + c else: s = s + ' ' list.append('%s^\n' % s) value = msg
if line is not None: i = 0 while i < len(line) and line[i].isspace(): i = i+1 list.append(' %s\n' % line.strip()) if offset is not None: s = ' ' for c in line[i:offset-1]: if c.isspace(): s = s + c else: s = s + ' ' list.append('%s^\n' % s) value = msg
def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError...
89f6e8c77bee38434b8fb8aea90a0e88f44a7203 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/89f6e8c77bee38434b8fb8aea90a0e88f44a7203/traceback.py
compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x badsyntax [TARGETDIR]Lib"
compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x bad_coding|badsyntax|site-packages [TARGETDIR]Lib"
def add_ui(db): x = y = 50 w = 370 h = 300 title = "[ProductName] Setup" # see "Dialog Style Bits" modal = 3 # visible | modal modeless = 1 # visible track_disk_space = 32 add_data(db, 'ActionText', uisample.ActionText) add_data(db, 'UIText', uisample.UIText) # Bitmaps if not os.path.exists(srcdir+r"\PC\pytho...
c8e664fb8b471867d15e8c4ed4aa7555160fcc4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c8e664fb8b471867d15e8c4ed4aa7555160fcc4b/msi.py
except SyntaxWarning, msg: print "got SyntaxWarning as expected"
except SyntaxError, msg: print "got SyntaxError as expected"
def compile_and_catch_warning(text): try: compile(text, "<test code>", "exec") except SyntaxWarning, msg: print "got SyntaxWarning as expected" else: print "expected SyntaxWarning"
a1eb4eb036f5bd0d3416f564ddf4deb75c1f2632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1eb4eb036f5bd0d3416f564ddf4deb75c1f2632/test_global.py
print "expected SyntaxWarning"
print "expected SyntaxError"
def compile_and_catch_warning(text): try: compile(text, "<test code>", "exec") except SyntaxWarning, msg: print "got SyntaxWarning as expected" else: print "expected SyntaxWarning"
a1eb4eb036f5bd0d3416f564ddf4deb75c1f2632 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a1eb4eb036f5bd0d3416f564ddf4deb75c1f2632/test_global.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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
'/usr/lib',
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
'/lib',
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
), 'incs': ('db.h',)},
)},
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
'/usr/lib', '/lib',
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
), 'incs': ('db.h',)},
)},
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
find_lib_file = self.compiler.find_library_file
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
for dbinc in dbd['incs']: db_incs = find_file(dbinc, [], dbd['incdirs']) dblib_dir = find_lib_file(dbd['libdirs'], dblib) if db_incs and dblib_dir: dblib_dir = os.path.dirname(dblib_dir) dblibs = [dblib] raise found
db_incs = find_file('db.h', [], dbd['incdirs']) dblib_dir = find_library_file(self.compiler, dblib, lib_dirs, list(dbd['libdirs'])) if (db_incs or dbkey == std_dbinc) and \ dblib_dir is not None: dblibs = [dblib] raise found
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
library_dirs=[dblib_dir], runtime_library_dirs=[dblib_dir],
library_dirs=dblib_dir, runtime_library_dirs=dblib_dir,
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')
637e5aa23d513f9f0eb05233f49db4bd638d2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/637e5aa23d513f9f0eb05233f49db4bd638d2eee/setup.py
try: os.rename(self.baseFilename, dfn) except (KeyboardInterrupt, SystemExit): raise except: self.handleError(record)
os.rename(self.baseFilename, dfn)
def doRollover(self): """ Do a rollover, as described in __init__(). """
2ec385f5122cb4f7fc4678471f65cdb012c5030b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ec385f5122cb4f7fc4678471f65cdb012c5030b/handlers.py
try: os.rename(self.baseFilename, dfn) except (KeyboardInterrupt, SystemExit): raise except: self.handleError(record)
os.rename(self.baseFilename, dfn)
def doRollover(self): """ do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens. However, you want the file to be named for the start of the interval, not the current time. If there is a backup count, then we have to get a list of matching filenames, sort them and remove...
2ec385f5122cb4f7fc4678471f65cdb012c5030b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ec385f5122cb4f7fc4678471f65cdb012c5030b/handlers.py
print f(2)(5)
class TestFuture(unittest.TestCase): def test_floor_div_operator(self): self.assertEqual(7 // 2, 3) def test_true_div_as_default(self): self.assertAlmostEqual(7 / 2, 3.5) def test_nested_scopes(self): self.assertEqual(nester(), 3) def test_main(): test_support.run_unittest(TestFuture) if __name__ == "__main__": te...
def g(y): return y // x
31e84142e3a185fa26e39d0c525ce386f31b61a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/31e84142e3a185fa26e39d0c525ce386f31b61a2/test_future3.py
if self.__at_start:
data = rawdata[i:j] if self.__at_start and space.match(data) is None:
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ...
6e34cc63866fd44f80a155ce15438c7767002341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e34cc63866fd44f80a155ce15438c7767002341/xmllib.py
data = rawdata[i:j]
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ...
6e34cc63866fd44f80a155ce15438c7767002341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e34cc63866fd44f80a155ce15438c7767002341/xmllib.py
res = qname.match(tagname)
if self.__use_namespaces: res = qname.match(tagname) else: res = None
def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracketfind.match(rawdata, i+1) if end is None: return -1 tag = starttagmatch.match(rawdata, i) if tag is None or tag.end(0) != end.end(0): self.syntax_error('garbage in starttag') return end.end(0) nstag = tagname = tag.group('tagn...
6e34cc63866fd44f80a155ce15438c7767002341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e34cc63866fd44f80a155ce15438c7767002341/xmllib.py
nattrdict = {} for key, val in attrdict.items(): res = qname.match(key) if res is not None: aprefix, key = res.group('prefix', 'local') if aprefix is None: aprefix = '' ans = None for t, d, nst in self.stack: if d.has_key(aprefix): ans = d[aprefix] if ans is None and aprefix != '': ans = self.__namespaces.get(aprefix) ...
if self.__use_namespaces: nattrdict = {} for key, val in attrdict.items(): res = qname.match(key) if res is not None: aprefix, key = res.group('prefix', 'local') if aprefix is None: aprefix = '' ans = None for t, d, nst in self.stack: if d.has_key(aprefix): ans = d[aprefix] if ans is None and aprefix != '': ans = self....
def parse_starttag(self, i): rawdata = self.rawdata # i points to start of tag end = endbracketfind.match(rawdata, i+1) if end is None: return -1 tag = starttagmatch.match(rawdata, i) if tag is None or tag.end(0) != end.end(0): self.syntax_error('garbage in starttag') return end.end(0) nstag = tagname = tag.group('tagn...
6e34cc63866fd44f80a155ce15438c7767002341 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e34cc63866fd44f80a155ce15438c7767002341/xmllib.py
self.assertRaises(ValueError, lambda: bytes([C(-1)])) self.assertRaises(ValueError, lambda: bytes([C(256)]))
self.assertRaises(ValueError, bytes, [C(-1)]) self.assertRaises(ValueError, bytes, [C(256)])
def __index__(self): return self.i
94d9d7deb67cb084db642b11ea4f6c2fa56d0dfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94d9d7deb67cb084db642b11ea4f6c2fa56d0dfb/test_bytes.py
self.assertRaises(TypeError, lambda: bytes(["0"])) self.assertRaises(TypeError, lambda: bytes([0.0])) self.assertRaises(TypeError, lambda: bytes([None])) self.assertRaises(TypeError, lambda: bytes([C()]))
self.assertRaises(TypeError, bytes, ["0"]) self.assertRaises(TypeError, bytes, [0.0]) self.assertRaises(TypeError, bytes, [None]) self.assertRaises(TypeError, bytes, [C()])
def test_constructor_type_errors(self): class C: pass self.assertRaises(TypeError, lambda: bytes(["0"])) self.assertRaises(TypeError, lambda: bytes([0.0])) self.assertRaises(TypeError, lambda: bytes([None])) self.assertRaises(TypeError, lambda: bytes([C()]))
94d9d7deb67cb084db642b11ea4f6c2fa56d0dfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94d9d7deb67cb084db642b11ea4f6c2fa56d0dfb/test_bytes.py
self.assertRaises(ValueError, lambda: bytes([-1])) self.assertRaises(ValueError, lambda: bytes([-sys.maxint])) self.assertRaises(ValueError, lambda: bytes([-sys.maxint-1])) self.assertRaises(ValueError, lambda: bytes([-sys.maxint-2])) self.assertRaises(ValueError, lambda: bytes([-10**100])) self.assertRaises(ValueError...
self.assertRaises(ValueError, bytes, [-1]) self.assertRaises(ValueError, bytes, [-sys.maxint]) self.assertRaises(ValueError, bytes, [-sys.maxint-1]) self.assertRaises(ValueError, bytes, [-sys.maxint-2]) self.assertRaises(ValueError, bytes, [-10**100]) self.assertRaises(ValueError, bytes, [256]) self.assertRaises(ValueE...
def test_constructor_value_errors(self): self.assertRaises(ValueError, lambda: bytes([-1])) self.assertRaises(ValueError, lambda: bytes([-sys.maxint])) self.assertRaises(ValueError, lambda: bytes([-sys.maxint-1])) self.assertRaises(ValueError, lambda: bytes([-sys.maxint-2])) self.assertRaises(ValueError, lambda: bytes(...
94d9d7deb67cb084db642b11ea4f6c2fa56d0dfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94d9d7deb67cb084db642b11ea4f6c2fa56d0dfb/test_bytes.py
def __init__(self, widget): self.widget = widget self.tipwindow = None self.id = None self.x = self.y = 0
keydefs = { '<<paren-open>>': ['<Key-parenleft>'], '<<paren-close>>': ['<Key-parenright>'], '<<check-calltip-cancel>>': ['<KeyRelease>', '<ButtonRelease>'] } windows_keydefs = { }
def __init__(self, widget): self.widget = widget self.tipwindow = None self.id = None self.x = self.y = 0
e3be6bfd1a3c9b8a90b99878151505c3c52878da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e3be6bfd1a3c9b8a90b99878151505c3c52878da/CallTips.py
def showtip(self, text): self.text = text if self.tipwindow or not self.text: return self.widget.see("insert") x, y, cx, cy = self.widget.bbox("insert") x = x + self.widget.winfo_rootx() + 2 y = y + cy + self.widget.winfo_rooty() self.tipwindow = tw = Toplevel(self.widget) tw.wm_overrideredirect(1) tw.wm_geometry("+%d+...
unix_keydefs = { } def __init__(self, editwin): self.editwin = editwin self.text = editwin.text self.calltip = None if hasattr(self.text, "make_calltip_window"): self._make_calltip_window = self.text.make_calltip_window else: self._make_calltip_window = self._make_tk_calltip_window def _make_tk_calltip_window(self): ...
def showtip(self, text): self.text = text if self.tipwindow or not self.text: return self.widget.see("insert") x, y, cx, cy = self.widget.bbox("insert") x = x + self.widget.winfo_rootx() + 2 y = y + cy + self.widget.winfo_rooty() self.tipwindow = tw = Toplevel(self.widget) tw.wm_overrideredirect(1) tw.wm_geometry("+%d+...
e3be6bfd1a3c9b8a90b99878151505c3c52878da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e3be6bfd1a3c9b8a90b99878151505c3c52878da/CallTips.py
class container: def __init__(self): root = Tk() text = self.text = Text(root) text.pack(side=LEFT, fill=BOTH, expand=1) text.insert("insert", "string.split") root.update() self.calltip = CallTip(text)
def test( tests ): failed=[] for t in tests: if get_arg_text(t) != t.__doc__: failed.append(t) print "%s - expected %s, but got %s" % (t, `t.__doc__`, `get_arg_text(t)`) print "%d of %d tests failed" % (len(failed), len(tests))
def hidetip(self): tw = self.tipwindow self.tipwindow = None if tw: tw.destroy()
e3be6bfd1a3c9b8a90b99878151505c3c52878da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e3be6bfd1a3c9b8a90b99878151505c3c52878da/CallTips.py
text.event_add("<<calltip-show>>", "(") text.event_add("<<calltip-hide>>", ")") text.bind("<<calltip-show>>", self.calltip_show) text.bind("<<calltip-hide>>", self.calltip_hide) text.focus_set()
tc = TC() tests = t1, t2, t3, t4, t5, t6, \ tc.t1, tc.t2, tc.t3, tc.t4, tc.t5, tc.t6
def __init__(self): root = Tk() text = self.text = Text(root) text.pack(side=LEFT, fill=BOTH, expand=1) text.insert("insert", "string.split") root.update() self.calltip = CallTip(text)
e3be6bfd1a3c9b8a90b99878151505c3c52878da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e3be6bfd1a3c9b8a90b99878151505c3c52878da/CallTips.py
def calltip_show(self, event): self.calltip.showtip("Hello world") def calltip_hide(self, event): self.calltip.hidetip() def main(): c=container() if __name__=='__main__': main()
test(tests)
def calltip_show(self, event): self.calltip.showtip("Hello world")
e3be6bfd1a3c9b8a90b99878151505c3c52878da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e3be6bfd1a3c9b8a90b99878151505c3c52878da/CallTips.py
print "open", askopenfilename(filetypes=[("all files", "*")]).encode(enc) print "saveas", asksaveasfilename().encode(enc)
def askdirectory (**options): "Ask for a directory, and return the file name" return Directory(**options).show()
63d1e57f2380f3be657cfca2d7f07e5b5a77c9c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/63d1e57f2380f3be657cfca2d7f07e5b5a77c9c4/tkFileDialog.py
extern int _QdRGB_Convert(PyObject *, RGBColorPtr *);
extern int _QdRGB_Convert(PyObject *, RGBColorPtr);
#ifdef USE_TOOLBOX_OBJECT_GLUE
f1d19a17b5516502cca2abacf7d6f28e08bff097 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f1d19a17b5516502cca2abacf7d6f28e08bff097/qdsupport.py
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColorPtr, QdRGB_Convert);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColor, QdRGB_Convert);
#ifdef USE_TOOLBOX_OBJECT_GLUE
f1d19a17b5516502cca2abacf7d6f28e08bff097 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f1d19a17b5516502cca2abacf7d6f28e08bff097/qdsupport.py
if hex(-16) != '0xfffffff0': raise TestFailed, 'hex(-16)'
if len(hex(-1)) != len(hex(sys.maxint)): raise TestFailed, 'len(hex(-1))' if hex(-16) not in ('0xfffffff0', '0xfffffffffffffff0'): raise TestFailed, 'hex(-16)'
def f(): pass
c059b0dcea2df5ebee4f464e6d6f0b5a0ca8ea95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c059b0dcea2df5ebee4f464e6d6f0b5a0ca8ea95/test_b1.py
longopts.sort()
def getopt(args, shortopts, longopts = []): """getopt(args, options[, long_options]) -> opts, args Parses command line options and parameter list. args is the argument list to be parsed, without the leading reference to the running program. Typically, this means "sys.argv[1:]". shortopts is the string of option let...
4ed29a7b1ad7d8762fc841d1631bef06a58b6d51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4ed29a7b1ad7d8762fc841d1631bef06a58b6d51/getopt.py
def do_longs(opts, opt, longopts, args): try: i = opt.index('=') except ValueError: optarg = None else: opt, optarg = opt[:i], opt[i+1:] has_arg, opt = long_has_args(opt, longopts) if has_arg: if optarg is None: if not args: raise GetoptError('option --%s requires argument' % opt, opt) optarg, args = args[0], args[1:]...
4ed29a7b1ad7d8762fc841d1631bef06a58b6d51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4ed29a7b1ad7d8762fc841d1631bef06a58b6d51/getopt.py
for i in range(len(longopts)): if longopts[i].startswith(opt): break else:
possibilities = [o for o in longopts if o.startswith(opt)] if not possibilities:
def long_has_args(opt, longopts): for i in range(len(longopts)): if longopts[i].startswith(opt): break else: raise GetoptError('option --%s not recognized' % opt, opt) # opt is a prefix of longopts[i]; find j s.t. opt is a prefix of # each possibility in longopts[i:j] j = i+1 while j < len(longopts) and longopts[j].sta...
4ed29a7b1ad7d8762fc841d1631bef06a58b6d51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4ed29a7b1ad7d8762fc841d1631bef06a58b6d51/getopt.py
j = i+1 while j < len(longopts) and longopts[j].startswith(opt): j += 1 possibilities = longopts[i:j]
def long_has_args(opt, longopts): for i in range(len(longopts)): if longopts[i].startswith(opt): break else: raise GetoptError('option --%s not recognized' % opt, opt) # opt is a prefix of longopts[i]; find j s.t. opt is a prefix of # each possibility in longopts[i:j] j = i+1 while j < len(longopts) and longopts[j].sta...
4ed29a7b1ad7d8762fc841d1631bef06a58b6d51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4ed29a7b1ad7d8762fc841d1631bef06a58b6d51/getopt.py
exceptions, this sets `sender' to the string that the SMTP refused
exceptions, this sets `sender' to the string that the SMTP refused.
def __init__(self, code, msg): self.smtp_code = code self.smtp_error = msg self.args = (code, msg)
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
"""All recipient addresses refused.
"""All recipient addresses refused.
def __init__(self, code, msg, sender): self.smtp_code = code self.smtp_error = msg self.sender = sender self.args = (code, msg, sender)
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
"""Error during connection establishment"""
"""Error during connection establishment."""
def __init__(self, recipients): self.recipients = recipients self.args = ( recipients,)
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
"""The server refused our HELO reply"""
"""The server refused our HELO reply."""
def __init__(self, recipients): self.recipients = recipients self.args = ( recipients,)
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
Double leading '.', and change Unix newline '\n', or Mac '\r' into
Double leading '.', and change Unix newline '\\n', or Mac '\\r' into
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
This is the message given by the server in responce to the
This is the message given by the server in response to the
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
This is the message given by the server in responce to the
This is the message given by the server in response to the
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
will _after you do an EHLO command_, contain the names of the SMTP service extentions this server supports, and their
will _after you do an EHLO command_, contain the names of the SMTP service extensions this server supports, and their
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
Note, all extention names are mapped to lower case in the
Note, all extension names are mapped to lower case in the
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
For method docs, see each method's docstrings. In general, there is a method of the same name to perform each SMTP command, and there is a method called 'sendmail' that will do an entire mail transaction. """
See each method's docstrings for details. In general, there is a method of the same name to perform each SMTP command. There is also a method called 'sendmail' that will do an entire mail transaction. """
def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
By default, smtplib.SMTP_PORT is used. An SMTPConnectError is raised if the specified `host' doesn't respond correctly.
By default, smtplib.SMTP_PORT is used. An SMTPConnectError is raised if the specified `host' doesn't respond correctly.
def __init__(self, host = '', port = 0): """Initialize a new instance.
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
one recipient. It returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server.
one recipient. It returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server.
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
SMTPRecipientsRefused The server rejected for ALL recipients
SMTPRecipientsRefused The server rejected ALL recipients
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
550. If all addresses are accepted, then the method will return an
550. If all addresses are accepted, then the method will return an
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
da063017c315c412a09400d414da00bc3d9b57c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/da063017c315c412a09400d414da00bc3d9b57c2/smtplib.py
text = text.translate(self.whitespace_trans)
if isinstance(text, str): text = text.translate(self.whitespace_trans) elif isinstance(text, unicode): text = text.translate(self.unicode_whitespace_trans)
def _munge_whitespace(self, text): """_munge_whitespace(text : string) -> string
ad25865f946cefe2d3f291298b6cb7e8fc0b2c39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ad25865f946cefe2d3f291298b6cb7e8fc0b2c39/textwrap.py
entriesbygid = {}
def test_values(self): entries = grp.getgrall() entriesbyname = {} entriesbygid = {}
004b7da367c3f8c8345a7897a0587b23d8642f2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/004b7da367c3f8c8345a7897a0587b23d8642f2e/test_grp.py
self.assertEqual(len(e), 4) self.assertEqual(e[0], e.gr_name) self.assert_(isinstance(e.gr_name, basestring)) self.assertEqual(e[1], e.gr_passwd) self.assert_(isinstance(e.gr_passwd, basestring)) self.assertEqual(e[2], e.gr_gid) self.assert_(isinstance(e.gr_gid, int)) self.assertEqual(e[3], e.gr_mem) self.assert_(isins...
self.check_value(e) entriesbygid.setdefault(e.gr_gid, []).append(e) entriesbyname.setdefault(e.gr_name, []).append(e)
def test_values(self): entries = grp.getgrall() entriesbyname = {} entriesbygid = {}
004b7da367c3f8c8345a7897a0587b23d8642f2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/004b7da367c3f8c8345a7897a0587b23d8642f2e/test_grp.py
entriesbyname.setdefault(e.gr_name, []).append(e) entriesbygid.setdefault(e.gr_gid, []).append(e)
def test_values(self): entries = grp.getgrall() entriesbyname = {} entriesbygid = {}
004b7da367c3f8c8345a7897a0587b23d8642f2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/004b7da367c3f8c8345a7897a0587b23d8642f2e/test_grp.py
self.assert_(grp.getgrgid(e.gr_gid) in entriesbygid[e.gr_gid]) self.assert_(grp.getgrnam(e.gr_name) in entriesbyname[e.gr_name])
e2 = grp.getgrgid(e.gr_gid) self.check_value(e2) self.assert_(max([self.valueseq(e2, x) \ for x in entriesbygid[e.gr_gid]])) e2 = grp.getgrnam(e.gr_name) self.check_value(e2) self.assert_(max([self.valueseq(e2, x) \ for x in entriesbyname[e.gr_name]]))
def test_values(self): entries = grp.getgrall() entriesbyname = {} entriesbygid = {}
004b7da367c3f8c8345a7897a0587b23d8642f2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/004b7da367c3f8c8345a7897a0587b23d8642f2e/test_grp.py
'initial value %r' % (maxcount,))
'initial value %r' % self.maxcount
def v(self): self.nonzero.acquire() if self.count == self.maxcount: raise ValueError, '.v() tried to raise semaphore count above ' \ 'initial value %r' % (maxcount,)) self.count = self.count + 1 self.nonzero.signal() self.nonzero.release()
fc96f630ebfb66bf5d29212c932fa19be98393c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fc96f630ebfb66bf5d29212c932fa19be98393c7/sync.py
input = text_file.TextFile('Modules/Setup', join_lines=1)
def build_extensions(self):
a0b32abbe449df441711895f67d1420d93fcd54f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0b32abbe449df441711895f67d1420d93fcd54f/setup.py
while 1: line = input.readline() if not line: break line = line.split() remove_modules.append( line[0] ) input.close()
for filename in ('Modules/Setup', 'Modules/Setup.local'): input = text_file.TextFile(filename, join_lines=1) while 1: line = input.readline() if not line: break line = line.split() remove_modules.append(line[0]) input.close()
def build_extensions(self):
a0b32abbe449df441711895f67d1420d93fcd54f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0b32abbe449df441711895f67d1420d93fcd54f/setup.py
'.mid': 'audio/midi', '.midi': 'audio/midi',
def read_mime_types(file): try: f = open(file) except IOError: return None db = MimeTypes() db.readfp(f) return db.types_map
0cabee06003d1b33f07c368e748b336d846fcd4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0cabee06003d1b33f07c368e748b336d846fcd4a/mimetypes.py
'.rtf': 'application/rtf',
def read_mime_types(file): try: f = open(file) except IOError: return None db = MimeTypes() db.readfp(f) return db.types_map
0cabee06003d1b33f07c368e748b336d846fcd4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0cabee06003d1b33f07c368e748b336d846fcd4a/mimetypes.py
def runctx(statement, globals, locals, filename=None): """Run statement under profiler, supplying your own globals and locals, optionally saving results in filename. statement and filename have the same semantics as profile.run """ prof = Profile() try: prof = prof.runctx(statement, globals, locals) except SystemExit:...
4cf397b8b6cd1fff94953015e85ed3afba0e066e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4cf397b8b6cd1fff94953015e85ed3afba0e066e/profile.py
for dirname in sys.path: fullname = os.path.join(dirname, 'profile.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} ' + fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "profile.doc"', print 'along the Python search path.'
print "Documentation for the profile module can be found " print "in the Python Library Reference, section 'The Python Profiler'."
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'profile.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} ' + fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "profile.doc"', print 'along the Python search path.'
4cf397b8b6cd1fff94953015e85ed3afba0e066e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4cf397b8b6cd1fff94953015e85ed3afba0e066e/profile.py
if platform in ('darwin', 'mac'):
if platform in ('darwin', 'mac') and ("--disable-toolbox-glue" not in sysconfig.get_config_var("CONFIG_ARGS")):
def build_extensions(self):
bb523df5026f155f5a81deb758ba0bbaa98e7c42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb523df5026f155f5a81deb758ba0bbaa98e7c42/setup.py
if platform == 'darwin':
if platform == 'darwin' and ("--disable-toolbox-glue" not in sysconfig.get_config_var("CONFIG_ARGS")):
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')
bb523df5026f155f5a81deb758ba0bbaa98e7c42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb523df5026f155f5a81deb758ba0bbaa98e7c42/setup.py
elif o[-6:] == '.lproj': files = os.listdir(o) for f in files: if f[-4:] == '.nib': nibname = os.path.split(f)[1][:-4] cocoainfo = """ <key>NSMainNibFile</key> <string>%s</string> <key>NSPrincipalClass</key> <string>NSApplication</string>""" % nibname
def process_common_macho(template, progress, code, rsrcname, destname, is_update, raw=0, others=[]): # First make sure the name ends in ".app" if destname[-4:] != '.app': destname = destname + '.app' # Now deduce the short name shortname = os.path.split(destname)[1] if shortname[-4:] == '.app': # Strip the .app suffix ...
5cd382bae9d7d532acc8f4de3ff268700461d6fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5cd382bae9d7d532acc8f4de3ff268700461d6fe/buildtools.py
stat_function = (os.stat, statcache.stat)[use_statcache] s1, s2 = _sig(stat_function(f1)), _sig(stat_function(f2)) if s1[0]!=stat.S_IFREG or s2[0]!=stat.S_IFREG: return 0 if shallow and s1 == s2: return 1 if s1[1]!=s2[1]: return 0
if use_statcache: stat_function = statcache.stat else: stat_function = os.stat s1 = _sig(stat_function(f1)) s2 = _sig(stat_function(f2)) if s1[0] != stat.S_IFREG or s2[0] != stat.S_IFREG: return 0 if shallow and s1 == s2: return 1 if s1[1] != s2[1]: return 0
def cmp(f1, f2, shallow=1,use_statcache=0): """Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- Just check stat signature (do not read the files). defaults to 1. use_statcache -- Do not stat() each file directly: go through the statcache module for more efficiency. Return valu...
e67ced89ee2947866569c4a47c3a35e513c980cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e67ced89ee2947866569c4a47c3a35e513c980cd/filecmp.py
if result and (s1, s2)==result[:2]:
if result and (s1, s2) == result[:2]:
def cmp(f1, f2, shallow=1,use_statcache=0): """Compare two files. Arguments: f1 -- First file name f2 -- Second file name shallow -- Just check stat signature (do not read the files). defaults to 1. use_statcache -- Do not stat() each file directly: go through the statcache module for more efficiency. Return valu...
e67ced89ee2947866569c4a47c3a35e513c980cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e67ced89ee2947866569c4a47c3a35e513c980cd/filecmp.py
print "path =", `path` if "/arse" in path: import pdb; pdb.set_trace()
def write_results_file(self, path, lines, lnotab, lines_hit): """Return a coverage results file in path."""
2ac16e538f0380db14afbbf75a366b09089f1651 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ac16e538f0380db14afbbf75a366b09089f1651/trace.py
raise IOError(errno.EBADF, "write() on read-only GzipFile object")
raise IOError(errno.EBADF, "read() on write-only GzipFile object")
def read(self, size=-1): if self.mode != READ: import errno raise IOError(errno.EBADF, "write() on read-only GzipFile object")
ca05e33210a2873d1779e971fa96e8fe3c9eecf7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca05e33210a2873d1779e971fa96e8fe3c9eecf7/gzip.py
elif type(arg) == type(""):
elif isinstance(arg, basestring):
def load_stats(self, arg): if not arg: self.stats = {} elif type(arg) == type(""): f = open(arg, 'rb') self.stats = marshal.load(f) f.close() try: file_stats = os.stat(arg) arg = time.ctime(file_stats.st_mtime) + " " + arg except: # in case this is not unix pass self.files = [ arg ] elif hasattr(arg, 'create_stats...
d87e451b9e9b355ac75c9c2ed08cde21ba10db5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d87e451b9e9b355ac75c9c2ed08cde21ba10db5e/pstats.py
'lambda': ('ref/lambda', 'FUNCTIONS'),
'lambda': ('ref/lambdas', 'FUNCTIONS'),
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...
9fbf287241e4561acb33255cfb71cba124e273ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9fbf287241e4561acb33255cfb71cba124e273ee/pydoc.py
'pass': 'PASS',
'pass': ('ref/pass', ''),
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...
9fbf287241e4561acb33255cfb71cba124e273ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9fbf287241e4561acb33255cfb71cba124e273ee/pydoc.py