rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
return self(result) def __call__(self, result):
def run(self, result): return self(result)
664347be946f0a217f91259f93962727ba84c287 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/664347be946f0a217f91259f93962727ba84c287/unittest.py
if string.find(string.lower(name), 'xml') >= 0:
if string.lower(name) == 'xml':
def parse_proc(self, i): rawdata = self.rawdata end = procclose.search(rawdata, i) if end is None: return -1 j = end.start(0) if illegal.search(rawdata, i+2, j): self.syntax_error('illegal character in processing instruction') res = tagfind.match(rawdata, i+2) if res is None: raise RuntimeError, 'unexpected call to par...
1f2e09bc45faa25c95f4e4ea1b24201af916179c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f2e09bc45faa25c95f4e4ea1b24201af916179c/xmllib.py
include_dirs += ['/usr/5include']
inc_dirs += ['/usr/5include']
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' )
b69c758f3bbbc9534d6a45b9b3cf5d14cbc3d48c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b69c758f3bbbc9534d6a45b9b3cf5d14cbc3d48c/setup.py
pos = pos + self.chunk_size
pos = pos + self.chunksize
def seek(self, pos, whence = 0): """Seek to specified position into the chunk. Default position is 0 (start of chunk). If the file is not seekable, this will result in an error. """
0d1b7ea365c2e299a1de4df1243927ffdfcd74d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0d1b7ea365c2e299a1de4df1243927ffdfcd74d7/chunk.py
def run(self): # remove the build/temp.<plat> directory (unless it's already # gone) if os.path.exists (self.build_temp): remove_tree (self.build_temp, self.verbose, self.dry_run) else: self.warn ("'%s' does not exist -- can't clean it" % self.build_temp)
7ac743bd72d1550d8f8df4787467f386a14bffa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ac743bd72d1550d8f8df4787467f386a14bffa9/clean.py
if os.path.exists (self.build_lib): remove_tree (self.build_lib, self.verbose, self.dry_run) else: self.warn ("'%s' does not exist -- can't clean it" % self.build_lib) if os.path.exists (self.bdist_base): remove_tree (self.bdist_base, self.verbose, self.dry_run) else: self.warn ("'%s' does not exist -- can't cle...
for directory in (self.build_lib, self.bdist_base, self.build_scripts): if os.path.exists (directory): remove_tree (directory, self.verbose, self.dry_run) else: self.warn ("'%s' does not exist -- can't clean it" % directory)
def run(self): # remove the build/temp.<plat> directory (unless it's already # gone) if os.path.exists (self.build_temp): remove_tree (self.build_temp, self.verbose, self.dry_run) else: self.warn ("'%s' does not exist -- can't clean it" % self.build_temp)
7ac743bd72d1550d8f8df4787467f386a14bffa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7ac743bd72d1550d8f8df4787467f386a14bffa9/clean.py
data.byteswap()
if big_endian: data.byteswap()
def readframes(self, nframes): if self._data_seek_needed: self._data_chunk.rewind() pos = self._soundpos * self._framesize if pos: self._data_chunk.setpos(pos) self._data_seek_needed = 0 if nframes == 0: return '' if self._sampwidth > 1: # unfortunately the fromfile() method does not take # something that only looks li...
ebb9c922cb1f1b72fe929cfba223e42df7492a1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebb9c922cb1f1b72fe929cfba223e42df7492a1c/wave.py
data.byteswap()
if big_endian: data.byteswap()
def writeframesraw(self, data): self._ensure_header_written(len(data)) nframes = len(data) / (self._sampwidth * self._nchannels) if self._convert: data = self._convert(data) if self._sampwidth > 1: import array data = array.array(_array_fmts[self._sampwidth], data) data.byteswap() data.tofile(self._file) self._datawrit...
ebb9c922cb1f1b72fe929cfba223e42df7492a1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebb9c922cb1f1b72fe929cfba223e42df7492a1c/wave.py
_write_long(36 + self._datawritten)
_write_long(self._file, 36 + self._datawritten)
def _patchheader(self): if self._datawritten == self._datalength: return curpos = self._file.tell() self._file.seek(self._form_length_pos, 0) _write_long(36 + self._datawritten) self._file.seek(self._data_length_pos, 0) _write_long(self._file, self._datawritten) self._file.seek(curpos, 0) self._datalength = self._dataw...
ebb9c922cb1f1b72fe929cfba223e42df7492a1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebb9c922cb1f1b72fe929cfba223e42df7492a1c/wave.py
day = int(mo.group(day)) year = int(mo.group(year)) hour = int(mo.group(hour)) min = int(mo.group(min)) sec = int(mo.group(sec)) zoneh = int(mo.group(zoneh)) zonem = int(mo.group(zonem))
day = int(mo.group('day')) year = int(mo.group('year')) hour = int(mo.group('hour')) min = int(mo.group('min')) sec = int(mo.group('sec')) zoneh = int(mo.group('zoneh')) zonem = int(mo.group('zonem'))
def Internaldate2tuple(resp): """Convert IMAP4 INTERNALDATE to UT. Returns Python time module tuple. """ mo = InternalDate.match(resp) if not mo: return None mon = Mon2num[mo.group('mon')] zonen = mo.group('zonen') day = int(mo.group(day)) year = int(mo.group(year)) hour = int(mo.group(hour)) min = int(mo.group(min...
f5d3ea00b97910bd14fa32fea46c29fae5775edd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5d3ea00b97910bd14fa32fea46c29fae5775edd/imaplib.py
self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae')
self.assertEquals(ef.read(), '\\\xd5\n\x00\x00\xae')
def test_basic(self): f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80') ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8') self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae')
f96b162b683543f076c67d97d1d86d38c3c215eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f96b162b683543f076c67d97d1d86d38c3c215eb/test_codecs.py
if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth) if auth: h.putheader('Authorization: Basic %s' % auth)
if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth) if auth: h.putheader('Authorization', 'Basic %s' % auth)
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None proxy_passwd = None if isinstance(url, str): host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url # here, we determine, whether the pr...
0faf90acc43484c934e816bb675bca0007d31c17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0faf90acc43484c934e816bb675bca0007d31c17/urllib.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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
framework = sysconfig.get_config_var('PYTHONFRAMEWORK') if framework: exts.append( Extension('gestalt', ['gestaltmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('MacOS', ['macosmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('icglue', ['icgluemodule.c'], ext...
exts.append( Extension('gestalt', ['gestaltmodule.c'],
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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
exts.append( Extension('_AE', ['ae/_AEmodule.c'],
exts.append( Extension('MacOS', ['macosmodule.c'],
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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
exts.append( Extension('_AH', ['ah/_AHmodule.c'],
exts.append( Extension('icglue', ['icgluemodule.c'],
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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
exts.append( Extension('_Alias', ['alias/_Aliasmodule.c'],
exts.append( Extension('macfs', ['macfsmodule.c', '../Python/getapplbycreator.c'],
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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
exts.append( Extension('_App', ['app/_Appmodule.c'],
exts.append( Extension('_Res', ['res/_Resmodule.c'],
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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
exts.append( Extension('_CarbonEvt', ['carbonevt/_CarbonEvtmodule.c'],
exts.append( Extension('_Snd', ['snd/_Sndmodule.c'],
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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
exts.append( Extension('_CG', ['cg/_CGmodule.c'], extra_link_args=['-framework', 'ApplicationServices', '-framework', 'Carbon']) ) exts.append( Extension('_Cm', ['cm/_Cmmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Ctl', ['ctl/_Ctlmodule.c'], extra_link_args=['-framework', 'Carbon']) ...
exts.append( Extension('Nav', ['Nav.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_AE', ['ae/_AEmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_AH', ['ah/_AHmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Alias', ['alias/_Alias...
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')
05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py
zinfo.flag_bits = 0x08
zinfo.flag_bits = 0x00
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[8]) date_time = mtime[0:6] # Create ZipInfo instance to store file information if arcname is None: zinfo = ZipInfo(filename, date_time)...
03a3bb812a002119f139c57b902172ed6499c28d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03a3bb812a002119f139c57b902172ed6499c28d/zipfile.py
CRC = 0 compress_size = 0 file_size = 0
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[8]) date_time = mtime[0:6] # Create ZipInfo instance to store file information if arcname is None: zinfo = ZipInfo(filename, date_time)...
03a3bb812a002119f139c57b902172ed6499c28d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03a3bb812a002119f139c57b902172ed6499c28d/zipfile.py
position = self.fp.tell() self.fp.seek(zinfo.header_offset + 14, 0)
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[8]) date_time = mtime[0:6] # Create ZipInfo instance to store file information if arcname is None: zinfo = ZipInfo(filename, date_time)...
03a3bb812a002119f139c57b902172ed6499c28d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03a3bb812a002119f139c57b902172ed6499c28d/zipfile.py
self.checksyntax(filename)
def check_module_event(self, event): filename = self.getfilename() if not filename: return if not self.tabnanny(filename): return self.checksyntax(filename)
c426ffcdfc12cbe13e307cf3897d99a5511fc8ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c426ffcdfc12cbe13e307cf3897d99a5511fc8ca/ScriptBinding.py
except IndentationError: pass
def tabnanny(self, filename): f = open(filename, 'r') try: tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError, msg: msgtxt, (lineno, start) = msg self.editwin.gotoline(lineno) self.errorbox("Tabnanny Tokenizing Error", "Token Error: %s" % msgtxt) return False except tabnanny.NannyN...
c426ffcdfc12cbe13e307cf3897d99a5511fc8ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c426ffcdfc12cbe13e307cf3897d99a5511fc8ca/ScriptBinding.py
if not self.tabnanny(filename): return
def run_module_event(self, event): """Run the module after setting up the environment.
c426ffcdfc12cbe13e307cf3897d99a5511fc8ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c426ffcdfc12cbe13e307cf3897d99a5511fc8ca/ScriptBinding.py
def __init__(self): self.childNodes = [] self.parentNode = None if Node._debug: index = repr(id(self)) + repr(self.__class__) Node.allnodes[index] = repr(self.__dict__) if Node.debug is None: Node.debug = _get_StringIO() #open( "debug4.out", "w" ) Node.debug.write("create %s\n" % index)
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
"%s cannot be child of %s" % (repr(newChild), repr(self) )
"%s cannot be child of %s" % (repr(newChild), repr(self))
def insertBefore(self, newChild, refChild): if newChild.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(newChild), repr(self) ) if newChild.parentNode is not None: newChild.parentNode.removeChild(newChild) if refChild is None: self.appendChild(newChild) else: index =...
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
"%s cannot be child of %s" % (repr(node), repr(self) )
"%s cannot be child of %s" % (repr(node), repr(self))
def appendChild(self, node): if node.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(node), repr(self) ) if node.parentNode is not None: node.parentNode.removeChild(node) if self.childNodes: last = self.lastChild node.previousSibling = last last.nextSibling = node el...
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
"%s cannot be child of %s" % (repr(newChild), repr(self) )
"%s cannot be child of %s" % (repr(newChild), repr(self))
def replaceChild(self, newChild, oldChild): if newChild.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(newChild), repr(self) ) if newChild.parentNode is not None: newChild.parentNode.removeChild(newChild) if newChild is oldChild: return index = self.childNodes.index...
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
return self._attrs[attname].value
try: return self._attrs[attname].value except KeyError: return ""
def getAttribute(self, attname): return self._attrs[attname].value
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
return self._attrsNS[(namespaceURI, localName)].value
try: return self._attrsNS[(namespaceURI, localName)].value except KeyError: return ""
def getAttributeNS(self, namespaceURI, localName): return self._attrsNS[(namespaceURI, localName)].value
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
return self._attrsNS[(namespaceURI, localName)]
return self._attrsNS.get((namespaceURI, localName))
def getAttributeNodeNS(self, namespaceURI, localName): return self._attrsNS[(namespaceURI, localName)]
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
raise xml.dom.WrongDocumentErr("doctype object owned by another DOM tree")
raise xml.dom.WrongDocumentErr( "doctype object owned by another DOM tree")
def createDocument(self, namespaceURI, qualifiedName, doctype): if doctype and doctype.parentNode is not None: raise xml.dom.WrongDocumentErr("doctype object owned by another DOM tree") doc = Document() if doctype is None: doctype = self.createDocumentType(qualifiedName, None, None) if qualifiedName: prefix, localname ...
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
raise xml.dom.NamespaceErr("illegal use of prefix without namespaces")
raise xml.dom.NamespaceErr( "illegal use of prefix without namespaces") element = doc.createElementNS(namespaceURI, qualifiedName) doc.appendChild(element)
def createDocument(self, namespaceURI, qualifiedName, doctype): if doctype and doctype.parentNode is not None: raise xml.dom.WrongDocumentErr("doctype object owned by another DOM tree") doc = Document() if doctype is None: doctype = self.createDocumentType(qualifiedName, None, None) if qualifiedName: prefix, localname ...
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
"%s cannot be child of %s" % (repr(node), repr(self) )
"%s cannot be child of %s" % (repr(node), repr(self))
def appendChild(self, node): if node.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(node), repr(self) ) if node.parentNode is not None: node.parentNode.removeChild(node)
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
raise xml.dom.HierarchyRequestErr("two document elements disallowed")
raise xml.dom.HierarchyRequestErr( "two document elements disallowed")
def appendChild(self, node): if node.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(node), repr(self) ) if node.parentNode is not None: node.parentNode.removeChild(node)
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
if a_uri:
if a_uri == xmlns_uri: if a_localname == 'xmlns': qname = a_localname else: qname = 'xmlns:' + a_localname attr = self.document.createAttributeNS(a_uri, qname) node.setAttributeNodeNS(attr) elif a_uri:
def startElementNS(self, name, tagName , attrs): uri, localname = name if uri: # When using namespaces, the reader may or may not # provide us with the original name. If not, create # *a* valid tagName from the current context. if tagName is None: prefix = self._current_context[uri] if prefix: tagName = prefix + ":" + ...
984158d25bd76fa33d4245e98f53c876f428d5f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/984158d25bd76fa33d4245e98f53c876f428d5f4/pulldom.py
print repr(str(err))
# def __getstate__(self):
98b922c0eca3f56f5fe1f1ed2c8337fbdb63618d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/98b922c0eca3f56f5fe1f1ed2c8337fbdb63618d/pickle.py
if not os.path.isfile(makefile):
if not os.path.isfile(makefile) or os.path.getsize(makefile)==0:
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
552262409dffc06b57c64ca8bfe011b8a10b2453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/552262409dffc06b57c64ca8bfe011b8a10b2453/build_ssl.py
run_configure(configure, do_script)
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
552262409dffc06b57c64ca8bfe011b8a10b2453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/552262409dffc06b57c64ca8bfe011b8a10b2453/build_ssl.py
print "Executing nmake over the ssl makefiles..."
makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile) print "Executing ssl makefiles:", makeCommand
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
552262409dffc06b57c64ca8bfe011b8a10b2453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/552262409dffc06b57c64ca8bfe011b8a10b2453/build_ssl.py
rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile))
rc = os.system(makeCommand)
def main(): build_all = "-a" in sys.argv if sys.argv[1] == "Release": arch = "x86" debug = False configure = "VC-WIN32" do_script = "ms\\do_masm" makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" do_script = "ms\\do_masm" makefile="ms\\d32.mak" elif sys.argv[1] == "Re...
552262409dffc06b57c64ca8bfe011b8a10b2453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/552262409dffc06b57c64ca8bfe011b8a10b2453/build_ssl.py
if (type!=float):
if type != float:
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (pow(type(i),0)!=1):
if pow(type(i), 0) != 1:
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (pow(type(i),1)!=type(i)):
if pow(type(i), 1) != type(i):
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (pow(type(0),1)!=type(0)):
if pow(type(0), 1) != type(0):
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (pow(type(1),1)!=type(1)):
if pow(type(1), 1) != type(1):
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (pow(type(i),3)!=i*i*i):
if pow(type(i), 3) != i*i*i:
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
pow2=1
pow2 = 1
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (pow(2,i)!=pow2):
if pow(2, i) != pow2:
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (i!=30): pow2=pow2*2
if i != 30 : pow2 = pow2*2 for othertype in int, long: for i in range(-10, 0) + range(1, 10): ii = type(i) for j in range(1, 11): jj = -othertype(j) try: pow(ii, jj) except ValueError: pass else: raise ValueError, "pow(%s, %s) did not fail" % (ii, jj) for othertype in int, long, float: for i in range(1, 100): zero = ...
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (type==float): il=1
if type == float: il = 1
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15
elif type == int: jl = 0 elif type == long: jl, jh = 0, 15
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
for j in range(jl,jh+1):
for j in range(jl, jh+1):
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (k!=0):
if k != 0:
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
if (j>=0 and k!=0): o=pow(i,j) % k n=pow(i,j,k) if (o!=n): print 'Integer mismatch:', i,j,k if (j>=0 and k<>0): o=pow(long(i),j) % k n=pow(long(i),j,k) if (o!=n): print 'Long mismatch:', i,j,k if (i>=0 and k<>0): o=pow(float(i),j) % k n=pow(float(i),j,k) if (o!=n): print 'Float mismatch:', i,j,k
if j >= 0 and k != 0: o = pow(i,j) % k n = pow(i,j,k) if o != n: print 'Integer mismatch:', i,j,k if j >= 0 and k <> 0: o = pow(long(i),j) % k n = pow(long(i),j,k) if o != n: print 'Long mismatch:', i,j,k if i >= 0 and k <> 0: o = pow(float(i),j) % k n = pow(float(i),j,k) if o != n: print 'Float mismatch:', i,j,k
def powtest(type): if (type!=float): print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if (pow(type(i),0)!=1): raise ValueError, 'pow('+str(i)+',0) != 1' if (pow(type(i),1)!=type(i)): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if (pow(type(0),1)!=type(0)): raise ValueError, 'pow(0,'+st...
c54d19043a595679f253a55e46fda2910f513c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c54d19043a595679f253a55e46fda2910f513c52/test_pow.py
... self.close = self.generator.close
... def __init__(self, name):
8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39/test_generators.py
>>> for s in sets: s.close()
... def __str__(self):
8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39/test_generators.py
... self.close = g.close
... def __init__(self, g):
8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39/test_generators.py
>>> m235.close()
>>> def m235():
8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39/test_generators.py
>>> fib.close()
... def tail(g):
8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8ebb28df3a6e0bce240b6c2aa20d7aa5a4dfef39/test_generators.py
self.min_readsize = 64
def __init__(self, filename=None, mode=None, compresslevel=9, fileobj=None): """Constructor for the GzipFile class.
b97597316b1176e62d538c812b9e468ff3372b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b97597316b1176e62d538c812b9e468ff3372b6b/gzip.py
if size < 0: size = sys.maxint readsize = self.min_readsize else: readsize = size bufs = ""
if size < 0: size = sys.maxint bufs = [] readsize = min(100, size)
def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
b97597316b1176e62d538c812b9e468ff3372b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b97597316b1176e62d538c812b9e468ff3372b6b/gzip.py
if size == 0: return bufs
if size == 0: return "".join(bufs)
def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
b97597316b1176e62d538c812b9e468ff3372b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b97597316b1176e62d538c812b9e468ff3372b6b/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 # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
b97597316b1176e62d538c812b9e468ff3372b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b97597316b1176e62d538c812b9e468ff3372b6b/gzip.py
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
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)
def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified
b97597316b1176e62d538c812b9e468ff3372b6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b97597316b1176e62d538c812b9e468ff3372b6b/gzip.py
tmp_file.close()
_sync_close(tmp_file)
def add(self, message): """Add message and return assigned key.""" tmp_file = self._create_tmp() try: self._dump_message(message, tmp_file) finally: tmp_file.close() if isinstance(message, MaildirMessage): subdir = message.get_subdir() suffix = self.colon + message.get_info() if suffix == self.colon: suffix = '' else: ...
bb876b9c69f80c253621937ad734eafef3086e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb876b9c69f80c253621937ad734eafef3086e5f/mailbox.py
new_file.close()
_sync_close(new_file)
def flush(self): """Write any pending changes to disk.""" if not self._pending: return self._lookup() new_file = _create_temporary(self._path) try: new_toc = {} self._pre_mailbox_hook(new_file) for key in sorted(self._toc.keys()): start, stop = self._toc[key] self._file.seek(start) self._pre_message_hook(new_file) new_...
bb876b9c69f80c253621937ad734eafef3086e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb876b9c69f80c253621937ad734eafef3086e5f/mailbox.py
self._file.close()
self._file.close()
def close(self): """Flush and close the mailbox.""" self.flush() if self._locked: self.unlock() self._file.close()
bb876b9c69f80c253621937ad734eafef3086e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb876b9c69f80c253621937ad734eafef3086e5f/mailbox.py
f.close()
_sync_close(f)
def add(self, message): """Add message and return assigned key.""" keys = self.keys() if len(keys) == 0: new_key = 1 else: new_key = max(keys) + 1 new_path = os.path.join(self._path, str(new_key)) f = _create_carefully(new_path) try: if self._locked: _lock_file(f) try: self._dump_message(message, f) if isinstance(messa...
bb876b9c69f80c253621937ad734eafef3086e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb876b9c69f80c253621937ad734eafef3086e5f/mailbox.py
f.close()
_sync_close(f)
def __setitem__(self, key, message): """Replace the keyed message; raise KeyError if it doesn't exist.""" path = os.path.join(self._path, str(key)) try: f = open(path, 'rb+') except IOError, e: if e.errno == errno.ENOENT: raise KeyError('No message with key: %s' % key) else: raise try: if self._locked: _lock_file(f) tr...
bb876b9c69f80c253621937ad734eafef3086e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb876b9c69f80c253621937ad734eafef3086e5f/mailbox.py
self._file.close()
_sync_close(self._file)
def unlock(self): """Unlock the mailbox if it is locked.""" if self._locked: _unlock_file(self._file) self._file.close() del self._file self._locked = False
bb876b9c69f80c253621937ad734eafef3086e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb876b9c69f80c253621937ad734eafef3086e5f/mailbox.py
f.close()
_sync_close(f)
def set_sequences(self, sequences): """Set sequences using the given name-to-key-list dictionary.""" f = open(os.path.join(self._path, '.mh_sequences'), 'r+') try: os.close(os.open(f.name, os.O_WRONLY | os.O_TRUNC)) for name, keys in sequences.iteritems(): if len(keys) == 0: continue f.write('%s:' % name) prev = None c...
bb876b9c69f80c253621937ad734eafef3086e5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bb876b9c69f80c253621937ad734eafef3086e5f/mailbox.py
if not self.py_modules and not self.packages: return if self.py_modules and self.packages: raise DistutilsOptionError, \ "build_py: supplying both 'packages' and 'py_modules' " + \ "options is not allowed"
def run (self):
e557f3556f1f87825e00a018eabf837c4c55f7d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e557f3556f1f87825e00a018eabf837c4c55f7d5/build_py.py
else:
if self.packages:
def run (self):
e557f3556f1f87825e00a018eabf837c4c55f7d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e557f3556f1f87825e00a018eabf837c4c55f7d5/build_py.py
modules = self.find_modules() else: modules = []
modules.extend(self.find_modules()) if self.packages:
def find_all_modules (self): """Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do."""
e557f3556f1f87825e00a018eabf837c4c55f7d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e557f3556f1f87825e00a018eabf837c4c55f7d5/build_py.py
testformat("One million is %i", 1000000, grouping=1, output='One million is 1,000,000',
testformat("One million is %i", 1000000, grouping=1, output='One million is 1%s000%s000' % (sep, sep),
def testformat(formatstr, value, grouping = 0, output=None, func=locale.format): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(value), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(value)), result = func(formatstr, value, grouping = grouping) if output and resul...
fad65594ba25caada52b334b05f5f3f0994b9206 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad65594ba25caada52b334b05f5f3f0994b9206/test_locale.py
testformat("One million is %i", 1000000, grouping=1, output='One million is 1,000,000',
testformat("One million is %i", 1000000, grouping=1, output='One million is 1%s000%s000' % (sep, sep),
def testformat(formatstr, value, grouping = 0, output=None, func=locale.format): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(value), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(value)), result = func(formatstr, value, grouping = grouping) if output and resul...
fad65594ba25caada52b334b05f5f3f0994b9206 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad65594ba25caada52b334b05f5f3f0994b9206/test_locale.py
testformat("--> %10.2f", 1000.0, grouping=1, output='--> 1,000.00',
testformat("--> %10.2f", 1000.0, grouping=1, output='--> 1%s000.00' % sep,
def testformat(formatstr, value, grouping = 0, output=None, func=locale.format): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(value), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(value)), result = func(formatstr, value, grouping = grouping) if output and resul...
fad65594ba25caada52b334b05f5f3f0994b9206 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad65594ba25caada52b334b05f5f3f0994b9206/test_locale.py
testformat("%*.*f", (10, 2, 1000.0), grouping=1, output=' 1,000.00',
testformat("%*.*f", (10, 2, 1000.0), grouping=1, output=' 1%s000.00' % sep,
def testformat(formatstr, value, grouping = 0, output=None, func=locale.format): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(value), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(value)), result = func(formatstr, value, grouping = grouping) if output and resul...
fad65594ba25caada52b334b05f5f3f0994b9206 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad65594ba25caada52b334b05f5f3f0994b9206/test_locale.py
output='int 1,000 float 1,000.00 str str', func=locale.format_string)
output='int 1%s000 float 1%s000.00 str str' % (sep, sep), func=locale.format_string)
def testformat(formatstr, value, grouping = 0, output=None, func=locale.format): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(value), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(value)), result = func(formatstr, value, grouping = grouping) if output and resul...
fad65594ba25caada52b334b05f5f3f0994b9206 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad65594ba25caada52b334b05f5f3f0994b9206/test_locale.py
test_support.run_unittest(UTF16Test)
suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UTF16Test)) suite.addTest(unittest.makeSuite(EscapeDecodeTest)) test_support.run_suite(suite)
def test_main(): test_support.run_unittest(UTF16Test)
8709a420c46aac08c2e692ab8fe181c1deb61e11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8709a420c46aac08c2e692ab8fe181c1deb61e11/test_codecs.py
self.lineno = self.lineno + string.count(rawdata[i:i], '\n')
self.lineno = self.lineno + string.count(rawdata[i:k], '\n')
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ...
5baaf66525aa7b3a61d2fec14b945539cd36d689 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5baaf66525aa7b3a61d2fec14b945539cd36d689/xmllib.py
method = self.elements.get(tag, (None, None))[1] if method is not None: self.handle_endtag(tag, method) else: self.unknown_endtag(tag)
def finish_endtag(self, tag): if not tag: self.syntax_error('name-less end tag') found = len(self.stack) - 1 if found < 0: self.unknown_endtag(tag) return else: found = -1 for i in range(len(self.stack)): if tag == self.stack[i][0]: found = i if found == -1: self.syntax_error('unopened end tag') method = self.elements....
5baaf66525aa7b3a61d2fec14b945539cd36d689 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5baaf66525aa7b3a61d2fec14b945539cd36d689/xmllib.py
global template if template == None:
global template, _pid if os.name == 'posix' and _pid and _pid != os.getpid(): template = None if template is None:
def gettempprefix(): global template if template == None: if os.name == 'posix': template = '@' + `os.getpid()` + '.' elif os.name == 'nt': template = '~' + `os.getpid()` + '-' elif os.name == 'mac': template = 'Python-Tmp-' else: template = 'tmp' # XXX might choose a better one return template
b0e5718643f807af590e16ebb8d3eb401a327ca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e5718643f807af590e16ebb8d3eb401a327ca3/tempfile.py
template = '@' + `os.getpid()` + '.'
_pid = os.getpid() template = '@' + `_pid` + '.'
def gettempprefix(): global template if template == None: if os.name == 'posix': template = '@' + `os.getpid()` + '.' elif os.name == 'nt': template = '~' + `os.getpid()` + '-' elif os.name == 'mac': template = 'Python-Tmp-' else: template = 'tmp' # XXX might choose a better one return template
b0e5718643f807af590e16ebb8d3eb401a327ca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b0e5718643f807af590e16ebb8d3eb401a327ca3/tempfile.py
h = self.outer.copy() h.update(self.inner.digest())
h = self._current()
def digest(self): """Return the hash value of this hashing object.
71662323992907f1da51ea61a6f29b09e571c089 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71662323992907f1da51ea61a6f29b09e571c089/hmac.py
return "".join([hex(ord(x))[2:].zfill(2) for x in tuple(self.digest())])
h = self._current() return h.hexdigest()
def hexdigest(self): """Like digest(), but returns a string of hexadecimal digits instead. """ return "".join([hex(ord(x))[2:].zfill(2) for x in tuple(self.digest())])
71662323992907f1da51ea61a6f29b09e571c089 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71662323992907f1da51ea61a6f29b09e571c089/hmac.py
filename = sys.argv[0]
try: filename = sys.argv[0] except AttributeError: filename = '__main__'
def warn(message, category=None, stacklevel=1): """Issue a warning, or maybe ignore it or raise an exception.""" # Check if message is already a Warning object if isinstance(message, Warning): category = message.__class__ # Check category argument if category is None: category = UserWarning assert issubclass(category, ...
12fe9b4ce492a676d77640a9caf8fc9a26cc5d53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/12fe9b4ce492a676d77640a9caf8fc9a26cc5d53/warnings.py
thishost = socket.getfqdn() try: if os.environ.has_key('LOGNAME'): realuser = os.environ['LOGNAME'] elif os.environ.has_key('USER'): realuser = os.environ['USER'] else: realuser = 'anonymous' except AttributeError: realuser = 'anonymous' passwd = passwd + realuser + '@' + thishost
passwd = passwd + 'anonymous@'
def login(self, user = '', passwd = '', acct = ''): '''Login, default anonymous.''' if not user: user = 'anonymous' if not passwd: passwd = '' if not acct: acct = '' if user == 'anonymous' and passwd in ('', '-'): # get fully qualified domain name of local host thishost = socket.getfqdn() try: if os.environ.has_key('LO...
c33e077838c8fee729c726f59c441555847b07e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c33e077838c8fee729c726f59c441555847b07e6/ftplib.py
s = "\\pdfoutline goto name{page.%dx}" % pageno
s = "\\pdfoutline goto name{page%03d}" % pageno
def write_toc_entry(entry, fp, layer): stype, snum, title, pageno, toc = entry s = "\\pdfoutline goto name{page.%dx}" % pageno if toc: s = "%s count -%d" % (s, len(toc)) if snum: title = "%s %s" % (snum, title) s = "%s {%s}\n" % (s, title) fp.write(s) for entry in toc: write_toc_entry(entry, fp, layer + 1)
bf88c3830e3a7d31022039fa265896aec90db61e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bf88c3830e3a7d31022039fa265896aec90db61e/toc2bkm.py
if s[0] in ('-', '+'):
if s[:1] in ('-', '+'):
def zfill(x, width): """zfill(x, width) -> string Pad a numeric string x with zeros on the left, to fill a field of the specified width. The string x is never truncated. """ if type(x) == type(''): s = x else: s = `x` n = len(s) if n >= width: return s sign = '' if s[0] in ('-', '+'): sign, s = s[0], s[1:] return si...
1b7aec35c43360ed1ec699458cc103e3223aac14 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1b7aec35c43360ed1ec699458cc103e3223aac14/string.py
except socket.sslerror, msg: break
except socket.sslerror, err: if (err[0] == socket.SSL_ERROR_WANT_READ or err[0] == socket.SSL_ERROR_WANT_WRITE or 0): continue if err[0] == socket.SSL_ERROR_ZERO_RETURN: break raise except socket.error, err: if err[0] = errno.EINTR: continue raise
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
6459c8d067890a64fc526204ab7004f9c8fcfe98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6459c8d067890a64fc526204ab7004f9c8fcfe98/httplib.py
found_docstring = False
def visitModule(self, node): stmt = node.node found_docstring = False for s in stmt.nodes: # Skip over docstrings if not found_docstring and isinstance(s, ast.Discard) \ and isinstance(s.expr, ast.Const) \ and isinstance(s.expr.value, str): found_docstring = True continue if not self.check_stmt(s): break
afcd838f1f69fdd4bf8a9e5799e0bd591fb109aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/afcd838f1f69fdd4bf8a9e5799e0bd591fb109aa/future.py
if not found_docstring and isinstance(s, ast.Discard) \ and isinstance(s.expr, ast.Const) \ and isinstance(s.expr.value, str): found_docstring = True continue
def visitModule(self, node): stmt = node.node found_docstring = False for s in stmt.nodes: # Skip over docstrings if not found_docstring and isinstance(s, ast.Discard) \ and isinstance(s.expr, ast.Const) \ and isinstance(s.expr.value, str): found_docstring = True continue if not self.check_stmt(s): break
afcd838f1f69fdd4bf8a9e5799e0bd591fb109aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/afcd838f1f69fdd4bf8a9e5799e0bd591fb109aa/future.py
try: line = raw_input(self.prompt) except EOFError: line = 'EOF'
if self.use_rawinput: try: line = raw_input(self.prompt) except EOFError: line = 'EOF' else: sys.stdout.write(self.prompt) line = sys.stdin.readline() if not len(line): line = 'EOF' else: line = line[:-1]
def cmdloop(self, intro=None): self.preloop() if intro is not None: self.intro = intro if self.intro: print self.intro stop = None while not stop: if self.cmdqueue: line = self.cmdqueue[0] del self.cmdqueue[0] else: try: line = raw_input(self.prompt) except EOFError: line = 'EOF' line = self.precmd(line) stop = self.on...
bfb9184ba80fc14a6d773e72fc591250f668ed3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bfb9184ba80fc14a6d773e72fc591250f668ed3a/cmd.py
negative_opts = {'use-defaults': 'no-defaults'}
negative_opt = {'no-defaults': 'use-defaults', 'no-prune': 'prune' }
def show_formats (): """Print all possible values for the 'formats' option (used by the "--help-formats" command-line option). """ from distutils.fancy_getopt import FancyGetopt from distutils.archive_util import ARCHIVE_FORMATS formats=[] for format in ARCHIVE_FORMATS.keys(): formats.append(("formats=" + format, None,...
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py
self.prune_file_list()
if self.prune: self.prune_file_list()
def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.files'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the stat...
499822d95975a4b59f902443596d1207c8f274b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/499822d95975a4b59f902443596d1207c8f274b9/sdist.py