rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def create_socket (self, family, type): | def create_socket(self, family, type): | def create_socket (self, family, type): self.family_and_type = family, type self.socket = socket.socket (family, type) self.socket.setblocking(0) self._fileno = self.socket.fileno() self.add_channel() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
self.socket = socket.socket (family, type) | self.socket = socket.socket(family, type) | def create_socket (self, family, type): self.family_and_type = family, type self.socket = socket.socket (family, type) self.socket.setblocking(0) self._fileno = self.socket.fileno() self.add_channel() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def set_socket (self, sock, map=None): | def set_socket(self, sock, map=None): | def set_socket (self, sock, map=None): self.socket = sock | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
self.add_channel (map) def set_reuse_addr (self): | self.add_channel(map) def set_reuse_addr(self): | def set_socket (self, sock, map=None): self.socket = sock | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
self.socket.setsockopt ( | self.socket.setsockopt( | def set_reuse_addr (self): # try to re-use a server port if possible try: self.socket.setsockopt ( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 ) except socket.error: pass | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
self.socket.getsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 | self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 | def set_reuse_addr (self): # try to re-use a server port if possible try: self.socket.setsockopt ( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt (socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 ) except socket.error: pass | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def readable (self): | def readable(self): | def readable (self): return True | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def writable (self): | def writable(self): | def writable (self): return not self.accepting | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def writable (self): | def writable(self): | def writable (self): return True | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def listen (self, num): | def listen(self, num): | def listen (self, num): self.accepting = 1 if os.name == 'nt' and num > 5: num = 1 return self.socket.listen (num) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
return self.socket.listen (num) def bind (self, addr): | return self.socket.listen(num) def bind(self, addr): | def listen (self, num): self.accepting = 1 if os.name == 'nt' and num > 5: num = 1 return self.socket.listen (num) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
return self.socket.bind (addr) def connect (self, address): | return self.socket.bind(addr) def connect(self, address): | def bind (self, addr): self.addr = addr return self.socket.bind (addr) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def accept (self): | def accept(self): | 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 | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def send (self, data): try: result = self.socket.send (data) | def send(self, data): try: result = self.socket.send(data) | 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 | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def recv (self, buffer_size): try: data = self.socket.recv (buffer_size) | def recv(self, buffer_size): try: data = self.socket.recv(buffer_size) | 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, EN... | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def close (self): | def close(self): | def close (self): self.del_channel() self.socket.close() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def __getattr__ (self, attr): return getattr (self.socket, attr) | def __getattr__(self, attr): return getattr(self.socket, attr) | def __getattr__ (self, attr): return getattr (self.socket, attr) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def log (self, message): sys.stderr.write ('log: %s\n' % str(message)) def log_info (self, message, type='info'): | def log(self, message): sys.stderr.write('log: %s\n' % str(message)) def log_info(self, message, type='info'): | def log (self, message): sys.stderr.write ('log: %s\n' % str(message)) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def handle_read_event (self): | def handle_read_event(self): | def handle_read_event (self): if self.accepting: # for an accepting socket, getting a read implies # that we are connected if not self.connected: self.connected = 1 self.handle_accept() elif not self.connected: self.handle_connect() self.connected = 1 self.handle_read() else: self.handle_read() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def handle_write_event (self): | def handle_write_event(self): | def handle_write_event (self): # getting a write implies that we are connected if not self.connected: self.handle_connect() self.connected = 1 self.handle_write() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def handle_expt_event (self): | def handle_expt_event(self): | def handle_expt_event (self): self.handle_expt() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def handle_error (self): | def handle_error(self): | def handle_error (self): nil, t, v, tbinfo = compact_traceback() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
self_repr = repr (self) | self_repr = repr(self) | def handle_error (self): nil, t, v, tbinfo = compact_traceback() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
self_repr = '<__repr__ (self) failed for object at %0x>' % id(self) self.log_info ( | self_repr = '<__repr__(self) failed for object at %0x>' % id(self) self.log_info( | def handle_error (self): nil, t, v, tbinfo = compact_traceback() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def handle_expt (self): self.log_info ('unhandled exception', 'warning') def handle_read (self): self.log_info ('unhandled read event', 'warning') def handle_write (self): self.log_info ('unhandled write event', 'warning') def handle_connect (self): self.log_info ('unhandled connect event', 'warning') def handle_ac... | def handle_expt(self): self.log_info('unhandled exception', 'warning') def handle_read(self): self.log_info('unhandled read event', 'warning') def handle_write(self): self.log_info('unhandled write event', 'warning') def handle_connect(self): self.log_info('unhandled connect event', 'warning') def handle_accept(sel... | def handle_expt (self): self.log_info ('unhandled exception', 'warning') | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
class dispatcher_with_send (dispatcher): def __init__ (self, sock=None): dispatcher.__init__ (self, sock) | class dispatcher_with_send(dispatcher): def __init__(self, sock=None): dispatcher.__init__(self, sock) | def handle_close (self): self.log_info ('unhandled close event', 'warning') self.close() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def initiate_send (self): | def initiate_send(self): | def initiate_send (self): num_sent = 0 num_sent = dispatcher.send (self, self.out_buffer[:512]) self.out_buffer = self.out_buffer[num_sent:] | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
num_sent = dispatcher.send (self, self.out_buffer[:512]) | num_sent = dispatcher.send(self, self.out_buffer[:512]) | def initiate_send (self): num_sent = 0 num_sent = dispatcher.send (self, self.out_buffer[:512]) self.out_buffer = self.out_buffer[num_sent:] | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def handle_write (self): | def handle_write(self): | def handle_write (self): self.initiate_send() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def writable (self): | def writable(self): | def writable (self): return (not self.connected) or len(self.out_buffer) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def send (self, data): | def send(self, data): | def send (self, data): if self.debug: self.log_info ('sending %s' % repr(data)) self.out_buffer = self.out_buffer + data self.initiate_send() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
self.log_info ('sending %s' % repr(data)) | self.log_info('sending %s' % repr(data)) | def send (self, data): if self.debug: self.log_info ('sending %s' % repr(data)) self.out_buffer = self.out_buffer + data self.initiate_send() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def compact_traceback (): | def compact_traceback(): | def compact_traceback (): t,v,tb = sys.exc_info() tbinfo = [] while 1: tbinfo.append (( tb.tb_frame.f_code.co_filename, tb.tb_frame.f_code.co_name, str(tb.tb_lineno) )) tb = tb.tb_next if not tb: break # just to be safe del tb file, function, line = tbinfo[-1] info = '[' + '] ['.join(map(lambda x: '|'.join(x), tbinfo... | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
tbinfo.append (( | tbinfo.append(( | def compact_traceback (): t,v,tb = sys.exc_info() tbinfo = [] while 1: tbinfo.append (( tb.tb_frame.f_code.co_filename, tb.tb_frame.f_code.co_name, str(tb.tb_lineno) )) tb = tb.tb_next if not tb: break # just to be safe del tb file, function, line = tbinfo[-1] info = '[' + '] ['.join(map(lambda x: '|'.join(x), tbinfo... | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def close_all (map=None): | def close_all(map=None): | def close_all (map=None): if map is None: map=socket_map for x in map.values(): x.socket.close() map.clear() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
map=socket_map | map = socket_map | def close_all (map=None): if map is None: map=socket_map for x in map.values(): x.socket.close() map.clear() | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def __init__ (self, fd): | def __init__(self, fd): | def __init__ (self, fd): self.fd = fd | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def recv (self, *args): | def recv(self, *args): | def recv (self, *args): return os.read(self.fd, *args) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def send (self, *args): | def send(self, *args): | def send (self, *args): return os.write(self.fd, *args) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
def close (self): return os.close (self.fd) def fileno (self): | def close(self): return os.close(self.fd) def fileno(self): | def close (self): return os.close (self.fd) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
class file_dispatcher (dispatcher): def __init__ (self, fd): dispatcher.__init__ (self) | class file_dispatcher(dispatcher): def __init__(self, fd): dispatcher.__init__(self) | def fileno (self): return self.fd | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0) | flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0) | def __init__ (self, fd): dispatcher.__init__ (self) self.connected = 1 # set it to non-blocking mode flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0) flags = flags | os.O_NONBLOCK fcntl.fcntl (fd, fcntl.F_SETFL, flags) self.set_file (fd) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
fcntl.fcntl (fd, fcntl.F_SETFL, flags) self.set_file (fd) def set_file (self, fd): | fcntl.fcntl(fd, fcntl.F_SETFL, flags) self.set_file(fd) def set_file(self, fd): | def __init__ (self, fd): dispatcher.__init__ (self) self.connected = 1 # set it to non-blocking mode flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0) flags = flags | os.O_NONBLOCK fcntl.fcntl (fd, fcntl.F_SETFL, flags) self.set_file (fd) | f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py |
try: | if old: | def __calc_date_time(self): # Set self.__date_time, self.__date, & self.__time by using # time.strftime(). | 444a288e73599ce77294e5a04ab9a6c787b1d9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/444a288e73599ce77294e5a04ab9a6c787b1d9ec/_strptime.py |
except ValueError: pass | def __calc_date_time(self): # Set self.__date_time, self.__date, & self.__time by using # time.strftime(). | 444a288e73599ce77294e5a04ab9a6c787b1d9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/444a288e73599ce77294e5a04ab9a6c787b1d9ec/_strptime.py | |
"""Convert a list to a regex string for matching directive.""" | """Convert a list to a regex string for matching a directive.""" | def __seqToRE(self, to_convert, directive): """Convert a list to a regex string for matching directive.""" def sorter(a, b): """Sort based on length. | 444a288e73599ce77294e5a04ab9a6c787b1d9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/444a288e73599ce77294e5a04ab9a6c787b1d9ec/_strptime.py |
def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string. The format argument may either be a regular expression object compiled by strptime(), or a format string. If False is passed in for data_string then the re object calculated for format will... | 444a288e73599ce77294e5a04ab9a6c787b1d9ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/444a288e73599ce77294e5a04ab9a6c787b1d9ec/_strptime.py | ||
if (self.compiler.find_library_file(lib_dirs, 'ncurses')): | if (self.compiler.find_library_file(lib_dirs, 'ncursesw')): curses_libs = ['ncursesw'] exts.append( Extension('_curses', ['_cursesmodule.c'], libraries = curses_libs) ) elif (self.compiler.find_library_file(lib_dirs, 'ncurses')): | 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') | a9394a1e18edd393554bb9e5bd1e64492e1a7be5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a9394a1e18edd393554bb9e5bd1e64492e1a7be5/setup.py |
def __hash__(self): """x.__hash__() <==> hash(x)""" # Decimal integers must hash the same as the ints # Non-integer decimals are normalized and hashed as strings # Normalization assures that hast(100E-1) == hash(10) if self._is_special: if self._isnan(): raise TypeError('Cannot hash a NaN value.') return hash(str(self)... | 4b1fbe0533d39488ec8e8e905d09ec02675479be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b1fbe0533d39488ec8e8e905d09ec02675479be/decimal.py | ||
contents.append(self.docother(value, key, name, 70)) | contents.append(self.docother(value, key, name, maxlen=70)) | def docmodule(self, object, name=None, mod=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name synop, desc = splitdoc(getdoc(object)) result = self.section('NAME', name + (synop and ' - ' + synop)) | 7230a9da5cea7af2fbf4d8daf7436a42514f13a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7230a9da5cea7af2fbf4d8daf7436a42514f13a1/pydoc.py |
name, mod, 70, doc) + '\n') | name, mod, maxlen=70, doc=doc) + '\n') | def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: if callable(value) or inspect.isdatadescriptor(value): doc = getdoc(value) else: doc = None push(self.docother(getattr(object, name), name, mod, 70, doc) + '\n') return attrs | 7230a9da5cea7af2fbf4d8daf7436a42514f13a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7230a9da5cea7af2fbf4d8daf7436a42514f13a1/pydoc.py |
def docother(self, object, name=None, mod=None, maxlen=None, doc=None): | def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=None): | def docother(self, object, name=None, mod=None, maxlen=None, doc=None): """Produce text documentation for a data object.""" repr = self.repr(object) if maxlen: line = (name and name + ' = ' or '') + repr chop = maxlen - len(line) if chop < 0: repr = repr[:chop] + '...' line = (name and self.bold(name) + ' = ' or '') + ... | 7230a9da5cea7af2fbf4d8daf7436a42514f13a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7230a9da5cea7af2fbf4d8daf7436a42514f13a1/pydoc.py |
def __getitem__(self, i): if i < 0 or i > 2: raise IndexError return i + 4 | aea5fbff3181c2daabfb58d1e3f187bb41ce2b97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aea5fbff3181c2daabfb58d1e3f187bb41ce2b97/test_b2.py | ||
def test_close_fds(self): os.pipe() p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' \ 'sys.stdout.write(str(os.dup(0)))'], stdout=subprocess.PIPE, close_fds=1) self.assertEqual(p.stdout.read(), "3") | def test_preexec(self): # preexec function p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' \ 'sys.stdout.write(os.getenv("FRUIT"))'], stdout=subprocess.PIPE, preexec_fn=lambda: os.putenv("FRUIT", "apple")) self.assertEqual(p.stdout.read(), "apple") | b8261e825e03449acb0b924df9a73da67376abbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b8261e825e03449acb0b924df9a73da67376abbf/test_subprocess.py | |
value = unicode(value[2], value[0]).encode("ascii") | param += '*' value = Utils.encode_rfc2231(value[2], value[0], value[1]) | def _formatparam(param, value=None, quote=1): """Convenience function to format and return a key=value pair. This will quote the value if needed or if quote is true. """ if value is not None and len(value) > 0: # TupleType is used for RFC 2231 encoded parameter values where items # are (charset, language, value). cha... | 618d6f9cb513a803c683d441a554d1e81ded076c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/618d6f9cb513a803c683d441a554d1e81ded076c/Message.py |
def set_param(self, param, value, header='Content-Type', requote=1): | def set_param(self, param, value, header='Content-Type', requote=1, charset=None, language=''): | def set_param(self, param, value, header='Content-Type', requote=1): """Set a parameter in the Content-Type: header. | 618d6f9cb513a803c683d441a554d1e81ded076c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/618d6f9cb513a803c683d441a554d1e81ded076c/Message.py |
""" | If charset is specified the parameter will be encoded according to RFC 2231. In this case language is optional. """ if not isinstance(value, TupleType) and charset: value = (charset, language, value) | def set_param(self, param, value, header='Content-Type', requote=1): """Set a parameter in the Content-Type: header. | 618d6f9cb513a803c683d441a554d1e81ded076c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/618d6f9cb513a803c683d441a554d1e81ded076c/Message.py |
raise SystemError,\ 'module "%s.%s" failed to register' % \ (__name__,modname) | raise CodecRegistryError,\ 'module "%s" (%s) failed to register' % \ (mod.__name__, mod.__file__) | def search_function(encoding): # Cache lookup entry = _cache.get(encoding,_unknown) if entry is not _unknown: return entry # Import the module modname = encoding.replace('-', '_') modname = aliases.aliases.get(modname,modname) try: mod = __import__(modname,globals(),locals(),'*') except ImportError,why: # cache misse... | e74026bdeca945ce4028e41fc3f426a696d1ce8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e74026bdeca945ce4028e41fc3f426a696d1ce8f/__init__.py |
raise SystemError,\ 'incompatible codecs in module "%s.%s"' % \ (__name__,modname) | raise CodecRegistryError,\ 'incompatible codecs in module "%s" (%s)' % \ (mod.__name__, mod.__file__) | def search_function(encoding): # Cache lookup entry = _cache.get(encoding,_unknown) if entry is not _unknown: return entry # Import the module modname = encoding.replace('-', '_') modname = aliases.aliases.get(modname,modname) try: mod = __import__(modname,globals(),locals(),'*') except ImportError,why: # cache misse... | e74026bdeca945ce4028e41fc3f426a696d1ce8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e74026bdeca945ce4028e41fc3f426a696d1ce8f/__init__.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... | f1c2352b36078b78646aa1199708a9210ae855a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f1c2352b36078b78646aa1199708a9210ae855a4/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... | f1c2352b36078b78646aa1199708a9210ae855a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f1c2352b36078b78646aa1199708a9210ae855a4/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... | f1c2352b36078b78646aa1199708a9210ae855a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f1c2352b36078b78646aa1199708a9210ae855a4/wave.py |
self._dist_path(rpms[0]) | self._dist_path(rpms[0])) | def run (self): | 66ceed69bd430455e12bd4e9495f4d8a2196f04a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66ceed69bd430455e12bd4e9495f4d8a2196f04a/bdist_rpm.py |
self._dist_path(debuginfo[0]) | self._dist_path(debuginfo[0])) | def run (self): | 66ceed69bd430455e12bd4e9495f4d8a2196f04a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66ceed69bd430455e12bd4e9495f4d8a2196f04a/bdist_rpm.py |
print "Failed", name | print "Passed", name | def confirm(outcome, name): global tests tests = tests + 1 if outcome: if verbose: print "Failed", name else: failures.append(name) | 195ae68bf37bf4cd1783d45c675d62d9b1cc96b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/195ae68bf37bf4cd1783d45c675d62d9b1cc96b1/test_sax.py |
EventHandlerUPP event; | # def outputFreeIt(self, name): | ce325f95143025fed890c0a8e0fb8e35f292bf6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ce325f95143025fed890c0a8e0fb8e35f292bf6c/CarbonEvtsupport.py | |
event = NewEventHandlerUPP(CarbonEvents_HandleCommand); _err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callback, &outRef); | _err = InstallEventHandler(_self->ob_itself, gEventHandlerUPP, 1, &inSpec, (void *)callback, &outRef); | # def outputFreeIt(self, name): | ce325f95143025fed890c0a8e0fb8e35f292bf6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ce325f95143025fed890c0a8e0fb8e35f292bf6c/CarbonEvtsupport.py |
return Py_BuildValue("l", outRef); """ | return Py_BuildValue("O&", EventHandlerRef_New, outRef);""" | # def outputFreeIt(self, name): | ce325f95143025fed890c0a8e0fb8e35f292bf6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ce325f95143025fed890c0a8e0fb8e35f292bf6c/CarbonEvtsupport.py |
printf("lock failure\n"); | printf("lock failure\\n"); | # def outputFreeIt(self, name): | ce325f95143025fed890c0a8e0fb8e35f292bf6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ce325f95143025fed890c0a8e0fb8e35f292bf6c/CarbonEvtsupport.py |
SetOutputFileName('_CarbonEvt.c') | SetOutputFileName('_CarbonEvtmodule.c') | # def outputFreeIt(self, name): | ce325f95143025fed890c0a8e0fb8e35f292bf6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ce325f95143025fed890c0a8e0fb8e35f292bf6c/CarbonEvtsupport.py |
if self.groupdict.has_key(name): raise error, "can only use each group name once" | ogid = self.groupdict.get(name, None) if ogid is not None: raise error, ("redefinition of group name %s as group %d; " + "was group %d") % (`name`, gid, ogid) | def opengroup(self, name=None): gid = self.groups self.groups = gid + 1 if name: if self.groupdict.has_key(name): raise error, "can only use each group name once" self.groupdict[name] = gid self.open.append(gid) return gid | 2b6c1308a930cb2a29d3ac3b3b2b761d810456d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2b6c1308a930cb2a29d3ac3b3b2b761d810456d5/sre_parse.py |
def test_mktime(self): self.assertRaises(OverflowError, time.mktime, (999999, 999999, 999999, 999999, 999999, 999999, 999999, 999999, 999999)) | def test_mktime(self): self.assertRaises(OverflowError, time.mktime, (999999, 999999, 999999, 999999, 999999, 999999, 999999, 999999, 999999)) | 16ddb2811b6c7cfeb0d9222dab667c2460d1895f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16ddb2811b6c7cfeb0d9222dab667c2460d1895f/test_time.py | |
"""Test whether a path is a mount point""" return isabs(splitdrive(path)[1]) | """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 '/\\' | def ismount(path): """Test whether a path is a mount point""" return isabs(splitdrive(path)[1]) | 7890be096947e384a41b6a2e44cd1d90fa78915e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7890be096947e384a41b6a2e44cd1d90fa78915e/ntpath.py |
if ' raise BuildError, "BuildApplet could destroy your sourcefile on OSX, please rename: %s" % filename | def process(template, filename, destname, copy_codefragment, rsrcname=None, others=[], raw=0, progress="default"): if progress == "default": progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120) progress.label("Compiling...") progress.inc(0) # Read the source and compile it # (there's... | cdeb5580dbd5ba6027e0c1bf062bf54c1c898216 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cdeb5580dbd5ba6027e0c1bf062bf54c1c898216/buildtools.py | |
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
#ifndef kControlCheckBoxUncheckedValue | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py | ||
f = ManualGenerator("SetControlData_Callback", setcontroldata_callback_body, condition=" | f = ManualGenerator("SetControlData_Callback", setcontroldata_callback_body); | def outputCleanupStructMembers(self): Output("Py_XDECREF(self->ob_callbackdict);") Output("if (self->ob_itself)SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */") | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py |
f = ManualGenerator("GetPopupData", getpopupdata_body, condition=" | f = ManualGenerator("GetPopupData", getpopupdata_body, condition=" | def outputCleanupStructMembers(self): Output("Py_XDECREF(self->ob_callbackdict);") Output("if (self->ob_itself)SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */") | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py |
f = ManualGenerator("SetPopupData", setpopupdata_body, condition=" | f = ManualGenerator("SetPopupData", setpopupdata_body, condition=" | def outputCleanupStructMembers(self): Output("Py_XDECREF(self->ob_callbackdict);") Output("if (self->ob_itself)SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */") | 19f1e58cf0a0ec5f666107518196b52449ffec41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19f1e58cf0a0ec5f666107518196b52449ffec41/ctlsupport.py |
dbfile = s.optiondb()['DBFILE'] | dbfile = s.optiondb().get('DBFILE') | def build(master=None, initialcolor=None, initfile=None, ignore=None, dbfile=None): # create all output widgets s = Switchboard(not ignore and initfile) # defer to the command line chosen color database, falling back to the one # in the .pynche file. if dbfile is None: dbfile = s.optiondb()['DBFILE'] # find a parseable... | f53663e2bbfef3a8a6c66e892a5fe548fc8c3cc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f53663e2bbfef3a8a6c66e892a5fe548fc8c3cc6/Main.py |
return Message(**options).show() | res = Message(**options).show() if isinstance(res, bool): if res: return YES return NO return res | def _show(title=None, message=None, icon=None, type=None, **options): if icon: options["icon"] = icon if type: options["type"] = type if title: options["title"] = title if message: options["message"] = message return Message(**options).show() | 04cdfdbc69778faaf659c88837724f573d62752b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/04cdfdbc69778faaf659c88837724f573d62752b/tkMessageBox.py |
print 'source', `class_tcl` | def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ... | 3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77/Tkinter.py | |
print 'execfile', `class_py` | def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ... | 3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77/Tkinter.py | |
print 'source', `base_tcl` | def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ... | 3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77/Tkinter.py | |
print 'execfile', `base_py` | def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.""" import os if os.environ.has_key('HOME'): home = os.environ['HOME'] else: home = os.curdir ... | 3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3a690fbc117f1bac0eadc6a38b9dbb1f9ec77c77/Tkinter.py | |
_copy_reg.pickle(stat_result, _pickle_stat_result,_make_stat_result) | try: _copy_reg.pickle(stat_result, _pickle_stat_result, _make_stat_result) except NameError: pass | def _pickle_stat_result(sr): (type, args) = sr.__reduce__() return (_make_stat_result, args) | 671bdacebf2d942c63ff5721fdd4f82570e95161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/671bdacebf2d942c63ff5721fdd4f82570e95161/os.py |
print "Failing syntax tree:" pprint.pprint(t) raise | raise TestFailed, s | def roundtrip(f, s): st1 = f(s) t = st1.totuple() try: st2 = parser.sequence2ast(t) except parser.ParserError: print "Failing syntax tree:" pprint.pprint(t) raise | cf2a4ce35af64d007368c63c4fe081ac90fe06bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf2a4ce35af64d007368c63c4fe081ac90fe06bf/test_parser.py |
roundtrip(suite, open(filename).read()) | roundtrip(parser.suite, open(filename).read()) | def roundtrip_fromfile(filename): roundtrip(suite, open(filename).read()) | cf2a4ce35af64d007368c63c4fe081ac90fe06bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf2a4ce35af64d007368c63c4fe081ac90fe06bf/test_parser.py |
roundtrip(expr, s) | roundtrip(parser.expr, s) | def test_expr(s): print "expr:", s roundtrip(expr, s) | cf2a4ce35af64d007368c63c4fe081ac90fe06bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf2a4ce35af64d007368c63c4fe081ac90fe06bf/test_parser.py |
roundtrip(suite, s) | roundtrip(parser.suite, s) | def test_suite(s): print "suite:", s roundtrip(suite, s) | cf2a4ce35af64d007368c63c4fe081ac90fe06bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf2a4ce35af64d007368c63c4fe081ac90fe06bf/test_parser.py |
sequence2ast(tree) | parser.sequence2ast(tree) | def check_bad_tree(tree, label): print print label try: sequence2ast(tree) except parser.ParserError: print "caught expected exception for invalid tree" pass else: print "test failed: did not properly detect invalid tree:" pprint.pprint(tree) | cf2a4ce35af64d007368c63c4fe081ac90fe06bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf2a4ce35af64d007368c63c4fe081ac90fe06bf/test_parser.py |
pass | def check_bad_tree(tree, label): print print label try: sequence2ast(tree) except parser.ParserError: print "caught expected exception for invalid tree" pass else: print "test failed: did not properly detect invalid tree:" pprint.pprint(tree) | cf2a4ce35af64d007368c63c4fe081ac90fe06bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf2a4ce35af64d007368c63c4fe081ac90fe06bf/test_parser.py | |
type, address = splittype(address) if not type: | import re if not re.match('^([^/:]+)://', address): | def getproxies_registry(): """Return a dictionary of scheme -> proxy server URL mappings. | bc94bef4d86a66c35db77a2b35bbc189f3e6cc13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc94bef4d86a66c35db77a2b35bbc189f3e6cc13/urllib.py |
def __init__(self): | def __init__(self, allow_none): | def __init__(self): self.funcs = {} self.instance = None | 44fa98d1ff28f6996bb6ec8ada530657e180b1c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44fa98d1ff28f6996bb6ec8ada530657e180b1c0/SimpleXMLRPCServer.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.