rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
x/2
x//2
>>> def f(x):
2e82ad9791c9029bfa44ef39f6c4cd1b786cef51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2e82ad9791c9029bfa44ef39f6c4cd1b786cef51/test_doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 1652, 284, 12, 92, 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, 0, 0,...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 1652, 284, 12, 92, 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, -100, -100...
for sk in self.klasses.keys() :
for sk in self.klass_names:
def code_get(self): result = """##############################################################################
e82f68afdd17c1d97543c1c408c46b5624dc6d8e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/e82f68afdd17c1d97543c1c408c46b5624dc6d8e/codegen_openerp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 981, 67, 588, 12, 2890, 4672, 563, 273, 3536, 10140, 10140, 26487, 1189, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 981, 67, 588, 12, 2890, 4672, 563, 273, 3536, 10140, 10140, 26487, 1189, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if ((item.startTime > date) and (item.startTime < nextDate)):
if ((item.startTime >= date) and (item.startTime < nextDate)):
def getItemsByDate(self, date): # make this a generator? items = [] nextDate = date + DateTime.RelativeDateTime(days=1) for item in self.contents: if ((item.startTime > date) and (item.startTime < nextDate)): items.append(item) return items
15ce39cdb41c3381137a912f64690c4585848092 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/15ce39cdb41c3381137a912f64690c4585848092/CalendarCanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15515, 858, 1626, 12, 2890, 16, 1509, 4672, 468, 1221, 333, 279, 4456, 35, 1516, 273, 5378, 1024, 1626, 273, 1509, 397, 3716, 18, 8574, 5096, 12, 9810, 33, 21, 13, 364, 761, 316, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15515, 858, 1626, 12, 2890, 16, 1509, 4672, 468, 1221, 333, 279, 4456, 35, 1516, 273, 5378, 1024, 1626, 273, 1509, 397, 3716, 18, 8574, 5096, 12, 9810, 33, 21, 13, 364, 761, 316, 365, ...
kws.setdefault('alink', mm_cfg.WEB_LINK_COLOR)
kws.setdefault('link', mm_cfg.WEB_LINK_COLOR)
def Format(self, indent=0, **kws): charset = 'us-ascii' if self.language: charset = Utils.GetCharSet(self.language) output = ['Content-Type: text/html; charset=%s\n' % charset] if not self.suppress_head: kws.setdefault('bgcolor', self.bgcolor) tab = ' ' * indent output.extend([tab, '<HTML>', '<HEAD>' ]) if mm_cfg.IMAGE_LOGOS: output.append('<LINK REL="SHORTCUT ICON" HREF="%s">' % (mm_cfg.IMAGE_LOGOS + mm_cfg.SHORTCUT_ICON)) # Hit all the bases output.append('<META http-equiv="Content-Type" ' 'content="text/html; charset=%s">' % charset) if self.title: output.append('%s<TITLE>%s</TITLE>' % (tab, self.title)) output.append('%s</HEAD>' % tab) quals = [] # Default link colors if mm_cfg.WEB_VLINK_COLOR: kws.setdefault('vlink', mm_cfg.WEB_VLINK_COLOR) if mm_cfg.WEB_ALINK_COLOR: kws.setdefault('alink', mm_cfg.WEB_ALINK_COLOR) if mm_cfg.WEB_LINK_COLOR: kws.setdefault('alink', mm_cfg.WEB_LINK_COLOR) for k, v in kws.items(): quals.append('%s="%s"' % (k, v)) output.append('%s<BODY %s>' % (tab, SPACE.join(quals))) # Always do this... output.append(Container.Format(self, indent)) if not self.suppress_head: output.append('%s</BODY>' % tab) output.append('%s</HTML>' % tab) return NL.join(output)
88478c2fc7db7f672177a5ac34b4c93df3610053 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/88478c2fc7db7f672177a5ac34b4c93df3610053/htmlformat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4077, 12, 2890, 16, 3504, 33, 20, 16, 2826, 79, 4749, 4672, 4856, 273, 296, 407, 17, 9184, 11, 309, 365, 18, 4923, 30, 4856, 273, 6091, 18, 967, 2156, 694, 12, 2890, 18, 4923, 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, 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, 4077, 12, 2890, 16, 3504, 33, 20, 16, 2826, 79, 4749, 4672, 4856, 273, 296, 407, 17, 9184, 11, 309, 365, 18, 4923, 30, 4856, 273, 6091, 18, 967, 2156, 694, 12, 2890, 18, 4923, 13, ...
struct_learner = structlearn.StructLearner(k, ds, pivots,self.trainer, self.strategy)
struct_learner = structlearn.StructLearner(k, ds, pivots, self.trainer, self.strategy)
def train(self, m, phi, k):
dc3727562e8d4c62f2cfe32db7499221174847dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14494/dc3727562e8d4c62f2cfe32db7499221174847dc/clscl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4691, 12, 2890, 16, 312, 16, 7706, 16, 417, 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, 4691, 12, 2890, 16, 312, 16, 7706, 16, 417, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
ev = MidiEvent(PROG, 0, 0, 0, 41)
ev = MidiEvent(PROG, 1, 1, 0, 41)
def testDataOffset(self): config(data_offset = 1) p = Channel(6) ev = MidiEvent(PROG, 0, 0, 0, 41) assert ev.channel_ == 0 assert ev.data2 == 41 def foo(ev): assert ev.channel == 1 assert ev.channel_ == 0 assert ev.program == 42 assert ev.data2 == 41 ev.channel = 6 r = self.run_test(p, ev) assert r[0].channel_ == 5
b1fc30c021fa46378e1688e998ff1b86a307820f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7503/b1fc30c021fa46378e1688e998ff1b86a307820f/unit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 751, 2335, 12, 2890, 4672, 642, 12, 892, 67, 3348, 273, 404, 13, 293, 273, 5307, 12, 26, 13, 2113, 273, 490, 350, 77, 1133, 12, 3373, 43, 16, 404, 16, 404, 16, 374, 16, 20170...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 751, 2335, 12, 2890, 4672, 642, 12, 892, 67, 3348, 273, 404, 13, 293, 273, 5307, 12, 26, 13, 2113, 273, 490, 350, 77, 1133, 12, 3373, 43, 16, 404, 16, 404, 16, 374, 16, 20170...
raise RuntimeError, "You must intall the optional gap_packages package."
raise RuntimeError, "You must install the optional gap_packages package."
def homology(self, n, p = 0): r""" Computes the group homology `H_n(G, F)`, where `F = \ZZ` if `p=0` and `F = \ZZ / p \ZZ` if `p > 0` is a prime. Wraps HAP's ``GroupHomology`` function, written by Graham Ellis. REQUIRES: GAP package HAP (in gap_packages-\*.spkg). AUTHORS:
80f2eb1544a665a7924db499436a75a7eec48f50 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/80f2eb1544a665a7924db499436a75a7eec48f50/permgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13995, 4676, 12, 2890, 16, 290, 16, 293, 273, 374, 4672, 436, 8395, 14169, 281, 326, 1041, 13995, 4676, 1375, 44, 67, 82, 12, 43, 16, 478, 13, 9191, 1625, 1375, 42, 273, 521, 27096, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13995, 4676, 12, 2890, 16, 290, 16, 293, 273, 374, 4672, 436, 8395, 14169, 281, 326, 1041, 13995, 4676, 1375, 44, 67, 82, 12, 43, 16, 478, 13, 9191, 1625, 1375, 42, 273, 521, 27096, ...
""" Returns the username Returns ------- - 'str' """
""" getUser() -> str - Returns the username. """
def getUser(self):
0d08a982cb8d26e26f2e6ab32b89ef18e54df8fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6341/0d08a982cb8d26e26f2e6ab32b89ef18e54df8fb/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4735, 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, 0, 0, 0,...
[ 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4735, 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, -100, -100, -...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 189) else quickfix.DoubleField.__init__(self, 189, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 6549, 29, 13, 469, 9549, 904, 18, 5265, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 6549, 29, 13, 469, 9549, 904, 18, 5265, 974, 16186, 2738, ...
'URI': self.request.serverVariables['SCRIPT_NAME'] + '/' + self.item.id,
def setParams(self): self.response.setHeader('Cache-Control', 'no-cache') sLang = self.request.getLang()
9a2f8b99a4794ca66a515bfe9ca832718bd20756 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2504/9a2f8b99a4794ca66a515bfe9ca832718bd20756/ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31705, 12, 2890, 4672, 365, 18, 2740, 18, 542, 1864, 2668, 1649, 17, 3367, 2187, 296, 2135, 17, 2493, 6134, 272, 7275, 273, 365, 18, 2293, 18, 588, 7275, 1435, 2, 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, 31705, 12, 2890, 4672, 365, 18, 2740, 18, 542, 1864, 2668, 1649, 17, 3367, 2187, 296, 2135, 17, 2493, 6134, 272, 7275, 273, 365, 18, 2293, 18, 588, 7275, 1435, 2, -100, -100, -100, -10...
exchange_mesg(serverinfo,conninfo["sock"],virtualsock)
exchange_mesg(serverinfo,conninfo["sock"],virtualsock)
def new_client(conn_id, value): # Get the connection info conninfo = CONNECTIONS[conn_id] servermac = value["server"] port = value["port"] # Has the server connected to this forwarder? if servermac not in MAC_ID_LOOKUP: return (False,NAT_STATUS_NO_SERVER) # Get the server info dictionary serverinfo = CONNECTIONS[MAC_ID_LOOKUP[servermac]] # Check if we have reach the limit of clients if not serverinfo["num_clients"] < MAX_CLIENTS_PER_SERV: return (False,NAT_STATUS_BSY_SERVER) # Check if the server is listening on the desired port if not port in serverinfo["ports"]: return (False,NAT_STATUS_FAILED) # Try to get a virtual socket try: virtualsock = serverinfo["mux"].openconn(serverinfo["ip"], port,localip=conninfo["ip"],localport=conninfo["port"]) # Manually send the confirmation RPC dict, since we will not return to the new_rpc function rpc_response = {RPC_REQUEST_STATUS:True,RPC_RESULT:NAT_STATUS_CONFIRMED} # DEBUG if DEBUG2: print getruntime(),"Client Conn. Successful",rpc_response conninfo["sock"].send(RPC_encode(rpc_response)) # Add 2 client connections (really just 1) # This is because each exchange_mesg will decrement num_clients # So there will be 2 decrements serverinfo["num_clients"] += 2 # Spawn a thread to exchange the messages between the server and client settimer(.2, exchange_mesg,[serverinfo,virtualsock,conninfo["sock"]]) # Call exchange message to do sent the messages between the client and the server exchange_mesg(serverinfo,conninfo["sock"],virtualsock) # We will only reach this point after exchange_mesg terminated, so the socket is closed # However, we will return normally, and new_rpc will catch an exceptiton return (True,NAT_STATUS_CONFIRMED) except: return (False,NAT_STATUS_FAILED)
6db9d12f0248bd7533342c0e79b8b0e15c4c09aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/6db9d12f0248bd7533342c0e79b8b0e15c4c09aa/forwarder_rpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 67, 2625, 12, 4646, 67, 350, 16, 460, 4672, 468, 968, 326, 1459, 1123, 1487, 1376, 273, 20695, 55, 63, 4646, 67, 350, 65, 1438, 5821, 273, 460, 9614, 3567, 11929, 1756, 273, 460, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 394, 67, 2625, 12, 4646, 67, 350, 16, 460, 4672, 468, 968, 326, 1459, 1123, 1487, 1376, 273, 20695, 55, 63, 4646, 67, 350, 65, 1438, 5821, 273, 460, 9614, 3567, 11929, 1756, 273, 460, ...
3: hex dump everything""", default=0) parser.add_option("", "--rts", dest="rts_state", action="store", type='int', help="set initial RTS line state (possible values: 0, 1)", default=None) parser.add_option("", "--dtr", dest="dtr_state", action="store", type='int', help="set initial DTR line state (possible values: 0, 1)", default=None) parser.add_option("-q", "--quiet", dest="quiet", action="store_true", help="suppress non error messages", default=False) parser.add_option("", "--exit-char", dest="exit_char", action="store", type='int', help="ASCII code of special charcter that is used to exit the application", default=0x1d) parser.add_option("", "--upload-char", dest="upload_char", action="store", type='int', help="ASCII code of special charcter that is used to send a file", default=0x15)
3: hex dump everything""", default = 0 ) parser.add_option("--rts", dest = "rts_state", action = "store", type = 'int', help = "set initial RTS line state (possible values: 0, 1)", default = None ) parser.add_option("--dtr", dest = "dtr_state", action = "store", type = 'int', help = "set initial DTR line state (possible values: 0, 1)", default = None ) parser.add_option("-q", "--quiet", dest = "quiet", action = "store_true", help = "suppress non error messages", default = False ) parser.add_option("--exit-char", dest = "exit_char", action = "store", type = 'int', help = "ASCII code of special character that is used to exit the application", default = 0x1d ) parser.add_option("--upload-char", dest = "upload_char", action = "store", type = 'int', help = "ASCII code of special character that is used to send a file", default = 0x15 )
def main(): import optparse parser = optparse.OptionParser(usage="""\
8b7ba3f0589ddf76ccf792ffe28b3db50351626b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/8b7ba3f0589ddf76ccf792ffe28b3db50351626b/miniterm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 1930, 2153, 2670, 225, 2082, 273, 2153, 2670, 18, 1895, 2678, 12, 9167, 1546, 3660, 64, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2774, 13332, 1930, 2153, 2670, 225, 2082, 273, 2153, 2670, 18, 1895, 2678, 12, 9167, 1546, 3660, 64, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if kind.startswith("ldate-"):
elif kind.startswith("ldate-"):
def _kind (self,full_type,endian): if endian == 'local': kind = full_type else: kind = full_type[2:]
fa8a059590f5621889e8f0481dc5d1c6f0c2d5c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/fa8a059590f5621889e8f0481dc5d1c6f0c2d5c8/magic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9224, 261, 2890, 16, 2854, 67, 723, 16, 22910, 4672, 309, 14759, 422, 296, 3729, 4278, 3846, 273, 1983, 67, 723, 469, 30, 3846, 273, 1983, 67, 723, 63, 22, 26894, 2, 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, 1, 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, 9224, 261, 2890, 16, 2854, 67, 723, 16, 22910, 4672, 309, 14759, 422, 296, 3729, 4278, 3846, 273, 1983, 67, 723, 469, 30, 3846, 273, 1983, 67, 723, 63, 22, 26894, 2, -100, -100, ...
window = self.get_widget(self.id)
window = self.get_widget(self.glade_id)
def register_gtk_quit(self): window = self.get_widget(self.id) self.do_gtk_quit = True # This means we've already been closed if window is None: gobject.idle_add(gtk.main_quit)
d02c4ac16a42c4c5d6d5d8c2a07d81d06b18f0b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/d02c4ac16a42c4c5d6d5d8c2a07d81d06b18f0b3/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 67, 4521, 79, 67, 27176, 12, 2890, 4672, 2742, 273, 365, 18, 588, 67, 6587, 12, 2890, 18, 7043, 2486, 67, 350, 13, 365, 18, 2896, 67, 4521, 79, 67, 27176, 273, 1053, 225, 468, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1744, 67, 4521, 79, 67, 27176, 12, 2890, 4672, 2742, 273, 365, 18, 588, 67, 6587, 12, 2890, 18, 7043, 2486, 67, 350, 13, 365, 18, 2896, 67, 4521, 79, 67, 27176, 273, 1053, 225, 468, ...
"-d", "%sm" % size,
def _AssembleLocal(cls, minor, backend, meta, size): """Configure the local part of a DRBD device.
60bca04acdabf9d9e4bba47ce19fb2f4516f1dc0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/60bca04acdabf9d9e4bba47ce19fb2f4516f1dc0/bdev.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1463, 10045, 2042, 12, 6429, 16, 8439, 16, 4221, 16, 2191, 16, 963, 4672, 3536, 11207, 326, 1191, 1087, 434, 279, 16801, 18096, 2346, 18, 2, 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, 389, 1463, 10045, 2042, 12, 6429, 16, 8439, 16, 4221, 16, 2191, 16, 963, 4672, 3536, 11207, 326, 1191, 1087, 434, 279, 16801, 18096, 2346, 18, 2, -100, -100, -100, -100, -100, -100, -100...
out.extend(['<script type="text/javascript" src="/javascript/cookies.js"></script>', '<script type="text/javascript" src="/javascript/collapsibleLists.js"></script>', '''<script type="text/javascript"> <!-- function loadPage() { createTreeFromList('sourceDirTree', getCookie('sourceDirTree'), true, false); } function unloadPage() { setCookie('sourceDirTree', stateToString('sourceDirTree')) } --> </script> ''',
out.extend(['''<script type="text/javascript" src="/ead/js/collapsibleLists.js"></script> <script type="text/javascript" src="/ead/js/cookies.js"></script> <script type="text/javascript"> <!-- var olf = function() { createTreeFromList('sourceDirTree', getCookie('sourceDirTree'), true, false);} ; if (addLoadEvent) { addLoadEvent(olf); } else { window.onload = olf; } var ulf = function() { setCookie('sourceDirTree', stateToString('sourceDirTree')); } ; if (addUnloadEvent) { addUnloadEvent(ulf); } else { window.onunload = ulf; } --> </script> ''',
def review_records(self, version='full'): global sourceDir self.htmlTitle.append('File Management') out = [] if (version=='full'): header = 'Existing Files' fileformsubmits = '''<input type="submit" name="operation" value="rename" onmousedown="op=this.value;"/> <input type="submit" name="operation" value="delete" onmousedown="op=this.value;"/> <input type="submit" name="operation" value="unindex + delete" onmousedown="op='unindex';"/>''' else : fileformsubmits = '''<input type="submit" name="operation" value="%s" onmousedown="op=this.value;"/>''' % version header = 'Please select file(s) to %s' % version if (version=='full'): out.extend([read_file('upload.html'), '<br/>']) out.extend(['<script type="text/javascript" src="/javascript/cookies.js"></script>', '<script type="text/javascript" src="/javascript/collapsibleLists.js"></script>', '''<script type="text/javascript"> <!-- function loadPage() { createTreeFromList('sourceDirTree', getCookie('sourceDirTree'), true, false); } function unloadPage() { setCookie('sourceDirTree', stateToString('sourceDirTree')) } --> </script> ''', '<h3 class="bar">%s <a href="/ead/admin/help.html#existing_files" title="What is this?"><img src="/images/whatisthis.gif" alt="[What is this?]"/></a></h3>' % (header), '<form action="files.html" name="fileops" method="post" onsubmit="return confirmOp();">', fileformsubmits, '<ul class="unmarked"><li><img src="/images/folderOpen.jpg" alt=""/>' + sourceDir, '<ul id="sourceDirTree" class="unmarked">' ]) out.extend(self._walk_directory(sourceDir)) out.extend(['</li>','</ul>', '</ul>', fileformsubmits, '</form>']) self.logger.log('File options') return '\n'.join(out)
b1aeb6d14a33b1c557ad2d17d5c49a948c2d454a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11263/b1aeb6d14a33b1c557ad2d17d5c49a948c2d454a/eadAdminHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10725, 67, 7094, 12, 2890, 16, 1177, 2218, 2854, 11, 4672, 2552, 26844, 365, 18, 2620, 4247, 18, 6923, 2668, 812, 13303, 6134, 596, 273, 5378, 309, 261, 1589, 18920, 2854, 11, 4672, 1446...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10725, 67, 7094, 12, 2890, 16, 1177, 2218, 2854, 11, 4672, 2552, 26844, 365, 18, 2620, 4247, 18, 6923, 2668, 812, 13303, 6134, 596, 273, 5378, 309, 261, 1589, 18920, 2854, 11, 4672, 1446...
g = Generator(s, mangle_from_=1)
g = Generator(s, mangle_from_=True)
def test_mangled_from(self): s = StringIO() g = Generator(s, mangle_from_=1) g.flatten(self.msg) self.assertEqual(s.getvalue(), """\
1abdc903fc08a89b4695728d372aaf3594fcb8c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1abdc903fc08a89b4695728d372aaf3594fcb8c8/test_email.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 81, 539, 1259, 67, 2080, 12, 2890, 4672, 272, 273, 15777, 1435, 314, 273, 10159, 12, 87, 16, 312, 4341, 67, 2080, 67, 33, 5510, 13, 314, 18, 16940, 12, 2890, 18, 3576, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 81, 539, 1259, 67, 2080, 12, 2890, 4672, 272, 273, 15777, 1435, 314, 273, 10159, 12, 87, 16, 312, 4341, 67, 2080, 67, 33, 5510, 13, 314, 18, 16940, 12, 2890, 18, 3576, 13, ...
if result is None or error is not None:
if result is None or result[0] is None or error is not None:
def _lookup_fingerprint(self, next, filename, result=None, error=None): try: file = self.tagger.files[filename] except (KeyError): # The file has been removed. do nothing return if result is None or error is not None: next(file, result=None) return fingerprint, length = result self.tagger.window.set_statusbar_message( N_("Looking up the fingerprint for file %s..."), file.filename) self.tagger.xmlws.query_musicdns(partial(self._lookup_finished, partial(next, file)), rmt='0', lkt='1', cid=MUSICDNS_KEY, cvr="MusicBrainz Picard-%s" % version_string, fpt=fingerprint, dur=str(file.metadata.length or length), brt=str(file.metadata.get("~#bitrate", 0)), fmt=file.metadata["~format"], art=file.metadata["artist"], ttl=file.metadata["title"], alb=file.metadata["album"], tnm=file.metadata["tracknumber"], gnr=file.metadata["genre"], yrr=file.metadata["date"][:4])
f3ae42a981bf992f83e1012f467fc490aaf9368e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12415/f3ae42a981bf992f83e1012f467fc490aaf9368e/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8664, 67, 24716, 12, 2890, 16, 1024, 16, 1544, 16, 563, 33, 7036, 16, 555, 33, 7036, 4672, 775, 30, 585, 273, 365, 18, 2692, 693, 18, 2354, 63, 3459, 65, 1335, 261, 653, 668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8664, 67, 24716, 12, 2890, 16, 1024, 16, 1544, 16, 563, 33, 7036, 16, 555, 33, 7036, 4672, 775, 30, 585, 273, 365, 18, 2692, 693, 18, 2354, 63, 3459, 65, 1335, 261, 653, 668, ...
self.goodrevs.append(self.repo.lookup(rev or '.')) if self.badrev:
self.goodnodes.append(self.repo.lookup(rev or '.')) if self.badnode:
def autogood(self, rev=None): """mark revision as good and update to the next revision to test""" self.goodrevs.append(self.repo.lookup(rev or '.')) if self.badrev: return self.autonext()
6919e042e934d02082016dfb73d7ed6ccac1b5b5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/6919e042e934d02082016dfb73d7ed6ccac1b5b5/hbisect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7608, 4773, 12, 2890, 16, 5588, 33, 7036, 4672, 3536, 3355, 6350, 487, 7494, 471, 1089, 358, 326, 1024, 6350, 358, 1842, 8395, 365, 18, 19747, 4690, 18, 6923, 12, 2890, 18, 7422, 18, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7608, 4773, 12, 2890, 16, 5588, 33, 7036, 4672, 3536, 3355, 6350, 487, 7494, 471, 1089, 358, 326, 1024, 6350, 358, 1842, 8395, 365, 18, 19747, 4690, 18, 6923, 12, 2890, 18, 7422, 18, 8...
except win32api.error:
except _RegError:
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import win32api import win32con except ImportError: return [] K = 'Software\\Microsoft\\Devstudio' L = [] for base in (win32con.HKEY_CLASSES_ROOT, win32con.HKEY_LOCAL_MACHINE, win32con.HKEY_CURRENT_USER, win32con.HKEY_USERS): try: k = win32api.RegOpenKeyEx(base,K) i = 0 while 1: try: p = win32api.RegEnumKey(k,i) if p[0] in '123456789' and p not in L: L.append(p) except win32api.error: break i = i + 1 except win32api.error: pass L.sort() L.reverse() return L
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 5206, 334, 4484, 67, 10169, 1832, 30, 3536, 967, 666, 434, 4461, 334, 4484, 5244, 628, 326, 8202, 4023, 18, 225, 2000, 279, 666, 434, 2064, 4191, 1177, 5600, 31, 326, 666, 903...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5206, 334, 4484, 67, 10169, 1832, 30, 3536, 967, 666, 434, 4461, 334, 4484, 5244, 628, 326, 8202, 4023, 18, 225, 2000, 279, 666, 434, 2064, 4191, 1177, 5600, 31, 326, 666, 903...
first_data.data = string.lstrip(first_data.data[4:])
first_data.data = first_data.data[4:].lstrip()
def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return set_tagName(node, "synopsis") lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_element(section, "moduleauthor") if modauthor: set_tagName(modauthor, "author") modauthor.appendChild(doc.createTextNode( modauthor.getAttribute("name"))) modauthor.removeAttribute("name") platform = extract_first_element(section, "platform") if section.tagName == "section": modinfo_pos = 2 modinfo = doc.createElement("moduleinfo") moddecl = extract_first_element(section, "declaremodule") name = None if moddecl: modinfo.appendChild(doc.createTextNode("\n ")) name = moddecl.attributes["name"].value namenode = doc.createElement("name") namenode.appendChild(doc.createTextNode(name)) modinfo.appendChild(namenode) type = moddecl.attributes.get("type") if type: type = type.value modinfo.appendChild(doc.createTextNode("\n ")) typenode = doc.createElement("type") typenode.appendChild(doc.createTextNode(type)) modinfo.appendChild(typenode) versionadded = extract_first_element(section, "versionadded") if versionadded: modinfo.setAttribute("added", versionadded.getAttribute("version")) title = get_first_element(section, "title") if title: children = title.childNodes if len(children) >= 2 \ and children[0].nodeName == "module" \ and children[0].childNodes[0].data == name: # this is it; morph the <title> into <short-synopsis> first_data = children[1] if first_data.data[:4] == " ---": first_data.data = string.lstrip(first_data.data[4:]) set_tagName(title, "short-synopsis") if children[-1].nodeType == TEXT \ and children[-1].data[-1:] == ".": children[-1].data = children[-1].data[:-1] section.removeChild(title) section.removeChild(section.childNodes[0]) title.removeChild(children[0]) modinfo_pos = 0 else: ewrite("module name in title doesn't match" " <declaremodule/>; no <short-synopsis/>\n") else: ewrite("Unexpected condition: <section/> without <title/>\n") modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(node) if title and not contents_match(title, node): # The short synopsis is actually different, # and needs to be stored: modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(title) if modauthor: modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(modauthor) if platform: modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(platform) modinfo.appendChild(doc.createTextNode("\n ")) section.insertBefore(modinfo, section.childNodes[modinfo_pos]) section.insertBefore(doc.createTextNode("\n "), modinfo) # # The rest of this removes extra newlines from where we cut out # a lot of elements. A lot of code for minimal value, but keeps # keeps the generated *ML from being too funny looking. # section.normalize() children = section.childNodes for i in range(len(children)): node = children[i] if node.nodeName == "moduleinfo": nextnode = children[i+1] if nextnode.nodeType == TEXT: data = nextnode.data if len(string.lstrip(data)) < (len(data) - 4): nextnode.data = "\n\n\n" + string.lstrip(data)
3c171d1b9f1420a6bbce02f1511ffb6b621863ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3c171d1b9f1420a6bbce02f1511ffb6b621863ef/docfixer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2978, 67, 1376, 12, 2434, 16, 2442, 4672, 468, 8264, 23935, 18, 756, 273, 2608, 67, 3645, 67, 2956, 12, 3464, 16, 315, 6400, 878, 29522, 7923, 309, 756, 353, 599, 30, 327, 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, 752, 67, 2978, 67, 1376, 12, 2434, 16, 2442, 4672, 468, 8264, 23935, 18, 756, 273, 2608, 67, 3645, 67, 2956, 12, 3464, 16, 315, 6400, 878, 29522, 7923, 309, 756, 353, 599, 30, 327, 4...
fp.write("default = %s\n" % abspath)
fp.write("default = %s\n" % abspath.replace('%', '%%'))
def force_copy(src, dst): if not os.path.exists(src): # Tolerate empty source repository and optional files return util.copyfiles(src, dst)
2b3ce81c0dde37162a6f19f2f2b76540f97ff87e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/2b3ce81c0dde37162a6f19f2f2b76540f97ff87e/hg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2944, 67, 3530, 12, 4816, 16, 3046, 4672, 309, 486, 1140, 18, 803, 18, 1808, 12, 4816, 4672, 468, 399, 355, 12600, 1008, 1084, 3352, 471, 3129, 1390, 327, 1709, 18, 3530, 2354, 12, 481...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2944, 67, 3530, 12, 4816, 16, 3046, 4672, 309, 486, 1140, 18, 803, 18, 1808, 12, 4816, 4672, 468, 399, 355, 12600, 1008, 1084, 3352, 471, 3129, 1390, 327, 1709, 18, 3530, 2354, 12, 481...
command.attr_build(OSDAttr(ATTR_SET, USER_COLL_PG, cid, htonl(cid)))
command.attr_build(OSDAttr(ATTR_SET, USER_COLL_PG, cid, htonll(cid)))
def create_any_object(pid): command = OSDCommand().set_create(pid) command.attr_build(OSDAttr(ATTR_GET, CUR_CMD_ATTR_PG, CCAP_OID, \ CCAP_OID_LEN)) attr = run(command) return ntohll(attr.val)
252a7e17c8cc59b5c8fc2bda44307ecec26b1d21 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11094/252a7e17c8cc59b5c8fc2bda44307ecec26b1d21/test-collection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2273, 67, 1612, 12, 6610, 4672, 1296, 273, 5932, 40, 2189, 7675, 542, 67, 2640, 12, 6610, 13, 1296, 18, 1747, 67, 3510, 12, 4618, 40, 3843, 12, 12043, 67, 3264, 16, 4706, 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, 752, 67, 2273, 67, 1612, 12, 6610, 4672, 1296, 273, 5932, 40, 2189, 7675, 542, 67, 2640, 12, 6610, 13, 1296, 18, 1747, 67, 3510, 12, 4618, 40, 3843, 12, 12043, 67, 3264, 16, 4706, 67...
contentsOverride = cont)
contentsOverride = cont, replaceFiles = replaceFiles)
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
22f9a9101585ff5ecfc72cfcc17af08af913547a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/22f9a9101585ff5ecfc72cfcc17af08af913547a/update.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7526, 56, 303, 537, 12, 2890, 16, 13686, 16, 23432, 537, 14272, 16, 26104, 16, 1026, 56, 303, 537, 16, 2662, 56, 303, 537, 16, 1365, 16, 14817, 13368, 16, 2943, 4672, 2, 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, 1, 1, 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, 7526, 56, 303, 537, 12, 2890, 16, 13686, 16, 23432, 537, 14272, 16, 26104, 16, 1026, 56, 303, 537, 16, 2662, 56, 303, 537, 16, 1365, 16, 14817, 13368, 16, 2943, 4672, 2, -100, -...
results_final = search_intersect_with_collrecs(req, results_in_any_collection, colls_to_search, of, dbg)
results_final = intersect_results_with_collrecs(req, results_in_any_collection, colls_to_search, ap, of, dbg)
def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", recid="-1", recidb="-1", sysno="", id="-1", idb="-1", sysnb="", action="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d="", dbg="0"): """Perform search, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page.""" # wash all passed arguments: cc = wash_url_argument(cc, 'str') sc = wash_url_argument(sc, 'int') (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) # which colls to search and to display? p = wash_pattern(wash_url_argument(p, 'str')) f = wash_field(wash_url_argument(f, 'str')) rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_pattern(wash_url_argument(p1, 'str')) f1 = wash_field(wash_url_argument(f1, 'str')) m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_pattern(wash_url_argument(p2, 'str')) f2 = wash_field(wash_url_argument(f2, 'str')) m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_pattern(wash_url_argument(p3, 'str')) f3 = wash_field(wash_url_argument(f3, 'str')) m3 = wash_url_argument(m3, 'str') jrec = wash_url_argument(jrec, 'int') recid = wash_url_argument(recid, 'int') recidb = wash_url_argument(recidb, 'int') sysno = wash_url_argument(sysno, 'str') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'str') action = wash_url_argument(action, 'str') d1y = wash_url_argument(d1y, 'str') d1m = wash_url_argument(d1m, 'str') d1d = wash_url_argument(d1d, 'str') d2y = wash_url_argument(d2y, 'str') d2m = wash_url_argument(d2m, 'str') d2d = wash_url_argument(d2d, 'str') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) dbg = wash_url_argument(dbg, 'int') # backwards compatibility: id, idb, sysnb -> recid, recidb, sysno (if applicable) if sysnb != "" and sysno == "": sysno = sysnb if id > 0 and recid == -1: recid = id if idb > 0 and recidb == -1: recidb = idb # TODO deduce passed search limiting criterias (if applicable) pl = "" # no limits by default if action != "Browse": # we do not want to add options while browsing fieldargs = cgi.parse_qs(req.args) for fieldcode in get_fieldcodes(): if fieldargs.has_key(fieldcode): for val in fieldargs[fieldcode]: pl += "+%s:\"%s\" " % (fieldcode, val) # deduce recid from sysno argument (if applicable): if sysno: # ALEPH SYS number was passed, so deduce MySQL recID for the record: recid = get_mysql_recid_from_aleph_sysno(sysno) # deduce collection we are in (if applicable): if recid>0: cc = guess_primary_collection_of_a_record(recid) # deduce user id (if applicable): try: uid = getUid(req) except: uid = 0 ## 0 - start output page_start(req, of, cc, as, uid) if recid>0: ## 1 - detailed record display if of == "hb": of = "hd" if record_exists(recid): if recidb<=recid: # sanity check recidb=recid+1 print_records(req, range(recid,recidb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): print_warning(req, "Requested record does not seem to exist.") elif action == "Browse": ## 2 - browse needed if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed if of.startswith("h"): req.write(create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, pl, d1y, d1m, d1d, d2y, d2m, d2d, action)) t1 = os.times()[4] results_in_any_collection = HitList() if as == 1 or (p1 or p2 or p3): ## 3A - advanced search results_in_any_collection = search_pattern(req, p1, f1, m1, of=of, dbg=dbg) if results_in_any_collection._nbhits == 0: return page_end(req, of) if p2: results_tmp = search_pattern(req, p2, f2, m2, of=of, dbg=dbg) if op1 == "a": # add results_in_any_collection.intersect(results_tmp) elif op1 == "o": # or results_in_any_collection.union(results_tmp) elif op1 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op1, "Error") results_in_any_collection.calculate_nbhits() if results_in_any_collection._nbhits == 0: return page_end(req, of) if p3: results_tmp = search_pattern(req, p3, f3, m3, of=of, dbg=dbg) if op2 == "a": # add results_in_any_collection.intersect(results_tmp) elif op2 == "o": # or results_in_any_collection.union(results_tmp) elif op2 == "n": # not results_in_any_collection.difference(results_tmp) else: if of.startswith("h"): print_warning(req, "Invalid set operation %s." % op2, "Error") results_in_any_collection.calculate_nbhits() else: ## 3B - simple search results_in_any_collection = search_pattern(req, p, f, of=of, dbg=dbg) if results_in_any_collection._nbhits == 0: return page_end(req, of)
f89feb7ea51a59100f9e1291d3f34cbf65a4ba8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/f89feb7ea51a59100f9e1291d3f34cbf65a4ba8b/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 2293, 67, 3072, 12, 3658, 33, 7036, 16, 4946, 33, 71, 2377, 529, 16, 276, 33, 7036, 16, 293, 1546, 3113, 284, 1546, 3113, 14524, 1546, 2163, 3113, 9033, 1546, 3113, 1427, 154...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3073, 67, 2293, 67, 3072, 12, 3658, 33, 7036, 16, 4946, 33, 71, 2377, 529, 16, 276, 33, 7036, 16, 293, 1546, 3113, 284, 1546, 3113, 14524, 1546, 2163, 3113, 9033, 1546, 3113, 1427, 154...
fileContent += ",".join(["s_PDO_staus_Initializer"]*texts["maxPDOtransmit"]) + """};
fileContent += ",".join(["s_PDO_status_Initializer"]*texts["maxPDOtransmit"]) + """};
def GenerateFileContent(Node, headerfilepath): global type global internal_types texts = {} texts["maxPDOtransmit"] = 0 texts["NodeName"] = Node.GetNodeName() texts["NodeID"] = Node.GetNodeID() texts["NodeType"] = Node.GetNodeType() texts["Description"] = Node.GetNodeDescription() texts["iam_a_slave"] = 0 if (texts["NodeType"] == "slave"): texts["iam_a_slave"] = 1 # Compiling lists of indexes rangelist = [idx for idx in Node.GetIndexes() if 0 <= idx <= 0x260] listIndex = [idx for idx in Node.GetIndexes() if 0x1000 <= idx <= 0xFFFF] communicationlist = [idx for idx in Node.GetIndexes() if 0x1000 <= idx <= 0x11FF] sdolist = [idx for idx in Node.GetIndexes() if 0x1200 <= idx <= 0x12FF] pdolist = [idx for idx in Node.GetIndexes() if 0x1400 <= idx <= 0x1BFF] variablelist = [idx for idx in Node.GetIndexes() if 0x2000 <= idx <= 0xBFFF]
69bdb505e309e9624eab365d05d11a7a42a672b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11017/69bdb505e309e9624eab365d05d11a7a42a672b7/gen_cfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 25391, 12, 907, 16, 1446, 10561, 4672, 2552, 618, 2552, 2713, 67, 2352, 15219, 273, 2618, 15219, 9614, 1896, 14625, 2338, 1938, 11929, 273, 374, 15219, 9614, 18948, 11929, 273, 2029, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6654, 25391, 12, 907, 16, 1446, 10561, 4672, 2552, 618, 2552, 2713, 67, 2352, 15219, 273, 2618, 15219, 9614, 1896, 14625, 2338, 1938, 11929, 273, 374, 15219, 9614, 18948, 11929, 273, 2029, ...
def _copy(self,obj): """copies to obj""" obj._attrMap = self._attrMap.clone() self_contents = self.contents for child in self_contents: obj.contents.append(child) self_contents = self.contents for (oldKey, oldValue) in self.__dict__.items(): if oldValue in self_contents: pos = self_contents.index(oldValue) setattr(obj, oldKey, obj.contents[pos]) return obj
def _copy(self,obj): """copies to obj""" obj._attrMap = self._attrMap.clone()
0db2330e659933f84282d056763486c5d836da89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/0db2330e659933f84282d056763486c5d836da89/shapes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3530, 12, 2890, 16, 2603, 4672, 3536, 22295, 606, 358, 1081, 8395, 1081, 6315, 1747, 863, 273, 365, 6315, 1747, 863, 18, 14056, 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, 0, 0, 0, 0, 0, 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, 3530, 12, 2890, 16, 2603, 4672, 3536, 22295, 606, 358, 1081, 8395, 1081, 6315, 1747, 863, 273, 365, 6315, 1747, 863, 18, 14056, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -1...
'lat' : 0.0, 'long' : 0.0, 'mlat' : 0.0, 'mlong' : 0.0, 'marker' : 'no'
'lat' : 0.0, 'long' : 0.0, 'mlat' : 0.0, 'mlong' : 0.0, 'marker' : 'no', 'clickable' : 'yes'
def do_gmap(parser, token): items = token.split_contents() # Defaults parameters = { 'lat' : 0.0, 'long' : 0.0, 'mlat' : 0.0, 'mlong' : 0.0, 'marker' : 'no' } for item in items[1:]: param, value = item.split(":") param = param.strip() value = value.strip() print param, value if parameters.has_key(param): if value[0] == '"': value = value[1:-1] parameters[param] = value return GMapNode(parameters)
be35f27dfb7ab89cc74ab62f13a40a92c2954b5a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11345/be35f27dfb7ab89cc74ab62f13a40a92c2954b5a/gmap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 75, 1458, 12, 4288, 16, 1147, 4672, 1516, 273, 1147, 18, 4939, 67, 3980, 1435, 225, 468, 14159, 1472, 273, 288, 296, 4801, 11, 4202, 294, 374, 18, 20, 16, 296, 5748, 11, 137...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 741, 67, 75, 1458, 12, 4288, 16, 1147, 4672, 1516, 273, 1147, 18, 4939, 67, 3980, 1435, 225, 468, 14159, 1472, 273, 288, 296, 4801, 11, 4202, 294, 374, 18, 20, 16, 296, 5748, 11, 137...
xx_c = os.path.join(sysconfig.project_base, 'Modules', 'xxmodule.c') shutil.copy(xx_c, self.tmp_dir)
shutil.copy(_get_source_filename(), self.tmp_dir)
def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir)
4d00138fe1465b32168e39c688f3eda277af51dd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/4d00138fe1465b32168e39c688f3eda277af51dd/test_build_ext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 468, 1788, 279, 4143, 1842, 3330, 468, 3609, 716, 732, 4565, 10480, 3478, 358, 2589, 18, 803, 365, 18, 5645, 67, 1214, 273, 13275, 18, 24816, 72, 5814, 12, 3239, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 24292, 12, 2890, 4672, 468, 1788, 279, 4143, 1842, 3330, 468, 3609, 716, 732, 4565, 10480, 3478, 358, 2589, 18, 803, 365, 18, 5645, 67, 1214, 273, 13275, 18, 24816, 72, 5814, 12, 3239, ...
do_char(c, event)
do_char(c, event)
def do_key(self, event): (what, message, when, where, modifiers) = event c = chr(message & charCodeMask) if modifiers & cmdKey: if c == '.': raise self else: result = MenuKey(ord(c)) id = (result>>16) & 0xffff # Hi word item = result & 0xffff # Lo word if id: self.do_rawmenu(id, item, None, event)
8deb9e9fee0ad9ff7ea024781a126a501fc8b7aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/8deb9e9fee0ad9ff7ea024781a126a501fc8b7aa/FrameWork.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 856, 12, 2890, 16, 871, 4672, 261, 23770, 16, 883, 16, 1347, 16, 1625, 16, 10429, 13, 273, 871, 276, 273, 4513, 12, 2150, 473, 13096, 5796, 13, 309, 10429, 473, 1797, 653, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 741, 67, 856, 12, 2890, 16, 871, 4672, 261, 23770, 16, 883, 16, 1347, 16, 1625, 16, 10429, 13, 273, 871, 276, 273, 4513, 12, 2150, 473, 13096, 5796, 13, 309, 10429, 473, 1797, 653, 3...
self.itemDeleteSelected.set_sensitive(can_delete or not can_cancel)
self.itemDeleteSelected.set_sensitive(can_delete)
def play_or_download(self): if not gpodder.ui.fremantle: if self.wNotebook.get_current_page() > 0: if gpodder.ui.desktop: self.toolCancel.set_sensitive(True) return
f9e536d55b9f626ce32dd254aa66dc5c5c091f18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12778/f9e536d55b9f626ce32dd254aa66dc5c5c091f18/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6599, 67, 280, 67, 7813, 12, 2890, 4672, 309, 486, 4178, 369, 765, 18, 4881, 18, 74, 2764, 970, 298, 30, 309, 365, 18, 91, 19751, 18, 588, 67, 2972, 67, 2433, 1435, 405, 374, 30, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6599, 67, 280, 67, 7813, 12, 2890, 4672, 309, 486, 4178, 369, 765, 18, 4881, 18, 74, 2764, 970, 298, 30, 309, 365, 18, 91, 19751, 18, 588, 67, 2972, 67, 2433, 1435, 405, 374, 30, 3...
dia = DataImportAttempt.objects.get(id=dia_id)
dia = mysite.profile.models.DataImportAttempt.objects.get(id=dia_id)
def create_citations_from_debianqa_results(dia_id, results): dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for package_name, package_description in results: (project, _) = Project.objects.get_or_create(name=package_name) package_link = 'http://packages.debian.org/src:' + urllib.quote( package_name) if PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = PortfolioEntry(person=person, project=project, project_description=package_description) portfolio_entry.save() portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] citation = Citation() citation.languages = "" # FIXME ", ".join(result['languages']) citation.contributor_role='Maintainer' citation.portfolio_entry = portfolio_entry citation.data_import_attempt = dia citation.url = package_link citation.save_and_check_for_duplicates() # And add a citation to the Debian portfolio entry (project, _) = Project.objects.get_or_create(name='Debian GNU/Linux') if PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = PortfolioEntry(person=person, project=project, project_description= 'The universal operating system') portfolio_entry.save() portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] citation = Citation() citation.languages = '' # FIXME: ? citation.contributor_role='Maintainer of %s' % package_name citation.portfolio_entry = portfolio_entry citation.data_import_attempt = dia citation.url = package_link citation.save_and_check_for_duplicates() person.last_polled = datetime.datetime.now() person.save() dia.completed = True dia.save()
f1d0d2222a9a25e0a8611c6a5776e209776dcdc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/f1d0d2222a9a25e0a8611c6a5776e209776dcdc0/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 71, 18282, 67, 2080, 67, 31888, 2779, 7588, 67, 4717, 12, 72, 1155, 67, 350, 16, 1686, 4672, 302, 1155, 273, 312, 1900, 1137, 18, 5040, 18, 7665, 18, 751, 5010, 7744, 18, 69...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 71, 18282, 67, 2080, 67, 31888, 2779, 7588, 67, 4717, 12, 72, 1155, 67, 350, 16, 1686, 4672, 302, 1155, 273, 312, 1900, 1137, 18, 5040, 18, 7665, 18, 751, 5010, 7744, 18, 69...
self.buf = self.buf + string.joinfields(self.buflist, '')
self.buf += EMPTYSTRING.join(self.buflist)
def getvalue(self): if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] return self.buf
c7ed0e3c1301fd27122e336eef7fd233526ccfc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c7ed0e3c1301fd27122e336eef7fd233526ccfc1/StringIO.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20590, 12, 2890, 4672, 309, 365, 18, 4385, 1098, 30, 365, 18, 4385, 1011, 8984, 5804, 18, 5701, 12, 2890, 18, 4385, 1098, 13, 365, 18, 4385, 1098, 273, 5378, 327, 365, 18, 4385, 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, 20590, 12, 2890, 4672, 309, 365, 18, 4385, 1098, 30, 365, 18, 4385, 1011, 8984, 5804, 18, 5701, 12, 2890, 18, 4385, 1098, 13, 365, 18, 4385, 1098, 273, 5378, 327, 365, 18, 4385, 2, -...
virtual = req.env.get("PATH_INFO", "").strip('/') if virtual.startswith('static/'): static = os.path.join(templater.templatepath(), 'static') fname = virtual[7:] req.write(staticfile(static, fname, req) or tmpl('error', error='%r not found' % fname)) elif virtual: while virtual: real = dict(self.repos).get(virtual)
try: virtual = req.env.get("PATH_INFO", "").strip('/') if virtual.startswith('static/'): static = os.path.join(templater.templatepath(), 'static') fname = virtual[7:] req.write(staticfile(static, fname, req) or tmpl('error', error='%r not found' % fname)) elif virtual: while virtual: real = dict(self.repos).get(virtual) if real: break up = virtual.rfind('/') if up < 0: break virtual = virtual[:up]
def get(section, name, default=None): return u.config(section, name, default, untrusted=True)
c83aed3419db82f951df457a948c5f44b594bdde /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/c83aed3419db82f951df457a948c5f44b594bdde/hgwebdir_mod.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 3464, 16, 508, 16, 805, 33, 7036, 4672, 327, 582, 18, 1425, 12, 3464, 16, 508, 16, 805, 16, 640, 25247, 33, 5510, 13, 2, 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, 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, 336, 12, 3464, 16, 508, 16, 805, 33, 7036, 4672, 327, 582, 18, 1425, 12, 3464, 16, 508, 16, 805, 16, 640, 25247, 33, 5510, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"""
"""
def prevTimepoint(self): """ Created: 18.07.2006, KP Description: Switch to previous timepoint """ if self.timepoint >= 1: self.setTimepoint(self.timepoint - 1) self.blockTpUpdate = 1 lib.messenger.send(None, "timepoint_changed", self.timepoint) self.blockTpUpdate = 0
228d177ed04eda3e5752ade67b1e400d3b569646 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/228d177ed04eda3e5752ade67b1e400d3b569646/Visualizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2807, 950, 1153, 12, 2890, 4672, 3536, 12953, 30, 6549, 18, 8642, 18, 6976, 26, 16, 1475, 52, 6507, 30, 13967, 358, 2416, 813, 1153, 3536, 309, 365, 18, 957, 1153, 1545, 404, 30, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2807, 950, 1153, 12, 2890, 4672, 3536, 12953, 30, 6549, 18, 8642, 18, 6976, 26, 16, 1475, 52, 6507, 30, 13967, 358, 2416, 813, 1153, 3536, 309, 365, 18, 957, 1153, 1545, 404, 30, 365, ...
for tbl in unordered:
for tbl in self._unordered:
def finalize(self): '''Write the final hash tables to the output file, and write out its index. The output file remains open upon return.''' unordered = [[] for i in range(256)] for slab in self._slabs: for pair in slab: unordered[pair[0] & 0xff].append(pair)
e7f2cfcd488fe8e484f0678b68aa07e9a9d7e3d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7738/e7f2cfcd488fe8e484f0678b68aa07e9a9d7e3d2/cdblib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12409, 12, 2890, 4672, 9163, 3067, 326, 727, 1651, 4606, 358, 326, 876, 585, 16, 471, 1045, 596, 2097, 770, 18, 1021, 876, 585, 22632, 1696, 12318, 327, 1093, 6309, 29573, 273, 306, 8526...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12409, 12, 2890, 4672, 9163, 3067, 326, 727, 1651, 4606, 358, 326, 876, 585, 16, 471, 1045, 596, 2097, 770, 18, 1021, 876, 585, 22632, 1696, 12318, 327, 1093, 6309, 29573, 273, 306, 8526...
self.pipeline = p
def f1(): f = ModuleFunction() f.name = 'op' f.returnType = 'void' param = ModuleParam() param.type = 'String' param.strValue = '+' f.params.append(param) return f
0b136f250a226eacc81b90eb4956369e988db984 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/0b136f250a226eacc81b90eb4956369e988db984/pipeline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 21, 13332, 284, 273, 5924, 2083, 1435, 284, 18, 529, 273, 296, 556, 11, 284, 18, 2463, 559, 273, 296, 6459, 11, 579, 273, 5924, 786, 1435, 579, 18, 723, 273, 296, 780, 11, 579, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 284, 21, 13332, 284, 273, 5924, 2083, 1435, 284, 18, 529, 273, 296, 556, 11, 284, 18, 2463, 559, 273, 296, 6459, 11, 579, 273, 5924, 786, 1435, 579, 18, 723, 273, 296, 780, 11, 579, ...
self.assertTrue(len(dirs), 4)
self.assertEqual(len(dirs), 4)
def test_getsitepackages(self): site.PREFIXES = ['xoxo'] dirs = site.getsitepackages()
477bd74fb9d12d61f8fb7cbcb55b2cdb33264622 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/477bd74fb9d12d61f8fb7cbcb55b2cdb33264622/test_site.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 14665, 305, 881, 484, 1023, 12, 2890, 4672, 2834, 18, 6307, 3991, 273, 10228, 92, 2409, 83, 3546, 7717, 273, 2834, 18, 14665, 305, 881, 484, 1023, 1435, 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, 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, 1842, 67, 14665, 305, 881, 484, 1023, 12, 2890, 4672, 2834, 18, 6307, 3991, 273, 10228, 92, 2409, 83, 3546, 7717, 273, 2834, 18, 14665, 305, 881, 484, 1023, 1435, 2, -100, -100, -100, ...
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False):
def _run_latex_(filename, debug=False, density=150, engine=None, png=False, do_in_background=False):
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't convert the dvi file to png (because of postscript specials or other issues), then dvips is called, and the PS file is converted to a png file. INPUT: - ``filename`` - string: file to process, including full path - ``debug`` - bool (optional, default False): whether to print verbose debugging output - ``density`` - integer (optional, default 150): how big output image is. - ``pdflatex`` - bool (optional, default False): whether to use pdflatex. - ``png`` - bool (optional, default False): whether to produce a png file. - ``do_in_background`` - bool (optional, default False): whether to run in the background. OUTPUT: string, which could be a string starting with 'Error' (if there was a problem), or it could be 'pdf' or 'dvi'. If ``pdflatex`` is False, then a dvi file is created, but if there appear to be problems with it (because of PS special commands, for example), then a pdf file is created instead. The function returns 'dvi' or 'pdf' to indicate which type of file is created. (Detecting problems requires that dvipng be installed; if it is not, then the dvi file is not checked for problems and 'dvi' is returned.) If ``pdflatex`` is True and there are no errors, then 'pdf' is returned. .. warning:: If ``png`` is True, then when using latex (the default), you must have 'dvipng' (or 'dvips' and 'convert') installed on your operating system, or this command won't work. When using pdflatex, you must have 'convert' installed. EXAMPLES:: sage: from sage.misc.latex import _run_latex_, _latex_file_ sage: file = os.path.join(SAGE_TMP, "temp.tex") sage: O = open(file, 'w') sage: O.write(_latex_file_([ZZ[x], RR])); O.close() sage: _run_latex_(file) # random - depends on whether latex is installed 'dvi' """ if pdflatex is None: pdflatex = _Latex_prefs._option["pdflatex"] if not pdflatex and not have_latex(): print "Error: LaTeX does not seem to be installed. Download it from" print "ctan.org and try again." return "Error" if pdflatex and not have_pdflatex(): print "Error: PDFLaTeX does not seem to be installed. Download it from" print "ctan.org and try again." return "Error" # if png output + latex, check to see if dvipng or convert is installed. if png: if not pdflatex and not (have_dvipng() or have_convert()): print "" print "Error: neither dvipng nor convert (from the ImageMagick suite)" print "appear to be installed. Displaying LaTeX or PDFLaTeX output" print "requires at least one of these programs, so please install" print "and try again." print "" print "Go to http://sourceforge.net/projects/dvipng/ and" print "http://www.imagemagick.org to download these programs." return "Error" # if png output + pdflatex, check to see if convert is installed. elif pdflatex and not have_convert(): print "" print "Error: convert (from the ImageMagick suite) does not" print "appear to be installed. Displaying PDFLaTeX output" print "requires this program, so please install and try again." print "" print "Go to http://www.imagemagick.org to download it." return "Error" # check_validity: check to see if the dvi file is okay by trying # to convert to a png file. if this fails, return_suffix will be # set to "pdf". return_suffix is the return value for this # function. # # thus if not png output, check validity of dvi output if dvipng # or convert is installed. else: check_validity = have_dvipng() # set up filenames, other strings: base, filename = os.path.split(filename) filename = os.path.splitext(filename)[0] # get rid of extension if len(filename.split()) > 1: raise ValueError, "filename must contain no spaces" if not debug: redirect=' 2>/dev/null 1>/dev/null ' else: redirect='' if do_in_background: background = ' &' else: background = '' if pdflatex: command = "pdflatex" # 'suffix' is used in the string 'convert' ... suffix = "pdf" return_suffix = "pdf" else: command = "latex" suffix = "ps" return_suffix = "dvi" # Define the commands to be used: lt = 'cd "%s"&& sage-native-execute %s \\\\nonstopmode \\\\input{%s.tex} %s'%(base, command, filename, redirect) # dvipng is run with the 'picky' option: this means that if # there are warnings, no png file is created. dvipng = 'cd "%s"&& sage-native-execute dvipng --picky -q -T tight -D %s %s.dvi -o %s.png'%(base, density, filename, filename) dvips = 'sage-native-execute dvips %s.dvi %s'%(filename, redirect) ps2pdf = 'sage-native-execute ps2pdf %s.ps %s'%(filename, redirect) # We seem to need a larger size when using convert compared to # when using dvipng: density = int(1.4 * density / 1.3) convert = 'sage-native-execute convert -density %sx%s -trim %s.%s %s.png %s '%\ (density,density, filename, suffix, filename, redirect) e = 1 # it is possible to get through the following commands # without running a program, so in that case we force error if pdflatex: if png: cmd = ' && '.join([lt, convert]) else: cmd = lt if debug: print cmd e = os.system(cmd + ' ' + redirect + background) else: # latex, not pdflatex if (png or check_validity): if have_dvipng(): cmd = ' && '.join([lt, dvipng]) if debug: print cmd e = os.system(cmd + ' ' + redirect) dvipng_error = not os.path.exists(base + '/' + filename + '.png') # If there is no png file, then either the latex # process failed or dvipng failed. Assume that dvipng # failed, and try running dvips and convert. (If the # latex process failed, then dvips and convert will # fail also, so we'll still catch the error.) if dvipng_error: if png: if have_convert(): cmd = ' && '.join(['cd "%s"'%(base,), dvips, convert]) if debug: print "'dvipng' failed; trying 'convert' instead..." print cmd e = os.system(cmd + ' ' + redirect + background) else: print "Error: 'dvipng' failed and 'convert' is not installed." return "Error: dvipng failed." else: # not png, i.e., check_validity return_suffix = "pdf" cmd = ' && '.join(['cd "%s"'%(base,), dvips, ps2pdf]) if debug: print "bad dvi file; running dvips and ps2pdf instead..." print cmd e = os.system(cmd) if e: # error running dvips and/or ps2pdf command = "pdflatex" lt = 'cd "%s"&& sage-native-execute %s \\\\nonstopmode \\\\input{%s.tex} %s'%(base, command, filename, redirect) if debug: print "error running dvips and ps2pdf; trying pdflatex instead..." print cmd e = os.system(cmd + background) else: # don't have dvipng, so must have convert. run latex, dvips, convert. cmd = ' && '.join([lt, dvips, convert]) if debug: print cmd e = os.system(cmd + ' ' + redirect + background) if e: print "An error occurred." try: print open(base + '/' + filename + '.log').read() except IOError: pass return "Error latexing slide." return return_suffix
0ba327bff9f9e2dd4e53c3716295af7ddd946dea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0ba327bff9f9e2dd4e53c3716295af7ddd946dea/latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2681, 67, 26264, 67, 12, 3459, 16, 1198, 33, 8381, 16, 12142, 33, 23014, 16, 4073, 33, 7036, 16, 14476, 33, 8381, 16, 741, 67, 267, 67, 9342, 33, 8381, 4672, 3536, 1220, 7597, 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, 389, 2681, 67, 26264, 67, 12, 3459, 16, 1198, 33, 8381, 16, 12142, 33, 23014, 16, 4073, 33, 7036, 16, 14476, 33, 8381, 16, 741, 67, 267, 67, 9342, 33, 8381, 4672, 3536, 1220, 7597, 2...
mysql_cur.execute("SELECT name FROM products")
if BZ_VERSION >= 2180: mysql_cur.execute("SELECT name FROM products") else: mysql_cur.execute("SELECT product AS name FROM products")
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % \ (_db, _host, _user, ("*" * len(_password))) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "\nCleaning all tickets..." c = trac.db().cursor() c.execute("DELETE FROM ticket_change") trac.db().commit() c.execute("DELETE FROM ticket") trac.db().commit() c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") # Straight from the Python documentation. for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_dir): os.mkdir(attachments_dir) trac.db().commit() print "All tickets cleaned..." print "\n0. Filtering products..." mysql_cur.execute("SELECT name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = products print " Using products", " ".join(PRODUCTS) print "\n1. Import severities..." trac.setSeverityList(SEVERITIES) print "\n2. Import components..." if not COMPONENTS_FROM_PRODUCTS: if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'name') else: sql = """SELECT program AS product, value AS comp, initialowner AS owner FROM components""" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) lines = mysql_cur.fetchall() all_components = {} # product -> components all_owners = {} # product, component -> owner for line in lines: product = line['product'] comp = line['comp'] owner = line['owner'] all_components.setdefault(product, []).append(comp) all_owners[(product, comp)] = owner component_list = [] for product, components in all_components.items(): # find best default owner default = None for comp in DEFAULT_COMPONENTS: if comp in components: default = comp break if default is None: default = components[0] owner = all_owners[(product, default)] owner_name = trac.getLoginName(mysql_cur, owner) component_list.append({'product': product, 'owner': owner_name}) trac.setComponentList(component_list, 'product') print "\n3. Import priorities..." trac.setPriorityList(PRIORITIES) print "\n4. Import versions..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCTROW versions.value AS value FROM products, versions""" sql += " WHERE" + makeWhereClause('products.name', PRODUCTS) else: sql = "SELECT DISTINCTROW value FROM versions" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) milestones = mysql_cur.fetchall() trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.id" sql += " ORDER BY b.bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print "\n7. Import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'].lower() ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) cc_list = [cc for cc in cc_list if '@' in cc and cc not in IGNORE_CC] ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time = desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] keywords = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == "resolution" or field_name == "bug_status": removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == "resolution": resolution = added.lower() add_keywords = [] remove_keywords = [] # convert bugzilla field names... if field_name == "bug_severity": field_name = "severity" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" if removed in STATUS_KEYWORDS: remove_keywords.append(STATUS_KEYWORDS[removed]) if added in STATUS_KEYWORDS: add_keywords.append(STATUS_KEYWORDS[added]) added = statusXlator[added] removed = statusXlator[removed] elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(removed, removed) if kw: remove_keywords.append(kw) if MAP_ALL_KEYWORDS or added in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(added, added) if kw: add_keywords.append(kw) if field_name == "component": # just keep the keyword change added = removed = "" elif field_name == "target_milestone": field_name = "milestone" if added in IGNORE_MILESTONES: added = "" if removed in IGNORE_MILESTONES: removed = "" ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if add_keywords or remove_keywords: # ensure removed ones are in old old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] # remove from new keywords = [kw for kw in keywords if kw not in remove_keywords] # add to new keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChangeKw['field'] = "keywords" ticketChangeKw['oldvalue'] = ' '.join(old_keywords) ticketChangeKw['newvalue'] = ' '.join(keywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # Skip changes that have no effect (think translation!). if added == removed: continue # Bugzilla splits large summary changes into two records. for oldChange in ticketChanges: if (field_name == "summary" and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break # cc sometime appear in different activities with same time if (field_name == "cc" \ and oldChange['time'] == ticketChange['time']): oldChange['newvalue'] += ", " + ticketChange['newvalue'] break else: ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # For some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. Let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == "closed": ticket['resolution'] = resolution bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] if kw not in keywords: keywords.append(kw) product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: keywords.append(kw) component = bug['component'] if (COMPONENTS_FROM_PRODUCTS and \ (MAP_ALL_KEYWORDS or component in KEYWORDS_MAPPING)): kw = KEYWORDS_MAPPING.get(component, component) if kw and kw not in keywords: keywords.append(kw) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) trac.addAttachment(author, a) print "\n8. Importing users and passwords..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['login_name'] htpasswd.write(login + ":" + user['cryptpassword'] + "\n") htpasswd.close() print " Bugzilla users converted to htpasswd format, see 'htpasswd'." print "\nAll tickets converted."
96cc24322ea11500094f96e7b8dc5b0c7e85d253 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/96cc24322ea11500094f96e7b8dc5b0c7e85d253/bugzilla2trac.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
tarinfo = self.tarfile.next() if not tarinfo: self.tarfile._loaded = True raise StopIteration
if not self.tarfile._loaded: tarinfo = self.tarfile.next() if not tarinfo: self.tarfile._loaded = True raise StopIteration else: try: tarinfo = self.tarfile.members[self.index] except IndexError: raise StopIteration self.index += 1
def next(self): """Return the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. """ tarinfo = self.tarfile.next() if not tarinfo: self.tarfile._loaded = True raise StopIteration return tarinfo
b59755619214a1f1926fd11fdfdf365f25225b6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b59755619214a1f1926fd11fdfdf365f25225b6c/tarfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 12, 2890, 4672, 3536, 990, 326, 1024, 761, 1450, 20334, 812, 1807, 1024, 1435, 707, 18, 5203, 777, 4833, 1240, 2118, 855, 16, 444, 20334, 812, 487, 389, 4230, 18, 3536, 565, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1024, 12, 2890, 4672, 3536, 990, 326, 1024, 761, 1450, 20334, 812, 1807, 1024, 1435, 707, 18, 5203, 777, 4833, 1240, 2118, 855, 16, 444, 20334, 812, 487, 389, 4230, 18, 3536, 565, 309, ...
print "Number of starttimes != Number of IFOs"
print >> sys.stderr, "Number of starttimes != Number of IFOs"
def main(): # Import the Configuration File into config # Import the Configuration File into config if(len(sys.argv) < 2): print "Insufficient command line arguments " print " Usage is ",sys.argv[0]," <ConfigFile> {Job Number} " print " Exiting ........." sys.exit(1) try: config = __import__(sys.argv[1]); except: print "Cannot import Config file '",sys.argv[1],"' exiting ...." sys.exit(1) UniqueID = '' # Compute Unique ID Number if(len(sys.argv) >= 3): UniqueID += '_' + sys.argv[2] # Variables Structure/Dictionary Vars = {} # SFT time baseline try: Vars['TSFT'] = config.TSFT except: print "TSFT cannot be read" sys.exit(1) # Strength of signal try: Vars['h0'] = config.h0 except: print "h0 cannot be read" sys.exit(1) # Cosine of iota try: Vars['cosi'] = config.cosi except: try: Vars['cosi'] = random.uniform(config.cosi_min,config.cosi_max) except: print "Cannot read in cosi variable" sys.exit(1) if(math.fabs(Vars['cosi']) > 1): print "abs(cosi) > 1 !!!" sys.exit(1) # Initial Phase try: Vars['phi0'] = config.phi0 except: try: Vars['phi0'] = random.uniform(config.phi0_min,config.phi0_max) except: print "Cannot read in phi0 variable" sys.exit(1) # Polarization Angle try: Vars['psi'] = config.psi except: try: Vars['psi'] = random.uniform(config.psi_min,config.psi_max) except: print "Cannot read in psi variable" sys.exit(1) # Number of Dirichlet terms used. try: Vars['Dterms'] = float(config.Dterms) except: print "Dterms cannot be read" sys.exit(1) # Interferometer try: IFOs = config.IFOs IFOs = IFOs.split(' ') NumofIFOs = len(IFOs) Vars['NumofIFOs'] = NumofIFOs Vars['IFO'] = [] for i in range(NumofIFOs): Vars['IFO'].append(IFOs[i]) except: print "IFO cannot be read" sys.exit(1) # Start Time try: t0 = config.t0 t0 = t0.split(' ') if(len(t0) != NumofIFOs): print "Number of starttimes != Number of IFOs" sys.exit(1) Vars['t0'] = [] for i in range(NumofIFOs): Vars['t0'].append(float(t0[i])) except: print "t0 cannot be read" sys.exit(1) # Reference Time in SSB try: Vars['refTime'] = float(config.refTime) refString = ' --refTime ' + str(Vars['refTime']) except: refString = ' ' # Output Directory try: Vars['Out'] = config.Out + UniqueID except: print "Out cannot be read" sys.exit(1) # Ephemeris Directory try: Vars['Ephem'] = config.Ephem except: print "Ephem cannot be read" sys.exit(1) # Ephemeris Year try: Vars['EphemYear'] = config.EphemYear except: print "EphemYear cannot be read" sys.exit(1) # Noise Sh try: Vars['Sh'] = float(config.Sh) except: print "Sh cannot be read" sys.exit(1) # Duration of Analysis try: TSpan = config.TSpan TSpan = TSpan.split(' ') if(len(TSpan) != NumofIFOs): print "Number of TSpans != Number of IFOs" sys.exit(1) Vars['TSpan'] = [] for i in range(NumofIFOs): Vars['TSpan'].append(float(TSpan[i])) except: print "TSpan cannot be read" sys.exit(1) # Number of SFTs to add try: NumSFTs = config.NumSFTs NumSFTs = NumSFTs.split(' ') if(len(NumSFTs) != NumofIFOs): print "Number of starttimes != Number of IFOs" sys.exit(1) Vars['NumSFTs'] = [] for i in range(NumofIFOs): Vars['NumSFTs'].append(int(NumSFTs[i])) except: print "NumSFTs cannot be read" sys.exit(1) # Number of Gaps to add try: NumGaps = config.NumGaps NumGaps = NumGaps.split(' ') if(len(NumGaps) != NumofIFOs): print "Number of starttimes != Number of IFOs" sys.exit(1) Vars['NumGaps'] = [] for i in range(NumofIFOs): Vars['NumGaps'].append(int(NumGaps[i])) except: print "NumGaps cannot be read" sys.exit(1) # Alpha (Right Ascension) try: Vars['Alpha'] = config.Alpha except: try: Vars['Alpha'] = random.uniform(config.Alpha_min,config.Alpha_max) except: print "Cannot read in Alpha variable" sys.exit(1) if(Vars['Alpha'] < 0 or Vars['Alpha'] > 2.0*math.pi): print "Alpha out of bounds !!!" sys.exit(1) # Delta (Declination) try: Vars['Delta'] = config.Delta except: try: Vars['Delta'] = random.uniform(config.Delta_min,config.Delta_max) except: print "Cannot read in Delta variable" sys.exit(1) if(math.fabs(Vars['Delta']) > math.pi/2.0): print "abs(Delta) > pi/2 !!!" sys.exit(1) # Minimum Frequency try: Vars['Fmin'] = config.Fmin except: print "Fmin cannot be read" sys.exit(1) # Band of Analysis try: Vars['Band'] = config.Band except: print "Band cannot be read" sys.exit(1) # Injection Frequency try: Vars['Finj'] = config.Finj except: try: Vars['Finj'] = random.uniform(config.Finj_min,config.Finj_max) except: print "Cannot read in Finj variable" sys.exit(1) if(Vars['Finj'] < 0): print "Finj < 0 !!!" sys.exit(1) # Spindown/ FDOT try: Vars['FDot'] = config.FDot except: try: Vars['FDot'] = random.uniform(config.FDot_min,config.FDot_max) except: print "Cannot read in FDot variable" sys.exit(1) # FDOTBand try: Vars['FDotBand'] = config.FDotBand except: Vars['FDotBand'] = 0 #print "Cannot read in FDot variable" #sys.exit(1) # dFDot try: Vars['dFDot'] = config.dFDot except: Vars['dFDot'] = 10 # Resolution try: Vars['Res'] = config.Res if(Vars['Res'] > 1.0/Vars['TSpan'][0]): print "Resolution too low, set to 1/T" Vars['Res'] = 1.0/Vars['TSpan'][0] if(Vars['Res'] < 0): print "Resolution < 0" sys.exit(1) except: Vars['Res'] = 1.0/Vars['TSpan'][0] current = 0 for i in range(NumofIFOs): if(Vars['TSpan'][i] > Vars['TSpan'][current]): current = i Vars['Res'] = 1.0/Vars['TSpan'][i] # Debug Check try: Vars['debug'] = config.debug except: Vars['debug'] = 1.0 # F Threshold try: Vars['FThres'] = config.FThres except: Vars['FThres'] = 0 # Optional Output Variable from Resamp try: Vars['ResampOutput'] = config.ResampOutput except: Vars['ResampOutput'] = "MyTS" # Optional Use Your Own TimeStampsFile try: Vars['TimeStampsFile'] = config.TimeStampsFile TimeStampsFile_Is_Set = True except: Vars['TimeStampsFile'] = 'TimeStampsFile' + UniqueID TimeStampsFile_Is_Set = False # Print out all the variables (if Debug is on) if(Vars['debug']): print "---------- Configuration Variables --------- " PrintValues(Vars) print "-------------------------------------------- \n \n" # Create the Time Stamp File if(not(TimeStampsFile_Is_Set)): CreateTimeStampFile(Vars,UniqueID) # If running multiple time, delete all the old SFTs if(os.path.exists("./"+Vars['Out'])): try: shutil.rmtree(Vars['Out']) except: print "Could not delete old directory\n" sys.exit(1) try: os.mkdir(Vars['Out']) except: print "Something went wrong creating new directory\n" print "Permission trouble maybe\n" sys.exit(1) # Generate Fake data string for ifo in range(NumofIFOs): FakeDataString = GenFakeDataString(1,Vars,ifo,UniqueID,refString) if(Vars['debug']): print "----------- Makefakedata String ------------" print FakeDataString print "--------------------------------------------\n\n" # Generate the data try: G = commands.getoutput(FakeDataString) os.remove("timestampsFile"+Vars['IFO'][ifo]+UniqueID) except: print "Tried to generate SFTs, failed" sys.exit(1) # Run v2() OutputFileVLoudest = "OutputVLoudest" + UniqueID OutputFileVFstat = "OutputVFstat" + UniqueID startstring = "lalapps_ComputeFStatistic_v2 --outputFstat " + OutputFileVFstat + " --outputLoudest " + OutputFileVLoudest + " -F " + str(Vars['FThres']) + " " endstring = " " + refString V2DataString = GenDataString(startstring,endstring,Vars) if(Vars['debug']): print "----------- V2 String ------------" print V2DataString print "----------------------------------\n\n" print "----------- Running V2 -----------" (status,Voutput) = commands.getstatusoutput(V2DataString) if(status): print "V2 failed, Output was \n\n" print Voutput sys.exit(1) if(Vars['debug']): print "---------- V2 Done ---------------\n\n" # Run Resamp ResampLocation = "/home/ppatel/lalsuite/lalapps/src/pulsar/FDS_isolated/ResamplingFstat/" OutputFileRLoudest = "OutputRLoudest" + UniqueID OutputFileRFstat = "OutputRFstat" + UniqueID startstring = ResampLocation + "lalapps_ComputeFStatistic_resamp --outputFstat " + OutputFileRFstat + " --outputLoudest " + OutputFileRLoudest+ " -F " + str(Vars['FThres']) + " " endstring = " " + refString RDataString = GenDataString(startstring,endstring,Vars) if(Vars['debug']): print "-------- Resamp String -----------" print RDataString print "----------------------------------\n\n" print "--------- Running Resamp ---------" (status,Routput) = commands.getstatusoutput(RDataString) if(status): print "Resamp failed, Output was\n\n" print Routput sys.exit(0) if(Vars['debug']): print "---------- Resamp Done -----------\n\n" if(Vars['debug']): print "---------- Deleting SFT Folder ---------\n\n" try: shutil.rmtree(Vars['Out']) except: print " Could not delete SFT folder \n\n" sys.exit(1) FreqOutput = AnalyzeFreq(OutputFileRFstat,OutputFileVFstat,Vars['Finj'],Vars['Res']) LoudestOutput = AnalyzeLoudest(OutputFileRLoudest,OutputFileVLoudest) os.remove(OutputFileRLoudest) os.remove(OutputFileVLoudest) #os.remove(OutputFileRFstat) #os.remove(OutputFileVFstat) print FreqOutput,LoudestOutput return(0)
9f242671e9d0d7238a0ede41c485e14209156b6b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/9f242671e9d0d7238a0ede41c485e14209156b6b/multiresamp_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 225, 468, 6164, 326, 4659, 1387, 1368, 642, 468, 6164, 326, 4659, 1387, 1368, 642, 309, 12, 1897, 12, 9499, 18, 19485, 13, 411, 576, 4672, 1172, 315, 5048, 11339, 1296, 980,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 225, 468, 6164, 326, 4659, 1387, 1368, 642, 468, 6164, 326, 4659, 1387, 1368, 642, 309, 12, 1897, 12, 9499, 18, 19485, 13, 411, 576, 4672, 1172, 315, 5048, 11339, 1296, 980,...
print base_config().cache.base_dir
def run(self): print base_config().cache.base_dir while True: tiles, progress = self.tiles_queue.get() if tiles is None: return print '[%s] %6.2f%% %s \tETA: %s\r' % ( timestamp(), progress[1]*100, progress[0], progress[2] ), sys.stdout.flush() if not self.dry_run: exp_backoff(self.tile_mgr.load_tile_coords, args=(tiles,), exceptions=(SourceError, IOError))
24300d6b16d49109f9ed5e38a4059e92fdfe4297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11249/24300d6b16d49109f9ed5e38a4059e92fdfe4297/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 1323, 1053, 30, 12568, 16, 4007, 273, 365, 18, 28366, 67, 4000, 18, 588, 1435, 309, 12568, 353, 599, 30, 327, 1172, 21848, 87, 65, 738, 26, 18, 22, 74, 11438, 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, 1086, 12, 2890, 4672, 1323, 1053, 30, 12568, 16, 4007, 273, 365, 18, 28366, 67, 4000, 18, 588, 1435, 309, 12568, 353, 599, 30, 327, 1172, 21848, 87, 65, 738, 26, 18, 22, 74, 11438, 7...
test(r"""sre.match(sre.escape(chr(i)), chr(i)) != None""", 1)
test(r"""sre.match(sre.escape(chr(i)), chr(i)) is not None""", 1)
def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1)
43203310e1400f4f6211972756449af0de8cca51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43203310e1400f4f6211972756449af0de8cca51/test_sre.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23559, 67, 2107, 12, 1916, 2603, 4672, 509, 67, 1132, 273, 509, 12, 1916, 2603, 18, 1655, 12, 20, 3719, 327, 609, 12, 474, 67, 1132, 397, 404, 13, 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, 23559, 67, 2107, 12, 1916, 2603, 4672, 509, 67, 1132, 273, 509, 12, 1916, 2603, 18, 1655, 12, 20, 3719, 327, 609, 12, 474, 67, 1132, 397, 404, 13, 225, 2, -100, -100, -100, -100, -10...
tags:tag1,tag2,tag3 : This way you can apply as many tags as you wish using comma as separator
You can also create a task with the attributes "tags", "due", and "defer" in the quickadd entry. The syntax for these attributes is:
def populate(): doc,root = cleanxml.emptydoc("project") #Task 0@1: Getting started with GTG title1 = _("Getting started with GTG") text1 = _("""Welcome to Getting Things Gnome!, your new task manager.
76bf5caf1729f76e2bf15a86b25f71ed1983de5e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/76bf5caf1729f76e2bf15a86b25f71ed1983de5e/firstrun_tasks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 13332, 997, 16, 3085, 273, 2721, 2902, 18, 5531, 2434, 2932, 4406, 7923, 225, 468, 2174, 374, 36, 21, 30, 26602, 5746, 598, 19688, 43, 2077, 21, 273, 389, 2932, 19213, 5746, 598, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6490, 13332, 997, 16, 3085, 273, 2721, 2902, 18, 5531, 2434, 2932, 4406, 7923, 225, 468, 2174, 374, 36, 21, 30, 26602, 5746, 598, 19688, 43, 2077, 21, 273, 389, 2932, 19213, 5746, 598, ...
url = response.getheader('Location') logger.debug("Redirecting to: %s" % url) continue
newurl = response.getheader('Location') old = urlparse.urlsplit(url) new = urlparse.urlsplit(newurl) if old[0] == new[0] and old[1] == new[1]: url = newurl logger.debug("Redirecting to: %s" % url) continue else: logger.debug("Illegal redirect: %s to %s" % (url, newurl)) raise IllegalRedirect()
def _request(self, method, url, body=None, extraHeaders={ }): logger.debug("_request: %s %s" % (method, url))
b8f3bed0788e226f719527f46cedaf9b2e897531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b8f3bed0788e226f719527f46cedaf9b2e897531/WebDAV.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2293, 12, 2890, 16, 707, 16, 880, 16, 1417, 33, 7036, 16, 2870, 3121, 5899, 289, 4672, 1194, 18, 4148, 2932, 67, 2293, 30, 738, 87, 738, 87, 6, 738, 261, 2039, 16, 880, 3719, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 2293, 12, 2890, 16, 707, 16, 880, 16, 1417, 33, 7036, 16, 2870, 3121, 5899, 289, 4672, 1194, 18, 4148, 2932, 67, 2293, 30, 738, 87, 738, 87, 6, 738, 261, 2039, 16, 880, 3719, ...
if ((tokenizer.token.value == "get" || tokenizer.token.value == "set") &&
if ((tokenizer.token.value == "get" or tokenizer.token.value == "set") &&
def PrimaryExpression(tokenizer, compilerContext) { var node, childNode, n3, tokenType = tokenizer.get(True) var builder = compilerContext.builder
58afad4d3cade0a037f53f0a04cb23589df417b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/58afad4d3cade0a037f53f0a04cb23589df417b1/Parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15884, 2300, 12, 2316, 1824, 16, 5274, 1042, 13, 288, 569, 756, 16, 9465, 16, 290, 23, 16, 22302, 273, 10123, 18, 588, 12, 5510, 13, 569, 2089, 273, 5274, 1042, 18, 9574, 2, 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, 1, 1, 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, 15884, 2300, 12, 2316, 1824, 16, 5274, 1042, 13, 288, 569, 756, 16, 9465, 16, 290, 23, 16, 22302, 273, 10123, 18, 588, 12, 5510, 13, 569, 2089, 273, 5274, 1042, 18, 9574, 2, -100, -1...
if options.disable_translation: DEFINES += "QT_NO_TRANSLATION "
if not options.enable_translation: DEFINES += "QT_NO_TRANSLATION "
def main(): # Options for qmake DEFINES = "" CONFIG = "" # Setup command line parser parser = OptionParser(version="%prog 0.2") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") parser.add_option("--python-includes", dest="py_incpath", help="Python include directory") parser.add_option("--python-libraries", dest="py_libpath", help="Python library path") parser.add_option("--qt-directory", dest="qt_dir", help="Base directory of Qt") parser.add_option("--static", action="store_true", dest="staticlink", help="Build wokfpack using static libraries") parser.add_option("--enable-debug", action="store_true", dest="enable_debug", help="Enables basic debugging support.") parser.add_option("--enable-aidebug", action="store_true", dest="enable_aidebug", help="Enabled debugging of NPC AI.") parser.add_option("--enable-mysql", action="store_true", dest="enable_mysql", help="Enables MySQL support.") parser.add_option("--disable-translation", action="store_true", dest="disable_translation", help="Disable non-English language support.") (options, args) = parser.parse_args() if options.nocolor or sys.platform == "win32": nocolor() checkPython(options, True, not (sys.platform == "darwin") ) if options.enable_mysql: CONFIG += "mysql " DEFINES += "MYSQL_DRIVER " checkMySQL(options) checkQt() if options.disable_translation: DEFINES += "QT_NO_TRANSLATION " # Create config.pri global py_libpath global py_libfile global py_incpath global qt_qmake global mysql_libpath global mysql_libfile global mysql_incpath config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n") config.write("# any changes to this file will be lost!\n") # Build Python LIBS and Includes if sys.platform == "darwin": # MacPython is build as a Framework, not a library :/ PY_LIBDIR = distutils.sysconfig.get_config_vars("LINKFORSHARED")[0] PY_LIBDIR += " -flat_namespace" else: PY_LIBDIR = buildLibLine( py_libpath, py_libfile ) config.write("PY_LIBDIR = %s\n" % PY_LIBDIR) config.write("PY_INCDIR = %s\n" % py_incpath ) # Build MySQL Libs and Includes MySQL_LIBDIR = buildLibLine( mysql_libpath, mysql_libfile ) config.write("MySQL_INCDIR = %s\n" % mysql_incpath ) config.write("MySQL_LIBDIR = %s\n" % MySQL_LIBDIR ) # if --debug if options.enable_debug: DEFINES += "_DEBUG " CONFIG += "debug warn_on " else: CONFIG += "release warn_off " # if --aidebug if options.enable_aidebug: DEFINES += "_AIDEBUG " config.write("DEFINES += %s\n" % DEFINES) config.write("CONFIG += %s\n" % CONFIG) config.write("LIBS += $$PY_LIBDIR $$MySQL_LIBDIR \n") config.write("INCLUDEPATH += $$PY_INCDIR $$MySQL_INCDIR \n") config.close() sys.stdout.write(green("Generating makefile...")) sys.stdout.flush() os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro"]) if options.dsp: sys.stdout.write("Generating Visual Studio project files...\n") os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, "wolfpack.pro", "-t vcapp"]) sys.stdout.write(bold("Done\n")) sys.stdout.write(bold("Configure finished. Please run 'make' now.\n"))
d941256082445e4067ba7bbfd19725f6d2fd0a35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/d941256082445e4067ba7bbfd19725f6d2fd0a35/configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 5087, 364, 1043, 6540, 25957, 3740, 55, 273, 1408, 9128, 273, 1408, 225, 468, 10939, 1296, 980, 2082, 2082, 273, 18862, 12, 1589, 11613, 14654, 374, 18, 22, 7923, 2082, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 468, 5087, 364, 1043, 6540, 25957, 3740, 55, 273, 1408, 9128, 273, 1408, 225, 468, 10939, 1296, 980, 2082, 2082, 273, 18862, 12, 1589, 11613, 14654, 374, 18, 22, 7923, 2082, ...
self->entries[i]->n = n
self->entries[i][0].n = n
void *def land_hash_insert(LandHash *self, char const *thekey, void *data): """Insert data into a LandHash. A LandHash simply is a mapping of keys to data pointers - it will never touch the passed data in any way. E.g. you need to make sure to delete any pointers you add to a hash. If the key already exists, there will be two entries with the same key from now on, and it is undefined behavior which one will get returned when querying for the key.""" int i # Need to resize? if (self->count + 1) * 2 > self->size: int oldsize = self->size LandHashEntry **oldentries = self->entries if !self->size: self->bits = 1 # for first entry, we already want size 2 else: self->bits++ self->size = 1 << self->bits self->entries = land_calloc(self->size * sizeof *self->entries) self->count = 0 for i = 0; i < oldsize; i++: LandHashEntry *entry = oldentries[i] if entry: int j for j = 0; j < entry->n; j++: land_hash_insert(self, entry[j].thekey, entry[j].data) land_free(entry[j].thekey) land_free(entry) if oldentries: land_free(oldentries) # Now there should be ample room to add the new one. i = self->hash_function(self, thekey) LandHashEntry *entry = self->entries[i] int n = entry ? entry->n + 1 : 1 self->entries[i] = land_realloc(entry, n * sizeof *entry) self->entries[i][n - 1].thekey = land_strdup(thekey) self->entries[i][n - 1].data = data self->entries[i]->n = n self->count++ return data
b295804d50a24d5b1258d8055ee7d1587badc5d4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/930/b295804d50a24d5b1258d8055ee7d1587badc5d4/hash.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 918, 380, 536, 19193, 67, 2816, 67, 6387, 12, 29398, 2310, 380, 2890, 16, 1149, 1866, 380, 5787, 856, 16, 918, 380, 892, 4672, 3536, 4600, 501, 1368, 279, 511, 464, 2310, 18, 225, 432, 511, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 918, 380, 536, 19193, 67, 2816, 67, 6387, 12, 29398, 2310, 380, 2890, 16, 1149, 1866, 380, 5787, 856, 16, 918, 380, 892, 4672, 3536, 4600, 501, 1368, 279, 511, 464, 2310, 18, 225, 432, 511, ...
while var in dir(__builtins__):
while var in dir(__builtin__):
def test_package_import__semantics(self):
6b5f56f291b77472b2f9321cd9b1a981d26390c0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/6b5f56f291b77472b2f9321cd9b1a981d26390c0/test_pkgimport.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5610, 67, 5666, 972, 18756, 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, ...
[ 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, 1842, 67, 5610, 67, 5666, 972, 18756, 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,...
hour,min,sec=self.parent.date.second2time(int(record_list[3]))
hour,min,sec=self.parent.date.second2time(timeinseconds)
def actualize_dayview(self,record_list): if len(record_list)>0: record_list=record_list[0] distance = self.parseFloat(record_list[2]) beats = self.parseFloat(record_list[4]) average = self.parseFloat(record_list[6]) calories = self.parseFloat(record_list[7]) self.dayview.set_sensitive(1) self.day_distance.set_text("%0.2f" %distance) hour,min,sec=self.parent.date.second2time(int(record_list[3])) self.day_hour.set_text("%d" %hour) self.day_minute.set_text("%d" %min) self.day_second.set_text("%d" %sec) self.day_beats.set_text("%0.2f" %beats) self.day_average.set_text("%0.2f" %average) self.day_calories.set_text("%0.0f" %calories) self.day_topic.set_text(record_list[1]) else: self.dayview.set_sensitive(0)
1510b4c661040e069508770d471a3c85c2436c4e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11865/1510b4c661040e069508770d471a3c85c2436c4e/windowmain.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3214, 554, 67, 2881, 1945, 12, 2890, 16, 3366, 67, 1098, 4672, 309, 562, 12, 3366, 67, 1098, 13, 34, 20, 30, 1409, 67, 1098, 33, 3366, 67, 1098, 63, 20, 65, 225, 3888, 273, 365, 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, 3214, 554, 67, 2881, 1945, 12, 2890, 16, 3366, 67, 1098, 4672, 309, 562, 12, 3366, 67, 1098, 13, 34, 20, 30, 1409, 67, 1098, 33, 3366, 67, 1098, 63, 20, 65, 225, 3888, 273, 365, 18...
%(keysAndValues)s
def send_report(self, report): try: keys = self.load_report(report) except IOError: return self.send_internal_error('Invalid report.')
8d89a4f563c907f77f6daf1c0d56f66a20c4045c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11986/8d89a4f563c907f77f6daf1c0d56f66a20c4045c/ScanView.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 6006, 12, 2890, 16, 2605, 4672, 775, 30, 1311, 273, 365, 18, 945, 67, 6006, 12, 6006, 13, 1335, 8340, 30, 327, 365, 18, 4661, 67, 7236, 67, 1636, 2668, 1941, 2605, 1093, 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, 1366, 67, 6006, 12, 2890, 16, 2605, 4672, 775, 30, 1311, 273, 365, 18, 945, 67, 6006, 12, 6006, 13, 1335, 8340, 30, 327, 365, 18, 4661, 67, 7236, 67, 1636, 2668, 1941, 2605, 1093, 13...
for path in self.getplatformpaths(libname): yield path
def getpaths(self,libname): """Return a list of paths where the library might be found.""" if os.path.isabs(libname): yield libname else: for p in self.other_dirs: yield os.path.join(p,libname) yield os.path.join(".",libname) path = ctypes.util.find_library(libname) if path: yield path for path in self.getplatformpaths(libname): yield path
ff63fd4e07491d4faf12997a5def407e97ca4051 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5005/ff63fd4e07491d4faf12997a5def407e97ca4051/libraryloader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4481, 12, 2890, 16, 2941, 529, 4672, 3536, 990, 279, 666, 434, 2953, 1625, 326, 5313, 4825, 506, 1392, 12123, 309, 1140, 18, 803, 18, 291, 5113, 12, 2941, 529, 4672, 2824, 2561, 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, 336, 4481, 12, 2890, 16, 2941, 529, 4672, 3536, 990, 279, 666, 434, 2953, 1625, 326, 5313, 4825, 506, 1392, 12123, 309, 1140, 18, 803, 18, 291, 5113, 12, 2941, 529, 4672, 2824, 2561, 5...
makeTagCloud(keylist, outwords) return keyws def makeTagCloud(entries, outwords):
html_out.sort() html_out.reverse() makeTagCloud(html_out) return 0 def makeTagCloud(entries):
def generate_keywords_rdf(textfile, dictfile, output, outwords, mode): """ A method that generates keywords from an rdf thesaurus. """ keylist = [] keyws = [] counts = {} entries = [] ns_skos = rdflib.Namespace("http://www.w3.org/2004/02/skos/core#") ns_dc=rdflib.Namespace("http://purl.org/dc/elements/1.1/") ns_rdf=rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#") ns_concept=rdflib.Namespace("http://cain.nbii.org/thesauri/CERESTheme.rdf") store = rdflib.Graph() store.load(dictfile) size = int(os.stat(textfile).st_size) rtmp = open(textfile, 'r') if mode == 1: # Fast mode: analysing only abstract + title + middle portion of document # Abstract and title is never more than 20% of whole document. text_string = str(rtmp.read(int(size*0.2))) throw_away = str(rtmp.read(int(size*0.25))) text_string += str(rtmp.read(int(size*0.2))) else: # Slow mode: get all document text_string = str(rtmp.read()) # text_string = text_string.lower() rtmp.close() try: if text_string.find("Keywords:"): safe_keys = text_string.split("Keywords:")[1].split("\n")[0] elif text_string.find("Key words:"): safe_keys = text_string.split("Key words:")[1].split("\n")[0] elif text_string.find("Key Words:"): safe_keys = text_string.split("Key Words:")[1].split("\n")[0] except: safe_keys = "" for s,pref in store.subject_objects(ns_skos["prefLabel"]): dictOUT = 0 dictOUT_alt = 0 safeOUT = 0 alternatives = " " broaders = " " narrowers = " " relateds = " " safekey = 0 if pref[:2].isupper(): # First two letters are uppercase. This could be an acronym. Better leave case untouched pattern = sre.compile('\\b' + pref.strip() + '\\b') else: # Let's do some case insensitive search pattern = sre.compile('\\b' + pref.strip() + '\\b', sre.I) dictOUT = len(sre.findall(pattern,text_string)) safeOUT = len(sre.findall(pattern,safe_keys)) for alt in store.objects(s, ns_skos["altLabel"]): if alt[:2].isupper(): # First two letters are uppercase. This could be an acronym. Better leave case untouched pattern_alt = sre.compile('\\b' + alt.strip() + '\\b') else: # Let's do some case insensitive search pattern_alt = sre.compile('\\b' + alt.strip() + '\\b', sre.I) dictOUT_alt += len(sre.findall(pattern_alt,text_string)) safeOUT += len(sre.findall(pattern_alt,safe_keys)) alternatives += alt.strip() + ", " alternatives = alternatives[:-2] dictOUT_total = int(dictOUT) + int(dictOUT_alt) if dictOUT_total>1: if safeOUT>0: safekey = safeOUT for bro in store.objects(s, ns_skos["broader"]): bro_link = store.value(bro, ns_skos["prefLabel"], any=True) if bro_link: broaders += bro_link.strip() + ", " for nar in store.objects(s, ns_skos["narrower"]): nar_link = store.value(nar, ns_skos["prefLabel"], any=True) if nar_link: narrowers += nar_link.strip() + ", " for rel in store.objects(s, ns_skos["related"]): rel_link = store.value(rel, ns_skos["prefLabel"], any=True) if rel_link: relateds += rel_link.strip() + ", " broaders = broaders[:-2] narrowers = narrowers[:-2] relateds = relateds[:-2] keylist.append([dictOUT_total, dictOUT, dictOUT_alt, pref.strip(), alternatives, relateds, broaders, narrowers, safekey]) keylist.sort() keylist.reverse() if output == 0: details = "\n" for i in range(outwords): details += str(keylist[i][3]) + " ("+ str(keylist[i][0]) if int(keylist[i][8])>0: details += "*" details += ")\n" if len(str(keylist[i][4]))>1: details += " UF (" + str(keylist[i][2]) + "):" + str(keylist[i][4]) + "\n" if len(str(keylist[i][5]))>1: details += " RT:" + str(keylist[i][5]) + "\n" if len(str(keylist[i][6]))>1: details += " BT:" + str(keylist[i][6]) + "\n" if len(str(keylist[i][7]))>1: details += " NT:" + str(keylist[i][7]) + "\n" details += "\n" print details else: makeTagCloud(keylist, outwords) return keyws
64a338f3e936f0b7dd77fc005559df697fcc01ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/64a338f3e936f0b7dd77fc005559df697fcc01ce/bibclassifylib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 11771, 67, 19299, 12, 955, 768, 16, 2065, 768, 16, 876, 16, 596, 3753, 16, 1965, 4672, 3536, 432, 707, 716, 6026, 7093, 628, 392, 9160, 286, 281, 28659, 407, 18, 3536, 498, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 11771, 67, 19299, 12, 955, 768, 16, 2065, 768, 16, 876, 16, 596, 3753, 16, 1965, 4672, 3536, 432, 707, 716, 6026, 7093, 628, 392, 9160, 286, 281, 28659, 407, 18, 3536, 498, ...
fx.run_score_test("b+3", "B+4")
fx.run_score_test("b+3", "B+4.0")
def test_players_score_agree_except_margin(tc): fx = Game_fixture(tc) fx.run_score_test("b+3", "B+4") tc.assertEqual(fx.game.result.sgf_result, "B+") tc.assertEqual(fx.game.result.detail, "unknown margin") tc.assertEqual(fx.game.result.winning_colour, 'b')
7f9b3af7e98ec5643048abc40a0d2ab302c82aa9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6121/7f9b3af7e98ec5643048abc40a0d2ab302c82aa9/gtp_game_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1601, 414, 67, 6355, 67, 346, 992, 67, 14137, 67, 10107, 12, 5111, 4672, 12661, 273, 14121, 67, 904, 10970, 12, 5111, 13, 12661, 18, 2681, 67, 6355, 67, 3813, 2932, 70, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1601, 414, 67, 6355, 67, 346, 992, 67, 14137, 67, 10107, 12, 5111, 4672, 12661, 273, 14121, 67, 904, 10970, 12, 5111, 13, 12661, 18, 2681, 67, 6355, 67, 3813, 2932, 70, 15, ...
os.pardir, 'include-5.2.0', 'src', '*.h'))
os.pardir, 'include-5.2.0', '*.h'))
def setup_qwt5_build(configuration, options, package): """Setup the qwt module build """ if 'Qwt5' not in options.modules: return print 'Setup the %s package build.' % package build_dir = options.qwt tmp_dir = 'tmp-%s' % options.qwt build_file = os.path.join(tmp_dir, '%s.sbf' % options.qwt) extra_sources = [] extra_headers = [] extra_moc_headers = [] if configuration.qt_version < 0x040000: extra_py_files = glob.glob( os.path.join(os.pardir, 'qt3lib', 'Qwt5', '*.py')) else: extra_py_files = glob.glob( os.path.join(os.pardir, 'qt4lib', 'PyQt4', 'Qwt5', '*.py')) # do we compile and link the sources of Qwt statically into PyQwt? if options.qwt_sources: extra_sources += glob.glob(os.path.join( options.qwt_sources, 'src', '*.cpp')) extra_headers += glob.glob(os.path.join( options.qwt_sources, 'src', '*.h')) extra_moc_headers = [] for header in extra_headers: text = open(header).read() if re.compile(r'^\s*Q_OBJECT', re.M).search(text): extra_moc_headers.append(header) # add the interface to the numerical Python extensions extra_sources += glob.glob(os.path.join(os.pardir, 'support', '*.cpp')) extra_headers += glob.glob(os.path.join(os.pardir, 'support', '*.h')) # do we compile and link the sources of Qwt into PyQwt? if sys.platform == 'win32': qwt = 'qwt5' else: qwt = 'qwt' if options.qwt_sources: # yes, zap all occurrences of a qwt library while options.extra_libs.count(qwt): options.extra_libs.remove(qwt) elif qwt not in options.extra_libs: # no, add the qwt library if needed options.extra_libs.append(qwt) # zap the temporary directory try: shutil.rmtree(tmp_dir) except: pass # make a clean temporary directory try: os.mkdir(tmp_dir) except: raise Die('Failed to create the temporary build directory.') # copy the extra files copy_files(extra_sources, tmp_dir) copy_files(extra_headers, tmp_dir) copy_files(extra_moc_headers, tmp_dir) copy_files(extra_py_files, tmp_dir) # work around a bug one of the Qwt-5.2.0 headers if not options.qwt_sources: fixed_headers = [] try: from qwt_version_info import QWT_VERSION except ImportError: raise Die('Failed to import qwt_version_info.') if QWT_VERSION == 0x050200: fixed_headers += glob.glob(os.path.join( os.pardir, 'include-5.2.0', 'src', '*.h')) copy_files(fixed_headers, tmp_dir) try: # Qt4 pyqt_sip_flags = configuration.pyqt_sip_flags except AttributeError: # Qt3 pyqt_sip_flags = configuration.pyqt_qt_sip_flags # invoke SIP cmd = ' '.join( [configuration.sip_bin, # SIP assumes POSIX style path separators '-I', configuration.pyqt_sip_dir.replace('\\', '/'), '-b', build_file, '-c', tmp_dir, options.jobs, options.trace, pyqt_sip_flags, ] + options.sip_include_dirs + options.excluded_features + options.timelines # SIP assumes POSIX style path separators + [options.qwt_sipfile.replace('\\', '/')] ) print 'sip invokation:' pprint.pprint(cmd) if os.path.exists(build_file): os.remove(build_file) os.system(cmd) if not os.path.exists(build_file): raise Die('SIP failed to generate the C++ code.') # fix the SIP build file fix_build_file(build_file, [os.path.basename(f) for f in extra_sources], [os.path.basename(f) for f in extra_headers], [os.path.basename(f) for f in extra_moc_headers]) # copy lazily to the build directory to speed up recompilation if not os.path.exists(build_dir): try: os.mkdir(build_dir) except: raise Die('Failed to create the build directory.') lazy_copies = 0 for pattern in ('*.c', '*.cpp', '*.h', '*.py', '*.sbf'): for source in glob.glob(os.path.join(tmp_dir, pattern)): target = os.path.join(build_dir, os.path.basename(source)) if lazy_copy_file(source, target): print 'Copy %s -> %s.' % (source, target) lazy_copies += 1 print '%s file(s) lazily copied.' % lazy_copies # byte-compile the Python files compileall.compile_dir(build_dir, 1, options.module_install_path) # files to be installed installs = [] installs.append([[os.path.basename(f) for f in glob.glob( os.path.join(build_dir, '*.py*'))], options.module_install_path]) pattern = os.path.join(os.pardir, 'sip', options.qwt, '*.sip') sip_files = [os.path.join(os.pardir, f) for f in glob.glob(pattern)] pattern = os.path.join(os.pardir, 'sip', options.qwt, 'common', '*.sip') sip_files += [os.path.join(os.pardir, f) for f in glob.glob(pattern)] installs.append( [sip_files, os.path.join(configuration.pyqt_sip_dir, 'Qwt5')]) # module makefile if options.qt == 3: makefile = pyqtconfig.sipconfig.SIPModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, installs = installs, qt = 1, warnings = 1, debug = options.debug, ) elif options.qt == 4: qt = ['QtCore', 'QtGui'] if '-x HAS_QWT_SVG' not in options.excluded_features: qt.append('QtSvg') makefile = pyqtconfig.sipconfig.SIPModuleMakefile( configuration = configuration, build_file = os.path.basename(build_file), dir = build_dir, install_dir = options.module_install_path, installs = installs, qt = qt, warnings = 1, debug = options.debug, ) makefile.extra_cflags.extend(options.extra_cflags) makefile.extra_cxxflags.extend(options.extra_cxxflags) makefile.extra_defines.extend(options.extra_defines) makefile.extra_include_dirs.extend(options.extra_include_dirs) makefile.extra_lflags.extend(options.extra_lflags) makefile.extra_libs.extend(options.extra_libs) makefile.extra_lib_dirs.extend(options.extra_lib_dirs) makefile.generate() if options.qt == 4: nsis()
7991fea5342babe9bbae030497fdba53470cb332 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5650/7991fea5342babe9bbae030497fdba53470cb332/configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 85, 6046, 25, 67, 3510, 12, 7025, 16, 702, 16, 2181, 4672, 3536, 7365, 326, 1043, 6046, 1605, 1361, 3536, 309, 296, 53, 6046, 25, 11, 486, 316, 702, 18, 6400, 30, 327, 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, 3875, 67, 85, 6046, 25, 67, 3510, 12, 7025, 16, 702, 16, 2181, 4672, 3536, 7365, 326, 1043, 6046, 1605, 1361, 3536, 309, 296, 53, 6046, 25, 11, 486, 316, 702, 18, 6400, 30, 327, 225,...
as_checkbox.set_active(self.use_scrobbler)
as_checkbox.set_active(self.as_enabled)
def on_prefs(self, widget): prefswindow = ui.dialog(title=_("Preferences"), parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, role='preferences', resizable=False, separator=False) hbox = gtk.HBox() prefsnotebook = gtk.Notebook() # MPD tab mpdlabel = ui.label(markup='<b>' + _('MPD Connection') + '</b>', y=1) controlbox = gtk.HBox() profiles = gtk.combo_box_new_text() add_profile = ui.button(img=ui.image(stock=gtk.STOCK_ADD)) remove_profile = ui.button(img=ui.image(stock=gtk.STOCK_REMOVE)) self.prefs_populate_profile_combo(profiles, self.profile_num, remove_profile) controlbox.pack_start(profiles, False, False, 2) controlbox.pack_start(remove_profile, False, False, 2) controlbox.pack_start(add_profile, False, False, 2) namebox = gtk.HBox() namelabel = ui.label(text=_("Name") + ":") namebox.pack_start(namelabel, False, False, 0) nameentry = ui.entry() namebox.pack_start(nameentry, True, True, 10) hostbox = gtk.HBox() hostlabel = ui.label(text=_("Host") + ":") hostbox.pack_start(hostlabel, False, False, 0) hostentry = ui.entry() hostbox.pack_start(hostentry, True, True, 10) portbox = gtk.HBox() portlabel = ui.label(text=_("Port") + ":") portbox.pack_start(portlabel, False, False, 0) portentry = ui.entry() portbox.pack_start(portentry, True, True, 10) dirbox = gtk.HBox() dirlabel = ui.label(text=_("Music dir") + ":") dirbox.pack_start(dirlabel, False, False, 0) direntry = ui.entry() direntry.connect('changed', self.prefs_direntry_changed, profiles) dirbox.pack_start(direntry, True, True, 10) passwordbox = gtk.HBox() passwordlabel = ui.label(text=_("Password") + ":") passwordbox.pack_start(passwordlabel, False, False, 0) passwordentry = ui.entry(password=True) self.tooltips.set_tip(passwordentry, _("Leave blank if no password is required.")) passwordbox.pack_start(passwordentry, True, True, 10) mpd_labels = [namelabel, hostlabel, portlabel, passwordlabel, dirlabel] ui.set_widths_equal(mpd_labels) autoconnect = gtk.CheckButton(_("Autoconnect on start")) autoconnect.set_active(self.autoconnect) # Fill in entries with current profile: self.prefs_profile_chosen(profiles, nameentry, hostentry, portentry, passwordentry, direntry) # Update display if $MPD_HOST or $MPD_PORT is set: host, port, password = self.mpd_env_vars() if host or port: using_mpd_env_vars = True if not host: host = "" if not port: port = "" if not password: password = "" hostentry.set_text(str(host)) portentry.set_text(str(port)) passwordentry.set_text(str(password)) nameentry.set_text(_("Using MPD_HOST/PORT")) for widget in [hostentry, portentry, passwordentry, nameentry, profiles, add_profile, remove_profile]: widget.set_sensitive(False) else: using_mpd_env_vars = False for widget in [hostentry, portentry, passwordentry, nameentry, profiles, add_profile, remove_profile]: widget.set_sensitive(True) nameentry.connect('changed', self.prefs_nameentry_changed, profiles, remove_profile) hostentry.connect('changed', self.prefs_hostentry_changed, profiles) portentry.connect('changed', self.prefs_portentry_changed, profiles) passwordentry.connect('changed', self.prefs_passwordentry_changed, profiles) profiles.connect('changed', self.prefs_profile_chosen, nameentry, hostentry, portentry, passwordentry, direntry) add_profile.connect('clicked', self.prefs_add_profile, nameentry, profiles, remove_profile) remove_profile.connect('clicked', self.prefs_remove_profile, profiles, remove_profile) mpd_frame = gtk.Frame() table = gtk.Table(6, 2, False) table.set_col_spacings(3) table.attach(ui.label(), 1, 3, 1, 2, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) table.attach(namebox, 1, 3, 2, 3, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) table.attach(hostbox, 1, 3, 3, 4, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) table.attach(portbox, 1, 3, 4, 5, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) table.attach(passwordbox, 1, 3, 5, 6, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) table.attach(dirbox, 1, 3, 6, 7, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) table.attach(ui.label(), 1, 3, 7, 8, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) mpd_frame.add(table) mpd_frame.set_label_widget(controlbox) mpd_table = gtk.Table(9, 2, False) mpd_table.set_col_spacings(3) mpd_table.attach(ui.label(), 1, 3, 1, 2, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) mpd_table.attach(mpdlabel, 1, 3, 2, 3, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) mpd_table.attach(ui.label(), 1, 3, 3, 4, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 10, 0) mpd_table.attach(mpd_frame, 1, 3, 4, 10, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) mpd_table.attach(ui.label(), 1, 3, 10, 11, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) mpd_table.attach(autoconnect, 1, 3, 11, 12, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) mpd_table.attach(ui.label(), 1, 3, 12, 13, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) mpd_table.attach(ui.label(), 1, 3, 13, 14, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) # Extras tab if not HAVE_AUDIOSCROBBLER: self.use_scrobbler = False as_label = ui.label(markup='<b>' + _('Extras') + '</b>') as_frame = gtk.Frame() as_frame.set_label_widget(as_label) as_frame.set_shadow_type(gtk.SHADOW_NONE) as_frame.set_border_width(15) as_vbox = gtk.VBox() as_vbox.set_border_width(15) as_checkbox = gtk.CheckButton(_("Enable Audioscrobbler")) as_checkbox.set_active(self.use_scrobbler) as_vbox.pack_start(as_checkbox, False) as_table = gtk.Table(2, 2) as_table.set_col_spacings(3) as_user_label = ui.label(text=" " + _("Username:")) as_pass_label = ui.label(text=" " + _("Password:")) as_user_entry = ui.entry(text=self.as_username, changed_cb=self.prefs_as_username_changed) as_pass_entry = ui.entry(text=self.as_password, password=True, changed_cb=self.prefs_as_password_changed) displaylabel2 = ui.label(markup='<b>' + _('Notification') + '</b>', y=1) display_notification = gtk.CheckButton(_("Popup notification on song changes")) display_notification.set_active(self.show_notification) notifhbox = gtk.HBox() notif_blank = ui.label(x=1) notifhbox.pack_start(notif_blank) notification_options = gtk.combo_box_new_text() for i in self.popuptimes: if i != _('Entire song'): notification_options.append_text(i + ' ' + gettext.ngettext('second', 'seconds', int(i))) else: notification_options.append_text(i) notification_options.set_active(self.popup_option) notification_options.connect('changed', self.prefs_notiftime_changed) notification_locs = gtk.combo_box_new_text() for i in self.popuplocations: notification_locs.append_text(i) notification_locs.set_active(self.traytips.notifications_location) notification_locs.connect('changed', self.prefs_notiflocation_changed) display_notification.connect('toggled', self.prefs_notif_toggled, notifhbox) notifhbox.pack_start(notification_options, False, False, 2) notifhbox.pack_start(notification_locs, False, False, 2) if not self.show_notification: notifhbox.set_sensitive(False) crossfadecheck = gtk.CheckButton(_("Enable Crossfade")) crossfadespin = gtk.SpinButton() crossfadespin.set_digits(0) crossfadespin.set_range(1, 30) crossfadespin.set_value(self.xfade) crossfadespin.set_numeric(True) crossfadespin.set_increments(1,5) crossfadespin.set_size_request(70,-1) crossfadelabel2 = ui.label(text=_("Fade length") + ":", x=1) crossfadelabel3 = ui.label(text=_("sec")) if not self.xfade_enabled: crossfadespin.set_sensitive(False) crossfadelabel2.set_sensitive(False) crossfadelabel3.set_sensitive(False) crossfadecheck.set_active(False) else: crossfadespin.set_sensitive(True) crossfadelabel2.set_sensitive(True) crossfadelabel3.set_sensitive(True) crossfadecheck.set_active(True) crossfadebox = gtk.HBox() crossfadebox.pack_start(crossfadelabel2) crossfadebox.pack_start(crossfadespin, False, False, 5) crossfadebox.pack_start(crossfadelabel3, False, False, 0) crossfadecheck.connect('toggled', self.prefs_crossfadecheck_toggled, crossfadespin, crossfadelabel2, crossfadelabel3) as_table.attach(as_user_label, 0, 1, 0, 1) as_table.attach(as_user_entry, 1, 2, 0, 1) as_table.attach(as_pass_label, 0, 1, 1, 2) as_table.attach(as_pass_entry, 1, 2, 1, 2) as_table.attach(ui.label(), 0, 2, 2, 3) as_table.attach(display_notification, 0, 2, 3, 4) as_table.attach(notifhbox, 0, 2, 4, 5) as_table.attach(ui.label(), 0, 2, 5, 6) as_table.attach(crossfadecheck, 0, 2, 6, 7) as_table.attach(crossfadebox, 0, 2, 7, 8) as_vbox.pack_start(as_table, False) as_frame.add(as_vbox) as_checkbox.connect('toggled', self.use_scrobbler_toggled, as_user_entry, as_pass_entry, as_user_label, as_pass_label) if not self.use_scrobbler or not HAVE_AUDIOSCROBBLER: as_user_entry.set_sensitive(False) as_pass_entry.set_sensitive(False) as_user_label.set_sensitive(False) as_pass_label.set_sensitive(False) # Display tab table2 = gtk.Table(7, 2, False) displaylabel = ui.label(markup='<b>' + _('Display') + '</b>', y=1) display_art_hbox = gtk.HBox() display_art = gtk.CheckButton(_("Enable album art")) display_art.set_active(self.show_covers) display_art_combo = gtk.combo_box_new_text() display_art_combo.append_text(_("Local only")) display_art_combo.append_text(_("Local, then remote")) display_art_combo.set_active(self.covers_pref) orderart_label = ui.label(text=_("Search order:"), x=1) display_art_hbox.pack_start(orderart_label) display_art_hbox.pack_start(display_art_combo, False, False, 5) display_art_hbox.set_sensitive(self.show_covers) display_art_location_hbox = gtk.HBox() display_art_location_hbox.pack_start(ui.label(text=_("Save art to:"), x=1)) display_art_location = gtk.combo_box_new_text() display_art_location_hbox.pack_start(display_art_location, False, False, 5) display_art_location.append_text("~/.covers/") display_art_location.append_text("../" + _("file_path") + "/cover.jpg") display_art_location.append_text("../" + _("file_path") + "/album.jpg") display_art_location.append_text("../" + _("file_path") + "/folder.jpg") display_art_location.append_text("../" + _("file_path") + "/" + _("custom")) display_art_location.set_active(self.art_location) display_art_location_hbox.set_sensitive(self.show_covers) display_art_location.connect('changed', self.prefs_art_location_changed) display_art.connect('toggled', self.prefs_art_toggled, display_art_hbox, display_art_location_hbox) display_playback = gtk.CheckButton(_("Enable playback/volume buttons")) display_playback.set_active(self.show_playback) display_playback.connect('toggled', self.prefs_playback_toggled) display_progress = gtk.CheckButton(_("Enable progressbar")) display_progress.set_active(self.show_progress) display_progress.connect('toggled', self.prefs_progress_toggled) display_statusbar = gtk.CheckButton(_("Enable statusbar")) display_statusbar.set_active(self.show_statusbar) display_statusbar.connect('toggled', self.prefs_statusbar_toggled) display_lyrics = gtk.CheckButton(_("Enable lyrics")) display_lyrics.set_active(self.show_lyrics) display_lyrics_location_hbox = gtk.HBox() savelyrics_label = ui.label(text=_("Save lyrics to:"), x=1) display_lyrics_location_hbox.pack_start(savelyrics_label) display_lyrics_location = gtk.combo_box_new_text() display_lyrics_location_hbox.pack_start(display_lyrics_location, False, False, 5) display_lyrics_location.append_text("~/.lyrics/") display_lyrics_location.append_text("../" + _("file_path") + "/") display_lyrics_location.set_active(self.lyrics_location) display_lyrics_location_hbox.set_sensitive(self.show_lyrics) display_lyrics_location.connect('changed', self.prefs_lyrics_location_changed) display_lyrics.connect('toggled', self.prefs_lyrics_toggled, display_lyrics_location_hbox) display_trayicon = gtk.CheckButton(_("Enable system tray icon")) display_trayicon.set_active(self.show_trayicon) if not HAVE_EGG and not HAVE_STATUS_ICON: display_trayicon.set_sensitive(False) table2.attach(ui.label(), 1, 3, 1, 2, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table2.attach(displaylabel, 1, 3, 2, 3, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table2.attach(ui.label(), 1, 3, 3, 4, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table2.attach(display_playback, 1, 3, 4, 5, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_progress, 1, 3, 5, 6, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_statusbar, 1, 3, 6, 7, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_trayicon, 1, 3, 7, 8, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_lyrics, 1, 3, 8, 9, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_lyrics_location_hbox, 1, 3, 9, 10, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_art, 1, 3, 10, 11, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_art_hbox, 1, 3, 11, 12, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(display_art_location_hbox, 1, 3, 12, 13, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table2.attach(ui.label(), 1, 3, 13, 14, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 75, 0) table2.attach(ui.label(), 1, 3, 14, 15, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 75, 0) # Behavior tab table3 = gtk.Table() behaviorlabel = ui.label(markup='<b>' + _('Window Behavior') + '</b>', y=1) win_sticky = gtk.CheckButton(_("Show window on all workspaces")) win_sticky.set_active(self.sticky) win_ontop = gtk.CheckButton(_("Keep window above other windows")) win_ontop.set_active(self.ontop) update_start = gtk.CheckButton(_("Update MPD library on start")) update_start.set_active(self.update_on_start) self.tooltips.set_tip(update_start, _("If enabled, Sonata will automatically update your MPD library when it starts up.")) exit_stop = gtk.CheckButton(_("Stop playback on exit")) exit_stop.set_active(self.stop_on_exit) self.tooltips.set_tip(exit_stop, _("MPD allows playback even when the client is not open. If enabled, Sonata will behave like a more conventional music player and, instead, stop playback upon exit.")) minimize = gtk.CheckButton(_("Minimize to system tray on close/escape")) minimize.set_active(self.minimize_to_systray) self.tooltips.set_tip(minimize, _("If enabled, closing Sonata will minimize it to the system tray. Note that it's currently impossible to detect if there actually is a system tray, so only check this if you have one.")) display_trayicon.connect('toggled', self.prefs_trayicon_toggled, minimize) if HAVE_STATUS_ICON and self.statusicon.is_embedded() and self.statusicon.get_visible(): minimize.set_sensitive(True) elif HAVE_EGG and self.trayicon.get_property('visible') == True: minimize.set_sensitive(True) else: minimize.set_sensitive(False) infofilebox = gtk.HBox() infofile_usage = gtk.CheckButton(_("Write status file:")) infofile_usage.set_active(self.use_infofile) self.tooltips.set_tip(infofile_usage, _("If enabled, Sonata will create a xmms-infopipe like file containing information about the current song. Many applications support the xmms-info file (Instant Messengers, IRC Clients...)")) infopath_options = ui.entry(text=self.infofile_path) self.tooltips.set_tip(infopath_options, _("If enabled, Sonata will create a xmms-infopipe like file containing information about the current song. Many applications support the xmms-info file (Instant Messengers, IRC Clients...)")) if not self.use_infofile: infopath_options.set_sensitive(False) infofile_usage.connect('toggled', self.prefs_infofile_toggled, infopath_options) infofilebox.pack_start(infofile_usage, False, False, 0) infofilebox.pack_start(infopath_options, True, True, 5) behaviorlabel2 = ui.label(markup='<b>' + _('Miscellaneous') + '</b>', y=1) table3.attach(ui.label(), 1, 3, 1, 2, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table3.attach(behaviorlabel, 1, 3, 2, 3, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table3.attach(ui.label(), 1, 3, 3, 4, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table3.attach(win_sticky, 1, 3, 4, 5, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(win_ontop, 1, 3, 5, 6, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(minimize, 1, 3, 6, 7, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(ui.label(), 1, 3, 7, 8, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table3.attach(behaviorlabel2, 1, 3, 8, 9, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table3.attach(ui.label(), 1, 3, 9, 10, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table3.attach(update_start, 1, 3, 10, 11, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(exit_stop, 1, 3, 11, 12, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(infofilebox, 1, 3, 12, 13, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(ui.label(), 1, 3, 13, 14, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(ui.label(), 1, 3, 14, 15, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table3.attach(ui.label(), 1, 3, 15, 16, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) # Format tab table4 = gtk.Table(9, 2, False) table4.set_col_spacings(3) formatlabel = ui.label(markup='<b>' + _('Song Formatting') + '</b>', y=1) currentformatbox = gtk.HBox() currentlabel = ui.label(text=_("Current playlist:")) currentoptions = ui.entry(text=self.currentformat) currentformatbox.pack_start(currentlabel, False, False, 0) currentformatbox.pack_start(currentoptions, False, False, 10) libraryformatbox = gtk.HBox() librarylabel = ui.label(text=_("Library:")) libraryoptions = ui.entry(text=self.libraryformat) libraryformatbox.pack_start(librarylabel, False, False, 0) libraryformatbox.pack_start(libraryoptions, False, False, 10) titleformatbox = gtk.HBox() titlelabel = ui.label(text=_("Window title:")) titleoptions = ui.entry(text=self.titleformat) titleoptions.set_text(self.titleformat) titleformatbox.pack_start(titlelabel, False, False, 0) titleformatbox.pack_start(titleoptions, False, False, 10) currsongformatbox1 = gtk.HBox() currsonglabel1 = ui.label(text=_("Current song line 1:")) currsongoptions1 = ui.entry(text=self.currsongformat1) currsongformatbox1.pack_start(currsonglabel1, False, False, 0) currsongformatbox1.pack_start(currsongoptions1, False, False, 10) currsongformatbox2 = gtk.HBox() currsonglabel2 = ui.label(text=_("Current song line 2:")) currsongoptions2 = ui.entry(text=self.currsongformat2) currsongformatbox2.pack_start(currsonglabel2, False, False, 0) currsongformatbox2.pack_start(currsongoptions2, False, False, 10) formatlabels = [currentlabel, librarylabel, titlelabel, currsonglabel1, currsonglabel2] for label in formatlabels: label.set_alignment(0, 0.5) ui.set_widths_equal(formatlabels) availableheading = ui.label(markup='<small>' + _('Available options') + ':</small>', y=0) availablevbox = gtk.VBox() availableformatbox = gtk.HBox() availableformatting = ui.label(markup='<small><span font_family="Monospace">%A</span> - ' + _('Artist name') + '\n<span font_family="Monospace">%B</span> - ' + _('Album name') + '\n<span font_family="Monospace">%T</span> - ' + _('Track name') + '\n<span font_family="Monospace">%N</span> - ' + _('Track number') + '\n<span font_family="Monospace">%D</span> - ' + _('Disc Number') + '\n<span font_family="Monospace">%Y</span> - ' + _('Year') + '</small>', y=0) availableformatting2 = ui.label(markup='<small><span font_family="Monospace">%G</span> - ' + _('Genre') + '\n<span font_family="Monospace">%F</span> - ' + _('File name') + '\n<span font_family="Monospace">%S</span> - ' + _('Stream name') + '\n<span font_family="Monospace">%L</span> - ' + _('Song length') + '\n<span font_family="Monospace">%E</span> - ' + _('Elapsed time (title only)') + '</small>', y=0) availableformatbox.pack_start(availableformatting) availableformatbox.pack_start(availableformatting2) availablevbox.pack_start(availableformatbox, False, False, 0) additionalinfo = ui.label(markup='<small>{ } - ' + _('Info displayed only if all enclosed tags are defined') + '\n' + '| - ' + _('Creates columns in the current playlist') + '</small>', y=0) availablevbox.pack_start(additionalinfo, False, False, 4) table4.attach(ui.label(), 1, 3, 1, 2, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table4.attach(formatlabel, 1, 3, 2, 3, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table4.attach(ui.label(), 1, 3, 3, 4, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 15, 0) table4.attach(currentformatbox, 1, 3, 4, 5, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table4.attach(libraryformatbox, 1, 3, 5, 6, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table4.attach(titleformatbox, 1, 3, 6, 7, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table4.attach(currsongformatbox1, 1, 3, 7, 8, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table4.attach(currsongformatbox2, 1, 3, 8, 9, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table4.attach(ui.label(), 1, 3, 9, 10, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table4.attach(availableheading, 1, 3, 10, 11, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table4.attach(availablevbox, 1, 3, 11, 12, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 45, 0) table4.attach(ui.label(), 1, 3, 12, 13, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 30, 0) table_names = [[_("_MPD"), mpd_table], [_("_Display"), table2], [_("_Behavior"), table3], [_("_Format"), table4], [_("_Extras"), as_frame]] for table_name in table_names: tmplabel = ui.label(textmn=table_name[0]) prefsnotebook.append_page(table_name[1], tmplabel) hbox.pack_start(prefsnotebook, False, False, 10) prefswindow.vbox.pack_start(hbox, False, False, 10) close_button = prefswindow.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) prefswindow.show_all() close_button.grab_focus() prefswindow.connect('response', self.prefs_window_response, prefsnotebook, exit_stop, activate, win_ontop, display_art_combo, win_sticky, direntry, minimize, update_start, autoconnect, currentoptions, libraryoptions, titleoptions, currsongoptions1, currsongoptions2, crossfadecheck, crossfadespin, infopath_options, hostentry, portentry, passwordentry, using_mpd_env_vars) # Save previous connection properties to determine if we should try to # connect to MPD after prefs are closed: self.prev_host = self.host[self.profile_num] self.prev_port = self.port[self.profile_num] self.prev_password = self.password[self.profile_num] response = prefswindow.show()
d9f94ae44e704d6986404a96af8786c6246b4182 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2312/d9f94ae44e704d6986404a96af8786c6246b4182/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 1484, 2556, 12, 2890, 16, 3604, 4672, 15503, 5668, 273, 5915, 18, 12730, 12, 2649, 33, 67, 2932, 12377, 6, 3631, 982, 33, 2890, 18, 5668, 16, 2943, 33, 4521, 79, 18, 2565, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 603, 67, 1484, 2556, 12, 2890, 16, 3604, 4672, 15503, 5668, 273, 5915, 18, 12730, 12, 2649, 33, 67, 2932, 12377, 6, 3631, 982, 33, 2890, 18, 5668, 16, 2943, 33, 4521, 79, 18, 2565, 1...
if x != self.get_symmetry:
if x != self.get_symmetry():
def symmetry_changed(self,x): if x != self.get_symmetry: return True else: return False
28c3f2a245341cd8f82e1ffe9c9883dad13198ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1380/28c3f2a245341cd8f82e1ffe9c9883dad13198ad/jacapo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26144, 67, 6703, 12, 2890, 16, 92, 4672, 309, 619, 480, 365, 18, 588, 67, 8117, 18042, 13332, 327, 1053, 469, 30, 327, 1083, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26144, 67, 6703, 12, 2890, 16, 92, 4672, 309, 619, 480, 365, 18, 588, 67, 8117, 18042, 13332, 327, 1053, 469, 30, 327, 1083, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
received = conn.recv(l)
received = '' while len( received ) < l: r = conn.recv(l) if len( r ) == 0: break received = received + r
def run( self ): global terminate
ec5b23437f53778b04cb5ba200e074107eefd732 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10890/ec5b23437f53778b04cb5ba200e074107eefd732/slimv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 365, 262, 30, 2552, 10850, 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...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 365, 262, 30, 2552, 10850, 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...
r'lstlisting[%s]{' % params,
r'begin{lstlisting}%s' % params,
def revert_listings_inset(document): r''' Revert listings inset to \lstinline or \begin, \end lstlisting, translate
a8e9fe82d0461fa821b3ec70c83fe76f02eafcb0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7514/a8e9fe82d0461fa821b3ec70c83fe76f02eafcb0/lyx_1_5.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 1098, 899, 67, 267, 542, 12, 5457, 4672, 436, 26418, 868, 1097, 666, 899, 316, 542, 358, 521, 16923, 10047, 578, 521, 10086, 16, 521, 409, 9441, 21228, 16, 4204, 2, 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, 1, 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, 15226, 67, 1098, 899, 67, 267, 542, 12, 5457, 4672, 436, 26418, 868, 1097, 666, 899, 316, 542, 358, 521, 16923, 10047, 578, 521, 10086, 16, 521, 409, 9441, 21228, 16, 4204, 2, -100, -1...
if item == draggedOutItem:
if item == draggedOutItem or item.isStale():
def drawCanvasItems(canvasItems, selected): for canvasItem in canvasItems: canvasItem.Draw(dc, styles, selected)
614ab5cab3e9342b2b61a31d52a28581d6dd612c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/614ab5cab3e9342b2b61a31d52a28581d6dd612c/TimedCanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 12971, 3126, 12, 15424, 3126, 16, 3170, 4672, 364, 5953, 1180, 316, 5953, 3126, 30, 5953, 1180, 18, 6493, 12, 7201, 16, 5687, 16, 3170, 13, 2, 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, 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, 3724, 12971, 3126, 12, 15424, 3126, 16, 3170, 4672, 364, 5953, 1180, 316, 5953, 3126, 30, 5953, 1180, 18, 6493, 12, 7201, 16, 5687, 16, 3170, 13, 2, -100, -100, -100, -100, -100, -100, ...
pairs = [(dist, a) for a in atoms ] pairs.sort() return [ x[1] for x in pairs ] def randomPatches( self, size, n=None, first_atom=None, exclude=None,
def randomPatches( self, size, n=None, exclude=None,
def orderCenters( self, atoms ): """ Order center atoms by increasing distance to first. atoms - [ int ], atom indices selected by distantAtoms -> [ int ], atom indices re-ordered """ dist = self.__distances( atoms[0] ).tolist() pairs = [(dist, a) for a in atoms ] pairs.sort() return [ x[1] for x in pairs ]
e5244fcd6e879bc27ccfd3cf243d90f2bd6a63fb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/e5244fcd6e879bc27ccfd3cf243d90f2bd6a63fb/PatchGeneratorFromOrbit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1353, 15897, 414, 12, 365, 16, 9006, 262, 30, 3536, 4347, 4617, 9006, 635, 21006, 3888, 358, 1122, 18, 9006, 225, 300, 306, 509, 308, 16, 3179, 4295, 3170, 635, 2411, 970, 14280, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1353, 15897, 414, 12, 365, 16, 9006, 262, 30, 3536, 4347, 4617, 9006, 635, 21006, 3888, 358, 1122, 18, 9006, 225, 300, 306, 509, 308, 16, 3179, 4295, 3170, 635, 2411, 970, 14280, 317, ...
lat = self.geodata.get('lat') lon = self.geodata.get('lon'),
lat = self.geodata.get('latitude') lon = self.geodata.get('longitude')
def ConfiguredLocationData(self): if not self.geodata: self.DiscoverLocation() country_code = self.geodata.get('country_code') lat = self.geodata.get('lat') lon = self.geodata.get('lon'),
17498b4285395eabfec0cd099fd26e778fdb4f29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4170/17498b4285395eabfec0cd099fd26e778fdb4f29/base_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1903, 2862, 2735, 751, 12, 2890, 4672, 309, 486, 365, 18, 908, 18229, 30, 365, 18, 26082, 2735, 1435, 5251, 67, 710, 273, 365, 18, 908, 18229, 18, 588, 2668, 9082, 67, 710, 6134, 2516,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1903, 2862, 2735, 751, 12, 2890, 4672, 309, 486, 365, 18, 908, 18229, 30, 365, 18, 26082, 2735, 1435, 5251, 67, 710, 273, 365, 18, 908, 18229, 18, 588, 2668, 9082, 67, 710, 6134, 2516,...
job.status = 'processing'
job.status = 'processing'
def getJob(self): r""" Returns a job to the client. This method returns the first job that has not been completed in our job database.
c834a8c52591d9aaa67980f722e69942a81fbcae /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/c834a8c52591d9aaa67980f722e69942a81fbcae/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13024, 12, 2890, 4672, 436, 8395, 2860, 279, 1719, 358, 326, 1004, 18, 225, 1220, 707, 1135, 326, 1122, 1719, 716, 711, 486, 2118, 5951, 316, 3134, 1719, 2063, 18, 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, 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, 13024, 12, 2890, 4672, 436, 8395, 2860, 279, 1719, 358, 326, 1004, 18, 225, 1220, 707, 1135, 326, 1122, 1719, 716, 711, 486, 2118, 5951, 316, 3134, 1719, 2063, 18, 2, -100, -100, -100, ...
except etree.XPathEvalError, e: pass
def _is_optimica(self): """ Find out if model is compiled with OptimicaCompiler. """ xmldoc = self._get_XMLDoc() return xmldoc.get_starttime()!=None
def _setDefaultValuesFromMetadata(self, libname=None, path=None): """Load metadata saved in XML files. Meta data can be things like time points, initial states, initial cost etc. """ if libname is None: libname = self._libname if path is None: path = self._path # set start attributes xml_file=libname+'.xml' # assumes libname is name of model and xmlfile is located in the same dir as the dll self._set_XMLDoc(xmlparser.XMLDoc(os.path.join(path,xml_file))) self._set_scaling_factors() self._set_start_attributes()
f6bd07566a9303be0d4f4e3f29bbf8c080afb8ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7711/f6bd07566a9303be0d4f4e3f29bbf8c080afb8ea/jmi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 542, 1868, 1972, 1265, 2277, 12, 2890, 16, 2561, 529, 33, 7036, 16, 589, 33, 7036, 4672, 3536, 2563, 1982, 5198, 316, 3167, 1390, 18, 225, 6565, 501, 848, 506, 9198, 3007, 813, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 542, 1868, 1972, 1265, 2277, 12, 2890, 16, 2561, 529, 33, 7036, 16, 589, 33, 7036, 4672, 3536, 2563, 1982, 5198, 316, 3167, 1390, 18, 225, 6565, 501, 848, 506, 9198, 3007, 813, 31...
class Letter(str): def __new__(cls, letter): if letter == 'EPS': return str.__new__(cls) return str.__new__(cls, letter) def __str__(self): if not self: return 'EPS' return self import sys test_stdout = sys.stdout sys.stdout = get_original_stdout() try: print(Letter('w')) except RuntimeError: pass else: raise TestFailed, "expected a RuntimeError for print recursion" sys.stdout = test_stdout
## def unsafecmp(a, b):
9ca193d994840dfc726dfaba82577b8b92de1a01 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/9ca193d994840dfc726dfaba82577b8b92de1a01/test_descr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 7541, 377, 1652, 16804, 1727, 557, 1291, 12, 69, 16, 324, 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,...
[ 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, 7541, 377, 1652, 16804, 1727, 557, 1291, 12, 69, 16, 324, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
stderr_thread.set_daemon(True)
stderr_thread.daemon = True
def _communicate(self, input): stdout = None # Return stderr = None # Return
9c0b2f3c8d66fe855013f73dbf98eefb6f045242 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/9c0b2f3c8d66fe855013f73dbf98eefb6f045242/subprocess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5702, 318, 2659, 12, 2890, 16, 810, 4672, 3909, 273, 599, 468, 2000, 4514, 273, 599, 468, 2000, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 5702, 318, 2659, 12, 2890, 16, 810, 4672, 3909, 273, 599, 468, 2000, 4514, 273, 599, 468, 2000, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if isinstance(kind, int): kind = {0:'zero', 1:'slinear', 2:'quadratic', 3:'cubic'}.get(kind,'none') if kind not in ['zero', 'linear', 'slinear', 'quadratic', 'cubic']: raise NotImplementedError("%d is unsupported: Use fitpack "\ "routines for other types.")
if kind in ['zero', 'slinear', 'quadratic', 'cubic']: order = {'zero':0,'slinear':1,'quadratic':2, 'cubic':3}[kind] kind = 'spline' elif isinstance(kind, int): order = kind kind = 'spline' elif kind != 'linear': raise NotImplementedError("%s is unsupported: Use fitpack "\ "routines for other types." % kind)
def __init__(self, x, y, kind='linear', axis=-1, copy=True, bounds_error=True, fill_value=np.nan): """ Initialize a 1D linear interpolation class.
4db244857b87d5117eda833744edd6826d40a0ad /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/4db244857b87d5117eda833744edd6826d40a0ad/interpolate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 619, 16, 677, 16, 3846, 2218, 12379, 2187, 2654, 29711, 21, 16, 1610, 33, 5510, 16, 4972, 67, 1636, 33, 5510, 16, 3636, 67, 1132, 33, 6782, 18, 13569, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 619, 16, 677, 16, 3846, 2218, 12379, 2187, 2654, 29711, 21, 16, 1610, 33, 5510, 16, 4972, 67, 1636, 33, 5510, 16, 3636, 67, 1132, 33, 6782, 18, 13569, ...
if code in ['bar','hsb','ksh']:
if code in ['bar','ksh','stq']:
def altlang(code): if code=='aa': return ['am'] if code in ['fa','so']: return ['ar'] if code=='ku': return ['ar','tr'] if code=='sk': return ['cs'] if code in ['bar','hsb','ksh']: return ['de'] if code in ['als','lb']: return ['de','fr'] if code=='io': return ['eo'] if code in ['an','ast','ay','ca','gn','nah','qu']: return ['es'] if code == ['cbk-zam']: return ['es','tl'] if code=='eu': return ['es','fr'] if code in ['glk','mzn']: return ['fa','ar'] if code=='gl': return ['es','pt'] if code=='lad': return ['es','he'] if code in ['br','ht','kab','ln','lo','nrm','wa']: return ['fr'] if code in ['ie','oc']: return ['ie','oc','fr'] if code in ['co','frp']: return ['fr','it'] if code=='yi': return ['he','de'] if code=='sa': return ['hi'] if code in ['eml','lij','lmo','nap','pms','roa-tara','sc','scn','vec']: return ['it'] if code=='rm': return ['it','de','fr'] if code in ['bat-smg','ltg']: return ['lt'] if code=='ia': return ['la','es','fr','it'] if code=='nds': return ['nds-nl','de'] if code=='nds-nl': return ['nds','nl'] if code in ['fy','pap','vls','zea']: return ['nl'] if code=='li': return ['nl','de'] if code=='csb': return ['pl'] if code in ['fab','tet']: return ['pt'] if code in ['mo','roa-rup']: return ['ro'] if code in ['av','bxr','cv','hy','lbe','tg','udm','uk','xal']: return ['ru'] if code in ['be','be-x-old']: return ['be','be-x-old','ru'] if code in ['ky','tt','uz']: return ['kk','tr','ru'] if code in ['az','diq','tk','ug']: return ['tr'] if code in ['ja','minnan','zh','zh-cn']: return ['zh','zh-tw','zh-classical','zh-cn'] if code in ['bo','cdo','hak','wuu','za','zh-cdo','zh-classical','zh-tw','zh-yue']: return ['zh','zh-cn','zh-classical','zh-tw'] if code=='da': return ['nb','no'] if code in ['is','no','nb','nn']: return ['no','nb','nn','da','sv'] if code=='sv': return ['da','no','nb'] if code=='se': return ['no','nb','sv','nn','fi','da'] if code in ['bug','id','jv','map-bms','ms','su']: return ['id','ms','jv'] if code in ['bs','hr','sh']: return ['sh','hr','bs','sr'] if code in ['mk','sr']: return ['sh','sr','hr','bs'] if code in ['ceb','pag','tl','war']: return ['tl','es'] if code=='bi': return ['tpi'] if code=='tpi': return ['bi'] if code == 'new': return ['ne'] if code == 'nov': return ['io','eo'] return []
5e07e31c85f757db4b1cc5703f5312383c81aa64 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/5e07e31c85f757db4b1cc5703f5312383c81aa64/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3770, 4936, 12, 710, 4672, 309, 981, 18920, 7598, 4278, 327, 10228, 301, 3546, 309, 981, 316, 10228, 507, 17023, 2048, 3546, 30, 327, 10228, 297, 3546, 309, 981, 18920, 31562, 4278, 327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3770, 4936, 12, 710, 4672, 309, 981, 18920, 7598, 4278, 327, 10228, 301, 3546, 309, 981, 316, 10228, 507, 17023, 2048, 3546, 30, 327, 10228, 297, 3546, 309, 981, 18920, 31562, 4278, 327, ...
def run_conv_nnet2_classif(use_gpu, isize, ksize, n_batch, n_iter,
def run_conv_nnet2_classif(use_gpu, isize, ksize, n_batch, n_train,
def run_conv_nnet2_classif(use_gpu, isize, ksize, n_batch, n_iter, downsample_ops=True, verbose=0, version=-1): if use_gpu: shared_fn = tcn.shared_constructor else: shared_fn = shared isize1=isize isize2=isize if isinstance(isize,(tuple,)): isize1=isize[0] isize2=isize[1] shape_img = (n_batch, 1, isize1, isize2) n_kern = 20 # 6 were used in LeNet5 shape_kern = (n_kern, 1, ksize, ksize) n_kern1 = 30 # 16 were used in LeNet5 shape_kern1 = (n_kern1, n_kern, ksize, ksize) logical_hid_shape = tcn.blas.GpuConv.logical_output_shape_2d((isize1, isize2), (ksize, ksize), 'valid') logical_hid_shape1 = tcn.blas.GpuConv.logical_output_shape_2d((logical_hid_shape[0]/2, logical_hid_shape[1]/2), (ksize, ksize), 'valid') n_hid = n_kern1 * logical_hid_shape1[0] * logical_hid_shape1[1] n_out = 10 w0 = shared_fn(0.01*(my_rand(*shape_kern)-0.5), 'w0') b0 = shared_fn(my_zeros((n_kern,)), 'b0') w1 = shared_fn(0.01*(my_rand(*shape_kern1)-0.5), 'w1') b1 = shared_fn(my_zeros((n_kern1,)), 'b1') v = shared_fn(0.01*my_randn(n_hid, n_out), 'v') c = shared_fn(my_zeros(n_out), 'c') print 'ALLOCATING ARCH: w0 shape', w0.value.shape print 'ALLOCATING ARCH: w1 shape', w1.value.shape print 'ALLOCATING ARCH: v shape', v.value.shape x = tensor.Tensor(dtype='float32', broadcastable=(0,1,0,0))('x') y = tensor.fmatrix('y') lr = tensor.fscalar('lr') conv_op = conv.ConvOp(shape_img[2:], shape_kern[2:], n_kern, n_batch, 1, 1, verbose=verbose, version=version) conv_op1 = conv.ConvOp( (n_kern,logical_hid_shape[0]/2, logical_hid_shape[1]/2), shape_kern1[2:], n_kern1, n_batch, 1, 1,verbose=verbose, version=version) conv_op.set_flops() conv_op1.set_flops() ds_op = downsample.DownsampleFactorMax((2,2), ignore_border=False) if downsample_ops: hid = tensor.tanh(ds_op(conv_op(x, w0)+b0.dimshuffle((0,'x','x')))) else: hid = tensor.tanh((conv_op(x, w0)+b0.dimshuffle((0,'x','x')))[:,:,::2,::2]) hid1 = tensor.tanh(conv_op1(hid, w1) + b1.dimshuffle((0,'x','x'))) hid_flat = hid1.reshape((n_batch, n_hid)) out = tensor.nnet.softmax(tensor.dot(hid_flat, v)+c) loss = tensor.sum(tensor.nnet.crossentropy_categorical_1hot(out, tensor.argmax(y, axis=1)) * lr) print 'loss type', loss.type params = [w0, b0, w1, b1, v, c] gparams = tensor.grad(loss, params, warn_type=True) mode = get_mode(use_gpu) print 'building pfunc ...' train = pfunc([x,y,lr], [loss], mode=mode, updates=[(p, p-g) for p,g in zip(params, gparams)]) if False: for i, n in enumerate(train.maker.env.toposort()): print i, n xval = my_rand(*shape_img) yval = my_rand(n_batch,n_out) lr = theano._asarray(0.01, dtype='float32') rvals=my_zeros(n_iter) t0 = time.time() for i in xrange(n_iter): rvals[i] = train(xval, yval, lr)[0] t1 = time.time() print_mode(mode) return rvals, t1-t0, mode
096c375fd2a3d51b589713ec856194dfefacf58c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/096c375fd2a3d51b589713ec856194dfefacf58c/test_nnet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 4896, 67, 82, 2758, 22, 67, 1106, 430, 12, 1202, 67, 23162, 16, 353, 554, 16, 417, 1467, 16, 290, 67, 5303, 16, 290, 67, 9754, 16, 2588, 6358, 67, 4473, 33, 5510, 16, 398...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 4896, 67, 82, 2758, 22, 67, 1106, 430, 12, 1202, 67, 23162, 16, 353, 554, 16, 417, 1467, 16, 290, 67, 5303, 16, 290, 67, 9754, 16, 2588, 6358, 67, 4473, 33, 5510, 16, 398...
stat_bar = self.gld.get_widget("statusbar") stat_bar.pop(self.stat_id) stat_bar.push(self.stat_id, _("Done.")) return
self._statusbar()
def _refresh_trees_and_queues(self, widget=None, pacs_queues=None): self.database.refresh() self._refresh_repos_tree() if pacs_queues: for pac in pacs_queues["add"]: if not pac.name in self.queues["add"]: self.queues["add"].append(pac.name)
64e1ca025017891278f9940d2cf1488af419581a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2654/64e1ca025017891278f9940d2cf1488af419581a/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9144, 67, 17204, 67, 464, 67, 18924, 12, 2890, 16, 3604, 33, 7036, 16, 293, 28965, 67, 18924, 33, 7036, 4672, 365, 18, 6231, 18, 9144, 1435, 365, 6315, 9144, 67, 15564, 67, 3413, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9144, 67, 17204, 67, 464, 67, 18924, 12, 2890, 16, 3604, 33, 7036, 16, 293, 28965, 67, 18924, 33, 7036, 4672, 365, 18, 6231, 18, 9144, 1435, 365, 6315, 9144, 67, 15564, 67, 3413, ...
for varname in varnames: vardoc = VariableDoc(varname, ValueDoc(), is_alias=0,
for varname, valuedoc_proxy in var_proxies.items(): vardoc = VariableDoc(varname, valuedoc_proxy, is_alias=0,
def process_import(self, cmd, names, pseudo_docstring): """ The statement handler for import statements. This handler adds a C{VariableDoc} to the parent C{APIDoc} for each name that is created by importing. These C{VariableDoc}s have empty C{ValueDoc}s, and are marked as imported (i.e., C{L{is_imported<VariableDoc.is_imported>}=True}).
d4b62290bc22e63f8cc96e7c77bc6b16300b943b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/d4b62290bc22e63f8cc96e7c77bc6b16300b943b/docparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 5666, 12, 2890, 16, 1797, 16, 1257, 16, 12454, 67, 24675, 4672, 3536, 1021, 3021, 1838, 364, 1930, 6317, 18, 225, 1220, 1838, 4831, 279, 385, 95, 3092, 1759, 97, 358, 326, 98...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5666, 12, 2890, 16, 1797, 16, 1257, 16, 12454, 67, 24675, 4672, 3536, 1021, 3021, 1838, 364, 1930, 6317, 18, 225, 1220, 1838, 4831, 279, 385, 95, 3092, 1759, 97, 358, 326, 98...
c.Run()
def call_upload_file(node_list, file_name, address_list=None): """Upload a file.
ecfe94918845683627f97b646872fde40247176b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/ecfe94918845683627f97b646872fde40247176b/rpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 67, 6327, 67, 768, 12, 2159, 67, 1098, 16, 585, 67, 529, 16, 1758, 67, 1098, 33, 7036, 4672, 3536, 4777, 279, 585, 18, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 67, 6327, 67, 768, 12, 2159, 67, 1098, 16, 585, 67, 529, 16, 1758, 67, 1098, 33, 7036, 4672, 3536, 4777, 279, 585, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
imageLU = map_chunk_slice(-10, 40, 70).crop((0,0,256,256)) imageRU = map_chunk_slice(-9, 40, 70).crop((0,0,256,256)) imageLD = map_chunk_slice(-10, 41, 70).crop((0,0,256,256)) imageRD = map_chunk_slice(-9, 41, 70).crop((0,0,256,256)) print "Image mode: %s" % imageLU.mode image = Image.new("RGB", (512, 512)) image.paste(imageLU, (0,0,256,256)) image.paste(imageRU, (256,0,512,256)) image.paste(imageLD, (0,256,256,512)) image.paste(imageRD, (256,256,512,512)) try: image.save('.\map.png', 'PNG') except: print "Something went wrong on save"
def get_cropbox(x, y): return (x*16, y*16, x*16 + 16, y*16 + 16)
085d2e65d6c70e23a4d1c9d5c5373fe9db845f1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13883/085d2e65d6c70e23a4d1c9d5c5373fe9db845f1a/read_chunk.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 13758, 2147, 12, 92, 16, 677, 4672, 327, 261, 92, 14, 2313, 16, 677, 14, 2313, 16, 619, 14, 2313, 397, 2872, 16, 677, 14, 2313, 397, 2872, 13, 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, 13758, 2147, 12, 92, 16, 677, 4672, 327, 261, 92, 14, 2313, 16, 677, 14, 2313, 16, 619, 14, 2313, 397, 2872, 16, 677, 14, 2313, 397, 2872, 13, 2, -100, -100, -100, -100, -...
self.ppp_list.append(filename)
def initialize(self, atoms): self.numbers = atoms.get_atomic_numbers().copy() self.species = [] for a, Z in enumerate(self.numbers): if a in self.ghosts: Z = -Z if Z not in self.species: self.species.append(Z)
bcd79d18ba4e7ed8dd8f2976da3985f94158dae8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/bcd79d18ba4e7ed8dd8f2976da3985f94158dae8/abinit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 12, 2890, 16, 9006, 4672, 365, 18, 13851, 273, 9006, 18, 588, 67, 27718, 67, 13851, 7675, 3530, 1435, 365, 18, 22657, 273, 5378, 364, 279, 16, 2285, 316, 4241, 12, 2890, 18, 1385...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4046, 12, 2890, 16, 9006, 4672, 365, 18, 13851, 273, 9006, 18, 588, 67, 27718, 67, 13851, 7675, 3530, 1435, 365, 18, 22657, 273, 5378, 364, 279, 16, 2285, 316, 4241, 12, 2890, 18, 1385...
n = 0
def _banreviewfix(self): # FIXME workaround until proper fix is done. bag = set() nodups = set() n = 0 for host, reviews in self.pendingReviews.iteritems(): n += len(reviews) for nick, msg in reviews: if nick == 'Automated-Addition': continue chan, m = msg.args[0], msg.args[1] s = m.rpartition(' ')[0] #remove the url if (nick, chan, s) not in bag: bag.add((nick, chan, s)) nodups.add((host, nick, msg))
5f68b51f72d1691845fd666f0ce320cd91f92b90 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3106/5f68b51f72d1691845fd666f0ce320cd91f92b90/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 21515, 16041, 904, 12, 2890, 4672, 468, 9852, 18975, 3180, 5338, 2917, 353, 2731, 18, 13189, 273, 444, 1435, 14003, 18294, 273, 444, 1435, 364, 1479, 16, 283, 7061, 316, 365, 18, 95...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21515, 16041, 904, 12, 2890, 4672, 468, 9852, 18975, 3180, 5338, 2917, 353, 2731, 18, 13189, 273, 444, 1435, 14003, 18294, 273, 444, 1435, 364, 1479, 16, 283, 7061, 316, 365, 18, 95...
game.quad[game.sector.x][game.sector.y]=IHDOT
game.quad[game.sector.i][game.sector.j]=IHDOT
def mayday(): "Yell for help from nearest starbase." # There's more than one way to move in this game! scanner.chew() # Test for conditions which prevent calling for help if game.condition == "docked": prout(_("Lt. Uhura- \"But Captain, we're already docked.\"")) return if damaged(DRADIO): prout(_("Subspace radio damaged.")) return if not game.state.baseq: prout(_("Lt. Uhura- \"Captain, I'm not getting any response from Starbase.\"")) return if game.landed: prout(_("You must be aboard the %s.") % crmshp()) return # OK -- call for help from nearest starbase game.nhelp += 1 if game.base.x!=0: # There's one in this quadrant ddist = (game.base - game.sector).distance() else: ddist = FOREVER for ibq in game.state.baseq: xdist = QUADSIZE * (ibq - game.quadrant).distance() if xdist < ddist: ddist = xdist # Since starbase not in quadrant, set up new quadrant game.quadrant = ibq newqad() # dematerialize starship game.quad[game.sector.x][game.sector.y]=IHDOT proutn(_("Starbase in Quadrant %s responds--%s dematerializes") \ % (game.quadrant, crmshp())) game.sector.invalidate() for m in range(1, 5+1): w = game.base.scatter() if VALID_SECTOR(w.x,w.y) and game.quad[w.x][w.y]==IHDOT: # found one -- finish up game.sector = w break if not game.sector.is_valid(): prout(_("You have been lost in space...")) finish(FMATERIALIZE) return # Give starbase three chances to rematerialize starship probf = math.pow((1.0 - math.pow(0.98,ddist)), 0.33333333) for m in range(1, 3+1): if m == 1: proutn(_("1st")) elif m == 2: proutn(_("2nd")) elif m == 3: proutn(_("3rd")) proutn(_(" attempt to re-materialize ") + crmshp()) game.quad[ix][iy]=(IHMATER0,IHMATER1,IHMATER2)[m-1] textcolor("red") warble() if randreal() > probf: break prout(_("fails.")) curses.delay_output(500) textcolor(None) if m > 3: game.quad[ix][iy]=IHQUEST game.alive = False drawmaps(1) setwnd(message_window) finish(FMATERIALIZE) return game.quad[ix][iy]=game.ship textcolor("green") prout(_("succeeds.")) textcolor(None) dock(False) skip(1) prout(_("Lt. Uhura- \"Captain, we made it!\""))
e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2026, 2881, 13332, 315, 61, 1165, 364, 2809, 628, 11431, 10443, 1969, 1199, 468, 6149, 1807, 1898, 2353, 1245, 4031, 358, 3635, 316, 333, 7920, 5, 7683, 18, 343, 359, 1435, 468, 7766, 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, 2026, 2881, 13332, 315, 61, 1165, 364, 2809, 628, 11431, 10443, 1969, 1199, 468, 6149, 1807, 1898, 2353, 1245, 4031, 358, 3635, 316, 333, 7920, 5, 7683, 18, 343, 359, 1435, 468, 7766, 36...
l = len(chunks[0])
l = len(chunks[-1])
def _wrap_chunks(self, chunks): """_wrap_chunks(chunks : [string]) -> [string]
d6b1aef33b7c7d40bfb1081d307451a71781d2bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6b1aef33b7c7d40bfb1081d307451a71781d2bc/textwrap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4113, 67, 14691, 12, 2890, 16, 6055, 4672, 3536, 67, 4113, 67, 14691, 12, 14691, 294, 306, 1080, 5717, 317, 306, 1080, 65, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4113, 67, 14691, 12, 2890, 16, 6055, 4672, 3536, 67, 4113, 67, 14691, 12, 14691, 294, 306, 1080, 5717, 317, 306, 1080, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
changed_cb=self.prefs_art_location_changed) display_art_location_hbox = gtk.HBox(spacing=12) display_art_location_hbox.pack_end(display_art_location, False, False) display_art_location_hbox.pack_end(ui.label( text=_("Save art to:")), False, False) display_art_location_hbox.set_sensitive(self.config.show_covers) display_art.connect('toggled', prefs_art_toggled, display_art_hbox, display_art_location_hbox, display_stylized_hbox) display_playback = gtk.CheckButton(_("_Playback/volume buttons")) display_playback.set_active(self.config.show_playback) display_playback.connect('toggled', prefs_playback_toggled) display_progress = gtk.CheckButton(_("Pr_ogressbar")) display_progress.set_active(self.config.show_progress) display_progress.connect('toggled', prefs_progress_toggled) display_statusbar = gtk.CheckButton(_("_Statusbar")) display_statusbar.set_active(self.config.show_statusbar) display_statusbar.connect('toggled', prefs_statusbar_toggled) display_lyrics = gtk.CheckButton(_("Song Ly_rics")) display_lyrics.set_active(self.config.show_lyrics)
changed_cb=self._art_location_changed) art_location_hbox = gtk.HBox(spacing=12) art_location_hbox.pack_end(art_location, False, False) art_location_hbox.pack_end(ui.label(text=_("Save art to:")), False, False) art_location_hbox.set_sensitive(self.config.show_covers) art.connect('toggled', art_toggled, art_hbox, art_location_hbox, stylized_hbox) playback = gtk.CheckButton(_("_Playback/volume buttons")) playback.set_active(self.config.show_playback) playback.connect('toggled', playback_toggled) progress = gtk.CheckButton(_("Pr_ogressbar")) progress.set_active(self.config.show_progress) progress.connect('toggled', progress_toggled) statusbar = gtk.CheckButton(_("_Statusbar")) statusbar.set_active(self.config.show_statusbar) statusbar.connect('toggled', statusbar_toggled) lyrics = gtk.CheckButton(_("Song Ly_rics")) lyrics.set_active(self.config.show_lyrics)
def display_tab(self, prefs_stylized_toggled, prefs_art_toggled, prefs_playback_toggled, prefs_progress_toggled, prefs_statusbar_toggled, prefs_lyrics_toggled, trayicon_available): """Construct and layout the display tab""" displaylabel = ui.label(markup='<b>' + _('Display') + '</b>') display_frame = gtk.Frame() display_frame.set_label_widget(displaylabel) display_frame.set_shadow_type(gtk.SHADOW_NONE)
7d41f2105c0d58643150b6472b6b9676150f38e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/7d41f2105c0d58643150b6472b6b9676150f38e3/preferences.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 67, 7032, 12, 2890, 16, 15503, 67, 334, 93, 80, 1235, 67, 88, 23972, 1259, 16, 15503, 67, 485, 67, 88, 23972, 1259, 16, 15503, 67, 1601, 823, 67, 88, 23972, 1259, 16, 15503, 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, 2562, 67, 7032, 12, 2890, 16, 15503, 67, 334, 93, 80, 1235, 67, 88, 23972, 1259, 16, 15503, 67, 485, 67, 88, 23972, 1259, 16, 15503, 67, 1601, 823, 67, 88, 23972, 1259, 16, 15503, 67...
direc = eye(N,dtype=float)
if direc is None: direc = eye(N, dtype=float) else: direc = asarray(direc, dtype=float)
def fmin_powell(func, x0, args=(), xtol=1e-4, ftol=1e-4, maxiter=None, maxfun=None, full_output=0, disp=1, retall=0, callback=None): """Minimize a function using modified Powell's method. Description: Uses a modification of Powell's method to find the minimum of a function of N variables Inputs: func -- the Python function or method to be minimized. x0 -- the initial guess. args -- extra arguments for func. callback -- an optional user-supplied function to call after each iteration. It is called as callback(xk), where xk is the current parameter vector. Outputs: (xopt, {fopt, xi, direc, iter, funcalls, warnflag}, {allvecs}) xopt -- minimizer of function fopt -- value of function at minimum: fopt = func(xopt) direc -- current direction set iter -- number of iterations funcalls -- number of function calls warnflag -- Integer warning flag: 1 : 'Maximum number of function evaluations.' 2 : 'Maximum number of iterations.' allvecs -- a list of solutions at each iteration Additional Inputs: xtol -- line-search error tolerance. ftol -- acceptable relative error in func(xopt) for convergence. maxiter -- the maximum number of iterations to perform. maxfun -- the maximum number of function evaluations. full_output -- non-zero if fval and warnflag outputs are desired. disp -- non-zero to print convergence messages. retall -- non-zero to return a list of the solution at each iteration See also: fmin, fmin_powell, fmin_cg, fmin_bfgs, fmin_ncg -- multivariate local optimizers leastsq -- nonlinear least squares minimizer fmin_l_bfgs_b, fmin_tnc, fmin_cobyla -- constrained multivariate optimizers anneal, brute -- global optimizers fminbound, brent, golden, bracket -- local scalar minimizers fsolve -- n-dimenstional root-finding brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding fixed_point -- scalar fixed-point finder """ # we need to use a mutable object here that we can update in the # wrapper function fcalls, func = wrap_function(func, args) x = asarray(x0) if retall: allvecs = [x] N = len(x) rank = len(x.shape) if not -1 < rank < 2: raise ValueError, "Initial guess must be a scalar or rank-1 sequence." if maxiter is None: maxiter = N * 1000 if maxfun is None: maxfun = N * 1000 direc = eye(N,dtype=float) fval = squeeze(func(x)) x1 = x.copy() iter = 0; ilist = range(N) while True: fx = fval bigind = 0 delta = 0.0 for i in ilist: direc1 = direc[i] fx2 = fval fval, x, direc1 = _linesearch_powell(func, x, direc1, tol=xtol*100) if (fx2 - fval) > delta: delta = fx2 - fval bigind = i iter += 1 if callback is not None: callback(x) if retall: allvecs.append(x) if (2.0*(fx - fval) <= ftol*(abs(fx)+abs(fval))+1e-20): break if fcalls[0] >= maxfun: break if iter >= maxiter: break # Construct the extrapolated point direc1 = x - x1 x2 = 2*x - x1 x1 = x.copy() fx2 = squeeze(func(x2)) if (fx > fx2): t = 2.0*(fx+fx2-2.0*fval) temp = (fx-fval-delta) t *= temp*temp temp = fx-fx2 t -= delta*temp*temp if t < 0.0: fval, x, direc1 = _linesearch_powell(func, x, direc1, tol=xtol*100) direc[bigind] = direc[-1] direc[-1] = direc1 warnflag = 0 if fcalls[0] >= maxfun: warnflag = 1 if disp: print "Warning: Maximum number of function evaluations has "\ "been exceeded." elif iter >= maxiter: warnflag = 2 if disp: print "Warning: Maximum number of iterations has been exceeded" else: if disp: print "Optimization terminated successfully." print " Current function value: %f" % fval print " Iterations: %d" % iter print " Function evaluations: %d" % fcalls[0] x = squeeze(x) if full_output: retlist = x, fval, direc, iter, fcalls[0], warnflag if retall: retlist += (allvecs,) else: retlist = x if retall: retlist = (x, allvecs) return retlist
8974d1f4da239d0c491cb9e9b4582fc60c0f37d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8974d1f4da239d0c491cb9e9b4582fc60c0f37d4/optimize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1154, 67, 23509, 1165, 12, 644, 16, 619, 20, 16, 833, 33, 9334, 619, 3490, 33, 21, 73, 17, 24, 16, 284, 3490, 33, 21, 73, 17, 24, 16, 25743, 33, 7036, 16, 943, 12125, 33, 70...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 284, 1154, 67, 23509, 1165, 12, 644, 16, 619, 20, 16, 833, 33, 9334, 619, 3490, 33, 21, 73, 17, 24, 16, 284, 3490, 33, 21, 73, 17, 24, 16, 25743, 33, 7036, 16, 943, 12125, 33, 70...
else: self.pop_dialog('连线错误', 'retstr') return False
def online(self, widget, data=None): self.e_user.set_editable(False) self.e_passwd.set_editable(False) self.account[0] = self.e_user.get_text() self.account[2] = self.e_passwd.get_text() self.account[3] = self.e_server.get_text() casnetconf.ops['-u'] = self.account[0] casnetconf.ops['-d'] = self.account[1] casnetconf.ops['-p'] = self.account[2] casnetconf.ops['-ip'] = self.account[3] casnetconf.ops['-m'] = self.account[4] casnetconf.ops['-r'] = self.account[5] casnetconf.ops['-a'] = self.account[6] casnetconf.write_ops() (ret, retstr) = casnet.login(self.account) if ret == False: self.pop_dialog('登录错误', retstr) return False (ret, retstr) = casnet.online(self.account[4]) if ret == False: if retstr.find('Online at other IP!'): casnet.forceoff(self.account) (ret, retstr) = casnet.login(self.account) else: self.pop_dialog('连线错误', 'retstr') return False self.pop_dialog('连接状态', retstr) self.stat(None, None) return True
ff5f65cbaefb102f37aa0e9b4e8324968d2e1e80 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4851/ff5f65cbaefb102f37aa0e9b4e8324968d2e1e80/casnet-gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12365, 12, 2890, 16, 3604, 16, 501, 33, 7036, 4672, 365, 18, 73, 67, 1355, 18, 542, 67, 19653, 12, 8381, 13, 365, 18, 73, 67, 24002, 18, 542, 67, 19653, 12, 8381, 13, 365, 18, 4631...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12365, 12, 2890, 16, 3604, 16, 501, 33, 7036, 4672, 365, 18, 73, 67, 1355, 18, 542, 67, 19653, 12, 8381, 13, 365, 18, 73, 67, 24002, 18, 542, 67, 19653, 12, 8381, 13, 365, 18, 4631...
best=orngSVM.parameter_selection(orngSVM.SVMLearner(),self.widget.data, 4, params, best, callback=self.widget.progres) except SystemExit:
best=orngSVM.parameter_selection(orngSVM.SVMLearner(),self.data, 4, params, best, callback=self.progres) except :
def run(self): params={} if self.widget.useNu: params["nu"]=[0.25, 0.5, 0.75] else: params["C"]=map(lambda g:2**g, range(-5,10,2)) if self.widget.kernel_type in [1,2]: params["gamma"]=map(lambda g:2**g, range(-3,10,2)) if self.widget.kernel_type==1: params["degree"]=[1,2,3] best={} try: best=orngSVM.parameter_selection(orngSVM.SVMLearner(),self.widget.data, 4, params, best, callback=self.widget.progres) except SystemExit: pass self.widget.finishSearch()
a017a62eeb64cb8f18353a5ad8eaccb9881945cf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/a017a62eeb64cb8f18353a5ad8eaccb9881945cf/OWSVM.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 859, 12938, 309, 365, 18, 6587, 18, 1202, 50, 89, 30, 859, 9614, 13053, 11929, 22850, 20, 18, 2947, 16, 374, 18, 25, 16, 374, 18, 5877, 65, 469, 30, 859, 9614, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 859, 12938, 309, 365, 18, 6587, 18, 1202, 50, 89, 30, 859, 9614, 13053, 11929, 22850, 20, 18, 2947, 16, 374, 18, 25, 16, 374, 18, 5877, 65, 469, 30, 859, 9614, ...
else: self._repository = args[0]
self._repository = args[0] for key,value in optlist: if key == '-o': self._output_dir = value elif key == '--output-dir': self._output_dir = value
def __init__(self, argv): self._argv = argv self._broken = False self._repository = None self._want_help = False self._error_message = None self._generate_all = True self._stats_to_generate = [] self._svn_binary = 'svn' self._outpur_dir = 'mpy-svn-stats'
6b9b071b98917bc4ce6a2b46cff255e9e6def7cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2516/6b9b071b98917bc4ce6a2b46cff255e9e6def7cf/mpy-svn-stats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5261, 4672, 365, 6315, 19485, 273, 5261, 365, 6315, 70, 19906, 273, 1083, 365, 6315, 9071, 273, 599, 365, 6315, 17369, 67, 5201, 273, 1083, 365, 6315, 1636...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5261, 4672, 365, 6315, 19485, 273, 5261, 365, 6315, 70, 19906, 273, 1083, 365, 6315, 9071, 273, 599, 365, 6315, 17369, 67, 5201, 273, 1083, 365, 6315, 1636...
s += '<a id="worksheet_title" class="worksheet_title" onClick="rename_worksheet(); return false;" title="Click to rename this worksheet">%s</a>'%(name.replace('<','&lt;'))
s += '<a id="worksheet_title" class="worksheet_title" onClick="rename_worksheet(); return false;" title="Click to rename this worksheet">%s</a>'%(cgi.escape(name))
def html_title(self, username='guest'): name = self.truncated_name()
dcd8cb32f2748f4f5a3f4b5ce524836841d15158 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/dcd8cb32f2748f4f5a3f4b5ce524836841d15158/worksheet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 67, 2649, 12, 2890, 16, 2718, 2218, 18908, 11, 4672, 508, 273, 365, 18, 23558, 690, 67, 529, 1435, 2, 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, 1729, 67, 2649, 12, 2890, 16, 2718, 2218, 18908, 11, 4672, 508, 273, 365, 18, 23558, 690, 67, 529, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
body += _("You may want to start browsing from &s") % link
body += _("You may want to start browsing from %s") % link
def tmpl_record_not_found(self, status='missing', recID="", ln=cdslang): """ Displays a page when bad or missing record ID was given. @param status: 'missing' : no recID was given 'inexistant': recID doesn't have an entry in the database 'nan' : recID is not a number 'invalid' : recID is an error code, i.e. in the interval [-99,-1] @param return: body of the page """ _ = gettext_set_language(ln) if status == 'inexistant': body = _("Sorry, the record %s does not seem to exist.") % (recID,) elif status == 'nan': body = _("Sorry, the record %s does not seem to be a number.") % (recID,) elif status == 'invalid': body = _("Sorry, the record %s is not a valid ID value.") % (recID,) else: body = _("Sorry, no record ID was provided.")
aaafa5fdc87762fc45b4953ee2125dba571f03c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/aaafa5fdc87762fc45b4953ee2125dba571f03c7/webcomment_templates.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10720, 67, 3366, 67, 902, 67, 7015, 12, 2890, 16, 1267, 2218, 7337, 2187, 1950, 734, 1546, 3113, 7211, 33, 4315, 2069, 539, 4672, 3536, 9311, 87, 279, 1363, 1347, 5570, 578, 3315, 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, 10720, 67, 3366, 67, 902, 67, 7015, 12, 2890, 16, 1267, 2218, 7337, 2187, 1950, 734, 1546, 3113, 7211, 33, 4315, 2069, 539, 4672, 3536, 9311, 87, 279, 1363, 1347, 5570, 578, 3315, 1409, ...
matches = [(x,y) for (x,y) in unicode_names if pat.search(y) is not None]
matches = [(y,x) for (x,y) in unicode_names if pat.search(y) is not None]
def main(args): unicode_names= [] for ix in range(sys.maxunicode+1): try: unicode_names.append( (ix, unicodedata.name(unichr(ix))) ) except ValueError: # no name for the character pass for arg in args: pat = re.compile(arg, re.I) matches = [(x,y) for (x,y) in unicode_names if pat.search(y) is not None] if matches: print "***", arg, "matches", "***" for (x,y) in matches: print "%s (%d)" % (y,x)
3c531ff74ae7d943b8c50bdd89b1f0393015b964 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/3c531ff74ae7d943b8c50bdd89b1f0393015b964/find-uname.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 1968, 4672, 5252, 67, 1973, 33, 5378, 364, 8288, 316, 1048, 12, 9499, 18, 1896, 9124, 15, 21, 4672, 775, 30, 5252, 67, 1973, 18, 6923, 12, 261, 697, 16, 5252, 892, 18, 529,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1968, 4672, 5252, 67, 1973, 33, 5378, 364, 8288, 316, 1048, 12, 9499, 18, 1896, 9124, 15, 21, 4672, 775, 30, 5252, 67, 1973, 18, 6923, 12, 261, 697, 16, 5252, 892, 18, 529,...
550. If all addresses are accepted, then the method will return an
550. If all addresses are accepted, then the method will return an
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction.
02d53b2445aff540d0f856f099c20b160ea659ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/02d53b2445aff540d0f856f099c20b160ea659ba/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 4408, 12, 2890, 16, 628, 67, 4793, 16, 358, 67, 23305, 16, 1234, 16, 4791, 67, 2116, 22850, 6487, 4519, 337, 67, 2116, 33, 8526, 4672, 3536, 2503, 1296, 11199, 392, 7278, 4791, 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, 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, 1366, 4408, 12, 2890, 16, 628, 67, 4793, 16, 358, 67, 23305, 16, 1234, 16, 4791, 67, 2116, 22850, 6487, 4519, 337, 67, 2116, 33, 8526, 4672, 3536, 2503, 1296, 11199, 392, 7278, 4791, 2...
for node in nodes:
for node in nodes[:]:
def call(self, auth, node_filter = None, return_fields = None): # Get node information nodes = Nodes(self.api, node_filter, return_fields)
66525a88db155d029e62841ec2170b276995e8cc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7598/66525a88db155d029e62841ec2170b276995e8cc/GetNodes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 2890, 16, 1357, 16, 756, 67, 2188, 273, 599, 16, 327, 67, 2821, 273, 599, 4672, 468, 968, 756, 1779, 2199, 273, 14037, 12, 2890, 18, 2425, 16, 756, 67, 2188, 16, 327, 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, 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, 745, 12, 2890, 16, 1357, 16, 756, 67, 2188, 273, 599, 16, 327, 67, 2821, 273, 599, 4672, 468, 968, 756, 1779, 2199, 273, 14037, 12, 2890, 18, 2425, 16, 756, 67, 2188, 16, 327, 67, ...
"""Returns the file selection dialog that may be shared among different modules of this application. This command will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix filedialog. An optional dlgclass parameter can be passed to specified what type of file selection dialog widget is desired. Possible options are 'tix' 'FileSelectDialog' or 'tixExFileSelectDialog'.
"""Returns the file selection dialog that may be shared among different calls from this application. This command will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix_filedialog. An optional dlgclass parameter can be passed to specified what type of file selection dialog widget is desired. Possible options are tix FileSelectDialog or tixExFileSelectDialog.
def tix_filedialog(self, dlgclass=None): """Returns the file selection dialog that may be shared among different modules of this application. This command will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix filedialog. An optional dlgclass parameter can be passed to specified what type of file selection dialog widget is desired. Possible options are 'tix' 'FileSelectDialog' or 'tixExFileSelectDialog'. """ if dlgclass is not None: return self.tk.call('tix', 'filedialog', dlgclass) else: return self.tk.call('tix', 'filedialog')
f6251f98f783a2e87344774cc7be0958561e5a16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/f6251f98f783a2e87344774cc7be0958561e5a16/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 697, 67, 768, 12730, 12, 2890, 16, 25840, 1106, 33, 7036, 4672, 3536, 1356, 326, 585, 4421, 6176, 716, 2026, 506, 5116, 17200, 3775, 4097, 628, 333, 2521, 18, 225, 1220, 1296, 903, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 268, 697, 67, 768, 12730, 12, 2890, 16, 25840, 1106, 33, 7036, 4672, 3536, 1356, 326, 585, 4421, 6176, 716, 2026, 506, 5116, 17200, 3775, 4097, 628, 333, 2521, 18, 225, 1220, 1296, 903, ...
snmpEngine.msgAndPduDsp.mibInstrumControlle.writeVars(
snmpEngine.msgAndPduDsp.mibInstrumController.writeVars(
def delVacmAccess(snmpEngine, groupName, contextName, securityModel, securityLevel): vacmAccessEntry, tblIdx = __cookVacmAccessInfo( snmpEngine, groupName, contextName, securityModel, securityLevel ) snmpEngine.msgAndPduDsp.mibInstrumControlle.writeVars( ((vacmAccessEntry.name + (9,) + tblIdx, 'destroy'),) )
7dfad80e5e6161ff385f2a932b0de0b0bc82af59 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/587/7dfad80e5e6161ff385f2a932b0de0b0bc82af59/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1464, 58, 26279, 1862, 12, 26527, 4410, 16, 11619, 16, 819, 461, 16, 4373, 1488, 16, 4373, 2355, 4672, 331, 26279, 1862, 1622, 16, 10142, 4223, 273, 1001, 29854, 58, 26279, 1862, 966, 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, 1464, 58, 26279, 1862, 12, 26527, 4410, 16, 11619, 16, 819, 461, 16, 4373, 1488, 16, 4373, 2355, 4672, 331, 26279, 1862, 1622, 16, 10142, 4223, 273, 1001, 29854, 58, 26279, 1862, 966, 12...
"""
def test_sendbytes(self): if self.TYPE != 'processes': return
9cbd5a7ebf2e75965579f3919b8cd9004fbf3411 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/9cbd5a7ebf2e75965579f3919b8cd9004fbf3411/test_multiprocessing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4661, 3890, 12, 2890, 4672, 309, 365, 18, 2399, 480, 296, 18675, 4278, 327, 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, ...
[ 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4661, 3890, 12, 2890, 4672, 309, 365, 18, 2399, 480, 296, 18675, 4278, 327, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
return ""
return ""
def cleanwikicode(text): if not text: return ""
1fc8304d6ddd18fcd83597ff7597b54525735edf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/1fc8304d6ddd18fcd83597ff7597b54525735edf/copyright.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 11999, 3487, 12, 955, 4672, 309, 486, 977, 30, 327, 1408, 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, ...
[ 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, 2721, 11999, 3487, 12, 955, 4672, 309, 486, 977, 30, 327, 1408, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
fov = 360.0 * atan(16.0 / camera.getLens()) / pi
if IM_HEIGHT > IM_WIDTH: factor=float(IM_WIDTH) / float(IM_HEIGHT) else: factor=1 fov = 360.0 * atan((factor*16.0) / camera.lens) / pi
def export_camera(cam): # get the camera camera = cam.getData() print "o exporting Camera "+camera.getName()+"..." # get the object matrix so we can calculate to and up objmatrix = cam.matrix eyeV = Mathutils.Vector([0, 0, 0, 1]) targetV = Mathutils.Vector([0, 0, -1, 1]) upV = Mathutils.Vector([0, 1, 0, 0]) eyeV = eyeV * objmatrix targetV = targetV * objmatrix upV = upV * objmatrix # get the fov value fov = 360.0 * atan(16.0 / camera.getLens()) / pi DOFDIST=camera.dofDist FILE.write("\n\ncamera {\n") if DOF.val == 1: camtype = "thinlens" FILE.write("\ttype %s\n" % camtype) FILE.write("\teye %s %s %s\n" % (eyeV[0], eyeV[1], eyeV[2])) FILE.write("\ttarget %s %s %s\n" % (targetV[0], targetV[1], targetV[2])) FILE.write("\tup %s %s %s\n" % (upV[0], upV[1], upV[2])) FILE.write("\tfov %s \n" % fov) FILE.write("\taspect %s \n" % (1.0 * IM_WIDTH / IM_HEIGHT)) FILE.write("\tfdist %s \n" % DOFDIST) FILE.write("\tlensr %s \n" % DOFRADIUS) FILE.write("\tsides %s \n" % LENSSIDES) FILE.write("\trotation %s \n" % LENSROTATION) elif SPHERICALCAMERA.val == 1: camtype = "spherical" FILE.write("\ttype %s\n" % camtype) FILE.write("\teye %s %s %s\n" % (eyeV[0], eyeV[1], eyeV[2])) FILE.write("\ttarget %s %s %s\n" % (targetV[0], targetV[1], targetV[2])) FILE.write("\tup %s %s %s\n" % (upV[0], upV[1], upV[2])) elif FISHEYECAMERA.val == 1: camtype = "fisheye" FILE.write("\ttype %s\n" % camtype) FILE.write("\teye %s %s %s\n" % (eyeV[0], eyeV[1], eyeV[2])) FILE.write("\ttarget %s %s %s\n" % (targetV[0], targetV[1], targetV[2])) FILE.write("\tup %s %s %s\n" % (upV[0], upV[1], upV[2])) else: camtype = "pinhole" FILE.write("\ttype %s\n" % camtype) FILE.write("\teye %s %s %s\n" % (eyeV[0], eyeV[1], eyeV[2])) FILE.write("\ttarget %s %s %s\n" % (targetV[0], targetV[1], targetV[2])) FILE.write("\tup %s %s %s\n" % (upV[0], upV[1], upV[2])) FILE.write("\tfov %s \n" % fov) FILE.write("\taspect %s \n" % (1.0 * IM_WIDTH / IM_HEIGHT)) FILE.write("}")
8623cadbda506d5312cf919d0f5bd1f96351ae31 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12400/8623cadbda506d5312cf919d0f5bd1f96351ae31/sunflow_export.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 26426, 12, 20133, 4672, 225, 468, 336, 326, 10836, 10836, 273, 5861, 18, 588, 751, 1435, 1172, 315, 83, 3359, 310, 30355, 13773, 26426, 18, 17994, 1435, 9078, 7070, 225, 468, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3359, 67, 26426, 12, 20133, 4672, 225, 468, 336, 326, 10836, 10836, 273, 5861, 18, 588, 751, 1435, 1172, 315, 83, 3359, 310, 30355, 13773, 26426, 18, 17994, 1435, 9078, 7070, 225, 468, 3...
start = start + timedelta(seconds=randint(-1, 4))
start = start + timedelta(seconds=randint(-1, 6))
def generate_progressive_date(start): while True: start = start + timedelta(seconds=randint(-1, 4)) yield start
629679d47a45ed50e4033049929bb76f4b8deafe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12383/629679d47a45ed50e4033049929bb76f4b8deafe/dist-make-test-database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 8298, 688, 67, 712, 12, 1937, 4672, 1323, 1053, 30, 787, 273, 787, 397, 10661, 12, 7572, 33, 7884, 474, 19236, 21, 16, 1666, 3719, 2824, 787, 225, 2, 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, 2103, 67, 8298, 688, 67, 712, 12, 1937, 4672, 1323, 1053, 30, 787, 273, 787, 397, 10661, 12, 7572, 33, 7884, 474, 19236, 21, 16, 1666, 3719, 2824, 787, 225, 2, -100, -100, -100, -100, ...
r""" Initial digit of $n$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000030; a Initial digit of n sage: a(0) 0 sage: a(1) 1 sage: a(8) 8 sage: a(454) 4 sage: a(-4) Traceback (most recent call last): ... ValueError: input n (=-4) must be an integer >= 0 sage: a.list(12) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1] AUTHOR: -- Jaap Spies (2007-01-18) """ def __init__(self):
def __init__(self): r""" Initial digit of $n$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000030; a Initial digit of n sage: a(0) 0 sage: a(1) 1 sage: a(8) 8 sage: a(454) 4 sage: a(-4) Traceback (most recent call last): ... ValueError: input n (=-4) must be an integer >= 0 sage: a.list(12) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1] AUTHOR: -- Jaap Spies (2007-01-18) """
def list(self, n): try: if len(self._b) <= n: raise IndexError else: return self._b[:n] except (AttributeError, IndexError): self._precompute() # try again return self.list(n)
d2510d4232e17c9cea8d1a0271c6be68a81d317b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/d2510d4232e17c9cea8d1a0271c6be68a81d317b/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 12, 2890, 16, 290, 4672, 775, 30, 309, 562, 12, 2890, 6315, 70, 13, 1648, 290, 30, 1002, 10195, 469, 30, 327, 365, 6315, 70, 10531, 82, 65, 1335, 261, 1499, 668, 16, 10195, 4672...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 666, 12, 2890, 16, 290, 4672, 775, 30, 309, 562, 12, 2890, 6315, 70, 13, 1648, 290, 30, 1002, 10195, 469, 30, 327, 365, 6315, 70, 10531, 82, 65, 1335, 261, 1499, 668, 16, 10195, 4672...
override if you don't want the standard buttons
override if you do not want the standard buttons
def buttonbox(self): '''add standard button box.
1444a631bfccf78b5684c81fd87c35a1d86968b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1444a631bfccf78b5684c81fd87c35a1d86968b7/tkSimpleDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3568, 2147, 12, 2890, 4672, 9163, 1289, 4529, 3568, 3919, 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, ...
[ 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, 3568, 2147, 12, 2890, 4672, 9163, 1289, 4529, 3568, 3919, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if __name__ == '__main__': _main(sys.argv)
if __name__ == '__main__': sys.stdout = codecs.getwriter( "utf-8" )( sys.stdout, "replace" ) sys.stderr = codecs.getwriter( "utf-8" )( sys.stderr, "replace" ) _main(sys.argv)
def _main(arglist): signal.signal(signal.SIGINT, signalHandler) try: (argp, rest) = getopt.gnu_getopt(arglist[1:], "sdfrokc:h", longopts=["state", "daemon", "full-help", "run", "runonce", "kill", "config=", "set-default-config=", "help", "list-failed", "list-saved", "purged-saved", "purge-failed", "comment-config"]) except getopt.GetoptError: print >> sys.stderr, helpMessage sys.exit(1) global _action, _runOnce, configFile, REDIRECT_TO, saved for param, argum in argp: if param == "--daemon" or param == "-d": _action = "daemon" elif param == "--run" or param == "-r": _action = "run" elif param == "--runonce" or param == "-o": _action = "run" _runOnce = True elif param =="--state" or param == "-s": _action = 'state' elif param == "--kill" or param == "-k": _action = "kill" elif param == "--config" or param == "-c": configFile = argum elif param == "--purge-failed": _action="purge-failed" elif param == "--help" or param == "-h": _action = 'help' elif param == "--full-help" or param == "-f": _action = 'fullhelp' elif param == "--set-default-config": _action ='set-default-config' elif param == "--list-failed": _action = 'list-failed' elif param == "--list-saved": _action = 'list-saved' elif param == "--purge-saved": _action = 'purge-saved' elif param == "--comment-config": _action = 'comment-config' if _action == 'comment-config': print(commentConfig) raise SystemExit elif _action == "daemon": getConfig(filename=configFile, reload=True) if os.name == u'nt' or os.name == u'dos' or os.name == u'ce': print >> sys.stderr, u"daemon mode not supported on Windows. will try to continue, but this is likely to crash" elif os.name == u'mac' or os.name == u"os2": print >> sys.stderr, u"""daemon mode may have issues on your
cb06f1645b77b7012f9195d9b9e4a000a0842687 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/cb06f1645b77b7012f9195d9b9e4a000a0842687/rssdler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5254, 12, 3175, 1098, 4672, 4277, 18, 10420, 12, 10420, 18, 18513, 3217, 16, 4277, 1503, 13, 775, 30, 261, 3175, 84, 16, 3127, 13, 273, 225, 336, 3838, 18, 1600, 89, 67, 588, 38...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 12, 3175, 1098, 4672, 4277, 18, 10420, 12, 10420, 18, 18513, 3217, 16, 4277, 1503, 13, 775, 30, 261, 3175, 84, 16, 3127, 13, 273, 225, 336, 3838, 18, 1600, 89, 67, 588, 38...
return _old_pydoc_help_call(self, *map(ppresolve,args), **kwds)
return _old_pydoc_help_call(self, *map(_ppresolve_ignore_failure,args), **kwds)
def _scipy_pydoc_help_call(self,*args,**kwds): return _old_pydoc_help_call(self, *map(ppresolve,args), **kwds)
5d6793a718e91906b1e75665ba78c6e02e6a1370 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/5d6793a718e91906b1e75665ba78c6e02e6a1370/ppimport.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1017, 9126, 67, 2074, 2434, 67, 5201, 67, 1991, 12, 2890, 16, 14, 1968, 16, 636, 25577, 4672, 327, 389, 1673, 67, 2074, 2434, 67, 5201, 67, 1991, 12, 2890, 16, 380, 1458, 12, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1017, 9126, 67, 2074, 2434, 67, 5201, 67, 1991, 12, 2890, 16, 14, 1968, 16, 636, 25577, 4672, 327, 389, 1673, 67, 2074, 2434, 67, 5201, 67, 1991, 12, 2890, 16, 380, 1458, 12, 11...
print pot_header % {'time': timestamp, 'version':__version__}
print pot_header % {'time': timestamp, 'version': __version__}
def write(self, fp): options = self.__options timestamp = time.ctime(time.time()) # common header try: sys.stdout = fp # The time stamp in the header doesn't have the same format # as that generated by xgettext... print pot_header % {'time': timestamp, 'version':__version__} for k, v in self.__messages.items(): for filename, lineno in v: # location comments are different b/w Solaris and GNU d = {'filename': filename, 'lineno': lineno} if options.location == options.SOLARIS: print _('# File: %(filename)s, line: %(lineno)d') % d elif options.location == options.GNU: print _('#: %(filename)s:%(lineno)d') % d # TBD: sorting, normalizing print 'msgid', normalize(k) print 'msgstr ""' print finally: sys.stdout = sys.__stdout__
b748a44903fd0395aa03a8c8e6f42748f50d37f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b748a44903fd0395aa03a8c8e6f42748f50d37f5/pygettext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 4253, 4672, 702, 273, 365, 16186, 2116, 2858, 273, 813, 18, 21261, 12, 957, 18, 957, 10756, 468, 2975, 1446, 775, 30, 2589, 18, 10283, 273, 4253, 468, 1021, 813, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 16, 4253, 4672, 702, 273, 365, 16186, 2116, 2858, 273, 813, 18, 21261, 12, 957, 18, 957, 10756, 468, 2975, 1446, 775, 30, 2589, 18, 10283, 273, 4253, 468, 1021, 813, 14...
if f.find('.svn')==-1 and f.find('LICENSE')==-1 and f.find('.psd')==-1 and f.find('.noinclude')==-1 and f.find('.module.damnvid')==-1 and f.find('.bmp')==-1 and f.find('.ai')==-1 and f.find('.exe')==-1 and f.find('.zip')==-1 and f.find('fireworks.png')==-1:
if goodFile(f):
def addDir(d): for f in os.listdir(d): if f.find('.svn')==-1 and f.find('LICENSE')==-1 and f.find('.psd')==-1 and f.find('.noinclude')==-1 and f.find('.module.damnvid')==-1 and f.find('.bmp')==-1 and f.find('.ai')==-1 and f.find('.exe')==-1 and f.find('.zip')==-1 and f.find('fireworks.png')==-1: if os.path.isdir(d+os.sep+f): addDir(d+os.sep+f) else: addFile(d+os.sep+f)
a2dbe49821a3445804104a60e1d9d3e41981ac44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11142/a2dbe49821a3445804104a60e1d9d3e41981ac44/build-required-files.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 1621, 12, 72, 4672, 364, 284, 316, 1140, 18, 1098, 1214, 12, 72, 4672, 309, 7494, 812, 12, 74, 4672, 309, 1140, 18, 803, 18, 291, 1214, 12, 72, 15, 538, 18, 10814, 15, 74, 467...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 527, 1621, 12, 72, 4672, 364, 284, 316, 1140, 18, 1098, 1214, 12, 72, 4672, 309, 7494, 812, 12, 74, 4672, 309, 1140, 18, 803, 18, 291, 1214, 12, 72, 15, 538, 18, 10814, 15, 74, 467...