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, ENOTCONN, ESHUTDOWN]: self.handle_close() return '' else: raise socket.error, why | 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_accept (self): self.log_info ('unhandled accept event', 'warning') def handle_close (self): self.log_info ('unhandled close event', 'warning') | 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(self): self.log_info('unhandled accept event', 'warning') def handle_close(self): self.log_info('unhandled close event', 'warning') | 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)) + ']' return (file, function, line), t, v, info | 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)) + ']' return (file, function, line), t, v, info | 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 be returned. The re object must be used with the same locale as was used to compile the re object. """ locale_time = LocaleTime() if isinstance(format, RegexpType): if format.pattern.find(locale_time.lang) == -1: raise TypeError("re object not created with same language as " "LocaleTime instance") else: compiled_re = format else: compiled_re = TimeRE(locale_time).compile(format) if data_string is False: return compiled_re else: found = compiled_re.match(data_string) if not found: raise ValueError("time data did not match format") year = month = day = hour = minute = second = weekday = julian = tz =-1 found_dict = found.groupdict() for group_key in found_dict.iterkeys(): if group_key == 'y': year = int("%s%s" % (time.strftime("%Y")[:-2], found_dict['y'])) elif group_key == 'Y': year = int(found_dict['Y']) elif group_key == 'm': month = int(found_dict['m']) elif group_key == 'B': month = _insensitiveindex(locale_time.f_month, found_dict['B']) elif group_key == 'b': month = _insensitiveindex(locale_time.a_month, found_dict['b']) elif group_key == 'd': day = int(found_dict['d']) elif group_key is 'H': hour = int(found_dict['H']) elif group_key == 'I': hour = int(found_dict['I']) ampm = found_dict.get('p', '').lower() # If there was no AM/PM indicator, we'll treat this like AM if ampm in ('', locale_time.am_pm[0].lower()): # We're in AM so the hour is correct unless we're # looking at 12 midnight. # 12 midnight == 12 AM == hour 0 if hour == 12: hour = 0 elif ampm == locale_time.am_pm[1].lower(): # We're in PM so we need to add 12 to the hour unless # we're looking at 12 noon. # 12 noon == 12 PM == hour 12 if hour != 12: hour += 12 elif group_key == 'M': minute = int(found_dict['M']) elif group_key == 'S': second = int(found_dict['S']) elif group_key == 'A': weekday = _insensitiveindex(locale_time.f_weekday, found_dict['A']) elif group_key == 'a': weekday = _insensitiveindex(locale_time.a_weekday, found_dict['a']) elif group_key == 'w': weekday = int(found_dict['w']) if weekday == 0: weekday = 6 else: weekday -= 1 elif group_key == 'j': julian = int(found_dict['j']) elif group_key == 'Z': found_zone = found_dict['Z'].lower() if locale_time.timezone[0] == locale_time.timezone[1]: pass #Deals with bad locale setup where timezone info is # the same; first found on FreeBSD 4.4 -current elif locale_time.timezone[0].lower() == found_zone: tz = 0 elif locale_time.timezone[1].lower() == found_zone: tz = 1 elif locale_time.timezone[2].lower() == found_zone: tz = 0 #XXX <bc>: If calculating fxns are never exposed to the general # populous then just inline calculations. if julian == -1 and year != -1 and month != -1 and day != -1: julian = julianday(year, month, day) if (month == -1 or day == -1) and julian != -1 and year != -1: year, month, day = gregorian(julian, year) if weekday == -1 and year != -1 and month != -1 and day != -1: weekday = dayofweek(year, month, day) return time.struct_time( (year,month,day,hour,minute,second,weekday, julian,tz)) | 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)) i = int(self) if self == Decimal(i): return hash(i) assert self.__nonzero__() # '-0' handled by integer case return hash(str(self.normalize())) | 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 '') + repr if doc is not None: line += '\n' + self.indent(str(doc)) return line | 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). charset is a string, not a Charset # instance. if isinstance(value, TupleType): # Convert to ascii, ignore language value = unicode(value[2], value[0]).encode("ascii") # BAW: Please check this. I think that if quote is set it should # force quoting even if not necessary. if quote or tspecials.search(value): return '%s="%s"' % (param, Utils.quote(value)) else: return '%s=%s' % (param, value) else: return param | 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 misses _cache[encoding] = None return None # Now ask the module for the registry entry try: entry = tuple(mod.getregentry()) except AttributeError: entry = () if len(entry) != 4: raise SystemError,\ 'module "%s.%s" failed to register' % \ (__name__,modname) for obj in entry: if not callable(obj): raise SystemError,\ 'incompatible codecs in module "%s.%s"' % \ (__name__,modname) # Cache the codec registry entry _cache[encoding] = entry # Register its aliases (without overwriting previously registered # aliases) try: codecaliases = mod.getaliases() except AttributeError: pass else: for alias in codecaliases: if not aliases.aliases.has_key(alias): aliases.aliases[alias] = modname # Return the registry entry return entry | 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 misses _cache[encoding] = None return None # Now ask the module for the registry entry try: entry = tuple(mod.getregentry()) except AttributeError: entry = () if len(entry) != 4: raise SystemError,\ 'module "%s.%s" failed to register' % \ (__name__,modname) for obj in entry: if not callable(obj): raise SystemError,\ 'incompatible codecs in module "%s.%s"' % \ (__name__,modname) # Cache the codec registry entry _cache[encoding] = entry # Register its aliases (without overwriting previously registered # aliases) try: codecaliases = mod.getaliases() except AttributeError: pass else: for alias in codecaliases: if not aliases.aliases.has_key(alias): aliases.aliases[alias] = modname # Return the registry entry return entry | 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 like a file object, so # we have to reach into the innards of the chunk object import array data = array.array(_array_fmts[self._sampwidth]) nitems = nframes * self._nchannels if nitems * self._sampwidth > self._data_chunk.chunksize - self._data_chunk.size_read: nitems = (self._data_chunk.chunksize - self._data_chunk.size_read) / self._sampwidth data.fromfile(self._data_chunk.file, nitems) self._data_chunk.size_read = self._data_chunk.size_read + nitems * self._sampwidth data.byteswap() data = data.tostring() else: data = self._data_chunk.read(nframes * self._framesize) if self._convert and data: data = self._convert(data) self._soundpos = self._soundpos + len(data) / (self._nchannels * self._sampwidth) return data | 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._datawritten = self._datawritten + len(data) * self._sampwidth else: self._file.write(data) self._datawritten = self._datawritten + len(data) self._nframeswritten = self._nframeswritten + nframes | 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._datawritten | 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 no point overwriting the destination if it has a syntax error) fp = open(filename, 'rU') text = fp.read() fp.close() try: code = compile(text, filename, "exec") except SyntaxError, arg: raise BuildError, "Syntax error in script %s: %s" % (filename, arg) except EOFError: raise BuildError, "End-of-file in script %s" % (filename,) # Set the destination file name. Note that basename # does contain the whole filepath, only a .py is stripped. if string.lower(filename[-3:]) == ".py": basename = filename[:-3] if MacOS.runtimemodel != 'macho' and not destname: destname = basename else: basename = filename if not destname: if MacOS.runtimemodel == 'macho': destname = basename + '.app' else: destname = basename + '.applet' if not rsrcname: rsrcname = basename + '.rsrc' # Try removing the output file. This fails in MachO, but it should # do any harm. try: os.remove(destname) except os.error: pass process_common(template, progress, code, rsrcname, destname, 0, copy_codefragment, raw, others) | 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 color database colordb = None files = RGB_TXT[:] while colordb is None: try: colordb = ColorDB.get_colordb(dbfile) except (KeyError, IOError): pass if colordb is None: if not files: break dbfile = files.pop(0) if not colordb: usage(1, 'No color database file found, see the -d option.') s.set_colordb(colordb) # create the application window decorations app = PyncheWidget(__version__, s, master=master) w = app.window() # these built-in viewers live inside the main Pynche window s.add_view(StripViewer(s, w)) s.add_view(ChipViewer(s, w)) s.add_view(TypeinViewer(s, w)) # get the initial color as components and set the color on all views. if # there was no initial color given on the command line, use the one that's # stored in the option database if initialcolor is None: optiondb = s.optiondb() red = optiondb.get('RED') green = optiondb.get('GREEN') blue = optiondb.get('BLUE') # but if there wasn't any stored in the database, use grey50 if red is None or blue is None or green is None: red, green, blue = initial_color('grey50', colordb) else: red, green, blue = initial_color(initialcolor, colordb) s.update_views(red, green, blue) return app, s | 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 class_tcl = os.path.join(home, '.%s.tcl' % className) class_py = os.path.join(home, '.%s.py' % className) base_tcl = os.path.join(home, '.%s.tcl' % baseName) base_py = os.path.join(home, '.%s.py' % baseName) dir = {'self': self} exec 'from Tkinter import *' in dir if os.path.isfile(class_tcl): print 'source', `class_tcl` self.tk.call('source', class_tcl) if os.path.isfile(class_py): print 'execfile', `class_py` execfile(class_py, dir) if os.path.isfile(base_tcl): print 'source', `base_tcl` self.tk.call('source', base_tcl) if os.path.isfile(base_py): print 'execfile', `base_py` execfile(base_py, dir) | 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 class_tcl = os.path.join(home, '.%s.tcl' % className) class_py = os.path.join(home, '.%s.py' % className) base_tcl = os.path.join(home, '.%s.tcl' % baseName) base_py = os.path.join(home, '.%s.py' % baseName) dir = {'self': self} exec 'from Tkinter import *' in dir if os.path.isfile(class_tcl): print 'source', `class_tcl` self.tk.call('source', class_tcl) if os.path.isfile(class_py): print 'execfile', `class_py` execfile(class_py, dir) if os.path.isfile(base_tcl): print 'source', `base_tcl` self.tk.call('source', base_tcl) if os.path.isfile(base_py): print 'execfile', `base_py` execfile(base_py, dir) | 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 class_tcl = os.path.join(home, '.%s.tcl' % className) class_py = os.path.join(home, '.%s.py' % className) base_tcl = os.path.join(home, '.%s.tcl' % baseName) base_py = os.path.join(home, '.%s.py' % baseName) dir = {'self': self} exec 'from Tkinter import *' in dir if os.path.isfile(class_tcl): print 'source', `class_tcl` self.tk.call('source', class_tcl) if os.path.isfile(class_py): print 'execfile', `class_py` execfile(class_py, dir) if os.path.isfile(base_tcl): print 'source', `base_tcl` self.tk.call('source', base_tcl) if os.path.isfile(base_py): print 'execfile', `base_py` execfile(base_py, dir) | 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 class_tcl = os.path.join(home, '.%s.tcl' % className) class_py = os.path.join(home, '.%s.py' % className) base_tcl = os.path.join(home, '.%s.tcl' % baseName) base_py = os.path.join(home, '.%s.py' % baseName) dir = {'self': self} exec 'from Tkinter import *' in dir if os.path.isfile(class_tcl): print 'source', `class_tcl` self.tk.call('source', class_tcl) if os.path.isfile(class_py): print 'execfile', `class_py` execfile(class_py, dir) if os.path.isfile(base_tcl): print 'source', `base_tcl` self.tk.call('source', base_tcl) if os.path.isfile(base_py): print 'execfile', `base_py` execfile(base_py, dir) | 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.