rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def test_both(): "Test mmap module on Unix systems and Windows" # Create an mmap'ed file f = open('foo', 'w+') # Write 2 pages worth of data to the file f.write('\0'* PAGESIZE) f.write('foo') f.write('\0'* (PAGESIZE-3) ) m = mmap.mmap(f.fileno(), 2 * PAGESIZE) f.close() # Simple sanity checks print ' Position of f... | 7a11671e8b61dcf653d70db714813fba23afc884 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a11671e8b61dcf653d70db714813fba23afc884/test_mmap.py | ||
m.resize( 512 ) | m.resize( 512 ) | def test_both(): "Test mmap module on Unix systems and Windows" # Create an mmap'ed file f = open('foo', 'w+') # Write 2 pages worth of data to the file f.write('\0'* PAGESIZE) f.write('foo') f.write('\0'* (PAGESIZE-3) ) m = mmap.mmap(f.fileno(), 2 * PAGESIZE) f.close() # Simple sanity checks print ' Position of f... | 7a11671e8b61dcf653d70db714813fba23afc884 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a11671e8b61dcf653d70db714813fba23afc884/test_mmap.py |
def test_both(): "Test mmap module on Unix systems and Windows" # Create an mmap'ed file f = open('foo', 'w+') # Write 2 pages worth of data to the file f.write('\0'* PAGESIZE) f.write('foo') f.write('\0'* (PAGESIZE-3) ) m = mmap.mmap(f.fileno(), 2 * PAGESIZE) f.close() # Simple sanity checks print ' Position of f... | 7a11671e8b61dcf653d70db714813fba23afc884 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a11671e8b61dcf653d70db714813fba23afc884/test_mmap.py | ||
if v == "1": g[n] = 1 else: g[n] = v | try: v = string.atoi(v) except ValueError: pass g[n] = v | undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n") | 3c8e54bf6220cd89ec80839161926db9a92e00ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c8e54bf6220cd89ec80839161926db9a92e00ba/sysconfig.py |
done[name] = value | try: value = string.atoi(value) except ValueError: pass done[name] = string.strip(value) | undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n") | 3c8e54bf6220cd89ec80839161926db9a92e00ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c8e54bf6220cd89ec80839161926db9a92e00ba/sysconfig.py |
done[name] = value | try: value = string.atoi(value) except ValueError: pass done[name] = string.strip(value) | undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n") | 3c8e54bf6220cd89ec80839161926db9a92e00ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c8e54bf6220cd89ec80839161926db9a92e00ba/sysconfig.py |
"calling %s returned %s, not a test" % obj,test | "calling %s returned %s, not a test" % (obj,test) | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 4bc808533f6f2d57c31493f6bb8f18594413fb5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4bc808533f6f2d57c31493f6bb8f18594413fb5c/unittest.py |
_header_parser = email.Parser.HeaderParser() | def nolog(*allargs): """Dummy function, assigned to log when logging is disabled.""" pass | 3a703b60593e2bc2ddde232eaad365e4c126ff42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a703b60593e2bc2ddde232eaad365e4c126ff42/cgi.py | |
headers = _header_parser.parse(fp) | headers = mimetools.Message(fp) | def parse_multipart(fp, pdict): """Parse multipart input. Arguments: fp : input file pdict: dictionary containing other parameters of content-type header Returns a dictionary just like parse_qs(): keys are the field names, each value is a list of values for that field. This is easy to use but not much good if you ... | 3a703b60593e2bc2ddde232eaad365e4c126ff42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a703b60593e2bc2ddde232eaad365e4c126ff42/cgi.py |
headers: a dictionary(-like) object (sometimes email.Message.Message or a subclass thereof) containing *all* headers | headers: a dictionary(-like) object (sometimes rfc822.Message or a subclass thereof) containing *all* headers | def __repr__(self): """Return printable representation.""" return "MiniFieldStorage(%r, %r)" % (self.name, self.value) | 3a703b60593e2bc2ddde232eaad365e4c126ff42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a703b60593e2bc2ddde232eaad365e4c126ff42/cgi.py |
headers = _header_parser.parse(self.fp) | headers = rfc822.Message(self.fp) | def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" ib = self.innerboundary if not valid_boundary(ib): raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,) self.list = [] klass = self.FieldStorageClass or self.__class__ part = klass(self.... | 3a703b60593e2bc2ddde232eaad365e4c126ff42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a703b60593e2bc2ddde232eaad365e4c126ff42/cgi.py |
ExistingwasteObj_New, &we) ) return NULL; | WEOObj_Convert, &we) ) return NULL; | def outputCheckNewArg(self): Output("""if (itself == NULL) { Py_INCREF(Py_None); return Py_None; }""") | 9f2ff9124c79ee1dba64967d594bb2a760922da2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9f2ff9124c79ee1dba64967d594bb2a760922da2/wastesupport.py |
verify(float(a).__class__ is float) | def __repr__(self): return "%.*g" % (self.prec, self) | 7a50f2536e59762897a05b1d3996e51f3f1a9686 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7a50f2536e59762897a05b1d3996e51f3f1a9686/test_descr.py | |
data += self.sslobj.read(len(data)-size) | data += self.sslobj.read(size-len(data)) | def read(self, size): """Read 'size' bytes from remote.""" # sslobj.read() sometimes returns < size bytes data = self.sslobj.read(size) while len(data) < size: data += self.sslobj.read(len(data)-size) | 17031bf421b21ae8b792d2b04c0ad5f997244865 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17031bf421b21ae8b792d2b04c0ad5f997244865/imaplib.py |
self.fp.write(struct.pack("<lll", zinfo.CRC, zinfo.compress_size, | self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size, | def write(self, filename, arcname=None, compress_type=None): """Put the bytes from filename into the archive under the name arcname.""" st = os.stat(filename) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information if arcname is None: zinfo = ZipInfo(filename, date... | ff450f7512900eb883576109b53f0aa3ebc76a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ff450f7512900eb883576109b53f0aa3ebc76a0a/zipfile.py |
self.fp.write(struct.pack("<lll", zinfo.CRC, zinfo.compress_size, | self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size, | def writestr(self, zinfo_or_arcname, bytes): """Write a file into the archive. The contents is the string 'bytes'. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.""" if not isinstance(zinfo_or_arcname, ZipInfo): zinfo = ZipInfo(filename=zinfo_or_arcname, date_time=time.localtim... | ff450f7512900eb883576109b53f0aa3ebc76a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ff450f7512900eb883576109b53f0aa3ebc76a0a/zipfile.py |
if self.inc.match(fullname) == None: | if DEBUG: print 'checkpath', fullname matchvalue = self.inc.match(fullname) if matchvalue == None: | def checkdir(self, path, istop): files = os.listdir(path) rv = [] todo = [] for f in files: if self.exc.match(f): continue fullname = os.path.join(path, f) if self.inc.match(fullname) == None: if os.path.isdir(fullname): todo.append(fullname) else: rv.append(fullname) for d in todo: if len(rv) > 500: if istop: rv.appen... | 73c804a3cd864cdb0ae2f2cff816848633f454f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73c804a3cd864cdb0ae2f2cff816848633f454f2/MkDistr.py |
macostools.copy(fullname, os.path.join(destprefix, dest), 1) | try: macostools.copy(fullname, os.path.join(destprefix, dest), 1) except: print 'cwd', os.path.getcwd() print 'fsspec', macfs.FSSpec(fullname) sys.exit(1) | def rundir(self, path, destprefix, doit): files = os.listdir(path) todo = [] rv = 1 for f in files: if self.exc.match(f): continue fullname = os.path.join(path, f) if os.path.isdir(fullname): todo.append(fullname) else: dest = self.inc.match(fullname) if dest == None: print 'Not yet resolved:', fullname rv = 0 if dest:... | 73c804a3cd864cdb0ae2f2cff816848633f454f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73c804a3cd864cdb0ae2f2cff816848633f454f2/MkDistr.py |
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed... | d11b62edd077428935f93b36ae8d65ebaa684cca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d11b62edd077428935f93b36ae8d65ebaa684cca/test_time.py | ||
if sys.platform == 'Darwin1.2': | if platform == 'Darwin1.2': | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
if (self.compiler.find_library_file(lib_dirs, 'ndbm')): exts.append( Extension('dbm', ['dbmmodule.c'], libraries = ['ndbm'] ) ) else: exts.append( Extension('dbm', ['dbmmodule.c']) ) | if platform not in ['cygwin']: if (self.compiler.find_library_file(lib_dirs, 'ndbm')): exts.append( Extension('dbm', ['dbmmodule.c'], libraries = ['ndbm'] ) ) else: exts.append( Extension('dbm', ['dbmmodule.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
if sys.platform not in ['mac', 'win32']: | if platform not in ['mac', 'win32']: | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
exts.append( Extension('resource', ['resource.c']) ) | if platform not in ['cygwin']: exts.append( Extension('resource', ['resource.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
if sys.platform == 'sunos4': | if platform == 'sunos4': | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
if sys.platform == 'irix5': | if platform == 'irix5': | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
plat = sys.platform if plat == 'linux2': | if platform == 'linux2': | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
if plat == 'sunos5': | if platform == 'sunos5': | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
if sys.platform == 'sunos5': | platform = self.get_platform() if platform == 'sunos5': | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. # # The command for _tkinter is long and site specific. Please # uncomment and/or edit those parts as indicated. If you don't have a # specific extension (e.g. Tix or BLT), leave the corresponding line # commented out. (Leave the trailing backslash... | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
if sys.platform in ['aix3', 'aix4']: | if platform in ['aix3', 'aix4']: | def detect_tkinter(self, inc_dirs, lib_dirs): # The _tkinter module. # # The command for _tkinter is long and site specific. Please # uncomment and/or edit those parts as indicated. If you don't have a # specific extension (e.g. Tix or BLT), leave the corresponding line # commented out. (Leave the trailing backslash... | 34febf5e9273cf7715b46286ff28fb41fa413231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34febf5e9273cf7715b46286ff28fb41fa413231/setup.py |
self.warn ("file %s (for module %s) not found" % module_file, module) | self.warn ("file %s (for module %s) not found" % (module_file, module)) | def check_module (self, module, module_file): if not os.path.isfile (module_file): self.warn ("file %s (for module %s) not found" % module_file, module) return 0 else: return 1 | 113e70efa2b932a3ad2662875114133a1edb600c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/113e70efa2b932a3ad2662875114133a1edb600c/build_py.py |
__contains__ = has_key | def __contains__(self, key): return self.has_key(key) | def has_key(self, key): try: value = self[key] except KeyError: return False return True | 51f3f1b7dce6d054891faf9959fc493e66e9f684 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/51f3f1b7dce6d054891faf9959fc493e66e9f684/UserDict.py |
iterkeys = __iter__ | def iterkeys(self): return self.__iter__() | def iteritems(self): for k in self: yield (k, self[k]) | 51f3f1b7dce6d054891faf9959fc493e66e9f684 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/51f3f1b7dce6d054891faf9959fc493e66e9f684/UserDict.py |
addinfourl.__init__(self, fp, hdrs, url) | self.__super_init(fp, hdrs, url) | def __init__(self, url, code, msg, hdrs, fp): addinfourl.__init__(self, fp, hdrs, url) self.code = code self.msg = msg self.hdrs = hdrs self.fp = fp # XXX self.filename = url | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
self.fp.close() | if self.fp: self.fp.close() | def __del__(self): # XXX is this safe? what if user catches exception, then # extracts fp and discards exception? self.fp.close() | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
result = apply(func, args) | result = func(*args) | def _call_chain(self, chain, kind, meth_name, *args): # XXX raise an exception if no one else should try to handle # this url. return None if you can't but someone else could. handlers = chain.get(kind, ()) for handler in handlers: func = getattr(handler, meth_name) result = apply(func, args) if result is not None: re... | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
'_open', req) | '_open', req) | def open(self, fullurl, data=None): # accept a URL or a Request object if type(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 result = self._call_chain(self.handle_open, 'default',... | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
result = apply(self._call_chain, args) | result = self._call_chain(*args) | def error(self, proto, *args): if proto == 'http': # XXX http protocol is special cased dict = self.handle_error[proto] proto = args[2] # YUCK! meth_name = 'http_error_%d' % proto http_err = 1 orig_args = args else: dict = self.handle_error meth_name = proto + '_error' http_err = 0 args = (dict, proto, meth_name) + ar... | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
return apply(self._call_chain, args) | return self._call_chain(*args) | def error(self, proto, *args): if proto == 'http': # XXX http protocol is special cased dict = self.handle_error[proto] proto = args[2] # YUCK! meth_name = 'http_error_%d' % proto http_err = 1 orig_args = args else: dict = self.handle_error meth_name = proto + '_error' http_err = 0 args = (dict, proto, meth_name) + ar... | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
h = httplib.HTTP(host) if req.has_data(): data = req.get_data() h.putrequest('POST', req.get_selector()) h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) else: h.putrequest('GET', req.get_selector()) | try: h = httplib.HTTP(host) if req.has_data(): data = req.get_data() h.putrequest('POST', req.get_selector()) h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) else: h.putrequest('GET', req.get_selector()) except socket.error, err: raise URLError(err) | def http_open(self, req): # XXX devise a new mechanism to specify user/password host = req.get_host() if not host: raise URLError('no host given') | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
apply(h.putheader, args) | h.putheader(*args) | def http_open(self, req): # XXX devise a new mechanism to specify user/password host = req.get_host() if not host: raise URLError('no host given') | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
if h.sock: h.sock.close() h.sock = None | def http_open(self, req): # XXX devise a new mechanism to specify user/password host = req.get_host() if not host: raise URLError('no host given') | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py | |
host = socket.gethostbyname(host) | try: host = socket.gethostbyname(host) except socket.error, msg: raise URLError(msg) | def ftp_open(self, req): host = req.get_host() if not host: raise IOError, ('ftp error', 'no host given') # XXX handle custom username & password host = socket.gethostbyname(host) host, port = splitport(host) if port is None: port = ftplib.FTP_PORT path, attrs = splitattr(req.get_selector()) path = unquote(path) dirs =... | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
elif socket.gethostname() == 'walden': | elif socket.gethostname() == 'bitdiddle.concentric.net': | def build_opener(self): opener = OpenerDirectory() for ph in self.proxy_handlers: if type(ph) == types.ClassType: ph = ph() opener.add_handler(ph) | 73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73574eefe56334fb7cf052cf89f5d7fbe4d1e0a6/urllib2.py |
def create_inifile (self): | def get_inidata (self): lines = [] | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py |
ini_name = "%s.ini" % metadata.get_fullname() self.announce ("creating %s" % ini_name) inifile = open (ini_name, "w") | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py | |
inifile.write ("[metadata]\n") | lines.append ("[metadata]") | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py |
inifile.write ("%s=%s\n" % (name, repr (data)[1:-1])) | lines.append ("%s=%s" % (name, repr (data)[1:-1])) | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py |
inifile.write ("\n[Setup]\n") inifile.write ("info=%s\n" % repr (info)[1:-1]) inifile.write ("pthname=%s.%s\n" % (metadata.name, metadata.version)) | lines.append ("\n[Setup]") lines.append ("info=%s" % repr (info)[1:-1]) lines.append ("pthname=%s.%s" % (metadata.name, metadata.version)) | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py |
inifile.write ("target_version=%s\n" % self.target_version) | lines.append ("target_version=%s" % self.target_version) | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py |
inifile.write ("title=%s\n" % repr (title)[1:-1]) inifile.close() return ini_name | lines.append ("title=%s" % repr (title)[1:-1]) return string.join (lines, "\n") | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py |
import struct cfgdata = open (self.create_inifile()).read() | import struct self.mkpath(self.dist_dir) cfgdata = self.get_inidata() | def create_exe (self, arcname, fullname): import struct#, zlib | 1ac9802748c26e716685f8ba19277d1a4dc0bcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ac9802748c26e716685f8ba19277d1a4dc0bcf1/bdist_wininst.py |
if (PyArg_Parse(v, "(O&l)", PyMac_GetOSType, &(out->eventClass), &(out->eventKind))) | if (PyArg_Parse(v, "(O&l)", PyMac_GetOSType, &(out->eventClass), &(out->eventKind))) | #ifdef WITHOUT_FRAMEWORKS | 820867662bf35a2d8d2234f8cd4c8ce316ebfd37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/820867662bf35a2d8d2234f8cd4c8ce316ebfd37/CarbonEvtsupport.py |
retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHandlerCallRef_New, handlerRef, EventRef_New, event); | retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHandlerCallRef_New, handlerRef, EventRef_New, event); | #ifdef WITHOUT_FRAMEWORKS | 820867662bf35a2d8d2234f8cd4c8ce316ebfd37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/820867662bf35a2d8d2234f8cd4c8ce316ebfd37/CarbonEvtsupport.py |
toaddrs = ','.split(prompt("To")) | toaddrs = prompt("To").split(',') | def prompt(prompt): sys.stdout.write(prompt + ": ") return sys.stdin.readline().strip() | 38151ed6b895f5a9a2234eb962bac16c417dd1f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38151ed6b895f5a9a2234eb962bac16c417dd1f4/smtplib.py |
info = metadata.long_description or '' + '\n' | info = (metadata.long_description or '') + '\n' | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 6f9320b9d12649d084ed54671960d8387a856282 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6f9320b9d12649d084ed54671960d8387a856282/bdist_wininst.py |
curses.pair_content(curses.COLOR_PAIRS) | curses.pair_content(curses.COLOR_PAIRS - 1) | def module_funcs(stdscr): "Test module-level functions" for func in [curses.baudrate, curses.beep, curses.can_change_color, curses.cbreak, curses.def_prog_mode, curses.doupdate, curses.filter, curses.flash, curses.flushinp, curses.has_colors, curses.has_ic, curses.has_il, curses.isendwin, curses.killchar, curses.longn... | d1badac99c01aeb15a261d262fff1c402c4f24e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1badac99c01aeb15a261d262fff1c402c4f24e9/test_curses.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 | 630a9a68941205a7ebb8428fe4faeef82429d77d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/630a9a68941205a7ebb8428fe4faeef82429d77d/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 | 630a9a68941205a7ebb8428fe4faeef82429d77d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/630a9a68941205a7ebb8428fe4faeef82429d77d/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 | 630a9a68941205a7ebb8428fe4faeef82429d77d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/630a9a68941205a7ebb8428fe4faeef82429d77d/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 | 630a9a68941205a7ebb8428fe4faeef82429d77d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/630a9a68941205a7ebb8428fe4faeef82429d77d/test_ntpath.py |
def test_close_fds(self): os.pipe() p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' \ 'sys.stdout.write(str(os.dup(0)))'], stdout=subprocess.PIPE, close_fds=1) self.assertEqual(p.stdout.read(), "3") | def test_preexec(self): # preexec function p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' \ 'sys.stdout.write(os.getenv("FRUIT"))'], stdout=subprocess.PIPE, preexec_fn=lambda: os.putenv("FRUIT", "apple")) self.assertEqual(p.stdout.read(), "apple") | c19ccc9f1137bceb830a635a199b0798cc6d3932 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19ccc9f1137bceb830a635a199b0798cc6d3932/test_subprocess.py | |
raise ValueError("truncated header") | raise HeaderError("truncated header") | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise ValueError("empty header") | ebbeed781d923494f782f0750e76ad4aac8e29f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebbeed781d923494f782f0750e76ad4aac8e29f5/tarfile.py |
raise ValueError("empty header") | raise HeaderError("empty header") try: chksum = nti(buf[148:156]) except ValueError: raise HeaderError("invalid header") if chksum not in calc_chksums(buf): raise HeaderError("bad checksum") | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise ValueError("empty header") | ebbeed781d923494f782f0750e76ad4aac8e29f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebbeed781d923494f782f0750e76ad4aac8e29f5/tarfile.py |
tarinfo.chksum = nti(buf[148:156]) | tarinfo.chksum = chksum | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise ValueError("empty header") | ebbeed781d923494f782f0750e76ad4aac8e29f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebbeed781d923494f782f0750e76ad4aac8e29f5/tarfile.py |
if tarinfo.chksum not in calc_chksums(buf): raise ValueError("invalid header") | def frombuf(cls, buf): """Construct a TarInfo object from a 512 byte string buffer. """ if len(buf) != BLOCKSIZE: raise ValueError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise ValueError("empty header") | ebbeed781d923494f782f0750e76ad4aac8e29f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebbeed781d923494f782f0750e76ad4aac8e29f5/tarfile.py | |
except ValueError, e: | except HeaderError, e: | def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m | ebbeed781d923494f782f0750e76ad4aac8e29f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebbeed781d923494f782f0750e76ad4aac8e29f5/tarfile.py |
self._dbg(2, "0x%X: empty or invalid block: %s" % (self.offset, e)) | self._dbg(2, "0x%X: %s" % (self.offset, e)) | def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m | ebbeed781d923494f782f0750e76ad4aac8e29f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebbeed781d923494f782f0750e76ad4aac8e29f5/tarfile.py |
raise ReadError("empty, unreadable or compressed " "file: %s" % e) | raise ReadError(str(e)) | def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m | ebbeed781d923494f782f0750e76ad4aac8e29f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebbeed781d923494f782f0750e76ad4aac8e29f5/tarfile.py |
ignores.append(regex.compile(a)) | ignores.append(re.compile(a)) | def main(): global filedict opts, args = getopt.getopt(sys.argv[1:], 'i:') for o, a in opts: if o == '-i': ignores.append(regex.compile(a)) if not args: args = ['-'] for filename in args: if filename == '-': sys.stdout.write('# Generated by h2py from stdin\n') process(sys.stdin, sys.stdout) else: fp = open(filename, 'r... | 4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543/h2py.py |
i = string.rfind(outfile, '.') | i = outfile.rfind('.') | def main(): global filedict opts, args = getopt.getopt(sys.argv[1:], 'i:') for o, a in opts: if o == '-i': ignores.append(regex.compile(a)) if not args: args = ['-'] for filename in args: if filename == '-': sys.stdout.write('# Generated by h2py from stdin\n') process(sys.stdin, sys.stdout) else: fp = open(filename, 'r... | 4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543/h2py.py |
outfile = string.upper(outfile) outfile = outfile + '.py' | modname = outfile.upper() outfile = modname + '.py' | def main(): global filedict opts, args = getopt.getopt(sys.argv[1:], 'i:') for o, a in opts: if o == '-i': ignores.append(regex.compile(a)) if not args: args = ['-'] for filename in args: if filename == '-': sys.stdout.write('# Generated by h2py from stdin\n') process(sys.stdin, sys.stdout) else: fp = open(filename, 'r... | 4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543/h2py.py |
if p_include.match(line) >= 0: regs = p_include.regs | match = p_include.match(line) if match: regs = match.regs | stmt = 'def %s(%s): return %s\n' % (macro, arg, body) | 4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543/h2py.py |
if not filedict.has_key(filename): | if importable.has_key(filename): outfp.write('import %s\n' % importable[filename]) elif not filedict.has_key(filename): | stmt = 'def %s(%s): return %s\n' % (macro, arg, body) | 4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543/h2py.py |
inclfp = open(dir + '/' + filename, 'r') | inclfp = open(dir + '/' + filename) | stmt = 'def %s(%s): return %s\n' % (macro, arg, body) | 4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f85bf3311e9ac09ec64e74f1ce9cf3e2d223543/h2py.py |
file(foo_path, 'w').close() file(bar_path, 'w').close() | f = open(foo_path, 'w') f.write("@") f.close() f = open(bar_path, 'w') f.write("@") f.close() | def test_clean(self): # Remove old files from 'tmp' foo_path = os.path.join(self._path, 'tmp', 'foo') bar_path = os.path.join(self._path, 'tmp', 'bar') file(foo_path, 'w').close() file(bar_path, 'w').close() self._box.clean() self.assert_(os.path.exists(foo_path)) self.assert_(os.path.exists(bar_path)) foo_stat = os.st... | b2045837b69992d054aa12849b07a3b0c8b2bd09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2045837b69992d054aa12849b07a3b0c8b2bd09/test_mailbox.py |
os.utime(os.path.join(foo_path), (time.time() - 129600 - 2, foo_stat.st_mtime)) | os.utime(foo_path, (time.time() - 129600 - 2, foo_stat.st_mtime)) | def test_clean(self): # Remove old files from 'tmp' foo_path = os.path.join(self._path, 'tmp', 'foo') bar_path = os.path.join(self._path, 'tmp', 'bar') file(foo_path, 'w').close() file(bar_path, 'w').close() self._box.clean() self.assert_(os.path.exists(foo_path)) self.assert_(os.path.exists(bar_path)) foo_stat = os.st... | b2045837b69992d054aa12849b07a3b0c8b2bd09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2045837b69992d054aa12849b07a3b0c8b2bd09/test_mailbox.py |
sys.stdout.flush() os.system("/depot/gnu/plat/bin/rlog -r %s </dev/null 2>&1" % self.name) | p = os.popen("/depot/gnu/plat/bin/rlog -r %s </dev/null 2>&1" % self.name) output = p.read() p.close() print cgi.escape(output) | def do_info(self): | 1dcc24404bd0414d44ae6e0d216f003d7b6c7af5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dcc24404bd0414d44ae6e0d216f003d7b6c7af5/faqmain.py |
sys.stdout.flush() os.system("/depot/gnu/plat/bin/rlog %s </dev/null 2>&1" % self.name) | p = os.popen("/depot/gnu/plat/bin/rlog %s </dev/null 2>&1" % self.name) output = p.read() p.close() print cgi.escape(output) | def do_rlog(self): | 1dcc24404bd0414d44ae6e0d216f003d7b6c7af5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dcc24404bd0414d44ae6e0d216f003d7b6c7af5/faqmain.py |
print "domain=%s;" % os.environ['HTTP_HOST'], | print "domain=%s;" % hostname, | def set_cookie(self, author, email): | 1dcc24404bd0414d44ae6e0d216f003d7b6c7af5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dcc24404bd0414d44ae6e0d216f003d7b6c7af5/faqmain.py |
<TEXTAREA COLS=80 ROWS=20 NAME=text>""" % title | <TEXTAREA COLS=80 ROWS=20 NAME=text>""" % self.escape(title) | def showedit(self, name, title, text): | 1dcc24404bd0414d44ae6e0d216f003d7b6c7af5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dcc24404bd0414d44ae6e0d216f003d7b6c7af5/faqmain.py |
""" % (author, email, self.log) | """ % (self.escape(author), self.escape(email), self.escape(self.log)) def escape(self, s): import regsub if '&' in s: s = regsub.gsub("&", "&", s) if '<' in s: s = regsub.gsub("<", "<", s) if '>' in s: s = regsub.gsub(">", ">", s) if '"' in s: s = regsub.gsub('"', """, s) return s | def showedit(self, name, title, text): | 1dcc24404bd0414d44ae6e0d216f003d7b6c7af5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dcc24404bd0414d44ae6e0d216f003d7b6c7af5/faqmain.py |
while url[-1] in ");:,.?": | while url[-1] in ");:,.?'\"": | def translate(self, text): | 1dcc24404bd0414d44ae6e0d216f003d7b6c7af5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dcc24404bd0414d44ae6e0d216f003d7b6c7af5/faqmain.py |
url = cgi.escape(url) | url = self.escape(url) | def translate(self, text): | 1dcc24404bd0414d44ae6e0d216f003d7b6c7af5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1dcc24404bd0414d44ae6e0d216f003d7b6c7af5/faqmain.py |
if hasattr(self.db, 'close'): self.db.close() self.db = None | if hasattr(self.dict, 'close'): self.dict.close() self.dict = None | def close(self): if hasattr(self.db, 'close'): self.db.close() self.db = None | cebfa70a794ba3d4aeda681b3164123d934d1c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cebfa70a794ba3d4aeda681b3164123d934d1c28/shelve.py |
elif compiler == "gcc" or compiler == "g++": | elif compiler[:3] == "gcc" or compiler[:3] == "g++": | def runtime_library_dir_option(self, dir): # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # d... | 69ceb33baccb85d7d215733c14861c1b3548aba5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69ceb33baccb85d7d215733c14861c1b3548aba5/unixccompiler.py |
UserDict.UserDict.__init__(self, *args, **kw) | def __init__(self, *args, **kw): UserDict.UserDict.__init__(self, *args, **kw) def remove(wr, selfref=ref(self)): self = selfref() if self is not None: del self.data[wr.key] self._remove = remove | 9166e1a24ac7b15776ffd38e436fa51a9b002674 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9166e1a24ac7b15776ffd38e436fa51a9b002674/weakref.py | |
'marshal', 'math', 'md5', 'operator', | 'math', 'md5', 'operator', | def reload(self, module, path=None): if path is None and hasattr(module, '__filename__'): head, tail = os.path.split(module.__filename__) path = [os.path.join(head, '')] return ihooks.ModuleImporter.reload(self, module, path) | 3ee6b195bbe8272b5901f3f97c0966ddd4bb72fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3ee6b195bbe8272b5901f3f97c0966ddd4bb72fa/rexec.py |
LE_MAGIC = 0x950412de BE_MAGIC = 0xde120495 | LE_MAGIC = 0x950412deL BE_MAGIC = 0xde120495L | def install(self, unicode=0): import __builtin__ __builtin__.__dict__['_'] = unicode and self.ugettext or self.gettext | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py |
MASK = 0xffffffff | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endia... | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py | |
magic = unpack('<i', buf[:4])[0] & MASK | magic = unpack('<I', buf[:4])[0] | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endia... | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py |
version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii' | version, msgcount, masteridx, transidx = unpack('<4I', buf[4:20]) ii = '<II' | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endia... | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py |
version, msgcount, masteridx, transidx = unpack('>4i', buf[4:20]) ii = '>ii' | version, msgcount, masteridx, transidx = unpack('>4I', buf[4:20]) ii = '>II' | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endia... | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py |
msgcount &= MASK masteridx &= MASK transidx &= MASK | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endia... | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py | |
moff &= MASK mend = moff + (mlen & MASK) | mend = moff + mlen | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endia... | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py |
toff &= MASK tend = toff + (tlen & MASK) | tend = toff + tlen | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endia... | 09707e363723fa24ba53e4e5d77cc26d4dea724f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09707e363723fa24ba53e4e5d77cc26d4dea724f/gettext.py |
if len(segments) >= 2 and segments[-1] == '..': | if len(segments) == 2 and segments[1] == '..' and segments[0] == '': segments[-1] = '' elif len(segments) >= 2 and segments[-1] == '..': | def urljoin(base, url, allow_framents = 1): if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_framents) scheme, netloc, path, params, query, fragment = \ urlparse(url, bscheme, allow_framents) # XXX Unofficial hack: default netloc to bnetloc even if # schemes diffe... | e612be59263f9771f89c79a89843872ae1b8f667 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e612be59263f9771f89c79a89843872ae1b8f667/urlparse.py |
from os.path import normpath, join, dirname for (name, value) in done.items(): if value[0:2] == "./": done[name] = normpath(join(dirname(fp.name), value)) | def parse_makefile(fp, g=None): """Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ if g is None: g = {} variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)\n") done =... | 4f880280c2b03ec08c17714f7023eeb9d89849e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4f880280c2b03ec08c17714f7023eeb9d89849e8/sysconfig.py | |
while args and args[0][0] == '-' and args[0] <> '-': | while args and args[0][:1] == '-' and args[0] <> '-': | def getopt(args, options): list = [] while args and args[0][0] == '-' and args[0] <> '-': if args[0] == '--': args = args[1:] break optstring, args = args[0][1:], args[1:] while optstring <> '': opt, optstring = optstring[0], optstring[1:] if classify(opt, options): # May raise exception as well if optstring == '': if ... | 70083dee1203992fff93c0d659df51c6286c3e19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/70083dee1203992fff93c0d659df51c6286c3e19/getopt.py |
def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)""" | 51ee66e611ca16e51bea158e09db663fe0cdff22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/51ee66e611ca16e51bea158e09db663fe0cdff22/subprocess.py | ||
BasicStrTest | BasicStrTest, CharmapTest | def test_main(): test_support.run_unittest( UTF16Test, UTF16LETest, UTF16BETest, UTF8Test, EscapeDecodeTest, RecodingTest, PunycodeTest, UnicodeInternalTest, NameprepTest, CodecTest, CodecsModuleTest, StreamReaderTest, Str2StrTest, BasicUnicodeTest, BasicStrTest ) | d1c1e10f70212464415fdf2ab0bed4b5d32fdf32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1c1e10f70212464415fdf2ab0bed4b5d32fdf32/test_codecs.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.