bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
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')
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')
8,300
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')
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')
8,301
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')
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')
8,302
def gather(self): "Collect and return the contents of the window." result = "" for y in range(self.maxy+1): self.win.move(y, 0) stop = self._end_of_line(y) #sys.stderr.write("y=%d, _end_of_line(y)=%d\n" % (y, stop)) if stop == 0 and self.stripspaces: continue for x in range(self.maxx+1): if self.stripspaces and x == st...
defgather(self):"Collectandreturnthecontentsofthewindow."result=""foryinrange(self.maxy+1):self.win.move(y,0)stop=self._end_of_line(y)#sys.stderr.write("y=%d,_end_of_line(y)=%d\n"%(y,stop))ifstop==0andself.stripspaces:continueforxinrange(self.maxx+1):ifself.stripspacesandx==stop:breakresult=result+chr(ascii.ascii(self....
8,303
def main(): if len(sys.argv) > 1: for filename in sys.argv[1:]: processfile(filename) else: filename = EasyDialogs.AskFileForOpen(message='Select file with aeut/aete resource:') if not filename: sys.exit(0) processfile(filename)
def main(): if len(sys.argv) > 1: for filename in sys.argv[1:]: processfile(filename) else: filename = EasyDialogs.AskFileForOpen( message='Select scriptable application', dialogOptionFlags=0x1056) if not filename: sys.exit(0) processfile(filename)
8,304
def main(): if len(sys.argv) > 1: for filename in sys.argv[1:]: processfile(filename) else: filename = EasyDialogs.AskFileForOpen(message='Select file with aeut/aete resource:') if not filename: sys.exit(0) processfile(filename)
def main(): if len(sys.argv) > 1: for filename in sys.argv[1:]: processfile(filename) else: filename = EasyDialogs.AskFileForOpen(message='Select file with aeut/aete resource:') if not filename: sys.exit(0) processfile(filename)
8,305
def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) creatorsignature, dummy = MacOS.GetCreatorAndType(fname) packagename = identify(os.path.splitext(os.path.basename(fname))[0]) ...
def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) creatorsignature, dummy = MacOS.GetCreatorAndType(fname) packagename = identify(os.path.splitext(os.path.basename(fname))[0]) ...
8,306
def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) creatorsignature, dummy = MacOS.GetCreatorAndType(fname) packagename = identify(os.path.splitext(os.path.basename(fname))[0]) ...
def compileaete(aete, resinfo, fname): """Generate code for a full aete resource. fname passed for doc purposes""" [version, language, script, suites] = aete major, minor = divmod(version, 256) creatorsignature, dummy = MacOS.GetCreatorAndType(fname) packagename = identify(os.path.splitext(os.path.basename(fname))[0]) ...
8,307
def identify(str): """Turn any string into an identifier: - replace space by _ - replace other illegal chars by _xx_ (hex code) - prepend _ if the result is a python keyword """ if not str: return "empty_ae_name_" rv = '' ok = string.ascii_letters + '_' ok2 = ok + string.digits for c in str: if c in ok: rv = rv + c eli...
def identify(str): """Turn any string into an identifier: - replace space by _ - replace other illegal chars by _xx_ (hex code) - prepend _ if the result is a python keyword """ if not str: return "empty_ae_name_" rv = '' ok = string.ascii_letters + '_' ok2 = ok + string.digits for c in str: if c in ok: rv = rv + c eli...
8,308
def test_charset(self): eq = self.assertEqual msg = MIMEText('hello there', _charset='us-ascii') eq(msg.get_charset().input_charset, 'us-ascii') eq(msg['content-type'], 'text/plain; charset="us-ascii"')
def test_charset(self): eq = self.assertEqual msg = MIMEText('hello there', _charset='us-ascii') eq(msg.get_charset().input_charset, 'us-ascii') eq(msg['content-type'], 'text/plain; charset="us-ascii"')
8,309
def __init__(self, host = '', port = 0): """Initialize a new instance.
def __init__(self, host = '', port = 0): """Initialize a new instance.
8,310
def __init__(self, host = '', port = 0): """Initialize a new instance.
def __init__(self, host = '', port = 0): """Initialize a new instance.
8,311
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
8,312
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
8,313
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
8,314
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
def getreply(self): """Get a reply from the server. Returns a tuple consisting of:
8,315
def docmd(self, cmd, args=""): """Send a command, and return its response code.""" self.putcmd(cmd,args) (code,msg)=self.getreply() return code
def docmd(self, cmd, args=""): """Send a command, and return its response code.""" self.putcmd(cmd,args) (code,msg)=self.getreply() return code
8,316
def helo(self, name=''): """SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("helo",name) (code,msg)=self.getreply() self.helo_resp=msg return code
def helo(self, name=''): """SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("helo",name) (code,msg)=self.getreply() self.helo_resp=msg return code
8,317
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MT...
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MT...
8,318
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MT...
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MT...
8,319
def help(self, args=''): """SMTP 'help' command. Returns help text from server.""" self.putcmd("help", args) (code,msg)=self.getreply() return msg
def help(self, args=''): """SMTP 'help' command. Returns help text from server.""" self.putcmd("help", args) (code,msg)=self.getreply() return msg
8,320
def rset(self): """SMTP 'rset' command -- resets session.""" code=self.docmd("rset") return code
def rset(self): """SMTP 'rset' command -- resets session.""" code=self.docmd("rset") return code
8,321
def noop(self): """SMTP 'noop' command -- doesn't do anything :>""" code=self.docmd("noop") return code
def noop(self): """SMTP 'noop' command -- doesn't do anything :>""" code=self.docmd("noop") return code
8,322
def data(self,msg): """SMTP 'DATA' command -- sends message data to server. Automatically quotes lines beginning with a period per rfc821. """ self.putcmd("data") (code,repl)=self.getreply() if self.debuglevel >0 : print "data:", (code,repl) if code <> 354: return -1 else: self.send(quotedata(msg)) self.send("%s.%s" % ...
def data(self,msg): """SMTP 'DATA' command -- sends message data to server. Automatically quotes lines beginning with a period per rfc821. """ self.putcmd("data") (code,repl)=self.getreply() if self.debuglevel >0 : print "data:", (code,repl) if code <> 354: raise SMTPDataError(code,repl) else: self.send(quotedata(msg))...
8,323
def data(self,msg): """SMTP 'DATA' command -- sends message data to server. Automatically quotes lines beginning with a period per rfc821. """ self.putcmd("data") (code,repl)=self.getreply() if self.debuglevel >0 : print "data:", (code,repl) if code <> 354: return -1 else: self.send(quotedata(msg)) self.send("%s.%s" % ...
def data(self,msg): """SMTP 'DATA' command -- sends message data to server. Automatically quotes lines beginning with a period per rfc821. """ self.putcmd("data") (code,repl)=self.getreply() if self.debuglevel >0 : print "data:", (code,repl) if code <> 354: return -1 else: self.send(quotedata(msg)) self.send("%s.%s" % ...
8,324
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
8,325
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
8,326
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
8,327
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
8,328
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
8,329
def decompress(self, data): return bz2.decompress(data)
def decompress(self, data): return bz2.decompress(data)
8,330
def normpath(s): """Normalize a pathname. Will return the same result for equivalent paths.""" if ":" not in s: return ":"+s comps = s.split(":") i = 1 while i < len(comps)-1: if comps[i] == "" and comps[i-1] != "": if i > 1: del comps[i-1:i+1] i = i - 1 else: # best way to handle this is to raise an exception raise...
def normpath(s): """Normalize a pathname. Will return the same result for equivalent paths.""" if ":" not in s: return ":"+s comps = s.split(":") i = 1 while i < len(comps)-1: if comps[i] == "" and comps[i-1] != "": if i > 1: del comps[i-1:i+1] i = i - 1 else: # best way to handle this is to raise an exception raise...
8,331
def connect(self, host = '', port = 0): '''Connect to host. Arguments are: - host: hostname to connect to (string, default previous host) - port: port to connect to (integer, default previous port)''' if host: self.host = host if port: self.port = port self.passiveserver = 0 msg = "getaddrinfo returns an empty list" f...
def connect(self, host = '', port = 0): '''Connect to host. Arguments are: - host: hostname to connect to (string, default previous host) - port: port to connect to (integer, default previous port)''' if host: self.host = host if port: self.port = port msg = "getaddrinfo returns an empty list" for res in socket.getadd...
8,332
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read...
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] except KeyError: pas...
8,333
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read...
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read...
8,334
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read...
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read...
8,335
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read...
def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read...
8,336
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.items(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.append ((...
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.items(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.append ((...
8,337
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.items(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.append ((...
def poll2 (timeout=0.0, map=None): import poll if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) if map: l = [] for fd, obj in map.items(): flags = 0 if obj.readable(): flags = poll.POLLIN if obj.writable(): flags = flags | poll.POLLOUT if flags: l.append ((...
8,338
def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.PO...
def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.PO...
8,339
def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.PO...
def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.PO...
8,340
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...
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...
8,341
def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline.""" # The indentation level we are currently in: lastindent = INFINITY # For a line to be interesting, it must begin with a block opening # keyword, and have less indentation than lastindent. for line_index in xrange(...
def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline.""" # The indentation level we are currently in: lastindent = INFINITY # For a line to be interesting, it must begin with a block opening # keyword, and have less indentation than lastindent. for line_index in xrange(...
8,342
def splittype(url): """splittype('type:opaquestring') --> 'type', 'opaquestring'.""" global _typeprog if _typeprog is None: import re _typeprog = re.compile('^([^/:]+):') match = _typeprog.match(url) if match: scheme = match.group(1) return scheme, url[len(scheme) + 1:] return None, url
def splittype(url): """splittype('type:opaquestring') --> 'type', 'opaquestring'.""" global _typeprog if _typeprog is None: import re _typeprog = re.compile('^([^/:]+):') match = _typeprog.match(url) if match: scheme = match.group(1) return scheme.lower(), url[len(scheme) + 1:] return None, url
8,343
def test_formatdate(self): now = 1005327232.109884 epoch = time.gmtime(0)[0] # When does the epoch start? if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' else: matchdate = "I don't understand your epoc...
def test_formatdate(self): now = 1005327232.109884 gm_epoch = time.gmtime(0)[0:3] loc_epoch = time.localtime(0)[0:3] # When does the epoch start? if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' else: m...
8,344
def test_formatdate(self): now = 1005327232.109884 epoch = time.gmtime(0)[0] # When does the epoch start? if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' else: matchdate = "I don't understand your epoc...
def test_formatdate(self): now = 1005327232.109884 epoch = time.gmtime(0)[0] # When does the epoch start? if gm_epoch == (1970, 1, 1): # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' else: matchdate = "I don't understan...
8,345
def test_formatdate(self): now = 1005327232.109884 epoch = time.gmtime(0)[0] # When does the epoch start? if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' else: matchdate = "I don't understand your epoc...
def test_formatdate(self): now = 1005327232.109884 epoch = time.gmtime(0)[0] # When does the epoch start? if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' elif loc_epoch == (1904, 1, 1): # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' else: matchdate = "I don't understa...
8,346
def setcontext(context, _local=local): """Set this thread's context to context.""" if context in (DefaultContext, BasicContext, ExtendedContext): context = context.copy() context.clear_flags() _local.__decimal_context__ = context
def setcontext(context, _local=local): """Set this thread's context to context.""" if context in (DefaultContext, BasicContext, ExtendedContext): context = context.copy() context.clear_flags() _local.__decimal_context__ = context
8,347
def __init__(self, value="0", context=None): """Create a decimal point instance.
def __init__(self, value="0", context=None): """Create a decimal point instance.
8,348
def __init__(self, value="0", context=None): """Create a decimal point instance.
def __init__(self, value="0", context=None): """Create a decimal point instance.
8,349
def __init__(self, value="0", context=None): """Create a decimal point instance.
def __init__(self, value="0", context=None): """Create a decimal point instance.
8,350
def __init__(self, value="0", context=None): """Create a decimal point instance.
def __init__(self, value="0", context=None): """Create a decimal point instance.
8,351
def _isnan(self): """Returns whether the number is not actually one.
def _isnan(self): """Returns whether the number is not actually one.
8,352
def _check_nans(self, other = None, context=None): """Returns whether the number is not actually one.
def _check_nans(self, other = None, context=None): """Returns whether the number is not actually one.
8,353
def __nonzero__(self): """Is the number non-zero?
def __nonzero__(self): """Is the number non-zero?
8,354
def __nonzero__(self): """Is the number non-zero?
def __nonzero__(self): """Is the number non-zero?
8,355
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
8,356
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
8,357
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
8,358
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
def __cmp__(self, other, context=None): if context is None: context = getcontext() other = self._convert_other(other)
8,359
def compare(self, other, context=None): """Compares one to another.
def compare(self, other, context=None): """Compares one to another.
8,360
def compare(self, other, context=None): """Compares one to another.
def compare(self, other, context=None): """Compares one to another.
8,361
def to_eng_string(self, context=None): """Convert to engineering-type string.
def to_eng_string(self, context=None): """Convert to engineering-type string.
8,362
def __neg__(self, context=None): """Returns a copy with the sign switched.
def __neg__(self, context=None): """Returns a copy with the sign switched.
8,363
def __pos__(self, context=None): """Returns a copy, unless it is a sNaN.
def __pos__(self, context=None): """Returns a copy, unless it is a sNaN.
8,364
def __abs__(self, round=1, context=None): """Returns the absolute value of self.
def __abs__(self, round=1, context=None): """Returns the absolute value of self.
8,365
def __add__(self, other, context=None): """Returns self + other.
def __add__(self, other, context=None): """Returns self + other.
8,366
def __add__(self, other, context=None): """Returns self + other.
def __add__(self, other, context=None): """Returns self + other.
8,367
def __add__(self, other, context=None): """Returns self + other.
def __add__(self, other, context=None): """Returns self + other.
8,368
def __add__(self, other, context=None): """Returns self + other.
def __add__(self, other, context=None): """Returns self + other.
8,369
def __sub__(self, other, context=None): """Return self + (-other)""" if context is None: context = getcontext() other = self._convert_other(other)
def __sub__(self, other, context=None): """Return self + (-other)""" if context is None: context = getcontext() other = self._convert_other(other)
8,370
def __rsub__(self, other, context=None): """Return other + (-self)""" if context is None: context = getcontext() other = self._convert_other(other)
def __rsub__(self, other, context=None): """Return other + (-self)""" if context is None: context = getcontext() other = self._convert_other(other)
8,371
def _increment(self, round=1, context=None): """Special case of add, adding 1eExponent
def _increment(self, round=1, context=None): """Special case of add, adding 1eExponent
8,372
def __mul__(self, other, context=None): """Return self * other.
def __mul__(self, other, context=None): """Return self * other.
8,373
def __mul__(self, other, context=None): """Return self * other.
def __mul__(self, other, context=None): """Return self * other.
8,374
def __mul__(self, other, context=None): """Return self * other.
def __mul__(self, other, context=None): """Return self * other.
8,375
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,376
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,377
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,378
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,379
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,380
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,381
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,382
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,383
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,384
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,385
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,386
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,387
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,388
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,389
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
8,390
def __rdiv__(self, other, context=None): """Swaps self/other and returns __div__.""" other = self._convert_other(other) return other.__div__(self, context=context)
def __rdiv__(self, other, context=None): """Swaps self/other and returns __div__.""" other = _convert_other(other) return other.__div__(self, context=context)
8,391
def __rdivmod__(self, other, context=None): """Swaps self/other and returns __divmod__.""" other = self._convert_other(other) return other.__divmod__(self, context=context)
def __rdivmod__(self, other, context=None): """Swaps self/other and returns __divmod__.""" other = _convert_other(other) return other.__divmod__(self, context=context)
8,392
def __mod__(self, other, context=None): """ self % other """ if context is None: context = getcontext() other = self._convert_other(other)
def __mod__(self, other, context=None): """ self % other """ if context is None: context = getcontext() other = self._convert_other(other)
8,393
def __rfloordiv__(self, other, context=None): """Swaps self/other and returns __floordiv__.""" other = self._convert_other(other) return other.__floordiv__(self, context=context)
def __rfloordiv__(self, other, context=None): """Swaps self/other and returns __floordiv__.""" other = _convert_other(other) return other.__floordiv__(self, context=context)
8,394
def __int__(self): """Converts self to a int, truncating if necessary.""" if self._isnan(): context = getcontext() return context._raise_error(InvalidContext) elif self._isinfinity(): raise OverflowError, "Cannot convert infinity to long" if not self: return 0 sign = '-'*self._sign if self._exp >= 0: s = sign + ''.join...
def __int__(self): """Converts self to a int, truncating if necessary.""" if self._is_special: if self._isnan(): context = getcontext() return context._raise_error(InvalidContext) elif self._isinfinity(): raise OverflowError, "Cannot convert infinity to long" if not self: return 0 sign = '-'*self._sign if self._exp >= ...
8,395
def __int__(self): """Converts self to a int, truncating if necessary.""" if self._isnan(): context = getcontext() return context._raise_error(InvalidContext) elif self._isinfinity(): raise OverflowError, "Cannot convert infinity to long" if not self: return 0 sign = '-'*self._sign if self._exp >= 0: s = sign + ''.join...
def __int__(self): """Converts self to a int, truncating if necessary.""" if self._isnan(): context = getcontext() return context._raise_error(InvalidContext) elif self._isinfinity(): raise OverflowError, "Cannot convert infinity to long" if not self: return 0 sign = '-'*self._sign if self._exp >= 0: s = sign + ''.join...
8,396
def _fix(self, prec=None, rounding=None, folddown=None, context=None): """Round if it is necessary to keep self within prec precision.
def _fix(self, prec=None, rounding=None, folddown=None, context=None): """Round if it is necessary to keep self within prec precision.
8,397
def _fix(self, prec=None, rounding=None, folddown=None, context=None): """Round if it is necessary to keep self within prec precision.
def _fix(self, prec=None, rounding=None, folddown=None, context=None): """Round if it is necessary to keep self within prec precision.
8,398
def _fixexponents(self, prec=None, rounding=None, folddown=None, context=None): """Fix the exponents and return a copy with the exponent in bounds.""" if self._isinfinity(): return self if context is None: context = getcontext() if prec is None: prec = context.prec if folddown is None: folddown = context._clamp Emin, E...
def _fixexponents(self, prec=None, rounding=None, folddown=None, context=None): """Fix the exponents and return a copy with the exponent in bounds.""" if self._is_special: return self if context is None: context = getcontext() if prec is None: prec = context.prec if folddown is None: folddown = context._clamp Emin, Ema...
8,399