rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
D = numpy.array([ [C1111, C1122, C1133, C1112, C1123, C1113], [C1122, C2222, C2233, C2212, C2223, C2213], [C1133, C2233, C3333, C3312, C3323, C3313], [C1112, C2212, C3312, C1212, C1223, C1213], [C1123, C2223, C3323, C1223, C2323, C2313], [C1113, C2213, C3313, C1213, C2313, C1313] ],
D = numpy.array([ [C1111, C1122, C1133, 0.5*C1112, 0.5*C1123, 0.5*C1113], [C1122, C2222, C2233, 0.5*C2212, 0.5*C2223, 0.5*C2213], [C1133, C2233, C3333, 0.5*C3312, 0.5*C3323, 0.5*C3313], [0.5*C1112, 0.5*C2212, 0.5*C3312, 0.5*C1212, 0.5*C1223, 0.5*C1213], [0.5*C1123, 0.5*C2223, 0.5*C3323, 0.5*C1223, 0.5*C2323, 0.5*C2313], [0.5*C1113, 0.5*C2213, 0.5*C3313, 0.5*C1213, 0.5*C2313, 0.5*C1313] ],
def _calculateElasticityMat(self): """ Calculate elasticity matrix. """ if 1 == self.cellDim: lambda2mu = self.lameLambda + 2*self.lameMu C1111 = lambda2mu D = numpy.array([ [C1111] ], dtype=numpy.float64) elif 2 == self.cellDim: lambda2mu = self.lameLambda + 2*self.lameMu C1111 = lambda2mu C1122 = self.lameLambda C1112 = 0.0 C2222 = lambda2mu C2212 = 0.0 C1212 = 2.0*self.lameMu D = numpy.array([ [C1111, C1122, C1112], [C1122, C2222, C2212], [C1112, C2212, C1212] ], dtype=numpy.float64) elif 3 == self.cellDim: lambda2mu = self.lameLambda + 2.0*self.lameMu C1111 = lambda2mu C1122 = self.lameLambda C1133 = self.lameLambda C1112 = 0.0 C1123 = 0.0 C1113 = 0.0 C2222 = lambda2mu C2233 = self.lameLambda C2212 = 0.0 C2223 = 0.0 C2213 = 0.0 C3333 = lambda2mu C3312 = 0.0 C3323 = 0.0 C3313 = 0.0 C1212 = 2.0*self.lameMu C1223 = 0.0 C1213 = 0.0 C2323 = 2.0*self.lameMu C2313 = 0.0 C1313 = 2.0*self.lameMu D = numpy.array([ [C1111, C1122, C1133, C1112, C1123, C1113], [C1122, C2222, C2233, C2212, C2223, C2213], [C1133, C2233, C3333, C3312, C3323, C3313], [C1112, C2212, C3312, C1212, C1223, C1213], [C1123, C2223, C3323, C1223, C2323, C2313], [C1113, C2213, C3313, C1213, C2313, C1313] ], dtype=numpy.float64) return D
43524f5301420bc3d7c0680835e1948ca5b36644 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8645/43524f5301420bc3d7c0680835e1948ca5b36644/IntegratorElasticity.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 11162, 12462, 560, 15947, 12, 2890, 4672, 3536, 9029, 10465, 560, 3148, 18, 3536, 309, 404, 422, 365, 18, 3855, 5225, 30, 3195, 22, 13297, 273, 365, 18, 80, 339, 12025, 397, 576, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 11162, 12462, 560, 15947, 12, 2890, 4672, 3536, 9029, 10465, 560, 3148, 18, 3536, 309, 404, 422, 365, 18, 3855, 5225, 30, 3195, 22, 13297, 273, 365, 18, 80, 339, 12025, 397, 576, ...
for f in node_file_dict.keys()
for f in node_file_dict.keys():
def write_abstract_dag(self): """ Write all the nodes in the workflow to the DAX file. """ if not self.__dag_file_path: raise CondorDAGError, "No path for DAX file" try: dagfile = open( self.__dag_file_path, 'w' ) except: raise CondorDAGError, "Cannot open file " + self.__dag_file_path
8de5094298a726baada65a26c0370d315b9c983f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/8de5094298a726baada65a26c0370d315b9c983f/pipeline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 17801, 67, 30204, 12, 2890, 4672, 3536, 2598, 777, 326, 2199, 316, 326, 6095, 358, 326, 463, 2501, 585, 18, 3536, 309, 486, 365, 16186, 30204, 67, 768, 67, 803, 30, 1002, 735...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 17801, 67, 30204, 12, 2890, 4672, 3536, 2598, 777, 326, 2199, 316, 326, 6095, 358, 326, 463, 2501, 585, 18, 3536, 309, 486, 365, 16186, 30204, 67, 768, 67, 803, 30, 1002, 735...
def cut_curvelist(curve_list, rapid_down_to_height, depth, clearance_height, keep_tool_down_if_poss):
def cut_curvelist(curve_list, rapid_down_to_height, current_start_depth, depth, clearance_height, keep_tool_down_if_poss):
def cut_curvelist(curve_list, rapid_down_to_height, depth, clearance_height, keep_tool_down_if_poss): p = area.Point(0, 0) first = True for curve in curve_list: need_rapid = True if first == False: s = curve.FirstVertex().p if keep_tool_down_if_poss == True: # see if we can feed across if feed_possible(p, s): need_rapid = False elif s.x == p.x and s.y == p.y: need_rapid = False if need_rapid: rapid(z = clearance_height) p = cut_curve(curve, need_rapid, p, rapid_down_to_height, depth) first = False rapid(z = clearance_height)
ec3698dde3d110a186cf4acac001834823044738 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12576/ec3698dde3d110a186cf4acac001834823044738/area_funcs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6391, 67, 1397, 941, 376, 12, 16683, 67, 1098, 16, 767, 6610, 67, 2378, 67, 869, 67, 4210, 16, 783, 67, 1937, 67, 5979, 16, 3598, 16, 2424, 1359, 67, 4210, 16, 3455, 67, 6738, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6391, 67, 1397, 941, 376, 12, 16683, 67, 1098, 16, 767, 6610, 67, 2378, 67, 869, 67, 4210, 16, 783, 67, 1937, 67, 5979, 16, 3598, 16, 2424, 1359, 67, 4210, 16, 3455, 67, 6738, 67, ...
def get_app_icons(self, exc=[]):
def get_app_icons(self, exc=None): if exc == None: exc = []
def get_app_icons(self, exc=[]):
760311448d8fd5baffe51406770b30e1ff74224c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9953/760311448d8fd5baffe51406770b30e1ff74224c/rpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2910, 67, 14516, 12, 2890, 16, 3533, 33, 8526, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2910, 67, 14516, 12, 2890, 16, 3533, 33, 8526, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
def findnames(file, prefix=""):
def findnames(file, prefixes=()):
def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names
dd669a5cc4b7512ba77b0b342fbd1c6aedc93d36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/dd669a5cc4b7512ba77b0b342fbd1c6aedc93d36/undoc_symbols.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 1973, 12, 768, 16, 9419, 33, 1435, 4672, 1257, 273, 2618, 364, 980, 316, 585, 18, 896, 3548, 13332, 309, 980, 63, 20, 65, 422, 11817, 4278, 1324, 1466, 273, 980, 18, 4939, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 1973, 12, 768, 16, 9419, 33, 1435, 4672, 1257, 273, 2618, 364, 980, 316, 585, 18, 896, 3548, 13332, 309, 980, 63, 20, 65, 422, 11817, 4278, 1324, 1466, 273, 980, 18, 4939, 1435, ...
"autoconnect":0}
"autoconnect":0, "debug":0}
def __init__(self,base_dir,config_file="config",theme_file="theme"): pyxmpp.Client.__init__(self) commands.CommandHandler.__init__(self,global_commands) self.settings={ "jid":self.jid, "password":self.password, "auth_methods":self.auth_methods, "layout":"plain", "disconnect_timeout":10.0, "disconnect_delay":0.25, "autoconnect":0} self.aliases={} self.available_settings=global_settings self.base_dir=base_dir self.config_file=config_file self.theme_file=theme_file home=os.environ.get("HOME","") self.home_dir=os.path.join(home,".cjc") self.plugin_dirs=[os.path.join(base_dir,"plugins"), os.path.join(self.home_dir,"plugins")] self.plugins={} self.event_handlers={} self.user_info={} self.info_handlers={} self.exiting=0 self.ui_thread=None self.stream_thread=None self.roster_window=None self.status_window=None self.main_window=None self.top_bar=None self.bottom_bar=None self.resize_request=0
d51ae6df60c054e34836a641054bb23a23d507d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12768/d51ae6df60c054e34836a641054bb23a23d507d5/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1969, 67, 1214, 16, 1425, 67, 768, 1546, 1425, 3113, 7997, 67, 768, 1546, 7997, 6, 4672, 2395, 92, 24109, 18, 1227, 16186, 2738, 972, 12, 2890, 13, 4364,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1969, 67, 1214, 16, 1425, 67, 768, 1546, 1425, 3113, 7997, 67, 768, 1546, 7997, 6, 4672, 2395, 92, 24109, 18, 1227, 16186, 2738, 972, 12, 2890, 13, 4364,...
pem = x509.as_pem()
def verifyCallback(self, ok, store): # Returning 1 means any error is ignored and SSL checking continues log.debug('TwistedProtocolWrapper.verifyCallback') global trusted_until_shutdown_site_certs, \ trusted_until_shutdown_invalid_site_certs, \ unknown_issuer if not ok: try: err = store.get_error() x509 = store.get_current_cert() # Check temporarily trusted certificates pem = x509.as_pem() if err not in unknown_issuer: # Check if we are temporarily ignoring errors with this # certificate. acceptedErrList = trusted_until_shutdown_invalid_site_certs.get(pem) if acceptedErrList is not None and err in acceptedErrList: log.debug('Ignoring certificate error %d' %err) return 1 self.untrustedCertificates.append(pem) return ok if pem in trusted_until_shutdown_site_certs: log.debug('Found temporarily trusted site cert') return 1 # Check permanently trusted certificates # XXX Why does this need to be commit()? refresh() does not # XXX seem pick up changes made in main thread. # Perhaps this should just use the main view (or the main # view should be passed in) and not do any refresh or commit # self.repositoryView.commit() q = schema.ns('osaf.framework.certstore', self.repositoryView).sslTrustedSiteCertificatesQuery for cert in q: if cert.pemAsString() == pem: log.debug('Found permanently trusted site cert') return 1 self.untrustedCertificates.append(pem) except: # This is ok, we MUST return a value and not raise log.exception('SSL verifyCallback raised exception')
89df4286345b6769b8583f5b9eb368a23770c242 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/89df4286345b6769b8583f5b9eb368a23770c242/ssl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 2428, 12, 2890, 16, 1529, 16, 1707, 4672, 468, 2000, 310, 404, 4696, 1281, 555, 353, 5455, 471, 7419, 6728, 29359, 613, 18, 4148, 2668, 23539, 25444, 5752, 3611, 18, 8705, 2428, 61...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 2428, 12, 2890, 16, 1529, 16, 1707, 4672, 468, 2000, 310, 404, 4696, 1281, 555, 353, 5455, 471, 7419, 6728, 29359, 613, 18, 4148, 2668, 23539, 25444, 5752, 3611, 18, 8705, 2428, 61...
'of': (str, ''),
'of': (str, 'hb'),
def unsubscribe(self, req, form): """Unsubscribe from basket pseudo-interface."""
dc8f02afc43158a24286d129324503dabb31ef4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/dc8f02afc43158a24286d129324503dabb31ef4e/webbasket_webinterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15954, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 984, 9174, 628, 12886, 12454, 17, 5831, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15954, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 984, 9174, 628, 12886, 12454, 17, 5831, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
template_values = self.InitializeTemplate('Chromium Tree Status')
template_values = {'title': 'Chromium Tree Status'}
def get(self): template_values = self.InitializeTemplate('Chromium Tree Status')
edcd96d293399deb493a943f4d3463ff49a46fa7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/476/edcd96d293399deb493a943f4d3463ff49a46fa7/status.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 1542, 67, 2372, 273, 365, 18, 7520, 2283, 2668, 30761, 5077, 4902, 2685, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 1542, 67, 2372, 273, 365, 18, 7520, 2283, 2668, 30761, 5077, 4902, 2685, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.registerEvent("STREAM", "<STUB>", "white")
try: self.registerEvent("STREAM", "ID: %s STATUS: %s CIRC_ID: %s TARGET: %s:%s REASON: %s REMOTE_REASON: %s SOURCE: %s SOURCE_ADDR: %s PURPOSE: %s" % (event.strm_id, event.status, event.circ_id, event.target_host, event.target_port, event.reason, event.remote_reason, event.source, event.source_addr, event.purpose), "white") except TypeError: self.registerEvent("STREAM", "DEBUG -> ID: %s STATUS: %s CIRC_ID: %s TARGET: %s:%s REASON: %s REMOTE_REASON: %s SOURCE: %s SOURCE_ADDR: %s PURPOSE: %s" % (type(event.strm_id), type(event.status), type(event.circ_id), type(event.target_host), type(event.target_port), type(event.reason), type(event.remote_reason), type(event.source), type(event.source_addr), type(event.purpose)), "white")
def stream_status_event(self, event): self.registerEvent("STREAM", "<STUB>", "white") # TODO: implement - variables: event.strm_id, event.status, event.circ_id, event.target_host, event.target_port, event.reason, event.remote_reason, event.source, event.source_addr, event.purpose
a7fd565fe45df582e39d52cf4f50b62f476f8b26 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13459/a7fd565fe45df582e39d52cf4f50b62f476f8b26/logPanel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1407, 67, 2327, 67, 2575, 12, 2890, 16, 871, 4672, 225, 775, 30, 365, 18, 4861, 1133, 2932, 13693, 3113, 315, 734, 30, 738, 87, 7136, 30, 738, 87, 385, 30240, 67, 734, 30, 738, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1407, 67, 2327, 67, 2575, 12, 2890, 16, 871, 4672, 225, 775, 30, 365, 18, 4861, 1133, 2932, 13693, 3113, 315, 734, 30, 738, 87, 7136, 30, 738, 87, 385, 30240, 67, 734, 30, 738, 87, ...
cartan_type - The Cartan Type
ct - The Cartan Type
def parent(self): return self._parent
585641b32ec9003014ab40e39d632a05e840e883 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/585641b32ec9003014ab40e39d632a05e840e883/weyl_characters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 982, 12, 2890, 4672, 327, 365, 6315, 2938, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 982, 12, 2890, 4672, 327, 365, 6315, 2938, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Here's a larger example, that would take some time if we found roots instead of using PARI's specialized machinery:
Here's a larger example, that would take some time if we found roots instead of using PARI's specialized machinery::
def automorphisms(self): r""" Compute all Galois automorphisms of self.
2aebed6fc49cc7755aa4327f8a8d992d698ca838 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/2aebed6fc49cc7755aa4327f8a8d992d698ca838/number_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18472, 7657, 23749, 12, 2890, 4672, 436, 8395, 8155, 777, 611, 287, 19606, 18472, 7657, 23749, 434, 365, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18472, 7657, 23749, 12, 2890, 4672, 436, 8395, 8155, 777, 611, 287, 19606, 18472, 7657, 23749, 434, 365, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
operator.div:'/', operator.pow:'^'}
operator.div:'/', operator.pow:'^', operator.neg:'-'}
def var_cmp(x,y): return cmp(repr(x), repr(y))
4abaf2c6ed0ea24bec64bbddc272c657c3f1ea05 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/4abaf2c6ed0ea24bec64bbddc272c657c3f1ea05/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 569, 67, 9625, 12, 92, 16, 93, 4672, 327, 9411, 12, 12715, 12, 92, 3631, 8480, 12, 93, 3719, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 569, 67, 9625, 12, 92, 16, 93, 4672, 327, 9411, 12, 12715, 12, 92, 3631, 8480, 12, 93, 3719, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
return name + ' =' + format_list(lst)
list_part = name + ' =' + format_list(lst) inst_part = [('$(INSTALL) %s "$(DEST_DIR)\include\$(LIBDIR)"' % x) for x in lst] inst_part = '\n\t'.join(['install-headers:'] + inst_part) return list_part + '\n\n' + inst_part
def expand_template(makefile, name, supplementary=None): """Get expansion of specified template, taking information from Makefile. SELF: defines TOP_SRCDIR, LIBRARY, LIBDIR DATA: install-data rule, created from foo_DATA LIB_HEADERS: this variable, filled from lib_LTLIBRARIES, fooinclude_HEADERS LIB_OBJECTS: this variable, filled from lib_LTLIBRARIES, foo_SOURCES LIB_OBJ_RULES: .c -> .obj rules, filled from lib_LTLIBRARIES, foo_SOURCES PRG_OBJECTS: this variable, filled from bin_PROGRAMS, foo_SOURCES PRG_OBJ_RULES: .c -> .obj rules, filled from bin_PROGRAMS, foo_SOURCES MODULES: this variable, filled from foo_LTLIBRARIES MOD_OBJ_RULES: .c -> .obj rules, filled from foo_LTLIBRARIES, foo_SOURCES MOD_DLL_RULES: .obj -> .dll rules, filled from foo_LTLIBRARIES MO_INSTALL_RULES: installdirs and install-mo rules, filled from LINGUAS""" if name == 'SELF': if srcpath: srcdir = '\\'.join(['..'] * len(srcpath)) s = ['TOP_SRCDIR = ' + srcdir] else: s = ['TOP_SRCDIR = .'] libraries = fix_suffixes(get_list(makefile, 'lib_LTLIBRARIES'), '.la') if libraries: assert len(libraries) == 1 s.append('LIBDIR = ' + srcpath[-1]) l = libraries[0] s.append('LIBRARY = ' + l) return '\n'.join(s) elif name == 'DATA': lst = get_list(makefile, '\w+_DATA') list_part = name + ' =' + format_list(lst) inst_part = [('$(INSTALL) %s "$(DEST_DIR)\$(DATA_TYPE)"' % x) for x in lst] inst_part = '\n\t'.join(['install-data: data'] + inst_part) return list_part + '\n\n' + inst_part elif name == 'LIB_HEADERS': libraries = fix_suffixes(get_list(makefile, 'lib_LTLIBRARIES'), '.la') lst = [] for l in libraries: ul = underscorize(l) lst += get_list(makefile, '%sinclude_HEADERS' % ul) return name + ' =' + format_list(lst) elif name == 'LIB_OBJECTS': libraries = get_list(makefile, 'lib_LTLIBRARIES') lst = [] for l in libraries: ul = underscorize(l) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % ul), '.c', '.obj') return name + ' =' + format_list(lst) elif name == 'LIB_OBJ_RULES': libraries = get_list(makefile, 'lib_LTLIBRARIES') lst = [] for l in libraries: ul = underscorize(l) for x in fix_suffixes(get_list(makefile, '%s_SOURCES' % ul), '.c'): deps = format_list(get_file_deps(x, ul)) lst.append(object_rule % (x, deps, 'LIB', x)) return '\n'.join(lst) elif name == 'PRG_OBJECTS': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: up = underscorize(p) lst += fix_suffixes(get_list(makefile, '%s_SOURCES' % up), '.c', '.obj') return name + ' =' + format_list(lst) elif name == 'PRG_OBJ_RULES': programs = get_list(makefile, 'bin_PROGRAMS') lst = [] for p in programs: up = underscorize(p) for x in fix_suffixes(get_list(makefile, '%s_SOURCES' % up), '.c'): deps = format_list(get_file_deps(x)) lst.append(object_rule % (x, deps, 'PRG', x)) return '\n'.join(lst) elif name == 'MODULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) mods = fix_suffixes(fix_suffixes(mods, '.la', '.dll'), ')', ').dll') return name + ' =' + format_list(mods) elif name == 'MOD_OBJ_RULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) lst = [] for m in mods: um = underscorize(m) for x in get_list(makefile, '%s_SOURCES' % um): # Ignore header files in SOURCES if not x.endswith('.c'): continue x = x[:-2] deps = format_list(get_file_deps(x, um)) lst.append(object_rule % (x, deps, 'MOD', x)) return '\n'.join(lst) elif name == 'MOD_DLL_RULES': mods = get_list(makefile, r'\w+_LTLIBRARIES') mods = expand_make_vars(mods, supplementary) mods = fix_suffixes(mods, '.la') lst = [] for m in mods: lst.append(mod_dll_rule % (m, m, m, m, m)) return '\n'.join(lst) elif name == 'MO_INSTALL_RULES': pos = [l.strip() for l in file('LINGUAS')] pos = [l for l in pos if l and not l.strip().startswith('#')] assert len(pos) == 1 pos = re.split(r'\s+', pos[0]) if not pos: return lst = ['installdirs:', '\t-@mkdir "$(DEST_DIR)\\locale"'] for p in pos: lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s"' % p) lst.append('\t-@mkdir "$(DEST_DIR)\\locale\\%s\\LC_MESSAGES"' % p) lst.append('') lst.append('install-mo:') for p in pos: lst.append(mo_inst_rule % (p, p)) return '\n'.join(lst) print 'WARNING: Unknown template %s' % name return ''
0e0d8602beb7590342670c278c2f17f752493061 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6171/0e0d8602beb7590342670c278c2f17f752493061/update-msvc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4542, 67, 3202, 12, 6540, 768, 16, 508, 16, 1169, 29005, 33, 7036, 4672, 3536, 967, 17965, 434, 1269, 1542, 16, 13763, 1779, 628, 4344, 768, 18, 225, 29918, 30, 11164, 18680, 67, 28413, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4542, 67, 3202, 12, 6540, 768, 16, 508, 16, 1169, 29005, 33, 7036, 4672, 3536, 967, 17965, 434, 1269, 1542, 16, 13763, 1779, 628, 4344, 768, 18, 225, 29918, 30, 11164, 18680, 67, 28413, ...
if self.center: file.write("tube2(" + povpoint(self.atom1.posn()) +
if center: file.write("tube2(" + povpoint(a1pos) +
def povwrite(self, file, dispdef, col): disp=max(self.atom1.display, self.atom2.display) if disp == diDEFAULT: disp= dispdef color1 = self.atom1.element.color * V(1,1,-1) color2 = self.atom2.element.color * V(1,1,-1) if disp<0: disp= dispdef if disp == diLINES: file.write("line(" + povpoint(self.atom1.posn()) + "," + povpoint(self.atom2.posn()) + ")\n") if disp == diCPK: file.write("bond(" + povpoint(self.atom1.posn()) + "," + povpoint(self.atom2.posn()) + ")\n") if disp == diTUBES: if self.center: file.write("tube2(" + povpoint(self.atom1.posn()) + "," + povpoint(color1) + "," + povpoint(self.center) + "," + povpoint(self.atom2.posn()) + "," + povpoint(color2) + ")\n") else: file.write("tube1(" + povpoint(self.atom1.posn()) + "," + povpoint(color1) + "," + povpoint(self.c1) + "," + povpoint(self.c2) + "," + povpoint(self.atom2.posn()) + "," + povpoint(color2) + ")\n")
66cf42fbb8e5ea30a29eda4ff4ae93a841dbd21d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/66cf42fbb8e5ea30a29eda4ff4ae93a841dbd21d/chem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 1527, 2626, 12, 2890, 16, 585, 16, 16232, 536, 16, 645, 4672, 16232, 33, 1896, 12, 2890, 18, 7466, 21, 18, 5417, 16, 365, 18, 7466, 22, 18, 5417, 13, 309, 16232, 422, 4314, 5280...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 1527, 2626, 12, 2890, 16, 585, 16, 16232, 536, 16, 645, 4672, 16232, 33, 1896, 12, 2890, 18, 7466, 21, 18, 5417, 16, 365, 18, 7466, 22, 18, 5417, 13, 309, 16232, 422, 4314, 5280...
from Explorers import FileExplorer, Explorer return FileExplorer.PyFileNode(path.basename(defaultDir), defaultDir, None, Explorer.EditorHelper.imgFolder, None, None)
return FileExplorer.PyFileNode(path.basename(defaultDir), defaultDir, None, EditorHelper.imgFolder, None, None)
def newFileNode(self, defaultDir): from Explorers import FileExplorer, Explorer return FileExplorer.PyFileNode(path.basename(defaultDir), defaultDir, None, Explorer.EditorHelper.imgFolder, None, None)
29c63b34f15350d68f2bffb35ff76d0e602e0bee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/29c63b34f15350d68f2bffb35ff76d0e602e0bee/FileDlg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20592, 907, 12, 2890, 16, 805, 1621, 4672, 628, 1312, 412, 280, 414, 1930, 1387, 20938, 16, 1312, 11766, 327, 1387, 20938, 18, 9413, 812, 907, 12, 803, 18, 13909, 12, 1886, 1621, 3631, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20592, 907, 12, 2890, 16, 805, 1621, 4672, 628, 1312, 412, 280, 414, 1930, 1387, 20938, 16, 1312, 11766, 327, 1387, 20938, 18, 9413, 812, 907, 12, 803, 18, 13909, 12, 1886, 1621, 3631, ...
t1 = func5(i)
t1 = self._func5(i)
def func5(cnt): if not cnt: return 0 mask = 0 while mask < cnt: mask = (mask << 1) + 1 i = 0 while True: self.n1 = self.encxkey[self.n1 & 0xff] + self.iv[self.n2] self.n2 += 1 if self.n2 >= len(self.iv): self.n2 = 0 self.n1 += len(self.iv) tmp = self.n1 & mask i += 1 if i > 11: tmp %= cnt if tmp <= cnt: break return tmp
3ef0508434eff2ac7002c1b88899d438e47fa6e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10390/3ef0508434eff2ac7002c1b88899d438e47fa6e6/cipher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 25, 12, 13085, 4672, 309, 486, 7599, 30, 327, 374, 225, 3066, 273, 374, 1323, 3066, 411, 7599, 30, 3066, 273, 261, 4455, 2296, 404, 13, 397, 404, 225, 277, 273, 374, 1323, 1053, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 25, 12, 13085, 4672, 309, 486, 7599, 30, 327, 374, 225, 3066, 273, 374, 1323, 3066, 411, 7599, 30, 3066, 273, 261, 4455, 2296, 404, 13, 397, 404, 225, 277, 273, 374, 1323, 1053, ...
if k is None or k == MV: return 0
def index_object(self, i, obj, threshold=None): """ index and object 'obj' with integer id 'i'""" index = self._index unindex = self._unindex
f1f2ebccb000323942603348d15a0d6f3ad0294c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f1f2ebccb000323942603348d15a0d6f3ad0294c/UnIndex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 67, 1612, 12, 2890, 16, 277, 16, 1081, 16, 5573, 33, 7036, 4672, 3536, 770, 471, 733, 296, 2603, 11, 598, 3571, 612, 296, 77, 11, 8395, 770, 273, 365, 6315, 1615, 640, 1615, 273...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 67, 1612, 12, 2890, 16, 277, 16, 1081, 16, 5573, 33, 7036, 4672, 3536, 770, 471, 733, 296, 2603, 11, 598, 3571, 612, 296, 77, 11, 8395, 770, 273, 365, 6315, 1615, 640, 1615, 273...
print "* ",som2[0] print "* ",som2[1]
print "* ", som2[0] print "* ", som2[1]
def wavelength_to_energy(obj, **kwargs): """ This function converts a primary axis of a SOM or SO from wavelength to energy. The wavelength axis for a SOM must be in units of Angstroms. The primary axis of a SO is assumed to be in units of Angstroms. A tuple of [wavelength, wavelength_err2] (assumed to be in units of Angstroms) can be converted to [energy, energy_err2]. Parameters: ---------- -> obj is the SOM, SO or tuple to be converted -> kwargs is a list of key word arguments that the function accepts: offset=an information object containing energy offset information units= a string containing the expected units for this function. The default for this function is Angstroms Return: ------ <- A SOM or SO with a primary axis in energy or a tuple converted to energy Exceptions: ---------- <- TypeError is raised if the incoming object is not a type the function recognizes <- RuntimeError is raised if the SOM x-axis units are not Angstroms """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) if o_descr == "list": raise TypeError, "Do not know how to handle given type: %s" %\ o_descr else: pass # Setup keyword arguments try: units = kwargs["units"] except KeyError: units = "Angstroms" try: offset = kwargs["offset"] except KeyError: offset = None # Primary axis for transformation. If a SO is passed, the function, will # assume the axis for transformation is at the 0 position if o_descr == "SOM": axis = hlr_utils.hlr_1D_units(obj, units) else: axis = 0 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "meV", axis) result.setAxisLabel(axis, "energy") result.setYUnits("Counts/meV") result.setYLabel("Intensity") else: pass # iterate through the values import array_manip import axis_manip for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis) value=axis_manip.wavelength_to_energy(val, err2) if o_descr != "number": value1 = axis_manip.reverse_array_cp(value[0]) value2 = axis_manip.reverse_array_cp(value[1]) rev_value = (value1,value2) else: rev_value = value map_so = hlr_utils.get_map_so(obj,None,i) if map_so != None: map_so.y=axis_manip.reverse_array_cp(map_so.y) map_so.var_y=axis_manip.reverse_array_cp(map_so.var_y) else: pass if offset is not None: info = hlr_utils.get_special(offset, map_so) try: rev_value = array_manip.add_ncerr(rev_value[0], rev_value[1], info[0], info[1]) except TypeError: # Have to do this since add_ncerr does not support # scalar-scalar operations value1 = rev_value[0] + info[0] value2 = rev_value[1] + info[1] rev_value = (value1, value2) else: pass hlr_utils.result_insert(result,res_descr,rev_value,map_so,"x",axis) return result
07f6a4277681d82ce92dcaf2ea5c15f6b5ce72d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/07f6a4277681d82ce92dcaf2ea5c15f6b5ce72d7/hlr_wavelength_to_energy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21410, 67, 869, 67, 15358, 12, 2603, 16, 2826, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 21410, 358, 12929, 18, 1021, 21410, 2654, 364, 279...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21410, 67, 869, 67, 15358, 12, 2603, 16, 2826, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 21410, 358, 12929, 18, 1021, 21410, 2654, 364, 279...
def preprocessText(self,text): text = text.lower() if len(text) == 1: text = letters[text] if letters.has_key(text) else text if self._variant == "ukr": text = ukrainianPronunciation[text] if ukrainianPronunciation.has_key(text) else text return text text = re_letterAfterNumber.sub(r"\1 \2", text) text = re_abbreviations.sub(replaceEnglishLetters, text) text = re_individualLetters.sub(replaceEnglishLetter, text) for s in englishPronunciation: text = text.replace(s, englishPronunciation[s])
def speakText(self, text, index=None): text = preprocessText(text)
def preprocessText(self,text): text = text.lower() if len(text) == 1: text = letters[text] if letters.has_key(text) else text if self._variant == "ukr": text = ukrainianPronunciation[text] if ukrainianPronunciation.has_key(text) else text return text text = re_letterAfterNumber.sub(r"\1 \2", text) text = re_abbreviations.sub(replaceEnglishLetters, text) text = re_individualLetters.sub(replaceEnglishLetter, text) for s in englishPronunciation: text = text.replace(s, englishPronunciation[s]) if self._variant == "ukr": for s in ukrainianPronunciation: text = text.replace(s, ukrainianPronunciation[s]) return text
3169ef8c8e0bd4fb4b8727ab40f39c0aa1d89c6d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9340/3169ef8c8e0bd4fb4b8727ab40f39c0aa1d89c6d/newfon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 10244, 1528, 12, 2890, 16, 977, 16, 770, 33, 7036, 4672, 977, 273, 17942, 1528, 12, 955, 13, 309, 365, 6315, 8688, 422, 315, 19445, 86, 6877, 364, 272, 316, 27178, 7596, 2779, 52,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 10244, 1528, 12, 2890, 16, 977, 16, 770, 33, 7036, 4672, 977, 273, 17942, 1528, 12, 955, 13, 309, 365, 6315, 8688, 422, 315, 19445, 86, 6877, 364, 272, 316, 27178, 7596, 2779, 52,...
except: pass
except: print("ERROR: Unexpected error:", sys.exc_info()[0])
def write_report(self): if not os.path.isdir(self.dir): os.mkdir(self.dir) os.chdir(self.dir)
81092918682cb3b404793cc6abd4020f9621498a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10674/81092918682cb3b404793cc6abd4020f9621498a/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 6006, 12, 2890, 4672, 309, 486, 1140, 18, 803, 18, 291, 1214, 12, 2890, 18, 1214, 4672, 1140, 18, 26686, 12, 2890, 18, 1214, 13, 1140, 18, 343, 1214, 12, 2890, 18, 1214, 13...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 6006, 12, 2890, 4672, 309, 486, 1140, 18, 803, 18, 291, 1214, 12, 2890, 18, 1214, 4672, 1140, 18, 26686, 12, 2890, 18, 1214, 13, 1140, 18, 343, 1214, 12, 2890, 18, 1214, 13...
self._dostore(description='create2')
self._x_dostore(description='create2')
def load_value(oid, version=''): data, revid = self._storage.load(oid, version) return zodb_unpickle(data).value
f1227aabc4e8f4406a79e3ba177e8f6d81e9d84e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f1227aabc4e8f4406a79e3ba177e8f6d81e9d84e/TransactionalUndoVersionStorage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 1132, 12, 839, 16, 1177, 2218, 11, 4672, 501, 16, 283, 1246, 273, 365, 6315, 5697, 18, 945, 12, 839, 16, 1177, 13, 327, 998, 10605, 67, 318, 20847, 12, 892, 2934, 1132, 2, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 1132, 12, 839, 16, 1177, 2218, 11, 4672, 501, 16, 283, 1246, 273, 365, 6315, 5697, 18, 945, 12, 839, 16, 1177, 13, 327, 998, 10605, 67, 318, 20847, 12, 892, 2934, 1132, 2, ...
<widget name="config" position="10,40" size="540,240" scrollbarMode="showOnDemand" />
<widget name="config" position="10,40" size="540,200" scrollbarMode="showOnDemand" /> <widget name="status" position="10,250" size="540,130" font="Regular;16" />
def runBackup(): destination = config.plugins.autobackup.mode.value if destination and (destination != "off"): try: print "[AutoBackup] **************** begin **************** destination:", destination os.system("/usr/lib/enigma2/python/Plugins/PLi/AutoBackup/settings-backup.sh %s" % destination) except Exception, e: print "[AutoBackup] FAIL:", e
72f1ac0f79f9b6705d800f9cca3b297951460066 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10199/72f1ac0f79f9b6705d800f9cca3b297951460066/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 6248, 13332, 2929, 273, 642, 18, 8057, 18, 6079, 9572, 18, 3188, 18, 1132, 309, 2929, 471, 261, 10590, 480, 315, 3674, 6, 4672, 775, 30, 1172, 5158, 4965, 6248, 65, 380, 1644, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 6248, 13332, 2929, 273, 642, 18, 8057, 18, 6079, 9572, 18, 3188, 18, 1132, 309, 2929, 471, 261, 10590, 480, 315, 3674, 6, 4672, 775, 30, 1172, 5158, 4965, 6248, 65, 380, 1644, 27...
print "exclude", pattern num = exclude_pattern (self.files, pattern, anchor=1) if num == 0: template.warn \ ("no previously-included files found matching '%s'" % pattern)
print "exclude", string.join(pattern_list) for pattern in pattern_list: num = exclude_pattern (self.files, pattern, anchor=1) if num == 0: template.warn ( "no previously-included files found matching '%s'"% pattern)
def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'."""
d1aa01cb91ac9abec6e7ba7ff3f8be6778f9dbda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d1aa01cb91ac9abec6e7ba7ff3f8be6778f9dbda/sdist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 3202, 261, 2890, 4672, 3536, 1994, 471, 1109, 326, 5643, 1542, 585, 4141, 635, 296, 2890, 18, 3202, 11, 261, 407, 3452, 315, 9560, 30050, 18, 267, 20387, 225, 4389, 777, 585, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 3202, 261, 2890, 4672, 3536, 1994, 471, 1109, 326, 5643, 1542, 585, 4141, 635, 296, 2890, 18, 3202, 11, 261, 407, 3452, 315, 9560, 30050, 18, 267, 20387, 225, 4389, 777, 585, ...
raise wikipedia.PageNotFound("Found family '%s'; Wikisource required.")
raise wikipedia.PageNotFound(u"Found family '%s'; Wikisource required." % site.family.name)
def main(): import os index = None djvu = None pages = None # what would have been changed. debug = False ask = False # Parse command line arguments for arg in wikipedia.handleArgs(): if arg.startswith("-debug"): debug = True elif arg.startswith("-ask"): ask = True elif arg.startswith("-djvu:"): djvu = arg[6:] elif arg.startswith("-index:"): index = arg[7:] elif arg.startswith("-pages:"): pages = arg[7:] else: print "Unknown argument %s" % arg # Check the djvu file exists if djvu: os.stat(djvu) if not index: import os.path index = os.path.basename(djvu) if djvu and index: site = wikipedia.getSite() index_page = wikipedia.Page(site, index) if site.family.name != 'wikisource': raise wikipedia.PageNotFound("Found family '%s'; Wikisource required.") if not index_page.exists() and index_page.namespace() == 0: index_namespace = wikipedia.Page(site, 'MediaWiki:Proofreadpage index namespace').get() index_page = wikipedia.Page(wikipedia.getSite(), u"%s:%s" % (index_namespace, index)) if not index_page.exists(): raise wikipedia.NoPage("Page '%s' does not exist" % index) wikipedia.output("uploading text from %s to %s" % (djvu, index_page) ) bot = DjVuTextBot(djvu, index, pages) if not bot.has_text(): raise ValueError("No text layer in djvu file") bot.ask = ask bot.run() else: wikipedia.showHelp()
3afdf05014bc0d0886e3c33c045186aeef34f676 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/3afdf05014bc0d0886e3c33c045186aeef34f676/djvutext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 1930, 1140, 770, 273, 599, 19754, 90, 89, 273, 599, 4689, 273, 599, 468, 4121, 4102, 1240, 2118, 3550, 18, 1198, 273, 1083, 6827, 273, 1083, 225, 468, 2884, 1296, 980, 1775,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 1930, 1140, 770, 273, 599, 19754, 90, 89, 273, 599, 4689, 273, 599, 468, 4121, 4102, 1240, 2118, 3550, 18, 1198, 273, 1083, 6827, 273, 1083, 225, 468, 2884, 1296, 980, 1775,...
for i in range(len(s)): if s[i:i+1].isalnum(): return s[:i] + s[i:i+1].upper() + s[i+1:]
for i, c in enumerate(s): if c.isalnum(): return s[:i] + c.upper() + s[i+1:]
def capword(s): for i in range(len(s)): if s[i:i+1].isalnum(): return s[:i] + s[i:i+1].upper() + s[i+1:] return s
c27b1c22f43889d5ad8fcd938fae2bc38f0a4322 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/c27b1c22f43889d5ad8fcd938fae2bc38f0a4322/misc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3523, 1095, 12, 87, 4672, 364, 277, 16, 276, 316, 4241, 12, 87, 4672, 309, 276, 18, 291, 287, 2107, 13332, 327, 272, 10531, 77, 65, 397, 276, 18, 5797, 1435, 397, 272, 63, 77, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3523, 1095, 12, 87, 4672, 364, 277, 16, 276, 316, 4241, 12, 87, 4672, 309, 276, 18, 291, 287, 2107, 13332, 327, 272, 10531, 77, 65, 397, 276, 18, 5797, 1435, 397, 272, 63, 77, 15, ...
[0, 3, 4]
[2, 3, 0]
def __init__(self, ambient, gens, names="f"): """ EXAMPLES: sage: F = AbelianGroup(5,[30,64,729],names = list("abcde")) sage: a,b,c,d,e = F.gens() sage: F.subgroup([a^3,b]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a^3, b] sage: F.subgroup([c]) Multiplicative Abelian Group isomorphic to C2 x C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [c] sage: F.subgroup([a,c]) Multiplicative Abelian Group isomorphic to Z x C2 x C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a, c] sage: F.subgroup([a,b*c]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a, b*c] sage: F.subgroup([b*c,d]) Multiplicative Abelian Group isomorphic to Z x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [b*c, d] sage: F.subgroup([a*b,c^6,d],names = list("xyz")) Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: H.<x,y,z> = F.subgroup([a*b, c^6, d]); H Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: G = F.subgroup([a*b,c^6,d],names = list("xyz")) sage: G Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: x,y,z = G.gens() sage: x.order() +Infinity sage: y.order() 5 sage: z.order() 64 sage: A = AbelianGroup(5,[3, 5, 5, 7, 8], names = "abcde") sage: a,b,c,d,e = A.gens() sage: A.subgroup([a,b]) Multiplicative Abelian Group isomorphic to C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b] sage: A.subgroup([a,b,c,d^2,e]) Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e] sage: A.subgroup([a,b,c,d^2,e^2]) Multiplicative Abelian Group isomorphic to C3 x C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e^2] sage: B = A.subgroup([a^3,b,c,d,e^2]); B Multiplicative Abelian Group isomorphic to C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [b, c, d, e^2] sage: B.invariants() [4, 5, 5, 7] sage: A = AbelianGroup(4,[1009, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B.invariants() [1009, 2003, 3001, 4001] sage: A.order() 24266473210027 sage: B.order() 24266473210027 sage: A = AbelianGroup(4,[1008, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B Multiplicative Abelian Group isomorphic to C3 x C7 x C16 x C2003 x C3001 x C4001, which is the subgroup of Multiplicative Abelian Group isomorphic to C7 x C9 x C16 x C2003 x C3001 x C4001 generated by [a^3, b, c, d] Infinite groups can also be handled: sage: G = AbelianGroup([3,4,0], names = "abc") sage: a,b,c = G.gens() sage: F = G.subgroup([a,b^2,c]); F Multiplicative Abelian Group isomorphic to Z x C3 x C4, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x C3 x C4 generated by [a, b^2, c] sage: F.invariants() [0, 3, 4] sage: F.gens() [a, b^2, c] sage: F.order() +Infinity
91d93eac9e73babe24c77f9b0d1b0336a7d35cef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/91d93eac9e73babe24c77f9b0d1b0336a7d35cef/abelian_group.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 13232, 1979, 16, 314, 773, 16, 1257, 1546, 74, 6, 4672, 3536, 225, 5675, 8900, 11386, 30, 272, 410, 30, 478, 273, 9771, 292, 2779, 1114, 12, 25, 16, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 13232, 1979, 16, 314, 773, 16, 1257, 1546, 74, 6, 4672, 3536, 225, 5675, 8900, 11386, 30, 272, 410, 30, 478, 273, 9771, 292, 2779, 1114, 12, 25, 16, 63...
amount = move.product_qty * move.product_id.standard_price
amount = q * move.product_id.standard_price
def action_done(self, cr, uid, ids, context=None): track_flag=False for move in self.browse(cr, uid, ids): if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting','confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'}) if move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) else: pass # self.action_done(cr, uid, [move.move_dest_id.id]) if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context)
738dc7153439aa6a02a35a23449214265547e516 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/738dc7153439aa6a02a35a23449214265547e516/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3298, 67, 6420, 33, 8381, 364, 3635, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, 4672, 309, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3298, 67, 6420, 33, 8381, 364, 3635, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, 4672, 309, 36...
clam.add_subtask("Annotator installation", [ {CMD: "echo setting QTDIR to qt4 path ", INFO: set_qtdir_to_qt4}, "cd %(sandbox)s/Annotator"%localDefinitions, "scons clam_vmqt4_path=vmqt prefix=%(installPath)s clam_prefix=%(installPath)s"%localDefinitions, "scons install",
clam.add_subtask('Annotator installation', [ {CMD: 'echo setting QTDIR to qt4 path ', INFO: set_qtdir_to_qt4}, 'cd %(sandbox)s/Annotator'%localDefinitions, 'scons clam_vmqt4_path=vmqt prefix=%(installPath)s clam_prefix=%(installPath)s'%localDefinitions, 'scons install',
def set_qtdir_to_qt3(x) : os.environ['QTDIR']=localDefinitions['qt3dir']
45b134e97af928f2c496e6230f188f705de98e96 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1456/45b134e97af928f2c496e6230f188f705de98e96/clam_testfarm_client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 23311, 1214, 67, 869, 67, 23311, 23, 12, 92, 13, 294, 1140, 18, 28684, 3292, 53, 56, 4537, 3546, 33, 3729, 7130, 3292, 23311, 23, 1214, 3546, 225, 2, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 23311, 1214, 67, 869, 67, 23311, 23, 12, 92, 13, 294, 1140, 18, 28684, 3292, 53, 56, 4537, 3546, 33, 3729, 7130, 3292, 23311, 23, 1214, 3546, 225, 2, -100, -100, -100, -100, ...
self._type = self.__disk.type.name
def __init__(self, device=None, PedDisk=None): """Create a new Disk object from the device and type specified. The device is a Device object and type is a string matching a key in the diskType hash.""" if PedDisk: self.__disk = PedDisk self._device = parted.Device(PedDevice=self.__disk.dev) self._type = self.__disk.type.name elif device is None: raise _ped.PartedException, "no device specified" else: self.__disk = _ped.Disk(device.getPedDevice()) self._device = device self._type = self.__disk.type.name
68e7a8aa6f15bf543db5837aaf4dcf6c5ebebe0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5978/68e7a8aa6f15bf543db5837aaf4dcf6c5ebebe0d/disk.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2346, 33, 7036, 16, 453, 329, 6247, 33, 7036, 4672, 3536, 1684, 279, 394, 12951, 733, 628, 326, 2346, 471, 618, 1269, 18, 225, 1021, 2346, 353, 279, 6077...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2346, 33, 7036, 16, 453, 329, 6247, 33, 7036, 4672, 3536, 1684, 279, 394, 12951, 733, 628, 326, 2346, 471, 618, 1269, 18, 225, 1021, 2346, 353, 279, 6077...
self.AddError(_("Maximum command lines (%d) encountered," " ignoring the rest...") % maxlines)
self.AddError(_("Maximum command lines (%(maxlines)d) " "encountered, ignoring the rest..."))
def ParseMailCommands(self, msg): # Break any infloops. If this has come from a Mailman server then # it'll have this header. It's still possible to infloop between two # servers because there's no guaranteed way to know it came from a # bot. if msg.get('x-beenthere') or msg.get('list-id'): return # check the autoresponse stuff if self.autorespond_requests: # TBD: this is a hack and is not safe with respect to errors in # the Replybot module. It should be redesigned to work with the # robust delivery scheme. from Mailman.Handlers import Replybot Replybot.process(self, msg, msgdata={'torequest':1}) if self.autorespond_requests == 1: # Yes, auto-respond and discard return
bfed9ae359e2eea17ad856f6284f7870ede7b63f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/bfed9ae359e2eea17ad856f6284f7870ede7b63f/MailCommandHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2884, 6759, 9127, 12, 2890, 16, 1234, 4672, 468, 17030, 1281, 8286, 383, 4473, 18, 225, 971, 333, 711, 12404, 628, 279, 11542, 4728, 1438, 1508, 468, 518, 5614, 1240, 333, 1446, 18, 225,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2884, 6759, 9127, 12, 2890, 16, 1234, 4672, 468, 17030, 1281, 8286, 383, 4473, 18, 225, 971, 333, 711, 12404, 628, 279, 11542, 4728, 1438, 1508, 468, 518, 5614, 1240, 333, 1446, 18, 225,...
print >>sys.stderr,"rquery: QUERY_REPLY has unknown query ID"
print >>sys.stderr,"rquery: QUERY_REPLY has unknown query ID", selversion
def recv_query_reply(self,permid,message,selversion): #print "****** recv query reply", len(message) if selversion < OLPROTO_VER_SIXTH: return False if len(message) > MAX_QUERY_REPLY_LEN: return True # don't close
d41ac7a2ba55f3bf152d5084d5af47df7b264a67 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/d41ac7a2ba55f3bf152d5084d5af47df7b264a67/RemoteQueryMsgHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10665, 67, 2271, 67, 10629, 12, 2890, 16, 12160, 350, 16, 2150, 16, 1786, 1589, 4672, 225, 468, 1188, 315, 11345, 10665, 843, 4332, 3113, 562, 12, 2150, 13, 225, 309, 357, 1589, 411, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10665, 67, 2271, 67, 10629, 12, 2890, 16, 12160, 350, 16, 2150, 16, 1786, 1589, 4672, 225, 468, 1188, 315, 11345, 10665, 843, 4332, 3113, 562, 12, 2150, 13, 225, 309, 357, 1589, 411, 5...
if currClassNode and len(leftItem.children) == 3 and leftItem.children[0].get("name") == "qx": if leftItem.children[1].get("name") == "Proto" and rightItem.type == "function":
if ( currClassNode and len(leftItem.children) == 3 and leftItem.children[0].get("name") == "qx" ): if ( leftItem.children[1].get("name") == "Proto" and rightItem.type == "function" ):
def createDoc(syntaxTree, docTree = None): if not docTree: docTree = tree.Node("doctree") try: currClassNode = None if not syntaxTree.hasChildren(): return docTree for item in syntaxTree.children: if item.type == "assignment": leftItem = item.getFirstListChild("left") rightItem = item.getFirstListChild("right") if leftItem.type == "variable": if currClassNode and len(leftItem.children) == 3 and leftItem.children[0].get("name") == "qx": if leftItem.children[1].get("name") == "Proto" and rightItem.type == "function": # It's a method definition handleMethodDefinitionOld(item, False, currClassNode) elif leftItem.children[1].get("name") == "Class": if rightItem.type == "function": handleMethodDefinitionOld(item, True, currClassNode) elif leftItem.children[2].get("name").isupper(): handleConstantDefinition(item, currClassNode) elif currClassNode and assembleVariable(leftItem).startswith(currClassNode.get("fullName")): # This is definition of the type "mypackage.MyClass.bla = ..." if rightItem.type == "function": handleMethodDefinitionOld(item, True, currClassNode) elif leftItem.children[len(leftItem.children) - 1].get("name").isupper(): handleConstantDefinition(item, currClassNode) elif item.type == "call": operand = item.getChild("operand", False) if operand: var = operand.getChild("variable", False) # qooxdoo < 0.7 (DEPRECATED) if var and len(var.children) == 3 and var.children[0].get("name") == "qx" and var.children[1].get("name") == "OO": methodName = var.children[2].get("name") if methodName == "defineClass": currClassNode = handleClassDefinitionOld(docTree, item) elif methodName in ["addProperty", "addFastProperty"]: # these are private and should be marked if listed, otherwise just hide them (wpbasti) #or methodName == "addCachedProperty" or methodName == "changeProperty": handlePropertyDefinitionOld(item, currClassNode) # qooxdoo >= 0.7 elif var and len(var.children) == 3 and var.children[0].get("name") == "qx" and var.children[1].get("name") in ["Class", "Clazz", "Locale", "Interface", "Mixin"] and var.children[2].get("name") == "define": currClassNode = handleClassDefinition(docTree, item, var.children[1].get("name").lower()) except DocException: exc = sys.exc_info()[1] msg = "" if hasattr(exc, "node"): (line, column) = getLineAndColumnFromSyntaxItem(exc.node) file = getFileFromSyntaxItem(exc.node) if line != None or file != None: msg = str(exc) + "\n " + str(file) + ", Line: " + str(line) + ", Column: " + str(column) if msg == "": raise exc else: print print " - Failed: %s" % msg sys.exit(1) return docTree
9d728d14d7340af50453498bb707627436ff954e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/9d728d14d7340af50453498bb707627436ff954e/api.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 1759, 12, 14308, 2471, 16, 997, 2471, 273, 599, 4672, 309, 486, 997, 2471, 30, 997, 2471, 273, 2151, 18, 907, 2932, 2896, 299, 992, 7923, 225, 775, 30, 4306, 797, 907, 273, 599, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 1759, 12, 14308, 2471, 16, 997, 2471, 273, 599, 4672, 309, 486, 997, 2471, 30, 997, 2471, 273, 2151, 18, 907, 2932, 2896, 299, 992, 7923, 225, 775, 30, 4306, 797, 907, 273, 599, ...
cdata = self.__process(child)
cdata, cval = self.__process(child)
def import_children(self, data, node): """ Import child nodes into L{data} @param data: The current object being built. @type data: L{Object} @param node: The current node being proecessed. @type node: L{sax.Element} """ for child in node.children: cdata = self.__process(child) key = reserved.get(child.name, child.name) if key in data: v = getattr(data, key) if isinstance(v, list): v.append(cdata) else: setattr(data, key, [v, cdata]) continue if self.unbounded(cdata): if cdata is None: setattr(data, key, []) else: setattr(data, key, [cdata,]) else: setattr(data, key, cdata)
dbe83d91b69b7810580d22427c226c67e95f2a55 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5377/dbe83d91b69b7810580d22427c226c67e95f2a55/unmarshaller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 5906, 12, 2890, 16, 501, 16, 756, 4672, 3536, 6164, 1151, 2199, 1368, 511, 95, 892, 97, 632, 891, 501, 30, 1021, 783, 733, 3832, 6650, 18, 632, 723, 501, 30, 511, 95, 921, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 5906, 12, 2890, 16, 501, 16, 756, 4672, 3536, 6164, 1151, 2199, 1368, 511, 95, 892, 97, 632, 891, 501, 30, 1021, 783, 733, 3832, 6650, 18, 632, 723, 501, 30, 511, 95, 921, ...
def GetClipboardText():
def GetClipboardText(primary_selection=False):
def GetClipboardText(): success = False do = wx.TextDataObject() if wx.TheClipboard.Open(): success = wx.TheClipboard.GetData(do) wx.TheClipboard.Close() if success: return do.GetText() return None
32abbe2cd5ebfa45bb4b91abe5b412fa43b1712a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/32abbe2cd5ebfa45bb4b91abe5b412fa43b1712a/stcinterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 15339, 3752, 1528, 12, 8258, 67, 10705, 33, 8381, 4672, 2216, 273, 1083, 741, 273, 7075, 18, 1528, 21881, 1435, 309, 7075, 18, 1986, 15339, 3752, 18, 3678, 13332, 2216, 273, 7075, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 15339, 3752, 1528, 12, 8258, 67, 10705, 33, 8381, 4672, 2216, 273, 1083, 741, 273, 7075, 18, 1528, 21881, 1435, 309, 7075, 18, 1986, 15339, 3752, 18, 3678, 13332, 2216, 273, 7075, 1...
result['info']['timestamp'] = datetime.strptime(dom.getElementsByTagName('times')[0].childNodes[0].data, "%Y-%m-%d %H:%M:%S")
result['info']['timestamp'] = datetime.strptime(dom.getElementsByTagName('time')[0].childNodes[0].data, "%Y-%m-%d %H:%M:%S")
def execute(self,data={}, context={}): dom = xml.dom.minidom.parse(self.path) result = {} result['temp1'] = {} result['temp1']['value'] = float(dom.getElementsByTagName('th1')[0].getElementsByTagName('temp')[0].childNodes[0].data) result['temp1']['unit'] = "C"
0639fb106a9f9d8a3423c036cf6bda6a359e9c84 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3323/0639fb106a9f9d8a3423c036cf6bda6a359e9c84/xmlquery.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 892, 28793, 819, 12938, 4672, 4092, 273, 2025, 18, 9859, 18, 1154, 350, 362, 18, 2670, 12, 2890, 18, 803, 13, 563, 273, 2618, 563, 3292, 5814, 21, 3546, 273, 2618, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 892, 28793, 819, 12938, 4672, 4092, 273, 2025, 18, 9859, 18, 1154, 350, 362, 18, 2670, 12, 2890, 18, 803, 13, 563, 273, 2618, 563, 3292, 5814, 21, 3546, 273, 2618, ...
os.popen("tar -czf " + temp_tarball + " " + install_dir)
os.popen("tar -czf " + temp_tarball + " " + INSTALL_DIR)
def package_linux(dist_dir, install_dir, inst_name, output_dir): """ <Purpose> Packages the installation files and appends the necessary scripts to create the Linux installer. <Arguments> dist_dir: The location of the dist directory in the trunk. install_dir: The location of the installation files. inst_name: The name that the final installer should have. output_dir: The final location of the installer. <Exceptions> IOError on bad filepaths. <Side Effects> None. <Returns> None. """ # First, package up the install directory into a tarball temp_tarball = inst_name + "temp_" + os.getpid() + ".tgz" orig_dir = os.getcwd() os.chdir(install_dir + "/..") os.popen("tar -czf " + temp_tarball + " " + install_dir) shutil.move(temp_tarball, orig_dir) os.chdir(orig_dir) shutil.move(temp_tarball, output_dir + "/" + inst_name) # Now, append the Linux-specific scripts to the tarball build_installers.append_to_tar(output_dir + "/" + inst_name, dist_dir + "/linux/scripts", INSTALL_DIR)
39b6ca2c17e100229572582584e6a5b1e35a12c5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7995/39b6ca2c17e100229572582584e6a5b1e35a12c5/make_base_installers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2181, 67, 20132, 12, 4413, 67, 1214, 16, 3799, 67, 1214, 16, 1804, 67, 529, 16, 876, 67, 1214, 4672, 3536, 411, 10262, 4150, 34, 7930, 1023, 326, 13193, 1390, 471, 8144, 326, 4573, 887...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2181, 67, 20132, 12, 4413, 67, 1214, 16, 3799, 67, 1214, 16, 1804, 67, 529, 16, 876, 67, 1214, 4672, 3536, 411, 10262, 4150, 34, 7930, 1023, 326, 13193, 1390, 471, 8144, 326, 4573, 887...
if verbose: print "generating TIFF file %s" % repr(filename)
if verbose: print "generating TIFF file %s" % filename
def save(self, formats=None, verbose=None, fnRoot=None): "Saves copies of self in desired location and formats" ext = '' fnroot = os.path.join(getattr(self,'outDir','.'), fnRoot or (getattr(self,'fileNamePattern',(self.__class__.__name__+'%03d')) % getattr(self,'chartId',0)))
069e1bc47081cdb8e90763c51a8506fb16e68a32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/069e1bc47081cdb8e90763c51a8506fb16e68a32/shapes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 12, 2890, 16, 6449, 33, 7036, 16, 3988, 33, 7036, 16, 2295, 2375, 33, 7036, 4672, 315, 13370, 13200, 434, 365, 316, 6049, 2117, 471, 6449, 6, 1110, 273, 875, 2295, 3085, 273, 114...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 12, 2890, 16, 6449, 33, 7036, 16, 3988, 33, 7036, 16, 2295, 2375, 33, 7036, 4672, 315, 13370, 13200, 434, 365, 316, 6049, 2117, 471, 6449, 6, 1110, 273, 875, 2295, 3085, 273, 114...
iemchat_userprop i, ofgroupuser j WHERE \
nwschat_userprop i, ofgroupuser j WHERE \
def process_sms(self, room, send_txt, sender): # Query for users in chatgroup sql = "select i.propvalue as num, i.username as username from \ iemchat_userprop i, ofgroupuser j WHERE \ i.username = j.username and \ j.groupname = '%sgroup'" % (room[:3].lower(),) DBPOOL.runQuery(sql).addCallback(self.sendSMS, room, send_txt, sender)
b0a0ee420c18e518e9e31fb2fbfb98cfd051a503 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11180/b0a0ee420c18e518e9e31fb2fbfb98cfd051a503/iemchatbot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 20984, 12, 2890, 16, 7725, 16, 1366, 67, 5830, 16, 5793, 4672, 468, 2770, 364, 3677, 316, 7916, 1655, 1847, 273, 315, 4025, 277, 18, 5986, 1132, 487, 818, 16, 277, 18, 5053, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 20984, 12, 2890, 16, 7725, 16, 1366, 67, 5830, 16, 5793, 4672, 468, 2770, 364, 3677, 316, 7916, 1655, 1847, 273, 315, 4025, 277, 18, 5986, 1132, 487, 818, 16, 277, 18, 5053, ...
self.append(signals) signals.add(signal_data)
self._add_child(signals, signal_data)
def add(self, data): method_data = data['methods'] signal_data = data['signals']
29e46f4c980daf59bdf05cd501c0d0ab2f17449d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5682/29e46f4c980daf59bdf05cd501c0d0ab2f17449d/introspect_data.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 12, 2890, 16, 501, 4672, 707, 67, 892, 273, 501, 3292, 5163, 3546, 4277, 67, 892, 273, 501, 3292, 29659, 3546, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 12, 2890, 16, 501, 4672, 707, 67, 892, 273, 501, 3292, 5163, 3546, 4277, 67, 892, 273, 501, 3292, 29659, 3546, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
<meta name="defaultView" content="slideshow" /> <meta name="controlVis" content="hidden" />
<meta name="defaultView" content="%(view_mode)s" /> <meta name="controlVis" content="%(control_visibility)s" />
def __init__(self): html4css1.Writer.__init__(self) self.translator_class = S5HTMLTranslator
ea46631693e3b62df1861e94f9fa1dc9c1f0bd43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/ea46631693e3b62df1861e94f9fa1dc9c1f0bd43/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 1729, 24, 5212, 21, 18, 2289, 16186, 2738, 972, 12, 2890, 13, 365, 18, 17879, 67, 1106, 273, 348, 25, 4870, 12233, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 1729, 24, 5212, 21, 18, 2289, 16186, 2738, 972, 12, 2890, 13, 365, 18, 17879, 67, 1106, 273, 348, 25, 4870, 12233, 2, -100, -100, -100, -100, -100, -10...
return FiniteField_ext_pariElement(self.__parent, -self.__value)
return FiniteField_ext_pariElement(self.__parent, -self.__value, check=False)
def __neg__(self): return FiniteField_ext_pariElement(self.__parent, -self.__value)
99f8f4d261745ac6dc3bdcdaa49d15b9651e62e7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/99f8f4d261745ac6dc3bdcdaa49d15b9651e62e7/finite_field_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 14518, 972, 12, 2890, 4672, 327, 9458, 1137, 974, 67, 408, 67, 1065, 77, 1046, 12, 2890, 16186, 2938, 16, 300, 2890, 16186, 1132, 16, 866, 33, 8381, 13, 225, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 14518, 972, 12, 2890, 4672, 327, 9458, 1137, 974, 67, 408, 67, 1065, 77, 1046, 12, 2890, 16186, 2938, 16, 300, 2890, 16186, 1132, 16, 866, 33, 8381, 13, 225, 2, -100, -100, -100,...
print '\twrite literal size %s' % len(literal)
_mesg('write literal size %s' % len(literal))
def _command(self, name, *args):
30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3076, 12, 2890, 16, 508, 16, 380, 1968, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3076, 12, 2890, 16, 508, 16, 380, 1968, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return addinfo(fp, headers)
return addinfourl(fp, headers, self.openedurl)
def open_http(self, url): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'http': realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest) print "proxy via http:", host, selector if not host: raise IOError, ('http error', 'no host given') if user_passwd: import base64 auth = string.strip(base64.encodestring(user_passwd)) else: auth = None h = httplib.HTTP(host) h.putrequest('GET', selector) if auth: h.putheader('Authorization: Basic %s' % auth) for args in self.addheaders: apply(h.putheader, args) h.endheaders() errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == 200: return addinfo(fp, headers) else: return self.http_error(url, fp, errcode, errmsg, headers)
e6ad8913e20766e3769b346450dc952f0140462c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e6ad8913e20766e3769b346450dc952f0140462c/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 2505, 12, 2890, 16, 880, 4672, 1930, 15851, 6673, 309, 618, 12, 718, 13, 353, 618, 2932, 6, 4672, 1479, 16, 3451, 273, 6121, 483, 669, 12, 718, 13, 729, 67, 24002, 16, 1479...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 2505, 12, 2890, 16, 880, 4672, 1930, 15851, 6673, 309, 618, 12, 718, 13, 353, 618, 2932, 6, 4672, 1479, 16, 3451, 273, 6121, 483, 669, 12, 718, 13, 729, 67, 24002, 16, 1479...
matches = [match for match in variable_re.finditer(input_str)]
if expansion_symbol in input_str: matches = [match for match in variable_re.finditer(input_str)] else: matches = None
def ExpandVariables(input, is_late, variables, build_file): # Look for the pattern that gets expanded into variables if not is_late: variable_re = early_variable_re else: variable_re = late_variable_re input_str = str(input) # Get the entire list of matches as a list of MatchObject instances. # (using findall here would return strings, and we want # MatchObjects). matches = [match for match in variable_re.finditer(input_str)] output = input_str if matches: # Reverse the list of matches so that replacements are done right-to-left. # That ensures that earlier replacements won't mess up the string in a # way that causes later calls to find the earlier substituted text instead # of what's intended for replacement. matches.reverse() for match_group in matches: match = match_group.groupdict() gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Matches: %s" % repr(match)) # match['replace'] is the substring to look for, match['type'] # is the character code for the replacement type (< > <! >! <| >| <@ # >@ <!@ >!@), match['is_array'] contains a '[' for command # arrays, and match['content'] is the name of the variable (< >) # or command to run (<! >!). # run_command is true if a ! variant is used. run_command = '!' in match['type'] # file_list is true if a | variant is used. file_list = '|' in match['type'] # Capture these now so we can adjust them later. replace_start = match_group.start('replace') replace_end = match_group.end('replace') # Find the ending paren, and re-evaluate the contained string. (c_start, c_end) = FindEnclosingBracketGroup(input_str[replace_start:]) # Adjust the replacement range to match the entire command # found by FindEnclosingBracketGroup (since the variable_re # probably doesn't match the entire command if it contained # nested variables). replace_end = replace_start + c_end # Find the "real" replacement, matching the appropriate closing # paren, and adjust the replacement start and end. replacement = input_str[replace_start:replace_end] # Figure out what the contents of the variable parens are. contents_start = replace_start + c_start + 1 contents_end = replace_end - 1 contents = input_str[contents_start:contents_end] # Do filter substitution now for <|(). # Admittedly, this is different than the evaluation order in other # contexts. However, since filtration has no chance to run on <|(), # this seems like the only obvious way to give them access to filters. if file_list: processed_variables = copy.deepcopy(variables) ProcessListFiltersInDict(contents, processed_variables) # Recurse to expand variables in the contents contents = ExpandVariables(contents, is_late, processed_variables, build_file) else: # Recurse to expand variables in the contents contents = ExpandVariables(contents, is_late, variables, build_file) # Strip off leading/trailing whitespace so that variable matches are # simpler below (and because they are rarely needed). contents = contents.strip() # expand_to_list is true if an @ variant is used. In that case, # the expansion should result in a list. Note that the caller # is to be expecting a list in return, and not all callers do # because not all are working in list context. Also, for list # expansions, there can be no other text besides the variable # expansion in the input string. expand_to_list = '@' in match['type'] and input_str == replacement if run_command or file_list: # Find the build file's directory, so commands can be run or file lists # generated relative to it. build_file_dir = os.path.dirname(build_file) if build_file_dir == '': # If build_file is just a leaf filename indicating a file in the # current directory, build_file_dir might be an empty string. Set # it to None to signal to subprocess.Popen that it should run the # command in the current directory. build_file_dir = None # Support <|(listfile.txt ...) which generates a file # containing items from a gyp list, generated at gyp time. # This works around actions/rules which have more inputs than will # fit on the command line. if file_list: if type(contents) == list: contents_list = contents else: contents_list = contents.split(' ') replacement = contents_list[0] path = replacement if not os.path.isabs(path): path = os.path.join(build_file_dir, path) f = gyp.common.WriteOnDiff(path) for i in contents_list[1:]: f.write('%s\n' % i) f.close() elif run_command: use_shell = True if match['is_array']: contents = eval(contents) use_shell = False # Check for a cached value to avoid executing commands, or generating # file lists more than once. # TODO(http://code.google.com/p/gyp/issues/detail?id=112): It is # possible that the command being invoked depends on the current # directory. For that case the syntax needs to be extended so that the # directory is also used in cache_key (it becomes a tuple). # TODO(http://code.google.com/p/gyp/issues/detail?id=111): In theory, # someone could author a set of GYP files where each time the command # is invoked it produces different output by design. When the need # arises, the syntax should be extended to support no caching off a # command's output so it is run every time. cache_key = str(contents) cached_value = cached_command_results.get(cache_key, None) if cached_value is None: gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Executing command '%s' in directory '%s'" % (contents,build_file_dir)) # Fix up command with platform specific workarounds. contents = FixupPlatformCommand(contents) p = subprocess.Popen(contents, shell=use_shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, cwd=build_file_dir) (p_stdout, p_stderr) = p.communicate('') if p.wait() != 0 or p_stderr: sys.stderr.write(p_stderr) # Simulate check_call behavior, since check_call only exists # in python 2.5 and later. raise Exception("Call to '%s' returned exit status %d." % (contents, p.returncode)) replacement = p_stdout.rstrip() cached_command_results[cache_key] = replacement else: gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Had cache value for command '%s' in directory '%s'" % (contents,build_file_dir)) replacement = cached_value else: if not contents in variables: raise KeyError, 'Undefined variable ' + contents + \ ' in ' + build_file replacement = variables[contents] if isinstance(replacement, list): for item in replacement: if not isinstance(item, str) and not isinstance(item, int): raise TypeError, 'Variable ' + contents + \ ' must expand to a string or list of strings; ' + \ 'list contains a ' + \ item.__class__.__name__ # Run through the list and handle variable expansions in it. Since # the list is guaranteed not to contain dicts, this won't do anything # with conditions sections. ProcessVariablesAndConditionsInList(replacement, is_late, variables, build_file) elif not isinstance(replacement, str) and \ not isinstance(replacement, int): raise TypeError, 'Variable ' + contents + \ ' must expand to a string or list of strings; ' + \ 'found a ' + replacement.__class__.__name__ if expand_to_list: # Expanding in list context. It's guaranteed that there's only one # replacement to do in |input_str| and that it's this replacement. See # above. if isinstance(replacement, list): # If it's already a list, make a copy. output = replacement[:] else: # Split it the same way sh would split arguments. output = shlex.split(str(replacement)) else: # Expanding in string context. encoded_replacement = '' if isinstance(replacement, list): # When expanding a list into string context, turn the list items # into a string in a way that will work with a subprocess call. # # TODO(mark): This isn't completely correct. This should # call a generator-provided function that observes the # proper list-to-argument quoting rules on a specific # platform instead of just calling the POSIX encoding # routine. encoded_replacement = gyp.common.EncodePOSIXShellList(replacement) else: encoded_replacement = replacement output = output[:replace_start] + str(encoded_replacement) + \ output[replace_end:] # Prepare for the next match iteration. input_str = output # Look for more matches now that we've replaced some, to deal with # expanding local variables (variables defined in the same # variables block as this one). gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Found output %s, recursing." % repr(output)) if isinstance(output, list): new_output = [] for item in output: new_output.append(ExpandVariables(item, is_late, variables, build_file)) output = new_output else: output = ExpandVariables(output, is_late, variables, build_file) # Convert all strings that are canonically-represented integers into integers. if isinstance(output, list): for index in xrange(0, len(output)): if IsStrCanonicalInt(output[index]): output[index] = int(output[index]) elif IsStrCanonicalInt(output): output = int(output) gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Expanding %s to %s" % (repr(input), repr(output))) return output
2cafcee9729bc09404918c3bbecbfc7f96e631fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6220/2cafcee9729bc09404918c3bbecbfc7f96e631fc/input.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16429, 6158, 12, 2630, 16, 353, 67, 20293, 16, 3152, 16, 1361, 67, 768, 4672, 468, 10176, 364, 326, 1936, 716, 5571, 8406, 1368, 3152, 309, 486, 353, 67, 20293, 30, 2190, 67, 266, 273,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16429, 6158, 12, 2630, 16, 353, 67, 20293, 16, 3152, 16, 1361, 67, 768, 4672, 468, 10176, 364, 326, 1936, 716, 5571, 8406, 1368, 3152, 309, 486, 353, 67, 20293, 30, 2190, 67, 266, 273,...
raise CompressionError, "bz2 module is not available"
raise CompressionError("bz2 module is not available")
def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9): """Open bzip2 compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'."
b4f9e5b91e72c3fe0ed21adc8fcc43e75b037e05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b4f9e5b91e72c3fe0ed21adc8fcc43e75b037e05/tarfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24788, 22, 3190, 12, 6429, 16, 508, 16, 1965, 1546, 86, 3113, 17041, 33, 7036, 16, 8099, 2815, 33, 29, 4672, 3536, 3678, 324, 4450, 22, 8968, 8232, 5052, 508, 364, 6453, 578, 7410, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24788, 22, 3190, 12, 6429, 16, 508, 16, 1965, 1546, 86, 3113, 17041, 33, 7036, 16, 8099, 2815, 33, 29, 4672, 3536, 3678, 324, 4450, 22, 8968, 8232, 5052, 508, 364, 6453, 578, 7410, 18,...
print error
log.addwarning(_("Exception during parsing %(area)s: %(exception)s") % {'area':'FileSearchResult', 'exception':error})
def parseNetworkMessage(self, message): try: message = zlib.decompress(message) except Exception, error: print error self.list = {} return pos, self.user = self.getObject(message, types.StringType) pos, self.token = self.getObject(message, types.IntType, pos) pos, nfiles = self.getObject(message, types.IntType, pos) shares = [] for i in range(nfiles): size = size1 = size2 = 0 pos, code = pos+1, ord(message[pos]) pos, name = self.getObject(message, types.StringType, pos) pos, size1 = self.getObject(message, types.LongType, pos) pos, size2 = self.getObject(message, types.LongType, pos) #size = (size2 << 32) + size1 size = size2 + size1
c41fe06d527031ac5ee480da53678b9e4c561ae8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/c41fe06d527031ac5ee480da53678b9e4c561ae8/slskmessages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 3906, 1079, 12, 2890, 16, 883, 4672, 775, 30, 883, 273, 24220, 18, 323, 14706, 12, 2150, 13, 1335, 1185, 16, 555, 30, 613, 18, 1289, 8551, 24899, 2932, 503, 4982, 5811, 8975, 503...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 3906, 1079, 12, 2890, 16, 883, 4672, 775, 30, 883, 273, 24220, 18, 323, 14706, 12, 2150, 13, 1335, 1185, 16, 555, 30, 613, 18, 1289, 8551, 24899, 2932, 503, 4982, 5811, 8975, 503...
self._deps[filename] = self.parse_deps(filename)
self._deps[filename] = self.parse_deps(filename, ext_module)
def immediate_deps(self, filename): """ Returns a list of files directly referenced by this file. """ if (filename not in self._deps or self.timestamp(filename) < self._last_parse[filename]): self._deps[filename] = self.parse_deps(filename) self._last_parse[filename] = self.timestamp(filename) return self._deps[filename]
d6623d98c5a2d12be8c4376310c8ab509c1d1557 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d6623d98c5a2d12be8c4376310c8ab509c1d1557/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14483, 67, 14877, 12, 2890, 16, 1544, 4672, 3536, 2860, 279, 666, 434, 1390, 5122, 8042, 635, 333, 585, 18, 3536, 309, 261, 3459, 486, 316, 365, 6315, 14877, 578, 365, 18, 5508, 12, 34...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14483, 67, 14877, 12, 2890, 16, 1544, 4672, 3536, 2860, 279, 666, 434, 1390, 5122, 8042, 635, 333, 585, 18, 3536, 309, 261, 3459, 486, 316, 365, 6315, 14877, 578, 365, 18, 5508, 12, 34...
frame.add(vbox)
frame.add(table)
def refresh_dataset_model(sender, project, model): model.clear() for ds in self.app.project.datasets: model.append( (ds.key,) )
9c32eac186439f07092e593414a8822590fd0705 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2510/9c32eac186439f07092e593414a8822590fd0705/layerwin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4460, 67, 8682, 67, 2284, 12, 15330, 16, 1984, 16, 938, 4672, 938, 18, 8507, 1435, 364, 3780, 316, 365, 18, 2910, 18, 4406, 18, 21125, 30, 938, 18, 6923, 12, 261, 2377, 18, 856, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4460, 67, 8682, 67, 2284, 12, 15330, 16, 1984, 16, 938, 4672, 938, 18, 8507, 1435, 364, 3780, 316, 365, 18, 2910, 18, 4406, 18, 21125, 30, 938, 18, 6923, 12, 261, 2377, 18, 856, 16, ...
os.unlink(self._instroot + "/etc/dracut.conf")
os.unlink(self._instroot + "/etc/sysconfig/mkinitrd")
def _unmount_instroot(self): try: os.unlink(self._instroot + "/etc/dracut.conf") except: pass LoopImageCreator._unmount_instroot(self)
acef794c9225371e11d3e4b6e84805ef2911cc77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9342/acef794c9225371e11d3e4b6e84805ef2911cc77/live.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 318, 4778, 67, 8591, 3085, 12, 2890, 4672, 775, 30, 1140, 18, 318, 1232, 12, 2890, 6315, 8591, 3085, 397, 2206, 14175, 19, 9499, 1425, 19, 24816, 2738, 13623, 7923, 1335, 30, 1342, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 318, 4778, 67, 8591, 3085, 12, 2890, 4672, 775, 30, 1140, 18, 318, 1232, 12, 2890, 6315, 8591, 3085, 397, 2206, 14175, 19, 9499, 1425, 19, 24816, 2738, 13623, 7923, 1335, 30, 1342, ...
if WINE_WRAPPER:
if WINE_WRAPPER and os.path.exists(self.getPath()):
def runWineTool (self, prog, cwd=None, wait=False, stdin=None, stdout=None, stderr=None, debug=None): """Run a wine tool (eg wine itself) with prefix and debug environment set This is only a wrapper for runNative """ env = os.environ env["WINEPREFIX"] = self.getPath() env["WINEDEBUG"] = "err+all,warn-all,fixme-all,trace-all" global WINE_WRAPPER if WINE_WRAPPER: open(self.getPath()+"/.no_prelaunch_window_flag","wc").close() if debug: env["WINEDEBUG"] = debug return self.runNative ( prog, cwd, wait, env, stdin, stdout, stderr )
010fc3a4ea625ec0cd09e6c7abbce55f8355d06d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12631/010fc3a4ea625ec0cd09e6c7abbce55f8355d06d/swinelib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 59, 558, 6364, 261, 2890, 16, 11243, 16, 7239, 33, 7036, 16, 2529, 33, 8381, 16, 8801, 33, 7036, 16, 3909, 33, 7036, 16, 4514, 33, 7036, 16, 1198, 33, 7036, 4672, 3536, 1997, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 59, 558, 6364, 261, 2890, 16, 11243, 16, 7239, 33, 7036, 16, 2529, 33, 8381, 16, 8801, 33, 7036, 16, 3909, 33, 7036, 16, 4514, 33, 7036, 16, 1198, 33, 7036, 4672, 3536, 1997, 2...
output = ur""
output = ur"<u>test</u>"
def testFormatUnderline01(self): test = ur"__test__" output = ur"" self.do(test, output)
929eb80dd90e5dbc5bd0f84f7b5fa023b1a444ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/929eb80dd90e5dbc5bd0f84f7b5fa023b1a444ff/test_converter_text_html_text_x_moin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1630, 14655, 1369, 1611, 12, 2890, 4672, 1842, 273, 8896, 6, 972, 3813, 14437, 876, 273, 8896, 6, 32, 89, 34, 3813, 1757, 89, 2984, 365, 18, 2896, 12, 3813, 16, 876, 13, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1630, 14655, 1369, 1611, 12, 2890, 4672, 1842, 273, 8896, 6, 972, 3813, 14437, 876, 273, 8896, 6, 32, 89, 34, 3813, 1757, 89, 2984, 365, 18, 2896, 12, 3813, 16, 876, 13, 2, -10...
return el1 def depart_image(self, node): pass
return el1, width
def generate_image(self, node, source, destination, current_element): #ipshell('At generate_image') self.image_style_count += 1 style_name = 'rstframestyle%d' % self.image_style_count # Add the style. attrib = { 'style:name': style_name, 'style:family': 'graphic', 'style:parent-style-name': 'Graphics', } el1 = SubElement(self.automatic_styles, 'style:style', attrib=attrib, nsdict=SNSD) halign = None valign = None if 'align' in node.attributes: align = node.attributes['align'].split() for val in align: if val in ('left', 'center', 'right'): halign = val elif val in ('top', 'middle', 'bottom'): valign = val attrib = { 'style:vertical-pos': 'top', 'style:vertical-rel': 'paragraph', #'style:horizontal-pos': halign, #'style:vertical-pos': valign, 'style:horizontal-rel': 'paragraph', 'style:mirror': 'none', 'fo:clip': 'rect(0cm 0cm 0cm 0cm)', 'draw:luminance': '0%', 'draw:contrast': '0%', 'draw:red': '0%', 'draw:green': '0%', 'draw:blue': '0%', 'draw:gamma': '100%', 'draw:color-inversion': 'false', 'draw:image-opacity': '100%', 'draw:color-mode': 'standard', } if halign is not None: attrib['style:horizontal-pos'] = halign if valign is not None: attrib['style:vertical-pos'] = valign #ipshell('At generate_image') # If we are inside a table, add a no-wrap style. if self.is_in_table(node): attrib['style:wrap'] = 'none' el2 = SubElement(el1, 'style:graphic-properties', attrib=attrib, nsdict=SNSD) # Add the content. #el = SubElement(current_element, 'text:p', # attrib={'text:style-name': 'rststyle-textbody'}) attrib={ 'draw:style-name': style_name, 'draw:name': 'graphics2', #'text:anchor-type': 'paragraph', #'svg:width': '%fcm' % (width, ), #'svg:height': '%fcm' % (height, ), 'draw:z-index': '1', } if isinstance(node.parent, nodes.TextElement): attrib['text:anchor-type'] = 'char' else: attrib['text:anchor-type'] = 'paragraph' if 'scale' in node.attributes: try: scale = int(node.attributes['scale']) if scale < 1: # or scale > 100: raise ValueError scale = scale * 0.01 except ValueError, e: print 'Error: Invalid scale for image: "%s"' % ( node.attributes['scale'], ) else: scale = 1.0 if 'width' in node.attributes: try: width = int(node.attributes['width']) width = width * (35.278 / 1000.0) width *= scale attrib['svg:width'] = '%.2fcm' % (width, ) except ValueError, e: print 'Error: Invalid width for image: "%s"' % ( node.attributes['width'], ) if 'height' in node.attributes: try: height = int(node.attributes['height']) height = height * (35.278 / 1000.0) height *= scale attrib['svg:height'] = '%.2fcm' % (height, ) except ValueError, e: print 'Error: Invalid height for image: "%s"' % ( node.attributes['height'], ) if ('scale' in node.attributes and ('width' not in node.attributes or 'height' not in node.attributes)): if Image is not None: if source in self.image_dict: filename, destination = self.image_dict[source] imageobj = Image.open(filename, 'r') width, height = imageobj.size width = width * (35.278 / 1000.0) width *= scale attrib['svg:width'] = '%.2fcm' % (width, ) height = height * (35.278 / 1000.0) height *= scale attrib['svg:height'] = '%.2fcm' % (height, ) else: raise RuntimeError, 'image has scale and no height/width and PIL not installed' el1 = SubElement(current_element, 'draw:frame', attrib=attrib) el2 = SubElement(el1, 'draw:image', attrib={ 'xlink:href': '%s' % (destination, ), 'xlink:type': 'simple', 'xlink:show': 'embed', 'xlink:actuate': 'onLoad', }) return el1
8f9c74628116346d2f6e669c6a41a3e179d554cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/8f9c74628116346d2f6e669c6a41a3e179d554cb/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 2730, 12, 2890, 16, 756, 16, 1084, 16, 2929, 16, 783, 67, 2956, 4672, 468, 625, 10304, 2668, 861, 2103, 67, 2730, 6134, 365, 18, 2730, 67, 4060, 67, 1883, 1011, 404, 2154, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 2730, 12, 2890, 16, 756, 16, 1084, 16, 2929, 16, 783, 67, 2956, 4672, 468, 625, 10304, 2668, 861, 2103, 67, 2730, 6134, 365, 18, 2730, 67, 4060, 67, 1883, 1011, 404, 2154, ...
if ((p > tmp2*(a-x)) and (p < tmp2*(b-x)) and (abs(p) < abs(0.5*tmp2*etemp))): d = p*1.0/tmp2 u = x + d
if ((p > tmp2*(a-x)) and (p < tmp2*(b-x)) and (abs(p) < abs(0.5*tmp2*dx_temp))): rat = p*1.0/tmp2 u = x + rat
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If bracket is two numbers then they are assumed to be a starting interval for a downhill bracket search (see bracket) Uses inverse interpolation when possible to speed up convergence. """ _mintol = 1.0e-11 _cg = 0.3819660 if brack is None: xa,xb,xc,fa,fb,fc,funcalls = bracket(func, args=args) elif len(brack) == 2: xa,xb,xc,fa,fb,fc,funcalls = bracket(func, xa=brack[0], xb=brack[1], args=args) elif len(brack) == 3: xa,xb,xc = brack if (xa > xc): # swap so xa < xc can be assumed dum = xa; xa=xc; xc=dum assert ((xa < xb) and (xb < xc)), "Not a bracketing interval." fa = apply(func, (xa,)+args) fb = apply(func, (xb,)+args) fc = apply(func, (xc,)+args) assert ((fb<fa) and (fb < fc)), "Not a bracketing interval." funcalls = 3 else: raise ValuError, "Bracketing interval must be length 2 or 3 sequence." x=w=v=xb fw=fv=fx=apply(func, (x,)+args) if (xa < xc): a = xa; b = xc else: a = xc; b = xa e = 0.0 funcalls = 1 iter = 0 while (iter < maxiter): tol1 = tol*abs(x) + _mintol tol2 = 2.0*tol1 xmid = 0.5*(a+b) if abs(x-xmid) < (tol2-0.5*(b-a)): # check for convergence xmin=x; fval=fx break if (abs(e) <= tol1): # do a parabolic fit if (x>=xmid): e=a-x else: e=b-x d = _cg*e else: tmp1 = (x-w)*(fx-fv) tmp2 = (x-v)*(fx-fw) p = (x-v)*tmp2 - (x-w)*tmp1; tmp2 = 2.0*(tmp2-tmp1) if (tmp2 > 0.0): p = -p tmp2 = abs(tmp2) etemp = e e = d # check parabolic fit if ((p > tmp2*(a-x)) and (p < tmp2*(b-x)) and (abs(p) < abs(0.5*tmp2*etemp))): d = p*1.0/tmp2 # if it's good use it. u = x + d if ((u-a) < tol2 or (b-u) < tol2): if xmid-x >= 0: d = tol1 else: d = -tol1 else: if (x>=xmid): e=a-x # if it's bad do a golden section step else: e=b-x d = _cg*e if (abs(d) < tol1): if d >= 0: u = x + tol1 else: u = x - tol1 else: u = x + d fu = apply(func, (u,)+args) funcalls += 1 if (fu > fx): if (u<x): a=u else: b=u if (fu<=fw) or (w==x): v=w; w=u; fv=fw; fw=fu elif (fu<=fv) or (v==x) or (v==w): v=u; fv=fu else: if (u >= x): a = x else: b = x v=w; w=x; x=u fv=fw; fw=fx; fx=fu xmin = x fval = fx if full_output: return xmin, fval, iter, funcalls else: return xmin
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 547, 12, 644, 16, 833, 33, 9334, 16430, 363, 33, 7036, 16, 6085, 33, 21, 18, 8875, 73, 17, 28, 16, 1983, 67, 2844, 33, 20, 16, 25743, 33, 12483, 4672, 3536, 16803, 279, 445, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 547, 12, 644, 16, 833, 33, 9334, 16430, 363, 33, 7036, 16, 6085, 33, 21, 18, 8875, 73, 17, 28, 16, 1983, 67, 2844, 33, 20, 16, 25743, 33, 12483, 4672, 3536, 16803, 279, 445, 4...
return postincoming(ui, repo, modheads, opts['update'], wasempty)
return postincoming(ui, repo, modheads, opts['update'])
def pull(ui, repo, source="default", **opts): """pull changes from the specified source Pull changes from a remote repository to a local one. This finds all changes from the repository at the specified path or URL and adds them to the local repository. By default, this does not update the copy of the project in the working directory. Valid URLs are of the form: local/filesystem/path (or file://local/filesystem/path) http://[user@]host[:port]/[path] https://[user@]host[:port]/[path] ssh://[user@]host[:port]/[path] static-http://host[:port]/[path] Paths in the local filesystem can either point to Mercurial repositories or to bundle files (as created by 'hg bundle' or 'hg incoming --bundle'). The static-http:// protocol, albeit slow, allows access to a Mercurial repository where you simply use a web server to publish the .hg directory as static content. An optional identifier after # indicates a particular branch, tag, or changeset to pull. Some notes about using SSH with Mercurial: - SSH requires an accessible shell account on the destination machine and a copy of hg in the remote path or specified with as remotecmd. - path is relative to the remote user's home directory by default. Use an extra slash at the start of a path to specify an absolute path: ssh://example.com//tmp/repository - Mercurial doesn't use its own compression via SSH; the right thing to do is to configure it in your ~/.ssh/config, e.g.: Host *.mylocalnetwork.example.com Compression no Host * Compression yes Alternatively specify "ssh -C" as your ssh command in your hgrc or with the --ssh command line option. """ source, revs = cmdutil.parseurl(ui.expandpath(source), opts['rev']) cmdutil.setremoteconfig(ui, opts) other = hg.repository(ui, source) ui.status(_('pulling from %s\n') % (source)) if revs: if 'lookup' in other.capabilities: revs = [other.lookup(rev) for rev in revs] else: error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.") raise util.Abort(error) wasempty = repo.changelog.count() == 0 modheads = repo.pull(other, heads=revs, force=opts['force']) return postincoming(ui, repo, modheads, opts['update'], wasempty)
78f57f9179983a87375af6bdd7e703bb47564a62 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/78f57f9179983a87375af6bdd7e703bb47564a62/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6892, 12, 4881, 16, 3538, 16, 1084, 1546, 1886, 3113, 2826, 4952, 4672, 3536, 13469, 3478, 628, 326, 1269, 1084, 225, 14899, 3478, 628, 279, 2632, 3352, 358, 279, 1191, 1245, 18, 225, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6892, 12, 4881, 16, 3538, 16, 1084, 1546, 1886, 3113, 2826, 4952, 4672, 3536, 13469, 3478, 628, 326, 1269, 1084, 225, 14899, 3478, 628, 279, 2632, 3352, 358, 279, 1191, 1245, 18, 225, 12...
quotedValue = quote(value, t)
quotedValue = self.quote_value(value, t)
def _rowLoader(self, transaction, tableName, parentRow, data, whereClause, forceChildren): """immediate loading of rowobjects from the table with the whereClause. """ tableInfo = self.schema[tableName] # Build the SQL for the query sql = "SELECT " first = 1 for column, type in tableInfo.rowColumns: if first: first = 0 else: sql = sql + "," sql = sql + " %s" % column sql = sql + " FROM %s """ % (tableName) if whereClause: sql += " WHERE " first = 1 for wItem in whereClause: if first: first = 0 else: sql += " AND " (columnName, cond, value) = wItem t = self.findTypeFor(tableName, columnName) quotedValue = quote(value, t) sql += "%s %s %s" % (columnName, self.conditionalLabels[cond], quotedValue)
3d1177b78afa568866d5353481d56f6ca39d9790 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3d1177b78afa568866d5353481d56f6ca39d9790/sqlreflector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 492, 2886, 12, 2890, 16, 2492, 16, 4775, 16, 982, 1999, 16, 501, 16, 30300, 16, 2944, 4212, 4672, 3536, 381, 6785, 7153, 434, 1027, 6911, 628, 326, 1014, 598, 326, 30300, 18, 3536...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 492, 2886, 12, 2890, 16, 2492, 16, 4775, 16, 982, 1999, 16, 501, 16, 30300, 16, 2944, 4212, 4672, 3536, 381, 6785, 7153, 434, 1027, 6911, 628, 326, 1014, 598, 326, 30300, 18, 3536...
if notice['update_id']: releasever = self.yumbase.conf.yumvar['releasever'] href = "https://admin.fedoraproject.org/updates/F%s/%s" % (releasever, notice['update_id']) title = "%s Update %s" % (notice['release'], notice['update_id']) urls['vendor'].append("%s;%s" % (href, title))
def _get_update_extras(self, pkg): md = self.updateMetadata notice = md.get_notice((pkg.name, pkg.version, pkg.release)) urls = {'bugzilla':[], 'cve' : [], 'vendor': []} if notice: # Update Details desc = notice['description'] if desc: desc = desc.replace("\t", " ")
b215580654500e77af50c1a689b5115f0bc30832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12904/b215580654500e77af50c1a689b5115f0bc30832/yumBackend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 2725, 67, 23687, 12, 2890, 16, 3475, 4672, 3481, 273, 365, 18, 2725, 2277, 11690, 273, 3481, 18, 588, 67, 20392, 12443, 10657, 18, 529, 16, 3475, 18, 1589, 16, 3475, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 2725, 67, 23687, 12, 2890, 16, 3475, 4672, 3481, 273, 365, 18, 2725, 2277, 11690, 273, 3481, 18, 588, 67, 20392, 12443, 10657, 18, 529, 16, 3475, 18, 1589, 16, 3475, 18, ...
def parse_address(s):
def parse_cpim_address(s, default_domain=None):
def parse_address(s): """ >>> alice = parse_address('<sip:alice@example.com>') >>> alice.user, alice.host, alice.display ('alice', 'example.com', None) >>> alice = parse_address('Alice The Great <sip:alice@example.com>') >>> alice.user, alice.host, alice.display ('alice', 'example.com', 'Alice The Great') """ m = _re_address.match(s) if not m: raise ValueError('Cannot parse message/cpim address: %r' % s) display, uri = m.groups() if display: display = display.strip().strip('"') uri = SIPAddress.parse(uri) return SIPURI(user=uri.username, host=uri.domain, display=display)
c477aabaf91fdf998b4b0fa53512b62ef670f3c7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/c477aabaf91fdf998b4b0fa53512b62ef670f3c7/cpim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 4057, 381, 67, 2867, 12, 87, 16, 805, 67, 4308, 33, 7036, 4672, 3536, 4080, 524, 1812, 273, 1109, 67, 2867, 2668, 32, 28477, 30, 287, 1812, 36, 8236, 18, 832, 1870, 13, 408...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 4057, 381, 67, 2867, 12, 87, 16, 805, 67, 4308, 33, 7036, 4672, 3536, 4080, 524, 1812, 273, 1109, 67, 2867, 2668, 32, 28477, 30, 287, 1812, 36, 8236, 18, 832, 1870, 13, 408...
if config.is_multisite(): sidebar_snapins["sitestatus"] = { "title" : "Site status", "render" : render_sitestatus, "allowed" : [ "user", "admin" ], "styles" : """
sidebar_snapins["sitestatus"] = { "title" : "Site status", "render" : render_sitestatus, "allowed" : [ "user", "admin" ], "styles" : """
def render_sitestatus(): if config.is_multisite(): html.write("<table cellspacing=0 class=sitestate>") for sitename in config.allsites(): site = config.site(sitename) state = html.site_status[sitename]["state"] if state == "disabled": switch = "on" text = site["alias"] else: switch = "off" text = link(site["alias"], "view.py?view_name=sitehosts&site=%s" % sitename) html.write("<tr><td class=left>%s</td>" % text) onclick = "switch_site('%s', '_site_switch=%s:%s')" % (defaults.checkmk_web_uri, sitename, switch) html.write("<td class=\"state %s\">" % state) html.write("<a href=\"\" onclick=\"%s\">%s</a></td>" % (onclick, state[:3])) html.write("</tr>\n") html.write("</table>\n")
ca5c921249f35e6d2e7d33b2cf81bec529a3da80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5589/ca5c921249f35e6d2e7d33b2cf81bec529a3da80/shipped.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 25404, 395, 996, 13332, 309, 642, 18, 291, 67, 23978, 1137, 13332, 1729, 18, 2626, 2932, 32, 2121, 2484, 14080, 33, 20, 667, 33, 25404, 395, 340, 2984, 13, 364, 10982, 1069, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 25404, 395, 996, 13332, 309, 642, 18, 291, 67, 23978, 1137, 13332, 1729, 18, 2626, 2932, 32, 2121, 2484, 14080, 33, 20, 667, 33, 25404, 395, 340, 2984, 13, 364, 10982, 1069, ...
filename = unicode( int(time.time()) ) + fileExt
filename = unicodeC( int(time.time()) ) + fileExt
def getFilenameFromHTTP(info, url): u"""info is an http header from the download, url is the url to the downloaded file (responseObject.geturl() ). or not. the response object is not unicode, and we like unicode. So the original, unicode url may be passed.""" filename = None logStatusMsg(u"determining filename", 5) if 'content-disposition' in info and info['content-disposition'].count('filename='): logStatusMsg(u"filename from content-disposition header", 5) filename = info['content-disposition'][ info['content-disposition'].index('filename=') + 9:] # 10 = len(filename=") if filename.startswith("'") and filename.endswith("'"): filename = filename.strip("'") elif filename.startswith('"') and filename.endswith('"'): filename = filename.strip('"') if filename: return unicode( filename ) # trust filename from http header over our URL extraction technique logStatusMsg(u"filename from url", 5) filename = percentUnQuote( urlparse.urlparse( url )[2].split('/')[-1] ) # Tup[2] is the path try: typeGuess = info.gettype() except AttributeError: typeGuess = None typeGuess1 = mimetypes.guess_type(filename)[0] if typeGuess and typeGuess1 and typeGuess == typeGuess1: pass # we're good elif typeGuess: # trust server content-type over filename logStatusMsg(u"getting extension from content-type header", 5) fileExt = mimetypes.guess_extension(typeGuess) if fileExt: # sloppy filename guess, probably will never get hit if not filename: logStatusMsg(u"never guessed filename, just setting it to the time", 5) filename = unicode( int(time.time()) ) + fileExt else: filename += fileExt elif 'content_type' not in info: msg = u"Proper file extension could not be determined for the downloaded file: %s you may need to add an extension to the file for it to work in some programs. It came from url %s. It may be correct, but I have no way of knowing due to insufficient information from the server." % (filename, url) logStatusMsg( msg, 1 ) if not filename: logStatusMsg('Could not determine filename for torrent from %s' % url, 1) return None return unicode( filename )
15efa811c3a3c7e375db44557ec2cc39fdd58d98 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/15efa811c3a3c7e375db44557ec2cc39fdd58d98/rssdler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14632, 1265, 3693, 12, 1376, 16, 880, 4672, 582, 8395, 1376, 353, 392, 1062, 1446, 628, 326, 4224, 16, 880, 353, 326, 880, 358, 326, 13549, 585, 261, 2740, 921, 18, 588, 718, 1435, 262...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14632, 1265, 3693, 12, 1376, 16, 880, 4672, 582, 8395, 1376, 353, 392, 1062, 1446, 628, 326, 4224, 16, 880, 353, 326, 880, 358, 326, 13549, 585, 261, 2740, 921, 18, 588, 718, 1435, 262...
self.pool.get('stock.move').create(cr, uid, {
move = self.pool.get('stock.move').create(cr, uid, {
def action_picking_create(self,cr, uid, ids, *args): picking_id = False for order in self.browse(cr, uid, ids): loc_id = order.partner_id.property_stock_supplier.id istate = 'none' if order.invoice_method=='picking': istate = '2binvoiced' picking_id = self.pool.get('stock.picking').create(cr, uid, { 'origin': order.name+((order.origin and (':'+order.origin)) or ''), 'type': 'in', 'address_id': order.dest_address_id.id or order.partner_address_id.id, 'invoice_state': istate, 'purchase_id': order.id, }) for order_line in order.order_line: if not order_line.product_id: continue if order_line.product_id.product_tmpl_id.type in ('product', 'consu'): dest = order.location_id.id self.pool.get('stock.move').create(cr, uid, { 'name': 'PO:'+order_line.name, 'product_id': order_line.product_id.id, 'product_qty': order_line.product_qty, 'product_uos_qty': order_line.product_qty, 'product_uom': order_line.product_uom.id, 'product_uos': order_line.product_uom.id, 'date_planned': order_line.date_planned, 'location_id': loc_id, 'location_dest_id': dest, 'picking_id': picking_id, 'move_dest_id': order_line.move_dest_id.id, 'state': 'assigned', 'purchase_line_id': order_line.id, }) if order_line.move_dest_id: self.pool.get('stock.move').write(cr, uid, [order_line.move_dest_id.id], {'location_id':order.location_id.id}) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) return picking_id
b6c85958ef0264a818e98d118f4aff2ff744fa31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/b6c85958ef0264a818e98d118f4aff2ff744fa31/purchase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 11503, 310, 67, 2640, 12, 2890, 16, 3353, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 6002, 310, 67, 350, 273, 1083, 364, 1353, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 11503, 310, 67, 2640, 12, 2890, 16, 3353, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 6002, 310, 67, 350, 273, 1083, 364, 1353, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 32...
msg = "Could not take job %s out from the TQ %s: %s" % ( jobId, tqId, retVal[ 'Message' ] ) self.log.error( msg ) return S_ERROR( msg )
msgFix = "Could not take job" msgVar = " %s out from the TQ %s: %s" % ( jobId, tqId, retVal[ 'Message' ] ) self.log.error( msgFix, msgVar ) return S_ERROR( msgFix + msgVar )
def matchAndGetJob( self, tqMatchDict, numJobsPerTry = 10, numQueuesPerTry = 10 ): """ Match a job """ #Make a copy to avoid modification of original if escaping needs to be done tqMatchDict = dict( tqMatchDict ) self.log.info( "Starting match for requirements", self.__strDict( tqMatchDict ) ) retVal = self._checkMatchDefinition( tqMatchDict ) if not retVal[ 'OK' ]: self.log.error( "TQ match request check failed", retVal[ 'Message' ] ) return retVal retVal = self._getConnection() if not retVal[ 'OK' ]: return S_ERROR( "Can't connect to DB: %s" % retVal[ 'Message' ] ) connObj = retVal[ 'Value' ] preJobSQL = "SELECT `tq_Jobs`.JobId, `tq_Jobs`.TQId FROM `tq_Jobs` WHERE `tq_Jobs`.TQId = %s AND `tq_Jobs`.Priority = %s" prioSQL = "SELECT `tq_Jobs`.Priority FROM `tq_Jobs` WHERE `tq_Jobs`.TQId = %s ORDER BY RAND() / `tq_Jobs`.RealPriority ASC LIMIT 1" postJobSQL = " ORDER BY `tq_Jobs`.JobId ASC LIMIT %s" % numJobsPerTry for matchTry in range( self.__maxMatchRetry ): if 'JobID' in tqMatchDict: # A certain JobID is required by the resource, so all TQ are to be considered retVal = self.matchAndGetTaskQueue( tqMatchDict, numQueuesToGet = 0, skipMatchDictDef = True, connObj = connObj ) preJobSQL = "%s AND `tq_Jobs`.JobId = %s " % ( preJobSQL, tqMatchDict['JobID'] ) else: retVal = self.matchAndGetTaskQueue( tqMatchDict, numQueuesToGet = numQueuesPerTry, skipMatchDictDef = True, connObj = connObj ) if not retVal[ 'OK' ]: return retVal tqList = retVal[ 'Value' ] if len( tqList ) == 0: self.log.info( "No TQ matches requirements" ) return S_OK( { 'matchFound' : False, 'tqMatch' : tqMatchDict } ) for tqId, tqOwnerDN, tqOwnerGroup in tqList: self.log.info( "Trying to extract jobs from TQ %s" % tqId ) retVal = self._query( prioSQL % tqId, conn = connObj ) if not retVal[ 'OK' ]: return S_ERROR( "Can't retrieve winning priority for matching job: %s" % retVal[ 'Message' ] ) if len( retVal[ 'Value' ] ) == 0: continue prio = retVal[ 'Value' ][0][0] retVal = self._query( "%s %s" % ( preJobSQL % ( tqId, prio ), postJobSQL ), conn = connObj ) if not retVal[ 'OK' ]: return S_ERROR( "Can't begin transaction for matching job: %s" % retVal[ 'Message' ] ) jobTQList = [ ( row[0], row[1] ) for row in retVal[ 'Value' ] ] if len( jobTQList ) == 0: gLogger.info( "Task queue %s seems to be empty, triggering a cleaning" % tqId ) result = self.deleteTaskQueueIfEmpty( tqId, tqOwnerDN, tqOwnerGroup, connObj = connObj ) if not result[ 'OK' ]: return result while len( jobTQList ) > 0: jobId, tqId = jobTQList.pop( random.randint( 0, len( jobTQList ) - 1 ) ) self.log.info( "Trying to extract job %s from TQ %s" % ( jobId, tqId ) ) retVal = self.deleteJob( jobId, connObj = connObj ) if not retVal[ 'OK' ]: msg = "Could not take job %s out from the TQ %s: %s" % ( jobId, tqId, retVal[ 'Message' ] ) self.log.error( msg ) return S_ERROR( msg ) if retVal[ 'Value' ] == True : self.log.info( "Extracted job %s with prio %s from TQ %s" % ( jobId, prio, tqId ) ) return S_OK( { 'matchFound' : True, 'jobId' : jobId, 'taskQueueId' : tqId, 'tqMatch' : tqMatchDict } ) self.log.info( "No jobs could be extracted from TQ %s" % tqId ) self.log.info( "Could not find a match after %s match retries" % self.__maxMatchRetry ) return S_ERROR( "Could not find a match after %s match retries" % self.__maxMatchRetry )
9e00d2a2886856e0c2d6ca1976321b73d326eab5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/9e00d2a2886856e0c2d6ca1976321b73d326eab5/TaskQueueDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 845, 14042, 2278, 12, 365, 16, 20061, 2060, 5014, 16, 818, 7276, 2173, 7833, 273, 1728, 16, 818, 17428, 2173, 7833, 273, 1728, 262, 30, 3536, 4639, 279, 1719, 3536, 468, 6464, 279, 1610,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 845, 14042, 2278, 12, 365, 16, 20061, 2060, 5014, 16, 818, 7276, 2173, 7833, 273, 1728, 16, 818, 17428, 2173, 7833, 273, 1728, 262, 30, 3536, 4639, 279, 1719, 3536, 468, 6464, 279, 1610,...
out_file = hdrfields[2]
out_file = hdrfields[2].rstrip()
def decode(in_file, out_file=None, mode=None): """Decode uuencoded file""" # # Open the input file, if needed. # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): in_file = open(in_file) # # Read until a begin is encountered or we've exhausted the file # while 1: hdr = in_file.readline() if not hdr: raise Error, 'No valid begin line found in input file' if hdr[:5] != 'begin': continue hdrfields = string.split(hdr) if len(hdrfields) == 3 and hdrfields[0] == 'begin': try: string.atoi(hdrfields[1], 8) break except ValueError: pass if out_file is None: out_file = hdrfields[2] if mode is None: mode = string.atoi(hdrfields[1], 8) # # Open the output file # if out_file == '-': out_file = sys.stdout elif type(out_file) == type(''): fp = open(out_file, 'wb') try: os.path.chmod(out_file, mode) except AttributeError: pass out_file = fp # # Main decoding loop # s = in_file.readline() while s and s != 'end\n': try: data = binascii.a2b_uu(s) except binascii.Error, v: # Workaround for broken uuencoders by /Fredrik Lundh nbytes = (((ord(s[0])-32) & 63) * 4 + 5) / 3 data = binascii.a2b_uu(s[:nbytes]) sys.stderr.write("Warning: %s\n" % str(v)) out_file.write(data) s = in_file.readline() if not str: raise Error, 'Truncated input file'
4854f0c2f4e33de75abe191cdd1ee3fb86f6782c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4854f0c2f4e33de75abe191cdd1ee3fb86f6782c/uu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 12, 267, 67, 768, 16, 596, 67, 768, 33, 7036, 16, 1965, 33, 7036, 4672, 3536, 6615, 582, 89, 10787, 585, 8395, 468, 468, 3502, 326, 810, 585, 16, 309, 3577, 18, 468, 309, 316, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 12, 267, 67, 768, 16, 596, 67, 768, 33, 7036, 16, 1965, 33, 7036, 4672, 3536, 6615, 582, 89, 10787, 585, 8395, 468, 468, 3502, 326, 810, 585, 16, 309, 3577, 18, 468, 309, 316, ...
if os.exists("%s/%s/oblogout/%s.svg" % (self.img_path, self.button_theme, name)):
if os.path.exists("%s/%s/oblogout/%s.svg" % (self.img_path, self.button_theme, name)):
def add_button(self, name, widget): """ Add a button to the panel """ box = gtk.VBox()
e41a8fc191ef3090906f9c078bd47be677dfa13d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11198/e41a8fc191ef3090906f9c078bd47be677dfa13d/oblogout.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 5391, 12, 2890, 16, 508, 16, 3604, 4672, 3536, 1436, 279, 3568, 358, 326, 6594, 3536, 225, 3919, 273, 22718, 18, 58, 3514, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 5391, 12, 2890, 16, 508, 16, 3604, 4672, 3536, 1436, 279, 3568, 358, 326, 6594, 3536, 225, 3919, 273, 22718, 18, 58, 3514, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -...
nxt = ' ' * (len(key) - 2) + ': '
nxt = ' ' * (utf8_width(key) - 2) + ': '
def _importplugins(self, types): '''Load plugins matching the given types. '''
713b04ee43f6d718014846e1fbe82556a904c4d1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5445/713b04ee43f6d718014846e1fbe82556a904c4d1/plugins.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5666, 8057, 12, 2890, 16, 1953, 4672, 9163, 2563, 4799, 3607, 326, 864, 1953, 18, 9163, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5666, 8057, 12, 2890, 16, 1953, 4672, 9163, 2563, 4799, 3607, 326, 864, 1953, 18, 9163, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def __rmul__(self,other):
def __mul__(self,other):
def __rmul__(self,other): """ Implements scalar multiplication (on the right).
b5d444db2992a10837c0e2ccaebfd79325c6361e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/b5d444db2992a10837c0e2ccaebfd79325c6361e/dft.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 16411, 972, 12, 2890, 16, 3011, 4672, 3536, 29704, 4981, 23066, 261, 265, 326, 2145, 2934, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 16411, 972, 12, 2890, 16, 3011, 4672, 3536, 29704, 4981, 23066, 261, 265, 326, 2145, 2934, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
builder.clean(cadDir, True) os.rmdir(cadDir)
def main(): shortargs = 'ho:i:s:t:v:p' longargs = ['help', 'outdir=', 'iconfile=', 'sourcedir=', 'tag=', 'version=', 'premature-exit'] try: opts, args = getopt.getopt(sys.argv[1:], shortargs, longargs) except getopt.GetoptError: usage() sys.exit(2) currentDir = os.getcwd() appName = "nanoENGINEER-1" rootDir = None if sys.platform == 'win32': iconFile = os.path.join(currentDir, 'nanorex_48x.ico') elif sys.platform == 'darwin': iconFile = os.path.join(currentDir, 'nanorex.icns') else: iconFile = None status = None cvsTag = None sourceDirectory = None specialVersion = None for o, a in opts: if o in ("-o", "--outdir"): rootDir = os.path.join(currentDir, a) elif o in ("-i", "--iconfile"): iconFile = os.path.join(currentDir, a) elif o in ("-t", "--tag"): cvsTag = a elif o in ("-s", "--sourcedir"): sourceDirectory = a elif o in ("-v", "--version"): specialVersion = a elif o in ("-p", "--premature-exit"): global prematureExit prematureExit = True elif o in ("-h", "--help"): usage() sys.exit() # Get the version information by checking out only the # version.py file like this: # # cvs -Q -z9 checkout cad/src/version.py # # Mark 051117 sp = sys.path cadDir = os.path.join(os.getcwd(), "cad") if sourceDirectory: system("rm -rf " + cadDir) system("cp -r %s %s" % (os.path.join(sourceDirectory, "cad"), cadDir)) elif cvsTag: system("cvs -Q -z9 checkout -r %s cad/src/version.py" % cvsTag) else: system("cvs -Q -z9 checkout cad/src/version.py") sys.path.append(os.path.join(cadDir, "src")) from version import Version global VERSION, PMMT VERSION = Version() PMMT = VERSION.product + "-" if specialVersion != None: PMMT += specialVersion elif hasattr(VERSION, "tiny"): PMMT += "%d.%d.%d" % (VERSION.major, VERSION.minor, VERSION.tiny) else: PMMT += "%d.%d" % (VERSION.major, VERSION.minor) sys.path = sp #answer = "maybe" #while answer not in ['yes', 'no']: # answer = raw_input(("\nThis will create the installation package for %s? " + # "\nDo you want to continue (yes or no): ") % PMMT) # if answer == 'no': # sys.exit() if not rootDir: rootDir = os.path.join(currentDir, PMMT) if os.path.isdir(rootDir): answer = "maybe" while answer not in ['yes', 'no']: answer = raw_input(("Do you want to use the existing directory %s? " + "All its contents will be erased (yes or no): ") % rootDir) if answer == 'no': sys.exit() relNo = "" if hasattr(VERSION, "tiny"): relNo = "%d" % VERSION.tiny builder = NanoBuild(appName, iconFile, rootDir, "%d.%d" % (VERSION.major, VERSION.minor), relNo, VERSION.releaseType, cvsTag) builder.sourceDirectory = sourceDirectory builder.clean(cadDir, True) os.rmdir(cadDir) builder.build() # The clean() method chokes on the symbolic link that I needed to use for the partlib # on the Mac. It was already broken on Linux, possibly for the same reason. So only # do cleanup on Windows. if sys.platform == "win32": builder.clean(rootDir) if os.path.isdir(rootDir) and not os.listdir(rootDir): os.rmdir(rootDir)
99748c3f7e39561ff8e1a74226ae9ea51ac96fff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/99748c3f7e39561ff8e1a74226ae9ea51ac96fff/autoBuild.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3025, 1968, 273, 296, 15008, 30, 77, 30, 87, 30, 88, 30, 90, 30, 84, 11, 1525, 1968, 273, 10228, 5201, 2187, 296, 659, 1214, 33, 2187, 296, 3950, 768, 33, 2187, 296, 316...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3025, 1968, 273, 296, 15008, 30, 77, 30, 87, 30, 88, 30, 90, 30, 84, 11, 1525, 1968, 273, 10228, 5201, 2187, 296, 659, 1214, 33, 2187, 296, 3950, 768, 33, 2187, 296, 316...
"raw","RGBA",0,1)
"raw","BGRA",0,1)
def flush(self): """temporary interface, must be splitted to different methods, (elif self.imageType == "png":)""" if self.fileName and self.imageType=='png': self.surface.write_to_png(self.fileName) elif self.image is not None: self.image.fromstring(self.surface.get_data(), "raw","RGBA",0,1) self.surface.finish() elif self.imageType == "png": buffer=self.surface.get_data() return buffer
249425c5a9928a4e43d7697689bf3b23c58b179b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9195/249425c5a9928a4e43d7697689bf3b23c58b179b/cairoCanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 3536, 31143, 1560, 16, 1297, 506, 17687, 358, 3775, 2590, 16, 261, 292, 430, 365, 18, 2730, 559, 422, 315, 6446, 6877, 15574, 309, 365, 18, 17812, 471, 365, 18, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 3536, 31143, 1560, 16, 1297, 506, 17687, 358, 3775, 2590, 16, 261, 292, 430, 365, 18, 2730, 559, 422, 315, 6446, 6877, 15574, 309, 365, 18, 17812, 471, 365, 18, 2...
if path == mysplit[1]:
if pathcompare(path,mysplit[1]):
def ismount(path): "enhanced to handle bind mounts" if os.path.ismount(path): return 1 a=open("/proc/mounts","r") mylines=a.readlines() a.close() for line in mylines: mysplit=line.split() if path == mysplit[1]: return 1 return 0
68311bda7d1987a6704359e5eb002cb5d3b0919f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/68311bda7d1987a6704359e5eb002cb5d3b0919f/catalyst_support.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 4778, 12, 803, 4672, 315, 275, 17221, 358, 1640, 1993, 19399, 6, 309, 1140, 18, 803, 18, 291, 4778, 12, 803, 4672, 327, 404, 279, 33, 3190, 2932, 19, 9381, 19, 4778, 87, 15937, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 4778, 12, 803, 4672, 315, 275, 17221, 358, 1640, 1993, 19399, 6, 309, 1140, 18, 803, 18, 291, 4778, 12, 803, 4672, 327, 404, 279, 33, 3190, 2932, 19, 9381, 19, 4778, 87, 15937, ...
def __init__(self, options, destination=None, destination_path=None): self.options = options """An option values object with "input_encoding" and "output_encoding"
def __init__(self, settings, destination=None, destination_path=None): self.settings = settings """A settings object with "input_encoding" and "output_encoding"
def __init__(self, options, destination=None, destination_path=None): self.options = options """An option values object with "input_encoding" and "output_encoding" attributes (typically a `docutils.optik.Values` object)."""
4dc05f6313b31ed168d03606d78b896f61e0699c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/4dc05f6313b31ed168d03606d78b896f61e0699c/io.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1947, 16, 2929, 33, 7036, 16, 2929, 67, 803, 33, 7036, 4672, 365, 18, 4272, 273, 1947, 3536, 37, 1947, 733, 598, 315, 2630, 67, 5999, 6, 471, 315, 2844...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1947, 16, 2929, 33, 7036, 16, 2929, 67, 803, 33, 7036, 4672, 365, 18, 4272, 273, 1947, 3536, 37, 1947, 733, 598, 315, 2630, 67, 5999, 6, 471, 315, 2844...
tlb = pythoncom.LoadRegTypeLib(tlb_guid, tlb_major, tlb_minor, lcid)
tlb = pythoncom.LoadRegTypeLib(tlb_guid, tlb_major, tlb_minor)
def _build_typeinfos_(self): # Can only ever be one for now. tlb_guid = getattr(self._obj_, '_typelib_guid_', None) if tlb_guid is None: return [] tlb_major, tlb_minor = getattr(self._obj_, '_typelib_version_', (1,0)) tlb = pythoncom.LoadRegTypeLib(tlb_guid, tlb_major, tlb_minor, lcid) typecomp = tlb.GetTypeComp() # Not 100% sure what semantics we should use for the default interface. # Look for the first name in _com_interfaces_ that exists in the typelib. for iname in self._obj_._com_interfaces_: try: type_info, type_comp = typecomp.BindType(iname) return [type_info] except pythoncom.com_error: pass return []
52f4ea219c63b1c69e766a93569e9b439c8f412f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/52f4ea219c63b1c69e766a93569e9b439c8f412f/policy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3510, 67, 723, 18227, 67, 12, 2890, 4672, 468, 4480, 1338, 14103, 506, 1245, 364, 2037, 18, 8332, 70, 67, 14066, 273, 3869, 12, 2890, 6315, 2603, 67, 16, 2070, 12846, 30575, 67, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3510, 67, 723, 18227, 67, 12, 2890, 4672, 468, 4480, 1338, 14103, 506, 1245, 364, 2037, 18, 8332, 70, 67, 14066, 273, 3869, 12, 2890, 6315, 2603, 67, 16, 2070, 12846, 30575, 67, 1...
gtk.gdk.threads_init()
gobject.threads_init()
def convertentity(m): if m.group(1)=='#': try: return chr(int(m.group(2))) except XValueError: return '&#%s;' % m.group(2) try: return htmlentitydefs.entitydefs[m.group(2)] except KeyError: return ('&%s;' % m.group(2)).decode('ISO-8859-1')
e7878e14d367496cfd8324e02f16bbdd1da9b79d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/e7878e14d367496cfd8324e02f16bbdd1da9b79d/traduisons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 1096, 12, 81, 4672, 309, 312, 18, 1655, 12, 21, 13, 18920, 7, 4278, 775, 30, 327, 4513, 12, 474, 12, 81, 18, 1655, 12, 22, 20349, 1335, 1139, 23610, 30, 327, 21312, 9, 87, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 1096, 12, 81, 4672, 309, 312, 18, 1655, 12, 21, 13, 18920, 7, 4278, 775, 30, 327, 4513, 12, 474, 12, 81, 18, 1655, 12, 22, 20349, 1335, 1139, 23610, 30, 327, 21312, 9, 87, 43...
summary = '&nbsp;<i>No Summary</i>'
summary = '&nbsp;<i>%s</i>' % _('No Summary')
def render_data(self, review_request): summary = conditional_escape(review_request.summary) if not summary: summary = '&nbsp;<i>No Summary</i>'
bff35e74cd9a1b9286aa3b81ecdbae04b2220433 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1600/bff35e74cd9a1b9286aa3b81ecdbae04b2220433/datagrids.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 892, 12, 2890, 16, 10725, 67, 2293, 4672, 4916, 273, 11139, 67, 6939, 12, 16041, 67, 2293, 18, 7687, 13, 309, 486, 4916, 30, 4916, 273, 5183, 10600, 31, 32, 77, 34, 2279, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 892, 12, 2890, 16, 10725, 67, 2293, 4672, 4916, 273, 11139, 67, 6939, 12, 16041, 67, 2293, 18, 7687, 13, 309, 486, 4916, 30, 4916, 273, 5183, 10600, 31, 32, 77, 34, 2279, 1...
return long(text)
return long(text or 0)
def parseLong(text): """ Long from string.
64031c9a62c8a5ff07e0f446226ed4bbe65dde70 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12196/64031c9a62c8a5ff07e0f446226ed4bbe65dde70/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16887, 12, 955, 4672, 3536, 3407, 628, 533, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16887, 12, 955, 4672, 3536, 3407, 628, 533, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self.assertEqual(a.next(), 0) self.assertEqual(a.next(), 1)
for i in xrange(100): self.assertEqual(a.next(), i)
def irange(n): for i in xrange(n): yield i
ad983e79d6f215235d205245c2599620e33cf719 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ad983e79d6f215235d205245c2599620e33cf719/test_itertools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 277, 3676, 12, 82, 4672, 364, 277, 316, 12314, 12, 82, 4672, 2824, 277, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 277, 3676, 12, 82, 4672, 364, 277, 316, 12314, 12, 82, 4672, 2824, 277, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
by the initial conditions $L^{(1)}_1=0$, $L^{(1)}_2=1$ and the recurrence relation $L^{(1)}_{n+2} = P*L^{(1)}_{n+1} - Q*L^{(1)}_n$.
by the initial conditions $L^{(1)}_1=0$, $L^{(1)}_2=1$ and the recurrence relation $L^{(1)}_{n+2} = P*L^{(1)}_{n+1} - Q*L^{(1)}_n$.
def lucas_number1(n,P,Q): """ Returns then n-th Lucas number ``of the first kind'' (this is not standard terminology). The Lucas sequence $L^{(1)}_n$ is defined by the initial conditions $L^{(1)}_1=0$, $L^{(1)}_2=1$ and the recurrence relation $L^{(1)}_{n+2} = P*L^{(1)}_{n+1} - Q*L^{(1)}_n$. Wraps GAP's Lucas(...)[1]. P=1, Q=-1 fives the Fibonacci sequence. INPUT: n -- integer P, Q -- integer or rational numbers OUTPUT: integer or rational number EXAMPLES: sage: lucas_number1(5,1,-1) 5 sage: lucas_number1(6,1,-1) 8 sage: lucas_number1(7,1,-1) 13 sage: lucas_number1(7,1,-2) 43 sage: lucas_number1(5,2,3/5) 229/25 sage: lucas_number1(5,2,1.5) Traceback (most recent call last): ... TypeError: no canonical coercion from Real Field with 53 bits of precision to Rational Field There was a conjecture that the sequence $L_n$ defined by $L_{n+2} = L_{n+1} + L_n$, $L_1=1$, $L_2=3$, has the property that $n$ prime implies that $L_n$ is prime. sage: lucas = lambda n:(5/2)*lucas_number1(n,1,-1)+(1/2)*lucas_number2(n,1,-1) sage: [[lucas(n),is_prime(lucas(n)),n+1,is_prime(n+1)] for n in range(15)] [[1, False, 1, False], [3, True, 2, True], [4, False, 3, True], [7, True, 4, False], [11, True, 5, True], [18, False, 6, False], [29, True, 7, True], [47, True, 8, False], [76, False, 9, False], [123, False, 10, False], [199, True, 11, True], [322, False, 12, False], [521, True, 13, True], [843, False, 14, False], [1364, False, 15, False]] Can you use SAGE to find a counterexample to the conjecture? """ ans=gap.eval("Lucas(%s,%s,%s)[1]"%(QQ._coerce_(P),QQ._coerce_(Q),ZZ(n))) return sage_eval(ans)
124156ba54f96d76a32e2d36a03086ee3fd0aea4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/124156ba54f96d76a32e2d36a03086ee3fd0aea4/combinat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 5286, 345, 67, 2696, 21, 12, 82, 16, 52, 16, 53, 4672, 3536, 2860, 1508, 290, 17, 451, 511, 5286, 345, 1300, 12176, 792, 326, 1122, 3846, 6309, 261, 2211, 353, 486, 4529, 16122, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 5286, 345, 67, 2696, 21, 12, 82, 16, 52, 16, 53, 4672, 3536, 2860, 1508, 290, 17, 451, 511, 5286, 345, 1300, 12176, 792, 326, 1122, 3846, 6309, 261, 2211, 353, 486, 4529, 16122, ...
return (pkg_name, affected, binaries, undo)
return (pkg_name, suite, affected, undo)
def doop_source(self, pkg):
0ef270283d494acfb65d58fb8123811e47c21a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/0ef270283d494acfb65d58fb8123811e47c21a74/britney.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 556, 67, 3168, 12, 2890, 16, 3475, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 556, 67, 3168, 12, 2890, 16, 3475, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers):
def _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers, extra_headers):
def _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers): """URL, filename, or string --> stream This function lets you define parsers that take any input source (URL, pathname to local or network file, or actual data as a string) and deal with it in a uniform manner. Returned object is guaranteed to have all the basic stdio read methods (read, readline, readlines). Just .close() the object when you're done with it. If the etag argument is supplied, it will be used as the value of an If-None-Match request header. If the modified argument is supplied, it must be a tuple of 9 integers as returned by gmtime() in the standard Python time module. This MUST be in GMT (Greenwich Mean Time). The formatted date/time will be used as the value of an If-Modified-Since request header. If the agent argument is supplied, it will be used as the value of a User-Agent request header. If the referrer argument is supplied, it will be used as the value of a Referer[sic] request header. If handlers is supplied, it is a list of handlers used to build a urllib2 opener. """ if hasattr(url_file_stream_or_string, 'read'): return url_file_stream_or_string if url_file_stream_or_string == '-': return sys.stdin if urlparse.urlparse(url_file_stream_or_string)[0] in ('http', 'https', 'ftp'): if not agent: agent = USER_AGENT # test for inline user:password for basic auth auth = None if base64: urltype, rest = urllib.splittype(url_file_stream_or_string) realhost, rest = urllib.splithost(rest) if realhost: user_passwd, realhost = urllib.splituser(realhost) if user_passwd: url_file_stream_or_string = '%s://%s%s' % (urltype, realhost, rest) auth = base64.encodestring(user_passwd).strip() # try to open with urllib2 (to use optional headers) request = urllib2.Request(url_file_stream_or_string) request.add_header('User-Agent', agent) if etag: request.add_header('If-None-Match', etag) if modified: # format into an RFC 1123-compliant timestamp. We can't use # time.strftime() since the %a and %b directives can be affected # by the current locale, but RFC 2616 states that dates must be # in English. short_weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] request.add_header('If-Modified-Since', '%s, %02d %s %04d %02d:%02d:%02d GMT' % (short_weekdays[modified[6]], modified[2], months[modified[1] - 1], modified[0], modified[3], modified[4], modified[5])) if referrer: request.add_header('Referer', referrer) if gzip and zlib: request.add_header('Accept-encoding', 'gzip, deflate') elif gzip: request.add_header('Accept-encoding', 'gzip') elif zlib: request.add_header('Accept-encoding', 'deflate') else: request.add_header('Accept-encoding', '') if auth: request.add_header('Authorization', 'Basic %s' % auth) if ACCEPT_HEADER: request.add_header('Accept', ACCEPT_HEADER) request.add_header('A-IM', 'feed') # RFC 3229 support opener = apply(urllib2.build_opener, tuple([_FeedURLHandler()] + handlers)) opener.addheaders = [] # RMK - must clear so we only send our custom User-Agent try: return opener.open(request) finally: opener.close() # JohnD # try to open with native open function (if url_file_stream_or_string is a filename) try: return open(url_file_stream_or_string) except: pass # treat url_file_stream_or_string as string return _StringIO(str(url_file_stream_or_string))
44482af2baebba8741223b8967e4efeaf8365c45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/44482af2baebba8741223b8967e4efeaf8365c45/feedparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3190, 67, 3146, 12, 718, 67, 768, 67, 3256, 67, 280, 67, 1080, 16, 13655, 16, 4358, 16, 4040, 16, 14502, 16, 4919, 16, 2870, 67, 2485, 4672, 3536, 1785, 16, 1544, 16, 578, 533, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3190, 67, 3146, 12, 718, 67, 768, 67, 3256, 67, 280, 67, 1080, 16, 13655, 16, 4358, 16, 4040, 16, 14502, 16, 4919, 16, 2870, 67, 2485, 4672, 3536, 1785, 16, 1544, 16, 578, 533, ...
file = open(filename,'r')
file = open(filename,'rb')
def __init__(self,filename):
e540accaab4c4ae206ff5b196392192c09ac38ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8973/e540accaab4c4ae206ff5b196392192c09ac38ae/Bruker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3459, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3459, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
for indirection in self._indirections:
for indirection in indirections:
def getContainer(self): # try to get a handle on the container by eval'ing and looking things # up in dictionaries, depending on the type of each indirection #import pdb;pdb.set_trace() evalStr = '' curObj = None # make sure the indirections don't go away on us for indirection in self._indirections: indirection.acquire() for indirection in self._indirections: yield None if not indirection.isDictKey(): # build up a string to be eval'd evalStr += indirection.getString() else: curObj = self._evalWithObj(evalStr, curObj) if curObj is None: raise FailedEval(evalStr) # try to look up this key in the curObj dictionary curObj = indirection.dereferenceDictKey(curObj) evalStr = '' for indirection in self._indirections: yield None indirection.release()
ee3d5337d51fd18347c409aee4acbcf050d63209 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/ee3d5337d51fd18347c409aee4acbcf050d63209/ContainerLeakDetector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9272, 12, 2890, 4672, 468, 775, 358, 336, 279, 1640, 603, 326, 1478, 635, 5302, 11, 310, 471, 7849, 9198, 468, 731, 316, 16176, 16, 8353, 603, 326, 618, 434, 1517, 1547, 2769, 468, 566...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9272, 12, 2890, 4672, 468, 775, 358, 336, 279, 1640, 603, 326, 1478, 635, 5302, 11, 310, 471, 7849, 9198, 468, 731, 316, 16176, 16, 8353, 603, 326, 618, 434, 1517, 1547, 2769, 468, 566...
self.zip_filename = make_zip(output=self.options.keep_zip, options=self.options, env=env, status=self.status)
self.zip_filename = make_zip(output=self.options.keep_zip, options=self.options, metabook=env.metabook, status=self.status)
def get_environment(self): from mwlib.status import Status from mwlib import zipwiki, nuwiki env = self.parser.makewiki() if ((isinstance(env.wiki, zipwiki.Wiki) and isinstance(env.images, zipwiki.ImageDB)) or isinstance(env.wiki, (nuwiki.NuWiki, nuwiki.adapt)) or isinstance(env, wiki.MultiEnvironment)): self.status = Status(self.options.status_file, progress_range=(0, 100)) return env
dbb6995aadb4c1dcc990a319da6891f8fd7c69c0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/dbb6995aadb4c1dcc990a319da6891f8fd7c69c0/render.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 10274, 12, 2890, 4672, 628, 14721, 2941, 18, 2327, 1930, 2685, 628, 14721, 2941, 1930, 3144, 13044, 16, 9244, 13044, 225, 1550, 273, 365, 18, 4288, 18, 81, 581, 359, 6169, 1435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 10274, 12, 2890, 4672, 628, 14721, 2941, 18, 2327, 1930, 2685, 628, 14721, 2941, 1930, 3144, 13044, 16, 9244, 13044, 225, 1550, 273, 365, 18, 4288, 18, 81, 581, 359, 6169, 1435,...
self.assertEquals(os.path.realpath(os.path.join(base, 'thisdir.txt')),
self.assertEquals(os.path.join(base, 'thisdir.txt'),
def test_getpath(self): base = os.path.dirname(self.filename) config = self._read() config.set('a', 'path_a', os.path.join(base, 'here', 'absolute.txt')) config.set('a', 'path_b', 'thisdir.txt') config.set('a', 'path_c', os.path.join(os.pardir, 'parentdir.txt'))
6c101510b9f590ed577fd60e4f78a52e24b77bd8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/6c101510b9f590ed577fd60e4f78a52e24b77bd8/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 803, 12, 2890, 4672, 1026, 273, 1140, 18, 803, 18, 12287, 12, 2890, 18, 3459, 13, 642, 273, 365, 6315, 896, 1435, 642, 18, 542, 2668, 69, 2187, 296, 803, 67, 69, 2187,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 803, 12, 2890, 4672, 1026, 273, 1140, 18, 803, 18, 12287, 12, 2890, 18, 3459, 13, 642, 273, 365, 6315, 896, 1435, 642, 18, 542, 2668, 69, 2187, 296, 803, 67, 69, 2187,...
self.VSpacerWidget.defaultHeight = defaultHeight self.parentWidget.vBoxLayout.addItem(self.VSpacerWidget)
self.verticalSpacer.defaultHeight = defaultHeight self.parentWidget.vBoxLayout.addItem(self.verticalSpacer)
def _addBottomSpacer(self): """ Add a vertical spacer below this groupbox <self>. Assume <self> is going to be the last groupbox in this PropMgr, so set its spacer's vertical sizePolicy to MinimumExpanding. We then set the vertical sizePolicy of the last groupbox's spacer to Fixed and set its height to pmGroupBoxSpacing. """ # Spacers are only added to groupboxes in the PropMgr, not # nested groupboxes. from PM_Dialog import PM_Dialog if not isinstance(self.parentWidget, PM_Dialog): self.VSpacerWidget = None return if self.parentWidget._lastGroupBox: # _lastGroupBox is no longer the last one. <self> will be the # _lastGroupBox, so we must change the VSpacerWidget height # and sizePolicy of _lastGroupBox to be a fixed # spacer between it and <self>. defaultHeight = pmGroupBoxSpacing self.parentWidget._lastGroupBox.VSpacerWidget.changeSize( 10, defaultHeight, QSizePolicy.Fixed, QSizePolicy.Fixed) self.parentWidget._lastGroupBox.VSpacerWidget.defaultHeight = defaultHeight # Add a 1 pixel high, MinimumExpanding VSpacer below this group box. # This keeps all group boxes in the PM layout squeezed together as # group boxes are expanded, collapsed, hidden and shown again. defaultHeight = 1 self.VSpacerWidget = QSpacerItem(10, defaultHeight, QSizePolicy.Fixed, QSizePolicy.MinimumExpanding) self.VSpacerWidget.defaultHeight = defaultHeight self.parentWidget.vBoxLayout.addItem(self.VSpacerWidget) # This groupbox is now the last one in the PropMgr. self.parentWidget._lastGroupBox = self
2c693e515c1d7f66b30f5a604a259df854e709ab /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/2c693e515c1d7f66b30f5a604a259df854e709ab/PM_GroupBox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 10393, 3389, 10598, 12, 2890, 4672, 3536, 1436, 279, 9768, 31896, 5712, 333, 1041, 2147, 411, 2890, 18652, 15983, 411, 2890, 34, 353, 8554, 358, 506, 326, 1142, 1041, 2147, 316,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 10393, 3389, 10598, 12, 2890, 4672, 3536, 1436, 279, 9768, 31896, 5712, 333, 1041, 2147, 411, 2890, 18652, 15983, 411, 2890, 34, 353, 8554, 358, 506, 326, 1142, 1041, 2147, 316,...
class FileHandler(logging.FileHandler):
class FileHandler(logging.StreamHandler): def __init__(self, filename, mode): logging.StreamHandler.__init__(self, utf_8.StreamWriter(file(filename, mode))) def close(self): self.flush() self.stream.close() logging.StreamHandler.close(self)
def exception(self, msg="", exc_info=True): """Log an exception at an appropriate levle. Normally, it will be logged at level "ERROR". However, certain exceptions which aren't considered errors (or aren't errors that we can fix) are expected and will therefore be logged at a lower level. """ import comtypes if exc_info is True: exc_info = sys.exc_info()
5895612f9644aa6202bfd32c78afd3035fdc5869 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/5895612f9644aa6202bfd32c78afd3035fdc5869/logHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1520, 12, 2890, 16, 1234, 1546, 3113, 3533, 67, 1376, 33, 5510, 4672, 3536, 1343, 392, 1520, 622, 392, 5505, 18565, 298, 18, 24773, 1230, 16, 518, 903, 506, 7545, 622, 1801, 315, 3589, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1520, 12, 2890, 16, 1234, 1546, 3113, 3533, 67, 1376, 33, 5510, 4672, 3536, 1343, 392, 1520, 622, 392, 5505, 18565, 298, 18, 24773, 1230, 16, 518, 903, 506, 7545, 622, 1801, 315, 3589, ...
if options.forking: server_class = ForkingHTTPServer else: server_class = StoppableHTTPServer server = server_class(('127.0.0.1', port), TestPageHandler)
server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler)
def main(options, args): # redirect output to a log file so it doesn't spam the unit test output logfile = open('testserver.log', 'w') sys.stderr = sys.stdout = logfile port = options.port # Try to free up the port if there's an orphaned old instance. TryKillingOldServer(port) if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified cert file not found: ' + options.cert + ' exiting...' return if options.forking: server_class = ForkingHTTPSServer else: server_class = HTTPSServer server = server_class(('127.0.0.1', port), TestPageHandler, options.cert) print 'HTTPS server started on port %d...' % port else: if options.forking: server_class = ForkingHTTPServer else: server_class = StoppableHTTPServer server = server_class(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url MakeDumpDir(server.data_dir) # means FTP Server else: my_data_dir = MakeDataDir() def line_logger(msg): if (msg.find("kill") >= 0): server.stop = True print 'shutting down server' sys.exit(0) # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer pyftpdlib.ftpserver.logline = line_logger # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) print 'FTP server started on port %d...' % port try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True
e70c6a8ce0d7a9e426c7247f5b771bed1b9eae4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/e70c6a8ce0d7a9e426c7247f5b771bed1b9eae4a/testserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 2116, 16, 833, 4672, 468, 3136, 876, 358, 279, 613, 585, 1427, 518, 3302, 1404, 24824, 326, 2836, 1842, 876, 15204, 273, 1696, 2668, 3813, 3567, 18, 1330, 2187, 296, 91, 6134, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 2116, 16, 833, 4672, 468, 3136, 876, 358, 279, 613, 585, 1427, 518, 3302, 1404, 24824, 326, 2836, 1842, 876, 15204, 273, 1696, 2668, 3813, 3567, 18, 1330, 2187, 296, 91, 6134, ...
if str(arg0.dtype).count('float')==1:
str_dtype = str(arg0.dtype) if str_dtype.count('float32')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('float64')==1:
def matrix(arg0=None, arg1=None, arg2=None, arg3=None, sparse=None): """ Create a matrix. INPUT: Supported formats 1. matrix([sparse=True]): the 0x0 matrix over ZZ 2. matrix(list_of_rows, [sparse=True]): matrix with each row constructed from the list_of_rows 3. matrix(nrows, entries, [sparse=True]): matrix with given number of rows and flat list of entries 4. matrix(nrows, ncols, entries, [sparse=True]): matrix with given number of rows and columns with flat list of entries 5. matrix(ring, list_of_row, [sparse=True]): matrix over ring with rows the elements of the list_of_rows 6. matrix(ring, nrows, entries, [sparse=True]): matrix over ring with given number of rows and entries from the flat list 7. matrix(ring, nrows, ncols, entries, [sparse=True]): matrix over the given ring with given number of rows and columns and entries. 8. matrix(numpy_array) The sparse option is optional, must be explicitly named (i.e., sparse=True), and may be either True or False. The entries can instead be a dictionary of key:value pairs of the form (i,j):x, where i,j are integers instead of a list. If sparse is not specified and the entries are a dictionary, it default to True. OUTPUT: a matrix EXAMPLES: 1. The degenerate matrix input format: sage: m = matrix(); m [] sage: parent(m) Full MatrixSpace of 0 by 0 dense matrices over Integer Ring sage: m = matrix(sparse=True); m [] sage: parent(m) Full MatrixSpace of 0 by 0 sparse matrices over Integer Ring 2. The "matrix(list_of_rows, [sparse])" input format. Notice that SAGE is careful to find a sensible common ring for all the entries (using the Sequence object): sage: x = polygen(QQ) sage: m = matrix([[1/3,2+x],[3,4]]); m [ 1/3 x + 2] [ 3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field sage: m = matrix([[1,2],[3,4/7]]); m [ 1 2] [ 3 4/7] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix([[1,2,3], [RDF(2), CDF(1,2), 3]]); m [ 1.0 2.0 3.0] [ 2.0 1.0 + 2.0*I 3.0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Complex Double Field sage: V = GF(7)^2 sage: m = matrix([V.0, V.0+2*V.1], sparse=True); m [1 0] [1 2] sage: parent(m) Full MatrixSpace of 2 by 2 sparse matrices over Finite Field of size 7 3. matrix(nrows, entries, [sparse]): sage: matrix(2,[1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The number of rows must divide the number of entries. sage: matrix(5,[1,2,3, 4,5,6]) Traceback (most recent call last): ... TypeError: entries has the wrong length 4. matrix(nrows, ncols, entries, [sparse]): sage: matrix(2,3, [1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3,2, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The length of the entry list must be the same as the number of rows times columns. sage: matrix(3,3, [1,2, 3/4, 5/6, 7*x, 8*x]) Traceback (most recent call last): ... TypeError: entries has the wrong length 5. matrix(ring, list_of_row, [sparse]): sage: m = matrix(QQ, [[1,2], [3,4]]); m [1 2] [3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix(GF(7), [[1/3,2/3,1/2], [3/4,4/5,7]]); m [5 3 4] [6 5 0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 7 6. matrix(ring, nrows, entries, [sparse]): sage: M = ZZ^4 sage: m = matrix(QQ, [M([1,2,3,4]), M([-1,0,3,4])]); m [ 1 2 3 4] [-1 0 3 4] sage: parent(m) Full MatrixSpace of 2 by 4 dense matrices over Rational Field 7. matrix(ring, nrows, ncols, entries, [sparse]) sage: matrix(QQ, 2, 2, [1,2,3,4]) [1 2] [3 4] sage: matrix(GF(5), 2, 3, range(6)) [0 1 2] [3 4 0] sage: matrix(ZZ, 10, 10, range(100)).parent() Full MatrixSpace of 10 by 10 dense matrices over Integer Ring sage: matrix(ZZ, 10, 10, range(100), sparse=True).parent() Full MatrixSpace of 10 by 10 sparse matrices over Integer Ring sage: R = PolynomialRing(QQ, 9, 'x') sage: A = matrix(R, 3, 3, R.gens()); A [x0 x1 x2] [x3 x4 x5] [x6 x7 x8] sage: det(A) -x2*x4*x6 + x1*x5*x6 + x2*x3*x7 - x0*x5*x7 - x1*x3*x8 + x0*x4*x8 CREATING SPARSE MATRICES FROM DICTS: sage: a = matrix({(1,2):10, (2,3):5/1}) sage: print a, a.parent() [ 0 0 0 0] [ 0 0 10 0] [ 0 0 0 5] Full MatrixSpace of 3 by 4 sparse matrices over Rational Field sage: a = matrix({(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] True sage: a = matrix(3,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(3,5,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, 5, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True 8. Creating a matrix from a numpy array Any numpy array with a datatype of float or complex may be passed to matrix If the data type is float the result will be a matrix over the real double field. complex numpy arrays will give matrices over the complex double field. The data of the numpy array must be contiguous, so slices of other matrices will raise an exception. sage: import numpy sage: n=numpy.array([[1,2],[3,4]],float) sage: m=matrix(n) sage: n=numpy.array([[numpy.complex(0,1),numpy.complex(0,2)],[3,4]],complex) sage: m=matrix(n) """ if hasattr(arg0, '_matrix_'): if arg1 is None: arg1 = rings.ZZ return arg0._matrix_(arg1) if hasattr(arg1, '_matrix_'): return arg1._matrix_(arg0) if arg0 is None: # 1. matrix([sparse]): # the 0x0 matrix over ZZ # the degenerate matrix ring = rings.ZZ nrows = 0 ncols = 0 entries = [] elif isinstance(arg0, (list, tuple)): # 2. matrix(list_of_rows, [sparse]): # matrix with each row constructed from the list_of_rows # list of rows if not (arg1 is None and arg2 is None and arg3 is None): raise TypeError, "invalid input" nrows = len(arg0) if nrows == 0: ncols = 0 else: ncols = len(arg0[0]) w = sum([list(v) for v in arg0], []) entries, ring = prepare(w) elif isinstance(arg0, dict): # 2. matrix(dict_of_rows, sparse=True): if sparse is None: sparse = True entries, ring = prepare_dict(arg0) nrows = nrows_from_dict(entries) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, [sparse]): # matrix with given number of rows and flat list of entries nrows = int(arg0) entries, ring = prepare(arg1) ncols = len(entries) // nrows elif not rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, sparse=True): # matrix with given number of rows and sparse dict of entries if sparse is None: sparse = True nrows = int(arg0) entries, ring = prepare_dict(arg1) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 4. matrix(nrows, ncols, entries, [sparse]): # matrix with given number of rows and columns with flat list of entries nrows = int(arg0) ncols = int(arg1) entries, ring = prepare(arg2) elif not rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 4. matrix(nrows, ncols, entries, sparse=True): # matrix with given number of rows and columns with flat list of entries if sparse is None: sparse = True nrows = int(arg0) ncols = int(arg1) entries, ring = prepare_dict(arg2) elif rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 5. matrix(ring, list_of_row, [sparse]): # matrix over ring with rows the elements of the list_of_rows ring = arg0 nrows = len(arg1) if nrows == 0: ncols = 0 else: try: ncols = len(arg1[0]) except TypeError: raise TypeError, "If making a matrix with the matrix(ring, list_of_row, [sparse]) constructor, the second input must be a list of rows." entries = sum([list(v) for v in arg1], []) elif rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 5. matrix(ring, dict, sparse=True): # matrix over ring with rows the elements the dict if sparse is None: sparse = True ring = arg0 entries = arg1 nrows = nrows_from_dict(entries) elif rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 6. matrix(ring, nrows, entries, [sparse]): # matrix over ring with given number of rows and entries from the flat list ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = len(entries) // nrows elif rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 6. matrix(ring, nrows, entries, sparse=True) # matrix over ring with given number of rows and entries from the dict if sparse is None: sparse = True ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = ncols_from_dict(entries) elif rings.is_Ring(arg0): # 7. matrix(ring, nrows, ncols, entries, [sparse]): # matrix over the given ring with given number of rows and columns and entries. ring = arg0 nrows = int(arg1) if arg2 is None: ncols = nrows else: ncols = int(arg2) entries = arg3 if isinstance(entries, dict): if sparse is None: sparse = True else: import numpy if isinstance(arg0,numpy.ndarray): if str(arg0.dtype).count('float')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() elif str(arg0.dtype).count('complex')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError, "unknown matrix constructor format. Type matrix? for help" if sparse is None: sparse = False return matrix_space.MatrixSpace(ring, nrows, ncols, sparse=sparse)(entries)
cfa30de3a8c77529a853866a5099789129b03b77 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/cfa30de3a8c77529a853866a5099789129b03b77/constructor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 12, 3175, 20, 33, 7036, 16, 1501, 21, 33, 7036, 16, 1501, 22, 33, 7036, 16, 1501, 23, 33, 7036, 16, 9387, 33, 7036, 4672, 3536, 1788, 279, 3148, 18, 225, 12943, 30, 19503, 6449...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 12, 3175, 20, 33, 7036, 16, 1501, 21, 33, 7036, 16, 1501, 22, 33, 7036, 16, 1501, 23, 33, 7036, 16, 9387, 33, 7036, 4672, 3536, 1788, 279, 3148, 18, 225, 12943, 30, 19503, 6449...
elif self.metadata['abacus'] == 'hex':
elif self.metadata['abacus'] == 'hexadecimal':
def __init__(self, handle): """ Initiate activity. """ super(AbacusActivity,self).__init__(handle)
4fc632b114344b600c8adc260b9babe0fbc715c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7608/4fc632b114344b600c8adc260b9babe0fbc715c2/AbacusActivity.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1640, 4672, 3536, 26615, 5728, 18, 3536, 2240, 12, 5895, 1077, 407, 6193, 16, 2890, 2934, 972, 2738, 972, 12, 4110, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1640, 4672, 3536, 26615, 5728, 18, 3536, 2240, 12, 5895, 1077, 407, 6193, 16, 2890, 2934, 972, 2738, 972, 12, 4110, 13, 2, -100, -100, -100, -100, -100, ...
for field_name in self._field_names: if not initial_dict.has_key(form_prefix + '-' + field_name): initial_dict[form_prefix + '-' + field_name] = getattr(self, field_name)
if not populating_from_form: for field_name in self._field_names: initial_dict[form_prefix + '-' + field_name] = getattr(self, field_name)
def get_field_by_name(name): for f in self._meta.fields: if f.name == name: return f return None
675eed5efd10a6155367266f93a9ed6e001338dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/675eed5efd10a6155367266f93a9ed6e001338dc/app_.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1518, 67, 1637, 67, 529, 12, 529, 4672, 364, 284, 316, 365, 6315, 3901, 18, 2821, 30, 309, 284, 18, 529, 422, 508, 30, 327, 284, 327, 599, 225, 2, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1518, 67, 1637, 67, 529, 12, 529, 4672, 364, 284, 316, 365, 6315, 3901, 18, 2821, 30, 309, 284, 18, 529, 422, 508, 30, 327, 284, 327, 599, 225, 2, -100, -100, -100, -100, ...
if sqlite_setup_debug:
if sqlite_setup_debug:
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')
36d3e6cad82fe428bb75746db0236ad4e54a1cca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/36d3e6cad82fe428bb75746db0236ad4e54a1cca/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 19, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 19, ...
'\xac\xfa\xfd\xc6\xa7\xe5\x16\x8f\xa2Q\xb8\xb7\xbe\xab'
"t\xb6\xc1'\x83\x17\xae\xc9ZO\x84V\x7fX"
def __call__(self, M, mode = "ECB"): r""" INPUT: - ``M`` - a StringMonoidElement - ``mode`` - ignored (default: 'ECB') EXAMPLES:: sage: FF = FiniteField(2) sage: P.<x> = PolynomialRing(FF) sage: LFSR = LFSRCryptosystem(FF) sage: IS_1 = [ FF(a) for a in [0,1,0,1,0,0,0] ] sage: e1 = LFSR((x^7 + x + 1,IS_1)) sage: IS_2 = [ FF(a) for a in [0,0,1,0,0,0,1,0,1] ] sage: e2 = LFSR((x^9 + x^3 + 1,IS_2)) sage: E = ShrinkingGeneratorCryptosystem() sage: e = E((e1,e2)) sage: B = BinaryStrings() sage: m = B.encoding("THECATINTHEHAT") sage: c = e(m) sage: c.decoding() '\xac\xfa\xfd\xc6\xa7\xe5\x16\x8f\xa2Q\xb8\xb7\xbe\xab' sage: e(e(m)) == m True sage: m.decoding() 'THECATINTHEHAT' """ B = self.domain() # = plaintext_space = ciphertext_space if not isinstance(M, StringMonoidElement) and M.parent() == B: raise TypeError, "Argument M (= %s) must be a string in the plaintext space." % M (e1, e2) = self.key() MStream = M._element_list g1 = e1.connection_polynomial() n1 = g1.degree() IS_1 = e1.initial_state() g2 = e2.connection_polynomial() n2 = g2.degree() IS_2 = e1.initial_state() k = 0 N = len(M) n = max(n1,n2) CStream = [] while k < N: r = max(N-k,2*n) KStream = lfsr_sequence(g1.list(), IS_1, r) DStream = lfsr_sequence(g2.list(), IS_2, r) for i in range(r-n): if DStream[i] != 0: CStream.append(int(MStream[k]+KStream[i])) k += 1 if k == N: break IS_1 = KStream[r-n-1:r-n+n1] IS_2 = KStream[r-n-1:r-n+n2] return B(CStream)
c08cd3169266d37baa13744a698641a2d3e74ca1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c08cd3169266d37baa13744a698641a2d3e74ca1/stream_cipher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 490, 16, 1965, 273, 315, 7228, 38, 6, 4672, 436, 8395, 12943, 30, 282, 300, 225, 12176, 49, 10335, 300, 279, 514, 11415, 839, 1046, 225, 300, 225, 12176,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 490, 16, 1965, 273, 315, 7228, 38, 6, 4672, 436, 8395, 12943, 30, 282, 300, 225, 12176, 49, 10335, 300, 279, 514, 11415, 839, 1046, 225, 300, 225, 12176,...
track_path = property(get_track_path)
track_path = property(get_track_path)
def ir_button(self, button): """Simulate IR Button Press""" self._request("button %s" % (button))
49f1d633b29ae28bcb28b899bb19396b31e101ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11405/49f1d633b29ae28bcb28b899bb19396b31e101ba/SqueezePlayer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9482, 67, 5391, 12, 2890, 16, 3568, 4672, 3536, 7993, 6243, 15908, 12569, 29806, 8395, 365, 6315, 2293, 2932, 5391, 738, 87, 6, 738, 261, 5391, 3719, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9482, 67, 5391, 12, 2890, 16, 3568, 4672, 3536, 7993, 6243, 15908, 12569, 29806, 8395, 365, 6315, 2293, 2932, 5391, 738, 87, 6, 738, 261, 5391, 3719, 2, -100, -100, -100, -100, -100, -10...
repos = property(fget=lambda self: self._getRepos())
repos = property(fget=lambda self: self._getRepos(), fset=lambda self, value: setattr(self, "_repos", value), fset=lambda self: delattr(self, "_repos"))
def _getGroups(self): """create the groups object that will store the comps metadata finds the repos with groups, gets their comps data and merge it into the group object""" if self._comps: return self._comps self.verbose_logger.debug('Getting group metadata') reposWithGroups = [] for repo in self.repos.listGroupsEnabled(): if repo.groups_added: # already added the groups from this repo reposWithGroups.append(repo) continue if not repo.ready(): raise Errors.RepoError, "Repository '%s' not yet setup" % repo try: groupremote = repo.getGroupLocation() except Errors.RepoMDError, e: pass else: reposWithGroups.append(repo) # now we know which repos actually have groups files. overwrite = self.conf.overwrite_groups self._comps = comps.Comps(overwrite_groups = overwrite)
e1d2f06ab3a5de4006ebffea34315ac5c5d6ec0b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5445/e1d2f06ab3a5de4006ebffea34315ac5c5d6ec0b/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 3621, 12, 2890, 4672, 3536, 2640, 326, 3252, 733, 716, 903, 1707, 326, 13979, 1982, 13094, 326, 13686, 598, 3252, 16, 5571, 3675, 13979, 501, 471, 2691, 518, 1368, 326, 1041, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 3621, 12, 2890, 4672, 3536, 2640, 326, 3252, 733, 716, 903, 1707, 326, 13979, 1982, 13094, 326, 13686, 598, 3252, 16, 5571, 3675, 13979, 501, 471, 2691, 518, 1368, 326, 1041, 7...
request.session['nav']={"blitz": blitz_host, "menu": "start", "view": "icon", "basket": 0, "experimenter":None, 'callback':dict()}
request.session['nav']={"error": None, "blitz": blitz_host, "menu": "start", "view": "icon", "basket": 0, "experimenter":None, 'callback':dict()}
def login(request): request.session.modified = True if request.REQUEST.get('server'): # upgrade check: # ------------- # On each startup OMERO.web checks for possible server upgrades # and logs the upgrade url at the WARNING level. If you would # like to disable the checks, change the following to # # if False: # # For more information, see # http://trac.openmicroscopy.org.uk/omero/wiki/UpgradeCheck # try: from omero.util.upgrade_check import UpgradeCheck check = UpgradeCheck("web") check.run() if check.isUpgradeNeeded(): logger.error("Upgrade is available. Please visit http://trac.openmicroscopy.org.uk/omero/wiki/MilestoneDownloads.\n") except Exception, x: logger.error("Upgrade check error: %s" % x) blitz = settings.SERVER_LIST.get(pk=request.REQUEST.get('server')) request.session['server'] = blitz.id request.session['host'] = blitz.host request.session['port'] = blitz.port request.session['username'] = request.REQUEST.get('username').encode('utf-8').strip() request.session['password'] = request.REQUEST.get('password').encode('utf-8').strip() request.session['ssl'] = (True, False)[request.REQUEST.get('ssl') is None] request.session['clipboard'] = {'images': None, 'datasets': None, 'plates': None} request.session['shares'] = dict() request.session['imageInBasket'] = set() blitz_host = "%s:%s" % (blitz.host, blitz.port) request.session['nav']={"blitz": blitz_host, "menu": "start", "view": "icon", "basket": 0, "experimenter":None, 'callback':dict()} error = request.REQUEST.get('error') conn = None try: conn = getBlitzConnection(request, useragent="OMERO.web") except Exception, x: error = x.__class__.__name__ if conn is not None: request.session['version'] = conn.getServerVersion() if request.REQUEST.get('noredirect'): return HttpResponse('OK') url = request.REQUEST.get("url") if url is not None: return HttpResponseRedirect(url) else: return HttpResponseRedirect(reverse("webindex")) else: if request.method == 'POST' and request.REQUEST.get('server'): if not _isServerOn(request.session.get('host'), request.session.get('port')): error = "Server is not responding, please contact administrator." elif not _checkVersion(request.session.get('host'), request.session.get('port')): error = "Client version does not match server, please contact administrator." else: error = "Connection not available, please check your user name and password." url = request.REQUEST.get("url") request.session['server'] = request.REQUEST.get('server') template = "webclient/login.html" if request.method == 'POST': form = LoginForm(data=request.REQUEST.copy()) else: blitz = settings.SERVER_LIST.get(pk=request.session.get('server')) if blitz is not None: initial = {'server': unicode(blitz.id)} try: if request.session.get('username'): initial['username'] = unicode(request.session.get('username')) form = LoginForm(data=initial) else: form = LoginForm(initial=initial) except: form = LoginForm(initial=initial) else: form = LoginForm() if url is not None: context = {"version": omero_version, 'url':url, 'error':error, 'form':form} else: context = {"version": omero_version, 'error':error, 'form':form} t = template_loader.get_template(template) c = Context(request, context) rsp = t.render(c) return HttpResponse(rsp)
7709cc0b7c3feac929c558577cf9ad6630ad7105 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/7709cc0b7c3feac929c558577cf9ad6630ad7105/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 2293, 4672, 590, 18, 3184, 18, 7342, 273, 1053, 225, 309, 590, 18, 5519, 18, 588, 2668, 3567, 11, 4672, 468, 8400, 866, 30, 468, 300, 7620, 468, 2755, 1517, 11850, 28839, 133...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 2293, 4672, 590, 18, 3184, 18, 7342, 273, 1053, 225, 309, 590, 18, 5519, 18, 588, 2668, 3567, 11, 4672, 468, 8400, 866, 30, 468, 300, 7620, 468, 2755, 1517, 11850, 28839, 133...
>>> t = Tester(globs={}, verbose=0, isprivate=lambda x,y: 0)
>>> t = Tester(globs={}, verbose=0)
... def bar(self):
71adf7e9d8fb2aca563eeca806ea127409c82bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71adf7e9d8fb2aca563eeca806ea127409c82bb6/doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 565, 1652, 4653, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 565, 1652, 4653, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
logging.error("Couldn't save hit", exc_info=1, extra={'hit': hit})
logger.error("Couldn't save hit", exc_info=1, extra={'hit': hit})
def emit(self, record): hit = Hit( session_key = record.session_key, user_agent = record.user_agent, device_id = record.device_id, ip_address = record.ip_address, referer = record.referer, full_path = record.full_path, requested = record.requested, response_time = record.response_time, local_name = record.local_name, view_name = record.view_name, status_code = record.status_code, redirect_to = record.redirect_to, traceback = getattr(record, 'traceback', None), ) try: hit.save() except Exception, e: # Likely there was some sort of database exception, so this really # isn't going to work. We'll log it in case anyone's interested. logging.error("Couldn't save hit", exc_info=1, extra={'hit': hit})
20be44293c802b7fdfacbde8fd53e07f5d166f80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/20be44293c802b7fdfacbde8fd53e07f5d166f80/logconfig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3626, 12, 2890, 16, 1409, 4672, 6800, 273, 670, 305, 12, 1339, 67, 856, 273, 1409, 18, 3184, 67, 856, 16, 729, 67, 5629, 273, 1409, 18, 1355, 67, 5629, 16, 2346, 67, 350, 273, 1409, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3626, 12, 2890, 16, 1409, 4672, 6800, 273, 670, 305, 12, 1339, 67, 856, 273, 1409, 18, 3184, 67, 856, 16, 729, 67, 5629, 273, 1409, 18, 1355, 67, 5629, 16, 2346, 67, 350, 273, 1409, ...
insert(output,(1-cond0)*(cond1==cond1), self.badvalue)
insert(output,(1-cond0)+(1-cond1)*(q!=0.0), self.badvalue)
def ppf(self,q,*args,**kwds): """Percent point function (inverse of cdf) at q of the given RV.
6db89fd66aa882d8bb85d064d95c26c6ce2fcc55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6db89fd66aa882d8bb85d064d95c26c6ce2fcc55/distributions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8228, 74, 12, 2890, 16, 85, 16, 14, 1968, 16, 636, 25577, 4672, 3536, 8410, 1634, 445, 261, 22552, 434, 23655, 13, 622, 1043, 434, 326, 864, 534, 58, 18, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8228, 74, 12, 2890, 16, 85, 16, 14, 1968, 16, 636, 25577, 4672, 3536, 8410, 1634, 445, 261, 22552, 434, 23655, 13, 622, 1043, 434, 326, 864, 534, 58, 18, 2, -100, -100, -100, -100, -...
self.list_win.resize(max_h, max_w) docstring = [] for paragraph in self.docstring.split('\n'): for line in textwrap.wrap(paragraph, max_w - 2): docstring.append('\n %s' % (line,)) docstring = docstring[:max_h]
docstring = self.format_docstring(self.docstring, max_w - 2)
def lsize(): wl = max(len(i) for i in v_items) + 1 if not wl: wl = 1 cols = ((max_w - 2) / wl) or 1 rows = len(v_items) / cols
45530450e8be1c5bbe96c698a7c28cf18212784a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/45530450e8be1c5bbe96c698a7c28cf18212784a/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 1467, 13332, 19564, 273, 943, 12, 1897, 12, 77, 13, 364, 277, 316, 331, 67, 3319, 13, 397, 404, 309, 486, 19564, 30, 19564, 273, 404, 5347, 273, 14015, 1896, 67, 91, 300, 576, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 1467, 13332, 19564, 273, 943, 12, 1897, 12, 77, 13, 364, 277, 316, 331, 67, 3319, 13, 397, 404, 309, 486, 19564, 30, 19564, 273, 404, 5347, 273, 14015, 1896, 67, 91, 300, 576, 1...
"""QueuePage
"""Constructs an HTML table of currently queued TLSMD jobs.
def html_queued_job_table(self, job_list): """QueuePage """ queued_list = [] for jdict in job_list: if jdict.get("state") == "queued": ## Populate queued list for XHTML table below queued_list.append(jdict)
ebe7911aaa6579796c3b771f64c91ad7ae981d9b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10674/ebe7911aaa6579796c3b771f64c91ad7ae981d9b/webtlsmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 67, 19499, 67, 4688, 67, 2121, 12, 2890, 16, 1719, 67, 1098, 4672, 3536, 13262, 392, 3982, 1014, 434, 4551, 12234, 8098, 6188, 6550, 18, 3536, 12234, 67, 1098, 273, 5378, 364, 525,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 67, 19499, 67, 4688, 67, 2121, 12, 2890, 16, 1719, 67, 1098, 4672, 3536, 13262, 392, 3982, 1014, 434, 4551, 12234, 8098, 6188, 6550, 18, 3536, 12234, 67, 1098, 273, 5378, 364, 525,...
str += self._navbar('index') + '<br/>\n'
str += self._navbar('index') + '<br>\n'
def _index_to_html(self): str = self._header('Index') str += self._navbar('index') + '<br/>\n' str += self._start_of('Index')
89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1615, 67, 869, 67, 2620, 12, 2890, 4672, 609, 273, 365, 6315, 3374, 2668, 1016, 6134, 609, 1011, 365, 6315, 11589, 3215, 2668, 1615, 6134, 397, 2368, 2848, 5333, 82, 11, 609, 1011, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1615, 67, 869, 67, 2620, 12, 2890, 4672, 609, 273, 365, 6315, 3374, 2668, 1016, 6134, 609, 1011, 365, 6315, 11589, 3215, 2668, 1615, 6134, 397, 2368, 2848, 5333, 82, 11, 609, 1011, ...
configCreator = self.importConfigurationLibrary()
process = self.importConfigurationLibrary()
def __call__(self): """ _operator()_
4f94ae9fd38060ba158b141dfa6fc533344c56e8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8887/4f94ae9fd38060ba158b141dfa6fc533344c56e8/RuntimeOfflineDQMSetup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 4672, 3536, 389, 9497, 1435, 67, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 4672, 3536, 389, 9497, 1435, 67, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...