bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def simulate_cmd_complete(self): get_time = self.get_time t = get_time() - self.t while self.cur[5]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! a = self.dispatch['return'](self, self.cur[4], t) t = 0 self.t = get_time() - t | def simulate_cmd_complete(self): get_time = self.get_time t = get_time() - self.t while self.cur[5]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! a = self.dispatch['return'](self, self.cur[-2], t) t = 0 self.t = get_time() - t | 19,300 |
def maybe(*choices): return apply(group, choices) + '?' | def maybe(*choices): return apply(group, choices) + '?' | 19,301 |
def maybe(*choices): return apply(group, choices) + '?' | def maybe(*choices): return apply(group, choices) + '?' | 19,302 |
def maybe(*choices): return apply(group, choices) + '?' | def maybe(*choices): return apply(group, choices) + '?' | 19,303 |
def maybe(*choices): return apply(group, choices) + '?' | def maybe(*choices): return apply(group, choices) + '?' | 19,304 |
def tokenize(readline, tokeneater=printtoken): lnum = parenlev = continued = 0 namechars, numchars = string.letters + '_', string.digits contstr, needcont = '', 0 indents = [0] while 1: # loop over lines in stream line = readline() lnum = lnum + 1 pos, max = 0, len(line) if contstr: ... | def tokenize(readline, tokeneater=printtoken): lnum = parenlev = continued = 0 namechars, numchars = string.letters + '_', string.digits contstr, needcont = '', 0 indents = [0] while 1: # loop over lines in stream line = readline() lnum = lnum + 1 pos, max = 0, len(line) if contstr: ... | 19,305 |
def tokenize(readline, tokeneater=printtoken): lnum = parenlev = continued = 0 namechars, numchars = string.letters + '_', string.digits contstr, needcont = '', 0 indents = [0] while 1: # loop over lines in stream line = readline() lnum = lnum + 1 pos, max = 0, len(line) if contstr: ... | def tokenize(readline, tokeneater=printtoken): lnum = parenlev = continued = 0 namechars, numchars = string.letters + '_', string.digits contstr, needcont = '', 0 indents = [0] while 1: # loop over lines in stream line = readline() lnum = lnum + 1 pos, max = 0, len(line) if contstr: ... | 19,306 |
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' ) | 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' ) | 19,307 |
def test_directories(self): # Does this test make sense? The message for "< ." may depend on # the command shell, and the message for "." depends on the OS. if sys.platform.startswith("win"): # On WinXP w/ cmd.exe, # "< ." gives "Access is denied.\n" # "." gives "C:\\Code\\python\\PCbuild\\python.exe: " + # ... | def test_directories(self): # Does this test make sense? The message for "< ." may depend on # the command shell, and the message for "." depends on the OS. if sys.platform.startswith("win"): # On WinXP w/ cmd.exe, # "< ." gives "Access is denied.\n" # "." gives "C:\\Code\\python\\PCbuild\\python.exe: " + # ... | 19,308 |
def test_directories(self): # Does this test make sense? The message for "< ." may depend on # the command shell, and the message for "." depends on the OS. if sys.platform.startswith("win"): # On WinXP w/ cmd.exe, # "< ." gives "Access is denied.\n" # "." gives "C:\\Code\\python\\PCbuild\\python.exe: " + # ... | def test_directories(self): # Does this test make sense? The message for "< ." may depend on # the command shell, and the message for "." depends on the OS. if sys.platform.startswith("win"): # On WinXP w/ cmd.exe, # "< ." gives "Access is denied.\n" # "." gives "C:\\Code\\python\\PCbuild\\python.exe: " + # ... | 19,309 |
def __init__(self, switchboard, parent=None): self.__sb = switchboard self.__frame = Frame(parent) self.__frame.pack(expand=YES, fill=BOTH) # create the chip that will display the currently selected color # exactly self.__sframe = Frame(self.__frame) self.__sframe.grid(row=0, column=0) self.__selected = ChipWidget(self... | def __init__(self, switchboard, parent=None): self.__sb = switchboard self.__frame = Frame(parent, relief=GROOVE, borderwidth=2) self.__frame.pack() # create the chip that will display the currently selected color # exactly self.__sframe = Frame(self.__frame) self.__sframe.grid(row=0, column=0) self.__selected = ChipWi... | 19,310 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,311 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,312 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,313 |
def setUp(self): self.case = "empty set" self.values = [] self.set = set(self.values) self.dup = set(self.values) self.length = 0 self.repr = "{}" | def setUp(self): self.case = "empty set" self.values = [] self.set = set(self.values) self.dup = set(self.values) self.length = 0 self.repr = "{}" | 19,314 |
def match(self, patharg): removed = [] # First check the include directory path = patharg while 1: if self.idict.has_key(path): # We know of this path (or initial piece of path) dstpath = self.idict[path] # We do want it distributed. Tack on the tail. while removed: dstpath = os.path.join(dstpath, removed[0]) removed =... | def match(self, patharg): removed = [] # First check the include directory path = patharg while 1: if self.idict.has_key(path): # We know of this path (or initial piece of path) dstpath = self.idict[path] # We do want it distributed. Tack on the tail. while removed: dstpath = os.path.join(dstpath, removed[0]) removed =... | 19,315 |
def __getitem__(self, key): try: return self._primary[key] except KeyError: return self._secondary[key] | def __getitem__(self, key): try: return self._primary[key] except KeyError: return self._secondary[key] | 19,316 |
def test_get_content_maintype_error(self): msg = Message() msg['Content-Type'] = 'no-slash-in-this-string' self.assertRaises(ValueError, msg.get_content_maintype) | def test_get_content_maintype_error(self): msg = Message() msg['Content-Type'] = 'no-slash-in-this-string' self.assertRaises(ValueError, msg.get_content_maintype) | 19,317 |
def test_get_content_subtype_error(self): msg = Message() msg['Content-Type'] = 'no-slash-in-this-string' self.assertRaises(ValueError, msg.get_content_subtype) | def test_get_content_subtype_error(self): msg = Message() msg['Content-Type'] = 'no-slash-in-this-string' self.assertRaises(ValueError, msg.get_content_subtype) | 19,318 |
def defaultFile(self): """Produce a reasonable default.""" filename = self.curframe.f_code.co_filename if filename == '<string>' and mainpyfile: filename = mainpyfile return filename | def defaultFile(self): """Produce a reasonable default.""" filename = self.curframe.f_code.co_filename if filename == '<string>' and self.mainpyfile: filename = self.mainpyfile return filename | 19,319 |
def lookupmodule(self, filename): """Helper function for break/clear parsing -- may be overridden.""" root, ext = os.path.splitext(filename) if ext == '': filename = filename + '.py' if os.path.isabs(filename): return filename for dirname in sys.path: while os.path.islink(dirname): dirname = os.readlink(dirname) fullna... | def lookupmodule(self, filename): """Helper function for break/clear parsing -- may be overridden. lookupmodule() translates (possibly incomplete) file or module name into an absolute file name. """ if os.path.isabs(filename) and os.path.exists(filename): return filename f = os.path.join(sys.path[0], filename) if os... | 19,320 |
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | 19,321 |
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | 19,322 |
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | 19,323 |
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path' | 19,324 |
def testRecvFrom(self): """Testing recfrom() over UDP.""" msg, addr = self.serv.recvfrom(len(MSG)) hostname, port = addr ##self.assertEqual(hostname, socket.gethostbyname('localhost')) self.assertEqual(msg, MSG) | def testRecvFrom(self): """Testing recvfrom() over UDP.""" msg, addr = self.serv.recvfrom(len(MSG)) hostname, port = addr ##self.assertEqual(hostname, socket.gethostbyname('localhost')) self.assertEqual(msg, MSG) | 19,325 |
def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')): """ Tries to determine the default locale settings and returns them as tuple (language code, encoding). According to POSIX, a program which has not called setlocale(LC_ALL, "") runs using the portable 'C' locale. Calling setlocale(LC_ALL, "") l... | def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')): """ Tries to determine the default locale settings and returns them as tuple (language code, encoding). According to POSIX, a program which has not called setlocale(LC_ALL, "") runs using the portable 'C' locale. Calling setlocale(LC_ALL, "") l... | 19,326 |
def frange(start, stop, step): while start <= stop: yield start start += stop | def frange(start, stop, step): while start <= stop: yield start start += step | 19,327 |
def _ascii_split(self, s, charset, firstline): # Attempt to split the line at the highest-level syntactic break # possible. Note that we don't have a lot of smarts about field # syntax; we just try to break on semi-colons, then whitespace. rtn = [] lines = s.splitlines() while lines: line = lines.pop(0) if firstline: ... | def _ascii_split(self, s, charset, firstline): # Attempt to split the line at the highest-level syntactic break # possible. Note that we don't have a lot of smarts about field # syntax; we just try to break on semi-colons, then whitespace. rtn = [] lines = s.splitlines() while lines: line = lines.pop(0) if firstline: ... | 19,328 |
def _deepcopy_inst(x, memo): if hasattr(x, '__deepcopy__'): return x.__deepcopy__(memo) if hasattr(x, '__getinitargs__'): args = x.__getinitargs__() _keep_alive(args, memo) args = deepcopy(args, memo) y = apply(x.__class__, args) else: y = _EmptyClass() y.__class__ = x.__class__ memo[id(x)] = y if hasattr(x, '__getstat... | def _deepcopy_inst(x, memo): if hasattr(x, '__deepcopy__'): return x.__deepcopy__(memo) if hasattr(x, '__getinitargs__'): args = x.__getinitargs__() args = deepcopy(args, memo) y = apply(x.__class__, args) else: y = _EmptyClass() y.__class__ = x.__class__ memo[id(x)] = y if hasattr(x, '__getstate__'): state = x.__getst... | 19,329 |
def _deepcopy_inst(x, memo): if hasattr(x, '__deepcopy__'): return x.__deepcopy__(memo) if hasattr(x, '__getinitargs__'): args = x.__getinitargs__() _keep_alive(args, memo) args = deepcopy(args, memo) y = apply(x.__class__, args) else: y = _EmptyClass() y.__class__ = x.__class__ memo[id(x)] = y if hasattr(x, '__getstat... | def _deepcopy_inst(x, memo): if hasattr(x, '__deepcopy__'): return x.__deepcopy__(memo) if hasattr(x, '__getinitargs__'): args = x.__getinitargs__() _keep_alive(args, memo) args = deepcopy(args, memo) y = apply(x.__class__, args) else: y = _EmptyClass() y.__class__ = x.__class__ memo[id(x)] = y if hasattr(x, '__getstat... | 19,330 |
def read(self, wtd): | def read(self, wtd): | 19,331 |
def read(self, wtd): | def read(self, wtd): | 19,332 |
def _checkcrc(self): | def _checkcrc(self): | 19,333 |
def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 19,334 |
def emit(self, record): """ Emit a record. | def emit(self, record): """ Emit a record. | 19,335 |
def run (self): | def run (self): | 19,336 |
def gammavariate(self, alpha, beta): # beta times standard gamma return beta * self.stdgamma(alpha) | def gammavariate(self, alpha, beta): # beta times standard gamma return beta * self.stdgamma(alpha) | 19,337 |
def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | 19,338 |
def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | 19,339 |
def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | 19,340 |
def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | def stdgamma(self, alpha, *args): # *args for Py2.2 compatiblity random = self.random if alpha <= 0.0: raise ValueError, 'stdgamma: alpha must be > 0.0' | 19,341 |
def _test(N=200): print 'TWOPI =', TWOPI print 'LOG4 =', LOG4 print 'NV_MAGICCONST =', NV_MAGICCONST print 'SG_MAGICCONST =', SG_MAGICCONST _test_generator(N, 'random()') _test_generator(N, 'normalvariate(0.0, 1.0)') _test_generator(N, 'lognormvariate(0.0, 1.0)') _test_generator(N, 'cunifvariate(0.0, 1... | def _test(N=20000): print 'TWOPI =', TWOPI print 'LOG4 =', LOG4 print 'NV_MAGICCONST =', NV_MAGICCONST print 'SG_MAGICCONST =', SG_MAGICCONST _test_generator(N, 'random()') _test_generator(N, 'normalvariate(0.0, 1.0)') _test_generator(N, 'lognormvariate(0.0, 1.0)') _test_generator(N, 'cunifvariate(0.0,... | 19,342 |
def master_open(): """Open pty master and return (master_fd, tty_name). SGI and Linux/BSD version.""" try: import sgi except ImportError: pass else: try: tty_name, master_fd = sgi._getpty(FCNTL.O_RDWR, 0666, 0) except IOError, msg: raise os.error, msg return master_fd, tty_name for x in 'pqrstuvwxyzPQRST': for y in '01... | def master_open(): """Open pty master and return (master_fd, tty_name). SGI and generic BSD version, for when openpty() fails.""" try: import sgi except ImportError: pass else: try: tty_name, master_fd = sgi._getpty(FCNTL.O_RDWR, 0666, 0) except IOError, msg: raise os.error, msg return master_fd, tty_name for x in 'pqr... | 19,343 |
def slave_open(tty_name): """Open the pty slave and acquire the controlling terminal. Return the file descriptor. Linux version.""" # (Should be universal? --Guido) return os.open(tty_name, FCNTL.O_RDWR) | def slave_open(tty_name): """Open the pty slave and acquire the controlling terminal. Return the file descriptor. Linux version.""" # (Should be universal? --Guido) return os.open(tty_name, FCNTL.O_RDWR) | 19,344 |
def fork(): """Fork and make the child a session leader with a controlling terminal. Return (pid, master_fd).""" master_fd, tty_name = master_open() pid = os.fork() if pid == CHILD: # Establish a new session. os.setsid() # Acquire controlling terminal. slave_fd = slave_open(tty_name) os.close(master_fd) # Slave becom... | def fork(): """fork() -> (pid, master_fd) Fork and make the child a session leader with a controlling terminal.""" try: pid, fd = os.forkpty() except (AttributeError, OSError): pass else: if pid == CHILD: try: os.setsid() except OSError: pass return pid, fd master_fd, slave_fd = openpty() pid = os.fork() if pid == C... | 19,345 |
def fork(): """Fork and make the child a session leader with a controlling terminal. Return (pid, master_fd).""" master_fd, tty_name = master_open() pid = os.fork() if pid == CHILD: # Establish a new session. os.setsid() # Acquire controlling terminal. slave_fd = slave_open(tty_name) os.close(master_fd) # Slave becom... | def fork(): """Fork and make the child a session leader with a controlling terminal. Return (pid, master_fd).""" master_fd, tty_name = master_open() pid = os.fork() if pid == CHILD: # Establish a new session. os.setsid() # Acquire controlling terminal. slave_fd = slave_open(tty_name) os.close(master_fd) # Slave becom... | 19,346 |
def writen(fd, data): """Write all the data to a descriptor.""" while data != '': n = os.write(fd, data) data = data[n:] | def _writen(fd, data): """Write all the data to a descriptor.""" while data != '': n = os.write(fd, data) data = data[n:] | 19,347 |
def read(fd): """Default read function.""" return os.read(fd, 1024) | def _read(fd): """Default read function.""" return os.read(fd, 1024) | 19,348 |
def copy(master_fd, master_read=read, stdin_read=read): """Parent copy loop. Copies pty master -> standard output (master_read) standard input -> pty master (stdin_read)""" while 1: rfds, wfds, xfds = select( [master_fd, STDIN_FILENO], [], []) if master_fd in rfds: data = master_read(master_fd) os.write(STDOUT_FILENO, ... | def _copy(master_fd, master_read=_read, stdin_read=_read): """Parent copy loop. Copies pty master -> standard output (master_read) standard input -> pty master (stdin_read)""" while 1: rfds, wfds, xfds = select( [master_fd, STDIN_FILENO], [], []) if master_fd in rfds: data = master_read(master_fd) os.write(STDOUT_FILEN... | 19,349 |
def copy(master_fd, master_read=read, stdin_read=read): """Parent copy loop. Copies pty master -> standard output (master_read) standard input -> pty master (stdin_read)""" while 1: rfds, wfds, xfds = select( [master_fd, STDIN_FILENO], [], []) if master_fd in rfds: data = master_read(master_fd) os.write(STDOUT_FILENO, ... | def copy(master_fd, master_read=read, stdin_read=read): """Parent copy loop. Copies pty master -> standard output (master_read) standard input -> pty master (stdin_read)""" while 1: rfds, wfds, xfds = select( [master_fd, STDIN_FILENO], [], []) if master_fd in rfds: data = master_read(master_fd) os.write(STDOUT_FILENO, ... | 19,350 |
def set_files(self): s = self.modules['sys'] s.stdin = FileWrapper(sys.stdin) s.stdout = FileWrapper(sys.stdout) s.stderr = FileWrapper(sys.stderr) | def set_files(self): s = self.modules['sys'] s.stdin = FileWrapper(sys.stdin) s.stdout = FileWrapper(sys.stdout) s.stderr = FileWrapper(sys.stderr) | 19,351 |
def restore_files(files): | def restore_files(files): | 19,352 |
def ismount(path): """Test whether a path is a mount point""" return isabs(splitdrive(path)[1]) | def ismount(path): """Test whether a path is a mount point (defined as root of drive)""" p = splitdrive(path)[1] return len(p)==1 and p[0] in '/\\' | 19,353 |
def endPrefixMapping(self, prefix): del self._current_context[-1] | def endPrefixMapping(self, prefix): del self._current_context[-1] | 19,354 |
def processingInstruction(self, target, data): self._out.write('<?%s %s?>' % (target, data)) | def processingInstruction(self, target, data): self._out.write('<?%s %s?>' % (target, data)) | 19,355 |
def ignorableWhitespace(self, chars, start, end): self._cont_handler.ignorableWhitespace(chars, start, end) | def ignorableWhitespace(self, chars, start, end): self._cont_handler.ignorableWhitespace(chars, start, end) | 19,356 |
def __init__ (self, verbose=0, dry_run=0, force=0): | def __init__ (self, verbose=0, dry_run=0, force=0): | 19,357 |
def __init__ (self, verbose=0, dry_run=0, force=0): | def __init__ (self, verbose=0, dry_run=0, force=0): | 19,358 |
def __init__ (self, verbose=0, dry_run=0, force=0): | def __init__ (self, verbose=0, dry_run=0, force=0): | 19,359 |
def __init__(self, maxsize=0): """Initialize a queue object with a given maximum size. | def __init__(self, maxsize=0): """Initialize a queue object with a given maximum size. | 19,360 |
def __init__(self, maxsize=0): """Initialize a queue object with a given maximum size. | def __init__(self, maxsize=0): """Initialize a queue object with a given maximum size. | 19,361 |
def __init__(self, maxsize=0): """Initialize a queue object with a given maximum size. | def __init__(self, maxsize=0): """Initialize a queue object with a given maximum size. | 19,362 |
def put(self, item, block=True, timeout=None): """Put an item into the queue. | def put(self, item, block=True, timeout=None): """Put an item into the queue. | 19,363 |
def put(self, item, block=True, timeout=None): """Put an item into the queue. | def put(self, item, block=True, timeout=None): """Put an item into the queue. | 19,364 |
def put(self, item, block=True, timeout=None): """Put an item into the queue. | def put(self, item, block=True, timeout=None): """Put an item into the queue. | 19,365 |
def put(self, item, block=True, timeout=None): """Put an item into the queue. | def put(self, item, block=True, timeout=None): """Put an item into the queue. | 19,366 |
def put(self, item, block=True, timeout=None): """Put an item into the queue. | def put(self, item, block=True, timeout=None): """Put an item into the queue. | 19,367 |
def put(self, item, block=True, timeout=None): """Put an item into the queue. | def put(self, item, block=True, timeout=None): """Put an item into the queue. | 19,368 |
def put(self, item, block=True, timeout=None): """Put an item into the queue. | def put(self, item, block=True, timeout=None): """Put an item into the queue. | 19,369 |
def put_nowait(self, item): """Put an item into the queue without blocking. | def put_nowait(self, item): """Put an item into the queue without blocking. | 19,370 |
def get(self, block=True, timeout=None): """Remove and return an item from the queue. | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | 19,371 |
def get(self, block=True, timeout=None): """Remove and return an item from the queue. | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | 19,372 |
def get(self, block=True, timeout=None): """Remove and return an item from the queue. | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | 19,373 |
def get(self, block=True, timeout=None): """Remove and return an item from the queue. | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | 19,374 |
def get(self, block=True, timeout=None): """Remove and return an item from the queue. | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | 19,375 |
def get(self, block=True, timeout=None): """Remove and return an item from the queue. | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | 19,376 |
def get(self, block=True, timeout=None): """Remove and return an item from the queue. | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | 19,377 |
def get_nowait(self): """Remove and return an item from the queue without blocking. | def get_nowait(self): """Remove and return an item from the queue without blocking. | 19,378 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,379 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,380 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,381 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,382 |
def process_rawq(self): """Transfer from raw queue to cooked queue. | def process_rawq(self): """Transfer from raw queue to cooked queue. | 19,383 |
def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent; we check two cases. for pattern in [' at 0x[0-9a-f]{6,}(>+)$', ' at [0-9A-F]{8,}(>+)$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '\\1', text) return text | def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent; we check two cases. if _re_stripid.search(repr(Exception)): return _re_stripid.sub(r'\1', text) return text | 19,384 |
def _is_some_method(object): return inspect.ismethod(object) or inspect.ismethoddescriptor(object) | def _is_some_method(obj): return inspect.ismethod(obj) or inspect.ismethoddescriptor(obj) | 19,385 |
def test_bug_1333982(self): self.do_disassembly_test(bug1333982, dis_bug1333982) | def test_bug_1333982(self): self.do_disassembly_test(bug1333982, dis_bug1333982) | 19,386 |
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') | 19,387 |
exec 'def f(a): global a; a = 1' | exec 'def f(a): global a; a = 1' | 19,388 |
def __init__(self, fp=None, headers=None, outerboundary="", environ=os.environ, keep_blank_values=0, strict_parsing=0): """Constructor. Read multipart/* until last part. | def __init__(self, fp=None, headers=None, outerboundary="", environ=os.environ, keep_blank_values=0, strict_parsing=0): """Constructor. Read multipart/* until last part. | 19,389 |
def connect(self, address): self.connected = False err = self.socket.connect_ex(address) # XXX Should interpret Winsock return values if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): return if err in (0, EISCONN): self.addr = address self.connected = True self.handle_connect() else: raise socket.error, err | def connect(self, address): self.connected = False err = self.socket.connect_ex(address) # XXX Should interpret Winsock return values if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): return if err in (0, EISCONN): self.addr = address self.connected = True self.handle_connect() else: raise socket.error, err | 19,390 |
def accept(self): # XXX can return either an address pair or None try: conn, addr = self.socket.accept() return conn, addr except socket.error, why: if why[0] == EWOULDBLOCK: pass else: raise socket.error, why | def accept(self): # XXX can return either an address pair or None try: conn, addr = self.socket.accept() return conn, addr except socket.error, why: if why[0] == EWOULDBLOCK: pass else: raise socket.error, why | 19,391 |
def send(self, data): try: result = self.socket.send(data) return result except socket.error, why: if why[0] == EWOULDBLOCK: return 0 else: raise socket.error, why return 0 | def send(self, data): try: result = self.socket.send(data) return result except socket.error, why: if why[0] == EWOULDBLOCK: return 0 else: raise return 0 | 19,392 |
def recv(self, buffer_size): try: data = self.socket.recv(buffer_size) if not data: # a closed connection is indicated by signaling # a read condition, and having recv() return 0. self.handle_close() return '' else: return data except socket.error, why: # winsock sometimes throws ENOTCONN if why[0] in [ECONNRESET, ENOT... | def recv(self, buffer_size): try: data = self.socket.recv(buffer_size) if not data: # a closed connection is indicated by signaling # a read condition, and having recv() return 0. self.handle_close() return '' else: return data except socket.error, why: # winsock sometimes throws ENOTCONN if why[0] in [ECONNRESET, ENOT... | 19,393 |
def handle_entityref(self, name): """Handle entity references, no need to override.""" replacement = convert_entityref(name) if replacement is None: self.unknown_entityref(name) else: self.handle_data(convert_entityref(name)) | def handle_entityref(self, name): """Handle entity references, no need to override.""" replacement = self.convert_entityref(name) if replacement is None: self.unknown_entityref(name) else: self.handle_data(convert_entityref(name)) | 19,394 |
def handle_entityref(self, name): """Handle entity references, no need to override.""" replacement = convert_entityref(name) if replacement is None: self.unknown_entityref(name) else: self.handle_data(convert_entityref(name)) | def handle_entityref(self, name): """Handle entity references, no need to override.""" replacement = convert_entityref(name) if replacement is None: self.unknown_entityref(name) else: self.handle_data(convert_entityref(name)) | 19,395 |
def handle(self, info=None): info = info or sys.exc_info() if self.format == "html": self.file.write(reset()) | def handle(self, info=None): info = info or sys.exc_info() if self.format == "html": self.file.write(reset()) | 19,396 |
def buildapplet(top, dummy, list): """Create a PPC python applet""" template = mkapplet.findtemplate() for src in list: if src[-3:] != '.py': raise 'Should end in .py', src base = os.path.basename(src) dst = os.path.join(top, base)[:-3] src = os.path.join(top, src) try: os.unlink(dst) except os.error: pass print 'Build... | def buildapplet(top, dummy, list): """Create a PPC python applet""" template = mkapplet.findtemplate() for src in list: if src[-3:] != '.py': raise 'Should end in .py', src base = os.path.basename(src) dst = os.path.join(top, base)[:-3] src = os.path.join(top, src) try: os.unlink(dst) except os.error: pass print 'Build... | 19,397 |
def buildapplet(top, dummy, list): """Create a PPC python applet""" template = mkapplet.findtemplate() for src in list: if src[-3:] != '.py': raise 'Should end in .py', src base = os.path.basename(src) dst = os.path.join(top, base)[:-3] src = os.path.join(top, src) try: os.unlink(dst) except os.error: pass print 'Build... | def buildapplet(top, dummy, list): """Create a PPC python applet""" template = mkapplet.findtemplate() for src in list: if src[-3:] != '.py': raise 'Should end in .py', src base = os.path.basename(src) dst = os.path.join(top, base)[:-3] src = os.path.join(top, src) try: os.unlink(dst) except os.error: pass print 'Build... | 19,398 |
def buildapplet(top, dummy, list): """Create a PPC python applet""" template = mkapplet.findtemplate() for src in list: if src[-3:] != '.py': raise 'Should end in .py', src base = os.path.basename(src) dst = os.path.join(top, base)[:-3] src = os.path.join(top, src) try: os.unlink(dst) except os.error: pass print 'Build... | def buildapplet(top, dummy, list): """Create a PPC python applet""" template = mkapplet.findtemplate() for src in list: if src[-3:] != '.py': raise 'Should end in .py', src base = os.path.basename(src) dst = os.path.join(top, base)[:-3] src = os.path.join(top, src) try: os.unlink(dst) except os.error: pass print 'Build... | 19,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.