rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
print >>sys.stderr, _('*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"') % { 'token': tstring, 'file': self.__curfile, 'lineno': self.__lineno} | print >> sys.stderr, _( '*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"' ) % { 'token': tstring, 'file': self.__curfile, 'lineno': self.__lineno } | def __openseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == ')': # We've seen the last of the translatable strings. Record the # line number of the first line of the strings and update the list # of messages seen. Reset state for the next batch. If there # were no strings inside _(), then ju... | e04ee70a68045f8d229ab59ad9b0256d0278c745 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e04ee70a68045f8d229ab59ad9b0256d0278c745/pygettext.py |
_('*** Seen unexpected token "%(token)s"' % {'token': 'test'}) | _('*** Seen unexpected token "%(token)s"') % {'token': 'test'} | def main(): global default_keywords try: opts, args = getopt.getopt( sys.argv[1:], 'ad:DEhk:Kno:p:S:Vvw:x:X:', ['extract-all', 'default-domain=', 'escape', 'help', 'keyword=', 'no-default-keywords', 'add-location', 'no-location', 'output=', 'output-dir=', 'style=', 'verbose', 'version', 'width=', 'exclude-file=', 'docs... | e04ee70a68045f8d229ab59ad9b0256d0278c745 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e04ee70a68045f8d229ab59ad9b0256d0278c745/pygettext.py |
def main(): global default_keywords try: opts, args = getopt.getopt( sys.argv[1:], 'ad:DEhk:Kno:p:S:Vvw:x:X:', ['extract-all', 'default-domain=', 'escape', 'help', 'keyword=', 'no-default-keywords', 'add-location', 'no-location', 'output=', 'output-dir=', 'style=', 'verbose', 'version', 'width=', 'exclude-file=', 'docs... | e04ee70a68045f8d229ab59ad9b0256d0278c745 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e04ee70a68045f8d229ab59ad9b0256d0278c745/pygettext.py | ||
(run, run == 1 and "" or "s", timeTaken)) | (run, run != 1 and "s" or "", timeTaken)) | def run(self, test): "Run the given test case or test suite." result = self._makeResult() startTime = time.time() test(result) stopTime = time.time() timeTaken = float(stopTime - startTime) result.printErrors() self.stream.writeln(result.separator2) run = result.testsRun self.stream.writeln("Ran %d test%s in %.3fs" % (... | 7616504dcf49d233d38a7518cdd28a9cc6531b74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7616504dcf49d233d38a7518cdd28a9cc6531b74/unittest.py |
if self.groupdict.has_key(name): raise error, "can only use each group name once" | ogid = self.groupdict.get(name, None) if ogid is not None: raise error, ("redefinition of group name %s as group %d; " + "was group %d") % (`name`, gid, ogid) | def opengroup(self, name=None): gid = self.groups self.groups = gid + 1 if name: if self.groupdict.has_key(name): raise error, "can only use each group name once" self.groupdict[name] = gid self.open.append(gid) return gid | 7533587d4363d0841232f58d61adc15fa32b4825 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7533587d4363d0841232f58d61adc15fa32b4825/sre_parse.py |
return self.try_cpp(headers=[header], include_dirs=include_dirs) | return self.try_cpp(body="/* No body */", headers=[header], include_dirs=include_dirs) | def check_header (self, header, include_dirs=None, library_dirs=None, lang="c"): """Determine if the system header file named by 'header_file' exists and can be found by the preprocessor; return true if so, false otherwise. """ return self.try_cpp(headers=[header], include_dirs=include_dirs) | 4013cbd06becfbfbb63b9b524e5c41513f497929 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4013cbd06becfbfbb63b9b524e5c41513f497929/config.py |
return '<' + x.__class__.__name__ + ' instance at ' + \ hex(id(x))[2:] + '>' | return '<%s instance at %x>' % (x.__class__.__name__, id(x)) | def repr_instance(self, x, level): try: s = __builtin__.repr(x) # Bugs in x.__repr__() can cause arbitrary # exceptions -- then make up something except: return '<' + x.__class__.__name__ + ' instance at ' + \ hex(id(x))[2:] + '>' if len(s) > self.maxstring: i = max(0, (self.maxstring-3)//2) j = max(0, self.maxstring-3... | 83a643071785959658f7e844ba1a341a7d9a7f46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/83a643071785959658f7e844ba1a341a7d9a7f46/repr.py |
if prog.match(line) == len(line): | if prog.match(line) >= 0: | def pickline(file, key, casefold = 1): try: f = open(file, 'r') except IOError: return None pat = key + ':' if casefold: prog = regex.compile(pat, regex.casefold) else: prog = regex.compile(pat) while 1: line = f.readline() if not line: break if prog.match(line) == len(line): text = line[len(key)+1:] while 1: line = f.... | ea8ee1dfc5359da79126d78609f4673e0673bb9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ea8ee1dfc5359da79126d78609f4673e0673bb9c/mhlib.py |
except (AttributeError, Tkinter.TclError): | except (KeyboardInterrupt, SystemExit): raise except Exception: | def __del__(self): try: if self.delete_font: self._call("font", "delete", self.name) except (AttributeError, Tkinter.TclError): pass | 314fce92dd12a8ff82876bd18845a2249a931fae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/314fce92dd12a8ff82876bd18845a2249a931fae/tkFont.py |
Pack the values v2, v2, ... according to fmt, write | Pack the values v1, v2, ... according to fmt, write | def pack_into(fmt, buf, offset, *args): """ Pack the values v2, v2, ... according to fmt, write the packed bytes into the writable buffer buf starting at offset. See struct.__doc__ for more on format strings. """ try: o = _cache[fmt] except KeyError: o = _compile(fmt) return o.pack_into(buf, offset, *args) | 499b0e638bf0ede8239fe57ed0b2eb76bc04fa49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499b0e638bf0ede8239fe57ed0b2eb76bc04fa49/struct.py |
tempcache = None | __tempfiles = [] | def urlcleanup(): if _urlopener: _urlopener.cleanup() | 2b3fd76cc7599630df68444a7a96e97fddd5c0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b3fd76cc7599630df68444a7a96e97fddd5c0fb/urllib.py |
if self.tempcache: | if self.__tempfiles: | def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | 2b3fd76cc7599630df68444a7a96e97fddd5c0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b3fd76cc7599630df68444a7a96e97fddd5c0fb/urllib.py |
for url in self.tempcache.keys(): | for file in self.__tempfiles: | def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | 2b3fd76cc7599630df68444a7a96e97fddd5c0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b3fd76cc7599630df68444a7a96e97fddd5c0fb/urllib.py |
os.unlink(self.tempcache[url][0]) | os.unlink(file) | def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | 2b3fd76cc7599630df68444a7a96e97fddd5c0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b3fd76cc7599630df68444a7a96e97fddd5c0fb/urllib.py |
del self.tempcache[url] | URLopener.__tempfiles = [] self.tempcache = None | def cleanup(self): if self.tempcache: import os for url in self.tempcache.keys(): try: os.unlink(self.tempcache[url][0]) except os.error: pass del self.tempcache[url] | 2b3fd76cc7599630df68444a7a96e97fddd5c0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b3fd76cc7599630df68444a7a96e97fddd5c0fb/urllib.py |
i = string.rfind(basepath, '/') | i = string.rfind(basepath[:-1], '/') | def basejoin(base, url): type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, just inherit type if type: return type + '://' + host + path else: #... | 2b3fd76cc7599630df68444a7a96e97fddd5c0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b3fd76cc7599630df68444a7a96e97fddd5c0fb/urllib.py |
basepath = basepath[:i-1] | basepath = basepath[:i+1] elif i == 0: basepath = '/' break else: basepath = '' | def basejoin(base, url): type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, just inherit type if type: return type + '://' + host + path else: #... | 2b3fd76cc7599630df68444a7a96e97fddd5c0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b3fd76cc7599630df68444a7a96e97fddd5c0fb/urllib.py |
if headers.has_key('www-authenticate'): stuff = headers['www-authenticate'] import re match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) if match: scheme, realm = match.groups() if scheme.lower() == 'basic': name = 'retry_' + self.type + '_basic_auth' if data is None: return getattr(self,name)(url, realm) ... | if not headers.has_key('www-authenticate'): URLopener.http_error_default(self, url, fp, errmsg, headers) stuff = headers['www-authenticate'] import re match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) if not match: URLopener.http_error_default(self, url, fp, errcode, errmsg, headers) scheme, realm = match... | def http_error_401(self, url, fp, errcode, errmsg, headers, data=None): """Error 401 -- authentication required. See this URL for a description of the basic authentication scheme: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt""" if headers.has_key('www-authenticate'): stuff = headers['www-authent... | e99bd17ed6ffbb7a6deee9b80b83ce6a9e4e8b10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e99bd17ed6ffbb7a6deee9b80b83ce6a9e4e8b10/urllib.py |
def run (self): | 5310e5078ad331631f109e8fa33b8534911f0ce0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5310e5078ad331631f109e8fa33b8534911f0ce0/bdist_rpm.py | ||
srpms = glob.glob(os.path.join(rpm_dir['SRPMS'], "*.rpm")) assert len(srpms) == 1, \ "unexpected number of SRPM files found: %s" % srpms dist_file = ('bdist_rpm', 'any', self._dist_path(srpms[0])) self.distribution.dist_files.append(dist_file) self.move_file(srpms[0], self.dist_dir) | srpm = os.path.join(rpm_dir['SRPMS'], source_rpm) assert(os.path.exists(srpm)) self.move_file(srpm, self.dist_dir) | def run (self): | 5310e5078ad331631f109e8fa33b8534911f0ce0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5310e5078ad331631f109e8fa33b8534911f0ce0/bdist_rpm.py |
rpms = glob.glob(os.path.join(rpm_dir['RPMS'], "*/*.rpm")) debuginfo = glob.glob(os.path.join(rpm_dir['RPMS'], "*/*debuginfo*.rpm")) if debuginfo: rpms.remove(debuginfo[0]) assert len(rpms) == 1, \ "unexpected number of RPM files found: %s" % rpms dist_file = ('bdist_rpm', get_python_version(), self._dist_path(rpms[0])... | for rpm in binary_rpms: rpm = os.path.join(rpm_dir['RPMS'], rpm) if os.path.exists(rpm): self.move_file(rpm, self.dist_dir) | def run (self): | 5310e5078ad331631f109e8fa33b8534911f0ce0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5310e5078ad331631f109e8fa33b8534911f0ce0/bdist_rpm.py |
def wm_state(self): """Return the state of this widget as one of normal, icon, iconic (see wm_iconwindow) and withdrawn.""" return self.tk.call('wm', 'state', self._w) | def wm_state(self, newstate=None): """Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).""" return self.tk.call('wm', 'state', self._w, newstate) | def wm_state(self): """Return the state of this widget as one of normal, icon, iconic (see wm_iconwindow) and withdrawn.""" return self.tk.call('wm', 'state', self._w) | 289ad8f06354eaac2ce8174d52265292a6e71965 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/289ad8f06354eaac2ce8174d52265292a6e71965/Tkinter.py |
newurl = '//' + host + selector return self.open_http(newurl) | newurl = 'http://' + host + selector return self.open(newurl) | def retry_http_basic_auth(self, url, realm): host, selector = splithost(url) i = string.find(host, '@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = '//' + host + selector return self.open_http(newurl) | e0c0da98d85a343ec0578ce8ce690fb952118a0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e0c0da98d85a343ec0578ce8ce690fb952118a0b/urllib.py |
from pprint import pprint print "options (after parsing config files):" pprint (self.command_options) | parser.__init__() | def parse_config_files (self, filenames=None): | 474607777d10562679b1640d3831290b0c4284f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/474607777d10562679b1640d3831290b0c4284f7/dist.py |
if opts.help: | if hasattr(opts, 'help') and opts.help: | def _parse_command_opts (self, parser, args): | 474607777d10562679b1640d3831290b0c4284f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/474607777d10562679b1640d3831290b0c4284f7/dist.py |
cmd_opts[command] = ("command line", value) | cmd_opts[name] = ("command line", value) | def _parse_command_opts (self, parser, args): | 474607777d10562679b1640d3831290b0c4284f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/474607777d10562679b1640d3831290b0c4284f7/dist.py |
cmd_obj = self.command_obj[command] = klass() self.command_run[command] = 0 | cmd_obj = self.command_obj[command] = klass(self) self.have_run[command] = 0 options = self.command_options.get(command) if options: print " setting options:" for (option, (source, value)) in options.items(): print " %s = %s (from %s)" % (option, value, source) setattr(cmd_obj, option, value) | def get_command_obj (self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no comand object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return None. """ cmd_obj = self.command_ob... | 474607777d10562679b1640d3831290b0c4284f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/474607777d10562679b1640d3831290b0c4284f7/dist.py |
x = self.dict[headerseen] + "\n " + line.strip() | def readheaders(self): """Read header lines. | 22b3a49d3c17c37348e65d06df8683e5b8fc6fd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22b3a49d3c17c37348e65d06df8683e5b8fc6fd0/httplib.py | |
conn = self.msg.getheader('connection') if conn: conn = conn.lower() self.will_close = conn.find('close') != -1 or \ ( self.version != 11 and \ not self.msg.getheader('keep-alive') ) else: self.will_close = self.version != 11 and \ not self.msg.getheader('keep-alive') | self.will_close = self._check_close() | def begin(self): if self.msg is not None: # we've already started reading the response return | 22b3a49d3c17c37348e65d06df8683e5b8fc6fd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22b3a49d3c17c37348e65d06df8683e5b8fc6fd0/httplib.py |
eq(value, 'text/plain; charset=us-ascii; boundary="BOUNDARY"') | eq(value, 'text/plain; charset="us-ascii"; boundary="BOUNDARY"') | def test_set_boundary(self): eq = self.assertEqual # This one has no existing boundary parameter, but the Content-Type: # header appears fifth. msg = self._msgobj('msg_01.txt') msg.set_boundary('BOUNDARY') header, value = msg.items()[4] eq(header.lower(), 'content-type') eq(value, 'text/plain; charset=us-ascii; boundar... | 9546e7972cd7fafa7da597cd433c6a59a3198ad8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9546e7972cd7fafa7da597cd433c6a59a3198ad8/test_email.py |
'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) | 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) | def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://'... | f0713d3f4d1d9fbd3cc10877822e824103f7affa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0713d3f4d1d9fbd3cc10877822e824103f7affa/urllib.py |
return addinfourl(open(url2pathname(file), 'rb'), | return addinfourl(open(localname, 'rb'), | def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://'... | f0713d3f4d1d9fbd3cc10877822e824103f7affa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0713d3f4d1d9fbd3cc10877822e824103f7affa/urllib.py |
return addinfourl(open(url2pathname(file), 'rb'), | return addinfourl(open(localname, 'rb'), | def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://'... | f0713d3f4d1d9fbd3cc10877822e824103f7affa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0713d3f4d1d9fbd3cc10877822e824103f7affa/urllib.py |
if os.path.isdir (name): | if os.path.isdir (name) or name == '': | def mkpath (name, mode=0777, verbose=0, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists, return silently. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' i... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
raise DistutilsFileError, "%s: %s" % (head, errstr) | raise DistutilsFileError, "'%s': %s" % (head, errstr) | def mkpath (name, mode=0777, verbose=0, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists, return silently. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' i... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
raise DistutilsFileError, "could not open %s: %s" % (src, errstr) | raise DistutilsFileError, \ "could not open '%s': %s" % (src, errstr) | def _copy_file_contents (src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anythi... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
raise DistutilsFileError, "could not create %s: %s" % (dst, errstr) | raise DistutilsFileError, \ "could not create '%s': %s" % (dst, errstr) | def _copy_file_contents (src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anythi... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
"could not read from %s: %s" % (src, errstr) | "could not read from '%s': %s" % (src, errstr) | def _copy_file_contents (src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anythi... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
"could not write to %s: %s" % (dst, errstr) | "could not write to '%s': %s" % (dst, errstr) | def _copy_file_contents (src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anythi... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
"can't copy %s: not a regular file" % src | "can't copy '%s': not a regular file" % src | def copy_file (src, dst, preserve_mode=1, preserve_times=1, update=0, verbose=0, dry_run=0): """Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' is true (the ... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
"cannot copy tree %s: not a directory" % src | "cannot copy tree '%s': not a directory" % src | def copy_tree (src, dst, preserve_mode=1, preserve_times=1, preserve_symlinks=0, update=0, verbose=0, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does not exist, it is creat... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
"error listing files in %s: %s" % (src, errstr) | "error listing files in '%s': %s" % (src, errstr) | def copy_tree (src, dst, preserve_mode=1, preserve_times=1, preserve_symlinks=0, update=0, verbose=0, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does not exist, it is creat... | 96182d7b68cfb2226af0c0e701b9d35d1aa59603 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96182d7b68cfb2226af0c0e701b9d35d1aa59603/util.py |
target_version = self.target_version if not target_version: assert self.skip_build, "Should have already checked this" target_version = sys.version[0:3] plat_specifier = ".%s-%s" % (get_platform(), target_version) build = self.get_finalized_command('build') build.build_lib = os.path.join(build.build_base, 'lib' +... | if self.distribution.has_ext_modules(): target_version = self.target_version if not target_version: assert self.skip_build, "Should have already checked this" target_version = sys.version[0:3] plat_specifier = ".%s-%s" % (get_platform(), target_version) build = self.get_finalized_command('build') build.build_lib ... | 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") | 79d9bfa28f66e031dbc252eabe78cd0aea081f06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/79d9bfa28f66e031dbc252eabe78cd0aea081f06/bdist_wininst.py |
def __init__ (self, dist): """Create and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated. """ # late import because of mutual dependence between these classes from distutils.dist import Dist... | 2b2fe94cde439e020ec2a5152e3d3e1dfec6ce9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b2fe94cde439e020ec2a5152e3d3e1dfec6ce9d/cmd.py | ||
user,pw = self.passwd.find_user_password(realm, host) | user, pw = self.passwd.find_user_password(realm, req.get_full_url()) | def retry_http_basic_auth(self, host, req, realm): user,pw = self.passwd.find_user_password(realm, host) if pw is not None: raw = "%s:%s" % (user, pw) auth = 'Basic %s' % base64.encodestring(raw).strip() if req.headers.get(self.auth_header, None) == auth: return None req.add_header(self.auth_header, auth) return self.p... | b300ae3a79624867cad30fddfb3350f9c731f21c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b300ae3a79624867cad30fddfb3350f9c731f21c/urllib2.py |
base = base + ', opaque="%s"' % opaque | base += ', opaque="%s"' % opaque | def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None | b300ae3a79624867cad30fddfb3350f9c731f21c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b300ae3a79624867cad30fddfb3350f9c731f21c/urllib2.py |
base = base + ', digest="%s"' % entdig if algorithm != 'MD5': base = base + ', algorithm="%s"' % algorithm | base += ', digest="%s"' % entdig base += ', algorithm="%s"' % algorithm | def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None | b300ae3a79624867cad30fddfb3350f9c731f21c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b300ae3a79624867cad30fddfb3350f9c731f21c/urllib2.py |
base = base + ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce) | base += ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce) | def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None | b300ae3a79624867cad30fddfb3350f9c731f21c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b300ae3a79624867cad30fddfb3350f9c731f21c/urllib2.py |
id = 257 | def AskString(prompt, default = "", id=257, ok=None, cancel=None): """Display a PROMPT string and a text entry field with a DEFAULT string. Return the contents of the text entry field when the user clicks the OK button or presses Return. Return None when the user clicks the Cancel button. If omitted, DEFAULT is empty... | 231fffe1d4582263a430781e0a3435e444399abe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/231fffe1d4582263a430781e0a3435e444399abe/EasyDialogs.py | |
if hasattr(socket, 'AF_UNIX'): class UnixStreamServer(TCPServer): address_family = socket.AF_UNIX class UnixDatagramServer(UDPServer): address_family = socket.AF_UNIX | def server_activate(self): # No need to call listen() for UDP. pass | 67a40e814ca29a8b886d0db018995f9b518785e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/67a40e814ca29a8b886d0db018995f9b518785e8/SocketServer.py | |
fp = open(pathname) | fp = open(pathname, "U") | def run_script(self, pathname): self.msg(2, "run_script", pathname) fp = open(pathname) stuff = ("", "r", imp.PY_SOURCE) self.load_module('__main__', fp, pathname, stuff) | 74416af9dc7900d30c41a16d3b56cf4ea00ec137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74416af9dc7900d30c41a16d3b56cf4ea00ec137/modulefinder.py |
fp = open(pathname) | fp = open(pathname, "U") | def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) fp = open(pathname) stuff = (ext, "r", imp.PY_SOURCE) self.load_module(name, fp, pathname, stuff) | 74416af9dc7900d30c41a16d3b56cf4ea00ec137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74416af9dc7900d30c41a16d3b56cf4ea00ec137/modulefinder.py |
editor.ted.WEUseText(Res.Resource(Text)) editor.ted.WECalText() editor.SetPort() editor.GetWindow().InvalWindowRect(editor._bounds) | editor.set(Text) | def replaceall(self): editor = findeditor(self) if not editor: return if self.visible: self.getparmsfromwindow() W.SetCursor("watch") find = self.parms["find"] if not find: return findlen = len(find) replace = self.parms["replace"] replacelen = len(replace) Text = editor.get() if not self.parms["casesens"]: find = stri... | 7b0255153f2402d9853b29cc7bd4ea1dce14a997 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7b0255153f2402d9853b29cc7bd4ea1dce14a997/PyEdit.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') | 3adc4aa2fb58aaca2f7692a37239ee3157887166 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3adc4aa2fb58aaca2f7692a37239ee3157887166/setup.py | ||
min_db_ver = (3, 2) | min_db_ver = (3, 3) | 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') | 3adc4aa2fb58aaca2f7692a37239ee3157887166 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3adc4aa2fb58aaca2f7692a37239ee3157887166/setup.py |
return code.split('.')[:2] | return tuple(code.split('.')[:2]) | def _parse_localename(localename): """ Parses the locale code for localename and returns the result as tuple (language code, encoding). The localename is normalized and passed through the locale alias engine. A ValueError is raised in case the locale name cannot be parsed. The language code corresponds to RFC 1766. ... | 346e67f80553be5297dccd43db7a71f4b81bdcab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/346e67f80553be5297dccd43db7a71f4b81bdcab/locale.py |
return section in self.sections() | return section in self.__sections | def has_section(self, section): """Indicate whether the named section is present in the configuration. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
sectdict = self.__sections[section].copy() | d.update(self.__sections[section]) | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if section == DEFAULTSECT: sectdict = {} else: | if section != DEFAULTSECT: | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
d = self.__defaults.copy() d.update(sectdict) | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py | |
rawval = d[option] | value = d[option] | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
return rawval | return value return self._interpolate(section, option, value, d) def _interpolate(self, section, option, rawval, vars): | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
value = rawval depth = 0 while depth < 10: depth = depth + 1 if value.find("%(") >= 0: | value = rawval depth = MAX_INTERPOLATION_DEPTH while depth: depth -= 1 if value.find("%(") != -1: | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
value = value % d | value = value % vars | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if value.find("%(") >= 0: | if value.find("%(") != -1: | def get(self, section, option, raw=0, vars=None): """Get an option value for a given section. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} | def getboolean(self, section, option): states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not v.lower() in states: raise ValueError, 'Not a boolean: %s' % v return states[v.lower()] | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py | |
if not v.lower() in states: | if v.lower() not in self._boolean_states: | def getboolean(self, section, option): states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not v.lower() in states: raise ValueError, 'Not a boolean: %s' % v return states[v.lower()] | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
return states[v.lower()] | return self._boolean_states[v.lower()] | def getboolean(self, section, option): states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not v.lower() in states: raise ValueError, 'Not a boolean: %s' % v return states[v.lower()] | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if not section or section == "DEFAULT": | if not section or section == DEFAULTSECT: option = self.optionxform(option) | def has_option(self, section, option): """Check for the existence of a given option in a given section.""" if not section or section == "DEFAULT": return option in self.__defaults elif not self.has_section(section): return 0 else: option = self.optionxform(option) return option in self.__sections[section] | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
elif not self.has_section(section): | elif section not in self.__sections: | def has_option(self, section, option): """Check for the existence of a given option in a given section.""" if not section or section == "DEFAULT": return option in self.__defaults elif not self.has_section(section): return 0 else: option = self.optionxform(option) return option in self.__sections[section] | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
return option in self.__sections[section] | return (option in self.__sections[section] or option in self.__defaults) | def has_option(self, section, option): """Check for the existence of a given option in a given section.""" if not section or section == "DEFAULT": return option in self.__defaults elif not self.has_section(section): return 0 else: option = self.optionxform(option) return option in self.__sections[section] | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if not section or section == "DEFAULT": | if not section or section == DEFAULTSECT: | def set(self, section, option, value): """Set an option.""" if not section or section == "DEFAULT": sectdict = self.__defaults else: try: sectdict = self.__sections[section] except KeyError: raise NoSectionError(section) option = self.optionxform(option) sectdict[option] = value | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
option = self.optionxform(option) sectdict[option] = value | sectdict[self.optionxform(option)] = value | def set(self, section, option, value): """Set an option.""" if not section or section == "DEFAULT": sectdict = self.__defaults else: try: sectdict = self.__sections[section] except KeyError: raise NoSectionError(section) option = self.optionxform(option) sectdict[option] = value | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
fp.write("[DEFAULT]\n") | fp.write("[%s]\n" % DEFAULTSECT) | def write(self, fp): """Write an .ini-format representation of the configuration state.""" if self.__defaults: fp.write("[DEFAULT]\n") for (key, value) in self.__defaults.items(): fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) fp.write("\n") for section in self.sections(): fp.write("[" + section + "]\n... | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
for section in self.sections(): fp.write("[" + section + "]\n") sectdict = self.__sections[section] for (key, value) in sectdict.items(): if key == "__name__": continue fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) | for section in self.__sections: fp.write("[%s]\n" % section) for (key, value) in self.__sections[section].items(): if key != "__name__": fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) | def write(self, fp): """Write an .ini-format representation of the configuration state.""" if self.__defaults: fp.write("[DEFAULT]\n") for (key, value) in self.__defaults.items(): fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) fp.write("\n") for section in self.sections(): fp.write("[" + section + "]\n... | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if not section or section == "DEFAULT": | if not section or section == DEFAULTSECT: | def remove_option(self, section, option): """Remove an option.""" if not section or section == "DEFAULT": sectdict = self.__defaults else: try: sectdict = self.__sections[section] except KeyError: raise NoSectionError(section) option = self.optionxform(option) existed = option in sectdict if existed: del sectdict[optio... | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if section in self.__sections: | existed = section in self.__sections if existed: | def remove_section(self, section): """Remove a file section.""" if section in self.__sections: del self.__sections[section] return True else: return False | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
return True else: return False | return existed | def remove_section(self, section): """Remove a file section.""" if section in self.__sections: del self.__sections[section] return True else: return False | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
def remove_section(self, section): """Remove a file section.""" if section in self.__sections: del self.__sections[section] return True else: return False | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py | ||
r'(?P<option>[]\-[\w_.*,(){}]+)' r'[ \t]*(?P<vi>[:=])[ \t]*' | r'(?P<option>[^:=\s]+)' r'\s*(?P<vi>[:=])\s*' | def remove_section(self, section): """Remove a file section.""" if section in self.__sections: del self.__sections[section] return True else: return False | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if line.split()[0].lower() == 'rem' \ and line[0] in "rR": | if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR": | def __read(self, fp, fpname): """Parse a sectioned setup file. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if line[0] in ' \t' and cursect is not None and optname: | if line[0].isspace() and cursect is not None and optname: | def __read(self, fp, fpname): """Parse a sectioned setup file. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
k = self.optionxform(optname) cursect[k] = "%s\n%s" % (cursect[k], value) | cursect[optname] = "%s\n%s" % (cursect[optname], value) | def __read(self, fp, fpname): """Parse a sectioned setup file. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
if pos and optval[pos-1].isspace(): | if pos != -1 and optval[pos-1].isspace(): | def __read(self, fp, fpname): """Parse a sectioned setup file. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
cursect[self.optionxform(optname)] = optval | optname = self.optionxform(optname) cursect[optname] = optval | def __read(self, fp, fpname): """Parse a sectioned setup file. | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py |
'\( | '\( | def processor(): """ Returns the (true) processor name, e.g. 'amdk6' An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for machine(), e.g. NetBSD does this. """ return uname()[5] | 3dafaabfb5abe2ca1dd6d5a8985fb960374f7c7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dafaabfb5abe2ca1dd6d5a8985fb960374f7c7a/platform.py |
buildno = int(buildno) | def _sys_version(): """ Returns a parsed version of Python's sys.version as tuple (version, buildno, builddate, compiler) referring to the Python version, build number, build date/time as string and the compiler identification string. Note that unlike the Python sys.version, the returned value for the Python version ... | 3dafaabfb5abe2ca1dd6d5a8985fb960374f7c7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dafaabfb5abe2ca1dd6d5a8985fb960374f7c7a/platform.py | |
if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) | if size < 0: size = sys.maxint readsize = self.min_readsize else: readsize = size bufs = "" | def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line | d72aab5e31f831edb2b8e837e2ab387f2db07aee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d72aab5e31f831edb2b8e837e2ab387f2db07aee/gzip.py |
if size == 0: return "".join(bufs) | if size == 0: return bufs | def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line | d72aab5e31f831edb2b8e837e2ab387f2db07aee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d72aab5e31f831edb2b8e837e2ab387f2db07aee/gzip.py |
if size is not None: if i==-1 and len(c) > size: i=size-1 elif size <= i: i = size -1 | def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line | d72aab5e31f831edb2b8e837e2ab387f2db07aee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d72aab5e31f831edb2b8e837e2ab387f2db07aee/gzip.py | |
bufs.append(c[:i+1]) self._unread(c[i+1:]) return ''.join(bufs) bufs.append(c) size = size - len(c) readsize = min(size, readsize * 2) | if size <= i: i = size - 1 self._unread(c[i+1:]) return bufs + c[:i+1] else: if len(c) > size: i = size - 1 bufs = bufs + c size = size - len(c) readsize = min(size, int(readsize * 1.1)) if readsize > self.min_readsize: self.min_readsize = readsize | def readline(self, size=-1): if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) # Read from the file in small chunks while True: if size == 0: return "".join(bufs) # Return resulting line | d72aab5e31f831edb2b8e837e2ab387f2db07aee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d72aab5e31f831edb2b8e837e2ab387f2db07aee/gzip.py |
if url[:1] != '/': url = '/' + url | if url and url[:1] != '/': url = '/' + url | def urlunparse((scheme, netloc, url, params, query, fragment)): """Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).""" if netloc o... | 867952f6e437270cc906af34dba28a9b580ec265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/867952f6e437270cc906af34dba28a9b580ec265/urlparse.py |
return urlunparse((scheme, netloc, path, params, query, fragment)) | return url | def urljoin(base, url, allow_fragments = 1): """Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.""" if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_fragments) scheme, netloc, path, params, query, fragment = \ urlparse(... | 867952f6e437270cc906af34dba28a9b580ec265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/867952f6e437270cc906af34dba28a9b580ec265/urlparse.py |
params, query or bquery, fragment)) | params, query, fragment)) | def urljoin(base, url, allow_fragments = 1): """Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.""" if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_fragments) scheme, netloc, path, params, query, fragment = \ urlparse(... | 867952f6e437270cc906af34dba28a9b580ec265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/867952f6e437270cc906af34dba28a9b580ec265/urlparse.py |
if segments[i] == '..' and segments[i-1]: | if (segments[i] == '..' and segments[i-1] not in ('', '..')): | def urljoin(base, url, allow_fragments = 1): """Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.""" if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_fragments) scheme, netloc, path, params, query, fragment = \ urlparse(... | 867952f6e437270cc906af34dba28a9b580ec265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/867952f6e437270cc906af34dba28a9b580ec265/urlparse.py |
if len(segments) == 2 and segments[1] == '..' and segments[0] == '': | if segments == ['', '..']: | def urljoin(base, url, allow_fragments = 1): """Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.""" if not base: return url bscheme, bnetloc, bpath, bparams, bquery, bfragment = \ urlparse(base, '', allow_fragments) scheme, netloc, path, params, query, fragment = \ urlparse(... | 867952f6e437270cc906af34dba28a9b580ec265 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/867952f6e437270cc906af34dba28a9b580ec265/urlparse.py |
value = value[:m.start()] + done[n] + after | value = value[:m.start()] + str(done[n]) + after | def parse_makefile(fn, 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. """ from distutils.text_file import TextFile fp = TextFile(fn, strip_comments=1, skip_blanks=1, ... | b11bd03626f2c4bb545bac0ba2150d6e168faccd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b11bd03626f2c4bb545bac0ba2150d6e168faccd/sysconfig.py |
except ValueError: pass done[name] = string.strip(value) | except ValueError: done[name] = string.strip(value) else: done[name] = value | def parse_makefile(fn, 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. """ from distutils.text_file import TextFile fp = TextFile(fn, strip_comments=1, skip_blanks=1, ... | b11bd03626f2c4bb545bac0ba2150d6e168faccd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b11bd03626f2c4bb545bac0ba2150d6e168faccd/sysconfig.py |
except ValueError: pass done[name] = string.strip(value) | except ValueError: done[name] = string.strip(value) else: done[name] = value | def parse_makefile(fn, 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. """ from distutils.text_file import TextFile fp = TextFile(fn, strip_comments=1, skip_blanks=1, ... | b11bd03626f2c4bb545bac0ba2150d6e168faccd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b11bd03626f2c4bb545bac0ba2150d6e168faccd/sysconfig.py |
testit('rint(0.7)', math.rint(0.7), 1) testit('rint(-0.3)', math.rint(-0.3), 0) testit('rint(2.5)', math.rint(2.5), 2) testit('rint(3.5)', math.rint(3.5), 4) | try: math.rint except AttributeError: pass else: testit('rint(0.7)', math.rint(0.7), 1) testit('rint(-0.3)', math.rint(-0.3), 0) testit('rint(2.5)', math.rint(2.5), 2) testit('rint(3.5)', math.rint(3.5), 4) | def testmodf(name, (v1, v2), (e1, e2)): if abs(v1-e1) > eps or abs(v2-e2): raise TestFailed, '%s returned %s, expected %s'%\ (name, `v1,v2`, `e1,e2`) | 8eded195aafd589b54b51412fd1ca61f6e932bbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8eded195aafd589b54b51412fd1ca61f6e932bbe/test_math.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.