rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
platform = self.get_platform() | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. | 0b06be7b0be87bd78707a939cb9964f634f392d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0b06be7b0be87bd78707a939cb9964f634f392d4/setup.py | |
def _utc2time(utc): return utc[1] | def _utc2time(utc): t = utc[1] if t < 0: t = t + 0x100000000L return t | def _utc2time(utc): return utc[1] | cbdffcee6239740665625ae2e4ff8710a8784242 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cbdffcee6239740665625ae2e4ff8710a8784242/macfs.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') | fc8341d0706bcf41711b289897cf7b8c4b7178a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fc8341d0706bcf41711b289897cf7b8c4b7178a7/setup.py | ||
list.append(errordict[e], errorfirst[e], errorlast[e], e) | list.append((errordict[e], errorfirst[e], errorlast[e], e)) | def parsedir(dir, modify): os.chdir(dir) pat = re.compile('^[0-9]*$') errordict = {} errorfirst = {} errorlast = {} nok = nwarn = nbad = 0 # find all numeric file names and sort them files = filter(lambda fn, pat=pat: pat.match(fn) is not None, os.listdir('.')) files.sort(sort_numeric) for fn in files: # Lets try to ... | 67dd17f730000cc369c8d48e747c1cf2af10c381 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/67dd17f730000cc369c8d48e747c1cf2af10c381/mailerdaemon.py |
def testboth(formatstr, *args): testformat(formatstr, *args) testformat(unicode(formatstr), *args) | a3a3a030af8579bdd0d3a8d293ee60a1ec8107dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a3a3a030af8579bdd0d3a8d293ee60a1ec8107dc/test_format.py | ||
ctype = msg.get_type() if ctype is None: ctype = msg.get_default_type() assert ctype in ('text/plain', 'message/rfc822') | ctype = msg.get_content_type() | def _dispatch(self, msg): # Get the Content-Type: for the message, then try to dispatch to # self._handle_<maintype>_<subtype>(). If there's no handler for the # full MIME type, then dispatch to self._handle_<maintype>(). If # that's missing too, then dispatch to self._writeBody(). ctype = msg.get_type() if ctype is ... | 1cecdc6bcb3226c2a0a071406e3b06308fbb1369 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1cecdc6bcb3226c2a0a071406e3b06308fbb1369/Generator.py |
self.extra_dirs = install.extra_dirs self.path_file = install.path_file | 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") | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py | |
root_dir = os.path.normpath (install.install_lib) | root_dir = os.path.normpath (install.install_purelib) | 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") | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py |
if (self.path_file): lines.append ("path_file=%s" % self.path_file) if (self.extra_dirs): lines.append ("extra_dirs=%s" % self.extra_dirs) | def get_inidata (self): # Return data describing the installation. | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py | |
AAAA4AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ZGUuDQ0KJAAAAAAAAADq05KMrrL8366y/N+usvzf1a7w36+y/N8trvLfrLL831GS+N+ssvzfzK3v 36ay/N+usv3fzrL8366y/N+jsvzfUZL236Oy/N9ptPrfr7L831JpY2iusvzfAAAAAAAAAABQRQAA TAEDAPimujkAAAAAAAAAAOAADwELAQYAAEAAAAAQAAAAkAAA4NUAAACgAAAA4AAAAABAAAAQAAAA AgAABAAAAAAA... | AAAA8AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ZGUuDQ0KJAAAAAAAAADqs5WMrtL7367S+9+u0vvf1c7336/S+98tzvXfrNL731Hy/9+s0vvfzM3o 36bS+9+u0vrf89L7367S+9+j0vvfUfLx36PS+99p1P3fr9L731JpY2iu0vvfAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAUEUAAEwBAwD9e9Q5AAAAAAAAAADgAA8BCwEGAABAAAAAEAAAAJAAAADVAAAA oAAAAOAAAAAA... | def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA) | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py |
bGwgUmlnaHRzIFJlc2VydmVkLiAkCgBVUFghDAkCCgSozNfnkDDP6bYAANQ1AAAAsAAAJgEAjf+/ /f9TVVaLdCQUhfZXdHaLfAi9EHBAAIA+AHRoalxWbP/29v8V/GANi/BZHll0V4AmAFcReP833//Y g/v/dR5qD3yFwHUROUQkHHQLV9na//9VagX/VCQog8QM9sMQdR1otwAAJID/T9itg10cACHGBlxG dZNqAVhfXr/7//9dW8NVi+yD7BCLRRRTVleLQBaLPYg0iUX4M/a79u7+d0PAOXUIdQfHRQgBDFZo gFYRY9/+9lZW... | bGwgUmlnaHRzIFJlc2VydmVkLiAkCgBVUFghDAkCCmbxMY8TFMU40bYAAPM0AAAAsAAAJgEABP+/ /f9TVVaLdCQUhfZXdHaLfAi9EHBAAIA+AHRoalxWbP/29v8V/GANi/BZHll0V4AmAFcRmP833//Y g/v/dR5qD5SFwHUROUQkHHQLV9na//9VagX/VCQog8QM9sMQdR1otwAAJJD/T9itg10cACHGBlxG dZNqAVhfXr/7//9dW8NVi+yD7BCLRRRTVleLQBaLPXg0iUX4M/a79u7+d0PAOXUIdQfHRQgBDFZo gFYRY9/+9lZW... | def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA) | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py |
vb37yAONRfBQ3GaLSAoDQAxRYdj70HuESn38GQNQ4XVvppQ7+HUJC1Sdhy+U7psOVmoEVhBwhIs9 VN/X4CKQhg9oOIk8mu3WNusmrCsCUyp0U8/3W9uuCCV2CDvGdRcnECjChmYwhJURM8B8ti385FvJ OFOLXVKLIVeh2B4W/kYIZj0IAFGeADiayG1uu13sUOjWP+JMEDZXyLbLVrgiEkC7CMwWXgbYtvvP 3SVoqFgq8VCJXdQtFoze+/7CjVrAdHf/dChQaJCfGUtbutvnBBeslXQTGg18kvLPde4E0JH2IR8W PIXAHrqBHGTc... | vb37yAONRfBQ3GaLSAoDQAxRYdj70Ht0Sn38GQNQ4XVvpqQ7+HUJC4idhy+U7psOVmoEVhCghIs9 iN/X4CKQhg9oOIk8mu3WNusmrCsCUyqcU8/3W9uuCCV2CDvGdRcnECjChmYwhJURM8B8ti385FvJ OFOLXVKLIVeh2B4W/kYIZj0IAFGeADiayG1uu13sUOjWPpJMEDZXyLbLVrgiEkC7CMwWXgbYtvvP 3SVoqFgq8VCJXdQtFTze+/7CjVrAdHf/dChQaJCfGUtbutvnBBZclXQTGg18kvLPde4E0JH2IR8U 7IXAHrqBHGTc... | def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA) | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py |
DUYcA1YaA8gDdlSKGh5shMYv7I2F6P6dXfQLgi1f92iw7lDM7hAfO9O72fRQjYQFDRdMGlDMbmFz GyUDAPAeDGG/DdjJSwRdV+hGFIC8BefCx+R3G1x0MP91FFhQ2JtrMLshAIZuFBsC7KmwM79WfAID | DUYcA1YaA8gDdlSKGh5shMYv7I2F6P6dXaQLgi1f92iw7lDMnhAfO9O72fRwjYQFDRdMGlDMbmFz GyUDAPAeDGG/DdjJSwRdV5hGFIC8BefCx+R3G1x0MP91FFhQ2JtrMLshAIZuFBsC7KmwM79WfAID | def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA) | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py |
yf2A+S912Lcz/gPGAFxAde9zQFwMD3QXdiPdDI+cQclEYVIF49gbrU4KC8BXUBRAYfPfbAXHcUoM PGoKmVn39222/PkzyWi0cFEAHmi8AgAN0SyZhi80KyhQbramtjLXGg0UFSS+4IloS0fYBFYZWVAu DwF2ct3dIB0sGP/TaCnXKN7XDuw4YCMKARXTqZw5070LXyCfnjhdY2vN9PH2wj7auLC9+7YABgA9 /OFOdHCBBRB42jHLZ6OKfQjfYTR8+E/nBgDHBCSAm78A8P/Ac7jfwfDyNUwF0xrtW7s0CugDPzrW aECKFjayOdho... | yf2A+S912Lcz/gPGAFxAde9zQFwMD3QXdpEaDI+cQd1hUnHsjdYFTgoLwFdQFExhb7aC4/NxSgxI agqZWfs2W/73+TPJaLRwUQAeaLwCAA1olkzDLzArOFA3W1PbMtcaDRQVKL6AibSlI2wEVhlZUC4P ATu57m4gHSQY/9NoKdco72sHdiBgIwoBFdOpzpzpXgtfLJ+eRK6xtWb08fbCPtrY3n3buAAGAD2s 4U50cIEFEOjumGVno4p9CFdBYTR8+E/nBgDHBCQgm78A8P/A5nCf7fJgNVgF0xq7t3ZpCugDPzrW aODCaP3ayOZg... | def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA) | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py |
AABFeGl0UHJvY2VzcwAAAFJlZ0Nsb3NlS2V5AAAAUHJvcGVydHlTaGVldEEAAFRleHRPdXRBAABm cmVlAABFbmRQYWludAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | AABFeGl0UHJvY2VzcwAAAFJlZ0Nsb3NlS2V5AAAAUHJvcGVydHlTaGVldEEAAFRleHRPdXRBAABl eGl0AABFbmRQYWludAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | def get_exe_bytes (self): import base64 return base64.decodestring (EXEDATA) | 1dbe9d52479c2edcd1384106afbe2e7ba921cf88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dbe9d52479c2edcd1384106afbe2e7ba921cf88/bdist_wininst.py |
raise 'catch me' except: | 1/0 except ZeroDivisionError: | def currentframe(): """Return the frame object for the caller's stack frame.""" try: raise 'catch me' except: return sys.exc_traceback.tb_frame.f_back | a959a36288120863f2122ac1c226ee965efcec97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a959a36288120863f2122ac1c226ee965efcec97/inspect.py |
"paragraph", "subparagraph") | "paragraph", "subparagraph", "description", "opcodedesc", "classdesc", "funcdesc", "methoddesc", "excdesc", "datadesc", "funcdescni", "methoddescni", "excdescni", "datadescni", ) | def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == xml.dom.core.ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep)) | 4259f0db04f4c85f91637eb276330ad6b1e25d54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4259f0db04f4c85f91637eb276330ad6b1e25d54/docfixer.py |
"moduleinfo", "title", "opcodedesc", "verbatim", "funcdesc", "methoddesc", "excdesc", "datadesc", | "moduleinfo", "title", "verbatim", "opcodedesc", "classdesc", "funcdesc", "methoddesc", "excdesc", "datadesc", | def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == xml.dom.core.ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep)) | 4259f0db04f4c85f91637eb276330ad6b1e25d54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4259f0db04f4c85f91637eb276330ad6b1e25d54/docfixer.py |
i = 0 | i = len(children) | def fixup_paras_helper(doc, container): # document is already normalized children = container.childNodes start = 0 start_fixed = 0 i = 0 SKIP_ELEMENTS = PARA_LEVEL_ELEMENTS + PARA_LEVEL_PRECEEDERS for child in children: if child.nodeType == xml.dom.core.ELEMENT: if child.tagName in FIXUP_PARA_ELEMENTS: fixup_paras_help... | 4259f0db04f4c85f91637eb276330ad6b1e25d54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4259f0db04f4c85f91637eb276330ad6b1e25d54/docfixer.py |
for child in children: if child.nodeType == xml.dom.core.ELEMENT: if child.tagName in FIXUP_PARA_ELEMENTS: fixup_paras_helper(doc, child) break elif child.tagName in SKIP_ELEMENTS: if not start_fixed: start = i + 1 elif not start_fixed: start_fixed = 1 i = i + 1 else: if child.nodeType == xml.dom.core.TEXT \ and string... | def fixup_paras_helper(doc, container): # document is already normalized children = container.childNodes start = 0 start_fixed = 0 i = 0 SKIP_ELEMENTS = PARA_LEVEL_ELEMENTS + PARA_LEVEL_PRECEEDERS for child in children: if child.nodeType == xml.dom.core.ELEMENT: if child.tagName in FIXUP_PARA_ELEMENTS: fixup_paras_help... | 4259f0db04f4c85f91637eb276330ad6b1e25d54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4259f0db04f4c85f91637eb276330ad6b1e25d54/docfixer.py | |
y = self.expovariate(alpha) z = self.expovariate(1.0/beta) return z/(y+z) | y = self.gammavariate(alpha, 1.) if y == 0: return 0.0 else: return y / (y + self.gammavariate(beta, 1.)) | def betavariate(self, alpha, beta): | 85e2e4742d0a1accecd02058a7907df36308297e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/85e2e4742d0a1accecd02058a7907df36308297e/random.py |
for pattern in [' at 0x[0-9a-f]{6,}>$', ' at [0-9A-F]{8,}>$']: | for pattern in [' at 0x[0-9a-f]{6,}(>+)$', ' at [0-9A-F]{8,}(>+)$']: | def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent; we check two cases. for pattern in [' at 0x[0-9a-f]{6,}>$', ' at [0-9A-F]{8,}>$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '>', text) return text | 45daeb093f070f2460028068e6e64a88c9db9665 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45daeb093f070f2460028068e6e64a88c9db9665/pydoc.py |
return re.sub(pattern, '>', text) | return re.sub(pattern, '\\1', text) | def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent; we check two cases. for pattern in [' at 0x[0-9a-f]{6,}>$', ' at [0-9A-F]{8,}>$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '>', text) return text | 45daeb093f070f2460028068e6e64a88c9db9665 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45daeb093f070f2460028068e6e64a88c9db9665/pydoc.py |
suffix, name = '', None if type(thing) is type(''): try: object = locate(thing, forceload) except ErrorDuringImport, value: print value return if not object: print 'no Python documentation found for %s' % repr(thing) return parts = split(thing, '.') if len(parts) > 1: suffix = ' in ' + join(parts[:-1], '.') name = part... | try: object, name = resolve(thing, forceload) desc = describe(object) module = inspect.getmodule(object) if name and '.' in name: desc += ' in ' + name[:name.rfind('.')] elif module and module is not object: desc += ' in module ' + module.__name__ pager(title % desc + '\n\n' + text.document(object, name)) except (Impor... | def doc(thing, title='Python Library Documentation: %s', forceload=0): """Display text documentation, given an object or a path to an object.""" suffix, name = '', None if type(thing) is type(''): try: object = locate(thing, forceload) except ErrorDuringImport, value: print value return if not object: print 'no Python ... | 45daeb093f070f2460028068e6e64a88c9db9665 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45daeb093f070f2460028068e6e64a88c9db9665/pydoc.py |
object = locate(key, forceload) except ErrorDuringImport, value: | object, name = resolve(thing, forceload) page = html.page(describe(object), html.document(object, name)) file = open(name + '.html', 'w') file.write(page) file.close() print 'wrote', name + '.html' except (ImportError, ErrorDuringImport), value: | def writedoc(key, forceload=0): """Write HTML documentation to a file in the current directory.""" try: object = locate(key, forceload) except ErrorDuringImport, value: print value else: if object: page = html.page(describe(object), html.document(object, object.__name__)) file = open(key + '.html', 'w') file.write(page... | 45daeb093f070f2460028068e6e64a88c9db9665 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45daeb093f070f2460028068e6e64a88c9db9665/pydoc.py |
else: if object: page = html.page(describe(object), html.document(object, object.__name__)) file = open(key + '.html', 'w') file.write(page) file.close() print 'wrote', key + '.html' else: print 'no Python documentation found for %s' % repr(key) | def writedoc(key, forceload=0): """Write HTML documentation to a file in the current directory.""" try: object = locate(key, forceload) except ErrorDuringImport, value: print value else: if object: page = html.page(describe(object), html.document(object, object.__name__)) file = open(key + '.html', 'w') file.write(page... | 45daeb093f070f2460028068e6e64a88c9db9665 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45daeb093f070f2460028068e6e64a88c9db9665/pydoc.py | |
return type(x) is types.StringType and find(x, os.sep) >= 0 | return isinstance(x, str) and find(x, os.sep) >= 0 | def ispath(x): return type(x) is types.StringType and find(x, os.sep) >= 0 | 45daeb093f070f2460028068e6e64a88c9db9665 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/45daeb093f070f2460028068e6e64a88c9db9665/pydoc.py |
"conjoin": conjoin_tests} | "conjoin": conjoin_tests, "weakref": weakref_tests, } | >>> def gencopy(iterator): | 56d12661934cfa280abf4884528d9e481a2d7a01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/56d12661934cfa280abf4884528d9e481a2d7a01/test_generators.py |
return _Dialog._fixresult(widget, result) | return _Dialog._fixresult(self, widget, result) | def _fixresult(self, widget, result): if isinstance(result, tuple): # multiple results: result = tuple([getattr(r, "string", r) for r in result]) if result: import os path, file = os.path.split(result[0]) self.options["initialdir"] = path # don't set initialfile or filename, as we have multiple of these return result i... | 8b76351934be5fcb53791019dab13ba3d6df4f89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b76351934be5fcb53791019dab13ba3d6df4f89/tkFileDialog.py |
import string PATH = string.splitfields(envpath, pathsep) | PATH = envpath.split(pathsep) | def _execvpe(file, args, env=None): if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath import string... | 965fdae40ea976fa133048110b24f35cc829b3c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/965fdae40ea976fa133048110b24f35cc829b3c8/os.py |
import string | def _execvpe(file, args, env=None): if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ global _notfound head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if env.has_key('PATH'): envpath = env['PATH'] else: envpath = defpath import string... | 965fdae40ea976fa133048110b24f35cc829b3c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/965fdae40ea976fa133048110b24f35cc829b3c8/os.py | |
upper = string.upper | def __init__(self, environ): UserDict.UserDict.__init__(self) data = self.data upper = string.upper for k, v in environ.items(): data[upper(k)] = v | 965fdae40ea976fa133048110b24f35cc829b3c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/965fdae40ea976fa133048110b24f35cc829b3c8/os.py | |
data[upper(k)] = v | data[k.upper()] = v | def __init__(self, environ): UserDict.UserDict.__init__(self) data = self.data upper = string.upper for k, v in environ.items(): data[upper(k)] = v | 965fdae40ea976fa133048110b24f35cc829b3c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/965fdae40ea976fa133048110b24f35cc829b3c8/os.py |
key = string.upper(key) self.data[key] = item | self.data[key.upper()] = item | def __setitem__(self, key, item): putenv(key, item) key = string.upper(key) self.data[key] = item | 965fdae40ea976fa133048110b24f35cc829b3c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/965fdae40ea976fa133048110b24f35cc829b3c8/os.py |
return self.data[string.upper(key)] | return self.data[key.upper()] def __delitem__(self, key): del self.data[key.upper()] | def __getitem__(self, key): return self.data[string.upper(key)] | 965fdae40ea976fa133048110b24f35cc829b3c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/965fdae40ea976fa133048110b24f35cc829b3c8/os.py |
return self.data.has_key(string.upper(key)) | return self.data.has_key(key.upper()) def get(self, key, failobj=None): return self.data.get(key.upper(), failobj) def update(self, dict): for k, v in dict.items(): self[k] = v | def has_key(self, key): return self.data.has_key(string.upper(key)) | 965fdae40ea976fa133048110b24f35cc829b3c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/965fdae40ea976fa133048110b24f35cc829b3c8/os.py |
suffixes = [".py", ".pyc", ".pyo"] | suffixes = [] for triple in imp.get_suffixes(): suffixes.append(triple[0]) | def find_all_submodules(self, m): if not m.__path__: return modules = {} suffixes = [".py", ".pyc", ".pyo"] for dir in m.__path__: try: names = os.listdir(dir) except os.error: self.msg(2, "can't list directory", dir) continue for name in names: mod = None for suff in suffixes: n = len(suff) if name[-n:] == suff: mod =... | aaf1c8dc9e6a3c83b974ebea4b2e3929526689c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/aaf1c8dc9e6a3c83b974ebea4b2e3929526689c3/modulefinder.py |
last.data = string.rstrip(last.data) + "\n " | last.data = last.data.rstrip() + "\n " | def rewrite_descriptor(doc, descriptor): # # Do these things: # 1. Add an "index='no'" attribute to the element if the tagName # ends in 'ni', removing the 'ni' from the name. # 2. Create a <signature> from the name attribute # 2a.Create an <args> if it appears to be available. # 3. Create additional <sign... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
and not string.strip(nodes[0].data): | and not nodes[0].data.strip(): | def handle_appendix(doc, fragment): # must be called after simplfy() if document is multi-rooted to begin with docelem = get_documentElement(fragment) toplevel = docelem.tagName == "manual" and "chapter" or "section" appendices = 0 nodes = [] for node in docelem.childNodes: if appendices: nodes.append(node) elif node.n... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
children[-1].data = string.rstrip(children[-1].data) def fixup_trailing_whitespace(doc, wsmap): queue = [doc] | children[-1].data = children[-1].data.rstrip() def fixup_trailing_whitespace(doc, fragment, wsmap): queue = [fragment] fixups = [] | def handle_labels(doc, fragment): for label in find_all_elements(fragment, "label"): id = label.getAttribute("id") if not id: continue parent = label.parentNode parentTagName = parent.tagName if parentTagName == "title": parent.parentNode.setAttribute("id", id) else: parent.setAttribute("id", id) # now, remove <label i... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
ws = wsmap[node.tagName] children = node.childNodes children.reverse() if children[0].nodeType == TEXT: data = string.rstrip(children[0].data) + ws children[0].data = data children.reverse() if node.tagName == "title" \ and node.parentNode.firstChild.nodeType == ELEMENT: node.parentNode.insertBefore(doc.createText("\n... | fixups.append(node) | def fixup_trailing_whitespace(doc, wsmap): queue = [doc] while queue: node = queue[0] del queue[0] if wsmap.has_key(node.nodeName): ws = wsmap[node.tagName] children = node.childNodes children.reverse() if children[0].nodeType == TEXT: data = string.rstrip(children[0].data) + ws children[0].data = data children.reverse... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
first_data.data = string.lstrip(first_data.data[4:]) | first_data.data = first_data.data[4:].lstrip() | def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return set_tagName(node, "synopsis") lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_elem... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
if len(string.lstrip(data)) < (len(data) - 4): nextnode.data = "\n\n\n" + string.lstrip(data) | s = data.lstrip() if len(s) < (len(data) - 4): nextnode.data = "\n\n\n" + s | def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return set_tagName(node, "synopsis") lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_elem... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
if string.strip(child.data): | if child.data.strip(): | def fixup_table(doc, table): # create the table head thead = doc.createElement("thead") row = doc.createElement("row") move_elements_by_name(doc, table, row, "entry") thead.appendChild(doc.createTextNode("\n ")) thead.appendChild(row) thead.appendChild(doc.createTextNode("\n ")) # create the table body tbody = do... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
pos = string.find(child.data, "\n\n") | pos = child.data.find("\n\n") | def build_para(doc, parent, start, i): children = parent.childNodes after = start + 1 have_last = 0 BREAK_ELEMENTS = PARA_LEVEL_ELEMENTS + RECURSE_INTO_PARA_CONTAINERS # Collect all children until \n\n+ is found in a text node or a # member of BREAK_ELEMENTS is found. for j in range(start, i): after = j + 1 child = chi... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
if string.rstrip(data) != data: | if data.rstrip() != data: | def build_para(doc, parent, start, i): children = parent.childNodes after = start + 1 have_last = 0 BREAK_ELEMENTS = PARA_LEVEL_ELEMENTS + RECURSE_INTO_PARA_CONTAINERS # Collect all children until \n\n+ is found in a text node or a # member of BREAK_ELEMENTS is found. for j in range(start, i): after = j + 1 child = chi... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
child.splitText(len(string.rstrip(data))) | child.splitText(len(data.rstrip())) | def build_para(doc, parent, start, i): children = parent.childNodes after = start + 1 have_last = 0 BREAK_ELEMENTS = PARA_LEVEL_ELEMENTS + RECURSE_INTO_PARA_CONTAINERS # Collect all children until \n\n+ is found in a text node or a # member of BREAK_ELEMENTS is found. for j in range(start, i): after = j + 1 child = chi... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
shortened = string.lstrip(data) | shortened = data.lstrip() | def skip_leading_nodes(children, start=0): """Return index into children of a node at which paragraph building should begin or a recursive call to fixup_paras_helper() should be made (for subsections, etc.). When the return value >= len(children), we've built all the paras we can from this list of children. """ i = le... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
and string.lstrip(child.data)[:3] == ">>>": | and child.data.lstrip().startswith(">>>"): | def fixup_verbatims(doc): for verbatim in find_all_elements(doc, "verbatim"): child = verbatim.childNodes[0] if child.nodeType == TEXT \ and string.lstrip(child.data)[:3] == ">>>": set_tagName(verbatim, "interactive-session") | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
fixup_trailing_whitespace(doc, { "abstract": "\n", "title": "", "chapter": "\n\n", "section": "\n\n", "subsection": "\n\n", "subsubsection": "\n\n", "paragraph": "\n\n", "subparagraph": "\n\n", | fixup_trailing_whitespace(doc, fragment, { "abstract": ("\n", "\n"), "title": ("", "\n"), "chapter": ("\n", "\n\n\n"), "section": ("\n", "\n\n\n"), "subsection": ("\n", "\n\n"), "subsubsection": ("\n", "\n\n"), "paragraph": ("\n", "\n\n"), "subparagraph": ("\n", "\n\n"), "enumeration": ("\n", "\n\n"), | def convert(ifp, ofp): events = esistools.parse(ifp) toktype, doc = events.getEvent() fragment = doc.createDocumentFragment() events.expandNode(fragment) normalize(fragment) simplify(doc, fragment) handle_labels(doc, fragment) handle_appendix(doc, fragment) fixup_trailing_whitespace(doc, { "abstract": "\n", "title": "... | 3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py |
""" finalstuff = finalstuff + """ /* Routines to convert any CF type to/from the corresponding CFxxxObj */ PyObject *CFObj_New(CFTypeRef itself) { if (itself == NULL) { PyErr_SetString(PyExc_RuntimeError, "cannot wrap NULL"); return NULL; } if (CFGetTypeID(itself) == CFArrayGetTypeID()) return CFArrayRefObj_New((CFAr... | #ifdef USE_TOOLBOX_OBJECT_GLUE | 4eb45e7804e312b19860b15dcdac904afe407c9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4eb45e7804e312b19860b15dcdac904afe407c9b/cfsupport.py | |
for meth in get_methods(handler): | for meth in dir(handler): | def add_handler(self, handler): added = 0 for meth in get_methods(handler): if meth[-5:] == '_open': protocol = meth[:-5] if self.handle_open.has_key(protocol): self.handle_open[protocol].append(handler) else: self.handle_open[protocol] = [handler] added = 1 continue i = meth.find('_') j = meth[i+1:].find('_') + i + 1 ... | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
if isinstance(fullurl, types.StringType): | if isinstance(fullurl, (types.StringType, types.UnicodeType)): | def open(self, fullurl, data=None): # accept a URL or a Request object if isinstance(fullurl, types.StringType): req = Request(fullurl, data) else: req = fullurl if data is not None: req.add_data(data) assert isinstance(req, Request) # really only care about interface | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
def is_callable(obj): if type(obj) in (types.BuiltinFunctionType, types.BuiltinMethodType, types.LambdaType, types.MethodType): return 1 if isinstance(obj, types.InstanceType): return hasattr(obj, '__call__') return 0 def get_methods(inst): methods = {} classes = [] classes.append(inst.__class__) while classes: kl... | def error(self, proto, *args): if proto in ['http', 'https']: # XXX http[s] protocols are special cased dict = self.handle_error['http'] # https is not different then http proto = args[2] # YUCK! meth_name = 'http_error_%d' % proto http_err = 1 orig_args = args else: dict = self.handle_error meth_name = proto + '_erro... | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py | |
if isinstance(check, types.ClassType): | if inspect.isclass(check): | def build_opener(*handlers): """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP and FTP. If there is a ProxyHandler, it must be at the front of the list of handlers. (Yuck.) If any of the handlers passed as arguments are subclasses of the def... | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
elif isinstance(check, types.InstanceType): if isinstance(check, klass): skip.append(klass) | elif isinstance(check, klass): skip.append(klass) | def build_opener(*handlers): """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP and FTP. If there is a ProxyHandler, it must be at the front of the list of handlers. (Yuck.) If any of the handlers passed as arguments are subclasses of the def... | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
if isinstance(h, types.ClassType): | if inspect.isclass(h): | def build_opener(*handlers): """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP and FTP. If there is a ProxyHandler, it must be at the front of the list of handlers. (Yuck.) If any of the handlers passed as arguments are subclasses of the def... | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
if isinstance(uri, types.StringType): | if isinstance(uri, (types.StringType, types.UnicodeType)): | def add_password(self, realm, uri, user, passwd): # uri could be a single URI or a sequence if isinstance(uri, types.StringType): uri = [uri] uri = tuple(map(self.reduce_uri, uri)) if not self.passwd.has_key(realm): self.passwd[realm] = {} self.passwd[realm][uri] = (user, passwd) | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
if isinstance(ph, types.ClassType): | if inspect.isclass(ph): | def build_opener(self): opener = OpenerDirector() for ph in self.proxy_handlers: if isinstance(ph, types.ClassType): ph = ph() opener.add_handler(ph) | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
'ftp://www.python.org/pub/tmp/httplib.py', 'ftp://www.python.org/pub/tmp/imageop.c', | 'ftp://www.python.org/pub/python/misc/sousa.au', | def build_opener(self): opener = OpenerDirector() for ph in self.proxy_handlers: if isinstance(ph, types.ClassType): ph = ph() opener.add_handler(ph) | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
('http://grail.cnri.reston.va.us/cgi-bin/faqw.py', | ('http://www.python.org/cgi-bin/faqw.py', | def build_opener(self): opener = OpenerDirector() for ph in self.proxy_handlers: if isinstance(ph, types.ClassType): ph = ph() opener.add_handler(ph) | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
'ftp://prep.ai.mit.edu/welcome.msg', 'ftp://www.python.org/pub/tmp/figure.prn', 'ftp://www.python.org/pub/tmp/interp.pl', 'http://checkproxy.cnri.reston.va.us/test/test.html', | 'ftp://gatekeeper.research.compaq.com/pub/DEC/SRC/research-reports/00README-Legal-Rules-Regs', | def build_opener(self): opener = OpenerDirector() for ph in self.proxy_handlers: if isinstance(ph, types.ClassType): ph = ph() opener.add_handler(ph) | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
if localhost is not None: urls = urls + [ 'file://%s/etc/passwd' % localhost, 'http://%s/simple/' % localhost, 'http://%s/digest/' % localhost, 'http://%s/not/found.h' % localhost, ] bauth = HTTPBasicAuthHandler() bauth.add_password('basic_test_realm', localhost, 'jhylton', 'password') dauth = HTTPDigestAuthHandler() ... | def build_opener(self): opener = OpenerDirector() for ph in self.proxy_handlers: if isinstance(ph, types.ClassType): ph = ph() opener.add_handler(ph) | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py | |
def at_cnri(req): host = req.get_host() print host if host[-18:] == '.cnri.reston.va.us': return 1 p = CustomProxy('http', at_cnri, 'proxy.cnri.reston.va.us') ph = CustomProxyHandler(p) | install_opener(build_opener(cfh, GopherHandler)) | def build_opener(self): opener = OpenerDirector() for ph in self.proxy_handlers: if isinstance(ph, types.ClassType): ph = ph() opener.add_handler(ph) | 8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8b78b99647f2bfa7b757f060bdcb2a4e0c6f7105/urllib2.py |
if (sysconfig.get_config_var('HAVE_GETSPNAM') or sysconfig.get_config_var('HAVE_GETSPENT')): | if (config_h_vars.get('HAVE_GETSPNAM', False) or config_h_vars.get('HAVE_GETSPENT', False)): | 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') | 4454a1ff8453c12739c65da21e00927ea3bf9ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4454a1ff8453c12739c65da21e00927ea3bf9ad9/setup.py |
config_h = sysconfig.get_config_h_filename() config_h_vars = sysconfig.parse_config_h(open(config_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') | 4454a1ff8453c12739c65da21e00927ea3bf9ad9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4454a1ff8453c12739c65da21e00927ea3bf9ad9/setup.py | |
opts, args = getopt.getopt(sys.argv[1:], 'deh:mo:p:P:qs:w') | opts, args = getopt.getopt(sys.argv[1:], 'de:hmo:p:P:qs:w') | def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path[:] modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # modules that are imported by the Python runtime implicits = ... | b7da642e2e283e33445c318733348a1e765b0031 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b7da642e2e283e33445c318733348a1e765b0031/freeze.py |
raise error, "bogus escape" | raise error, "bogus escape (end of line)" | def __next(self): if self.index >= len(self.string): self.next = None return char = self.string[self.index] if char[0] == "\\": try: c = self.string[self.index + 1] except IndexError: raise error, "bogus escape" char = char + c self.index = self.index + len(char) self.next = char | 8a0232d84fcc3317e31f7c4cad5c1d34a3c16f10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8a0232d84fcc3317e31f7c4cad5c1d34a3c16f10/sre_parse.py |
0x00b4: 0x0403, | 0x00b4: 0x0404, | def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) | 361d66de5de1f7c295d9866cdf4237899d819db5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/361d66de5de1f7c295d9866cdf4237899d819db5/koi8_u.py |
if userhome.endswith('/'): i += 1 | userhome = userhome.rstrip('/') | def expanduser(path): """Expand ~ and ~user constructions. If user or $HOME is unknown, do nothing.""" if not path.startswith('~'): return path i = path.find('/', 1) if i < 0: i = len(path) if i == 1: if 'HOME' not in os.environ: import pwd userhome = pwd.getpwuid(os.getuid()).pw_dir else: userhome = os.environ['HOME'... | 9c9a9ab6340eb2225f57fbef6d6cf9e3da547142 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9c9a9ab6340eb2225f57fbef6d6cf9e3da547142/posixpath.py |
attempdirs = ['/usr/tmp', '/tmp', pwd] | attempdirs = ['/var/tmp', '/usr/tmp', '/tmp', pwd] | def gettempdir(): """Function to calculate the directory to use.""" global tempdir if tempdir is not None: return tempdir try: pwd = os.getcwd() except (AttributeError, os.error): pwd = os.curdir attempdirs = ['/usr/tmp', '/tmp', pwd] if os.name == 'nt': attempdirs.insert(0, 'C:\\TEMP') attempdirs.insert(0, '\\TEMP') e... | e504c0c2dc6fabbab4f44dab21674d94f2b6df34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e504c0c2dc6fabbab4f44dab21674d94f2b6df34/tempfile.py |
user_pass = base64.encode_string(unquote(user_passw)).strip() req.addheader('Proxy-Authorization', user_pass) | user_pass = base64.encodestring(unquote(user_pass)).strip() req.add_header('Proxy-Authorization', 'Basic '+user_pass) | def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) user_pass = base64.encode_string(unquote(user_passw)).strip() req.addheader('Proxy-Authorization', user_pass) host = unquote(host) req.set... | d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6/urllib2.py |
host = req.get_host() | host = urlparse.urlparse(req.get_full_url())[1] | def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given') | d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6/urllib2.py |
h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) | if not req.headers.has_key('Content-type'): h.putheader('Content-type', 'application/x-www-form-urlencoded') if not req.headers.has_key('Content-length'): h.putheader('Content-length', '%d' % len(data)) | def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given') | d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6/urllib2.py |
def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given') | d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3f193fe9d1edd99b69b829edb8e8e981c0d0fa6/urllib2.py | ||
def yview(self, *what): | def xview_moveto(self, fraction): """Adjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.""" self.tk.call(self._w, 'xview', 'moveto', fraction) def xview_scroll(self, number, what): """Shift the x-view according to NUMBER which is measured in "units" or "pages" (WH... | def yview(self, *what): """Query and change vertical position of the view.""" if not what: return self._getdoubles(self.tk.call(self._w, 'yview')) self.tk.call((self._w, 'yview') + what) | 5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6/Tkinter.py |
if not what: | if not args: | def yview(self, *what): """Query and change vertical position of the view.""" if not what: return self._getdoubles(self.tk.call(self._w, 'yview')) self.tk.call((self._w, 'yview') + what) | 5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6/Tkinter.py |
self.tk.call((self._w, 'yview') + what) | self.tk.call((self._w, 'yview') + args) def yview_moveto(self, fraction): """Adjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.""" self.tk.call(self._w, 'yview', 'moveto', fraction) def yview_scroll(self, number, what): """Shift the y-view according to NUMBER whi... | def yview(self, *what): """Query and change vertical position of the view.""" if not what: return self._getdoubles(self.tk.call(self._w, 'yview')) self.tk.call((self._w, 'yview') + what) | 5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bd2cd663dad454da19f66ccde3ac6a3ee8aa6a6/Tkinter.py |
dump(vars(values), write) | dump({'faultCode': values.faultCode, 'faultString': values.faultString}, write) | def dumps(self, values): out = [] write = out.append dump = self.__dump if isinstance(values, Fault): # fault instance write("<fault>\n") dump(vars(values), write) write("</fault>\n") else: # parameter block # FIXME: the xml-rpc specification allows us to leave out # the entire <params> block if there are no parameters... | 541342f82cf5819a9c6bbe80426d3074d5f229c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/541342f82cf5819a9c6bbe80426d3074d5f229c3/xmlrpclib.py |
Checks wether this line is typed in the normal prompt or in a breakpoint command list definition | Checks whether this line is typed at the normal prompt or in a breakpoint command list definition. | def onecmd(self, line): """Interpret the argument as though it had been typed in response to the prompt. | 9aed98feb2a58ae17913fae4f40b8ff24ed17aaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9aed98feb2a58ae17913fae4f40b8ff24ed17aaf/pdb.py |
f.seek(0) | def test_truncate(self): eq = self.assertEqual f = self.MODULE.StringIO() f.write(self._lines) f.seek(10) f.truncate() eq(f.getvalue(), 'abcdefghij') f.seek(0) f.truncate(5) eq(f.getvalue(), 'abcde') f.close() self.assertRaises(ValueError, f.write, 'frobnitz') | 037b3ee44e7de00b4653d73d4808c0f679a909a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/037b3ee44e7de00b4653d73d4808c0f679a909a7/test_StringIO.py | |
prefix = PREFIX | prefix = None | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: o... | 96c4dd95cfdd3ed761c7030de047839419689a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96c4dd95cfdd3ed761c7030de047839419689a68/freeze.py |
opts, args = getopt.getopt(sys.argv[1:], 'e:p:P:') | opts, args = getopt.getopt(sys.argv[1:], 'e:o:p:P:') | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: o... | 96c4dd95cfdd3ed761c7030de047839419689a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96c4dd95cfdd3ed761c7030de047839419689a68/freeze.py |
if exec_prefix is None: exec_prefix = EXEC_PREFIX if exec_prefix is None: | if not exec_prefix: if prefix: | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: o... | 96c4dd95cfdd3ed761c7030de047839419689a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96c4dd95cfdd3ed761c7030de047839419689a68/freeze.py |
binlib = os.path.join(exec_prefix, 'lib/python1.4/config') incldir = os.path.join(prefix, 'include/python1.4') | version = sys.version[:3] binlib = os.path.join(exec_prefix, 'lib/python%s/config' % version) incldir = os.path.join(prefix, 'include/python%s' % version) | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: o... | 96c4dd95cfdd3ed761c7030de047839419689a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96c4dd95cfdd3ed761c7030de047839419689a68/freeze.py |
files = ['$(OPT)', '$(LDFLAGS)', config_c, frozen_c] + \ | files = ['$(OPT)', '$(LDFLAGS)', base_config_c, base_frozen_c] + \ | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: o... | 96c4dd95cfdd3ed761c7030de047839419689a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96c4dd95cfdd3ed761c7030de047839419689a68/freeze.py |
makemakefile.makemakefile(outfp, somevars, files, target) | makemakefile.makemakefile(outfp, somevars, files, base_target) | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: o... | 96c4dd95cfdd3ed761c7030de047839419689a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96c4dd95cfdd3ed761c7030de047839419689a68/freeze.py |
print 'Now run make to build the target:', target | if odir: print 'Now run make in', odir, print 'to build the target:', base_target else: print 'Now run make to build the target:', base_target | def main(): # overridable context prefix = PREFIX # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' # parse command line try: o... | 96c4dd95cfdd3ed761c7030de047839419689a68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96c4dd95cfdd3ed761c7030de047839419689a68/freeze.py |
user_pass = base64.encodestring(unquote(user_pass)).strip() req.add_header('Proxy-Authorization', 'Basic '+user_pass) | if ':' in user_pass: user, password = user_pass.split(':', 1) user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))) req.add_header('Proxy-Authorization', 'Basic ' + user_pass) | def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) user_pass = base64.encodestring(unquote(user_pass)).strip() req.add_header('Proxy-Authorization', 'Basic '+user_pass) host = unquote(host)... | 144dea3e05d82388c73011d66733726048765ebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/144dea3e05d82388c73011d66733726048765ebd/urllib2.py |
h.putheader('Host', host) | scheme, sel = splittype(req.get_selector()) sel_host, sel_path = splithost(sel) h.putheader('Host', sel_host or host) | def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given') | 144dea3e05d82388c73011d66733726048765ebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/144dea3e05d82388c73011d66733726048765ebd/urllib2.py |
from time import sleep | def demo2(): # exercises some new and improved features speed('fast') width(3) # draw a segmented half-circle setheading(towards(0,0)) x,y = position() r = (x**2+y**2)**.5/2.0 right(90) pendown = True for i in range(18): if pendown: up() pendown = False else: down() pendown = True circle(r,10) sleep(2) reset() left(9... | d80e0c86778f92b63cf2c4d82c7248c8ece0fd47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d80e0c86778f92b63cf2c4d82c7248c8ece0fd47/turtle.py | |
unquote(password))) | unquote(password))).strip() | def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) if ':' in user_pass: user, password = user_pass.split(':', 1) user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))... | a5a2088dd7ea5f4434a4266995b194da91b28b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a5a2088dd7ea5f4434a4266995b194da91b28b77/urllib2.py |
if sys.platform=="win32" and win32api is not None: HKEY_LOCAL_MACHINE = 0x80000002 | if sys.platform=="win32": import _winreg from _winreg import HKEY_LOCAL_MACHINE | def find_module(self, name, path): if name in self.excludes: self.msgout(3, "find_module -> Excluded") raise ImportError, name | d3d7bb1c315eef797dd9ccc952cb232269cb4b49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3d7bb1c315eef797dd9ccc952cb232269cb4b49/modulefinder.py |
pathname = win32api.RegQueryValue(HKEY_LOCAL_MACHINE, "Software\\Python\\PythonCore\\%s\\Modules\\%s" % (sys.winver, name)) | pathname = _winreg.QueryValueEx(HKEY_LOCAL_MACHINE, \ "Software\\Python\\PythonCore\\%s\\Modules\\%s" % (sys.winver, name)) | def find_module(self, name, path): if name in self.excludes: self.msgout(3, "find_module -> Excluded") raise ImportError, name | d3d7bb1c315eef797dd9ccc952cb232269cb4b49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3d7bb1c315eef797dd9ccc952cb232269cb4b49/modulefinder.py |
except win32api.error: | except _winreg.error: | def find_module(self, name, path): if name in self.excludes: self.msgout(3, "find_module -> Excluded") raise ImportError, name | d3d7bb1c315eef797dd9ccc952cb232269cb4b49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d3d7bb1c315eef797dd9ccc952cb232269cb4b49/modulefinder.py |
return bool() | """Return true if the scope uses exec""" return bool(self._table.optimized & (OPT_EXEC | OPT_BARE_EXEC)) def has_import_star(self): """Return true if the scope uses import *""" return bool(self._table.optimized & OPT_IMPORT_STAR) | def has_exec(self): return bool() | 5030cf1c2db98d5e83ef0c2b21e3d7a1fed50047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5030cf1c2db98d5e83ef0c2b21e3d7a1fed50047/symtable.py |
return bool(self.flag & DEF_STAR) | return bool(self.__flags & DEF_STAR) | def is_vararg(self): return bool(self.flag & DEF_STAR) | 5030cf1c2db98d5e83ef0c2b21e3d7a1fed50047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5030cf1c2db98d5e83ef0c2b21e3d7a1fed50047/symtable.py |
return bool(self.__flags & DEF_STARSTAR) | return bool(self.__flags & DEF_DOUBLESTAR) | def is_keywordarg(self): return bool(self.__flags & DEF_STARSTAR) | 5030cf1c2db98d5e83ef0c2b21e3d7a1fed50047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5030cf1c2db98d5e83ef0c2b21e3d7a1fed50047/symtable.py |
self.assertRaises(AttributeError, f, LenOnly(), 10) | self.assertRaises(TypeError, f, LenOnly(), 10) | def test_len_only(self): for f in (bisect_left, bisect_right, insort_left, insort_right): self.assertRaises(AttributeError, f, LenOnly(), 10) | 1ae9afa829ff0b6372b9fd70365653ab6c565b3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ae9afa829ff0b6372b9fd70365653ab6c565b3a/test_bisect.py |
self.assertRaises(AttributeError, f, GetOnly(), 10) | self.assertRaises(TypeError, f, GetOnly(), 10) | def test_get_only(self): for f in (bisect_left, bisect_right, insort_left, insort_right): self.assertRaises(AttributeError, f, GetOnly(), 10) | 1ae9afa829ff0b6372b9fd70365653ab6c565b3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ae9afa829ff0b6372b9fd70365653ab6c565b3a/test_bisect.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.