rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
self.data = [1]
self.data = [1,1]
def __init__(self): self.x = 0 self.y = 0 self.width = 100 self.height = 100 self.data = [1] self.labels = None # or list of strings self.startAngle = 90 self.direction = "clockwise"
ae98fe1a4e38594839cd1a4dc3f19a361611dcf1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/ae98fe1a4e38594839cd1a4dc3f19a361611dcf1/doughnut.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 92, 273, 374, 365, 18, 93, 273, 374, 365, 18, 2819, 273, 2130, 365, 18, 4210, 273, 2130, 365, 18, 892, 273, 306, 21, 16, 21, 65, 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, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 92, 273, 374, 365, 18, 93, 273, 374, 365, 18, 2819, 273, 2130, 365, 18, 4210, 273, 2130, 365, 18, 892, 273, 306, 21, 16, 21, 65, 365, 18, ...
neighbors=self.successor_iterator yield u seen={} queue=[u] seen[u]=True while queue: v=queue.pop(0) for w in neighbors(v): if w not in seen: seen[w]=True queue.append(w) yield w def depth_first_search(self, u, ignore_direction=False): """ Returns an iterator over vertices in a depth-first ordering.
queue=[(start,0)] for v,d in queue: yield v seen.add(v) while len(queue)>0: v,d = queue.pop(0) if distance is None or d<distance: for w in neighbors(v): if w not in seen: seen.add(w) queue.append((w, d+1)) yield w def depth_first_search(self, start, ignore_direction=False, distance=None, neighbors=None): """ Returns an iterator over the vertices in a depth-first ordering.
def breadth_first_search(self, u, ignore_direction=False): """ Returns an iterator over vertices in a breadth-first ordering. INPUT: - ``u`` - vertex at which to start search - ``ignore_direction`` - (default False) only applies to directed graphs. If True, searches across edges in either direction. EXAMPLES:: sage: G = Graph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) sage: list(G.breadth_first_search(0)) [0, 1, 4, 2, 3] sage: list(G.depth_first_search(0)) [0, 4, 3, 2, 1] :: sage: D = DiGraph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) sage: list(D.breadth_first_search(0)) [0, 1, 2, 3, 4] sage: list(D.depth_first_search(0)) [0, 1, 2, 3, 4] :: sage: D = DiGraph({1:[0], 2:[0]}) sage: list(D.breadth_first_search(0)) [0] sage: list(D.breadth_first_search(0, ignore_direction=True)) [0, 1, 2] """ # This function is straight from an old version of networkx if not self._directed or ignore_direction: neighbors=self.neighbor_iterator else: neighbors=self.successor_iterator # nlist=[u] # list of nodes in a BFS order yield u seen={} # nodes seen queue=[u] # FIFO queue seen[u]=True while queue: v=queue.pop(0) # this is expensive, should use a faster FIFO queue for w in neighbors(v): if w not in seen: seen[w]=True queue.append(w) # nlist.append(w) yield w # return nlist
4561fbd2b46645f5e3fb1c16b7f1c4e121dc90a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/4561fbd2b46645f5e3fb1c16b7f1c4e121dc90a0/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 25254, 67, 3645, 67, 3072, 12, 2890, 16, 582, 16, 2305, 67, 9855, 33, 8381, 4672, 3536, 2860, 392, 2775, 1879, 6928, 316, 279, 324, 25254, 17, 3645, 9543, 18, 225, 12943, 30, 282,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 25254, 67, 3645, 67, 3072, 12, 2890, 16, 582, 16, 2305, 67, 9855, 33, 8381, 4672, 3536, 2860, 392, 2775, 1879, 6928, 316, 279, 324, 25254, 17, 3645, 9543, 18, 225, 12943, 30, 282,...
begin_pos = format.find("(", end_pos)
begin_pos = format.find("{", end_pos)
def parse_formatting_return_substrings(self, format): substrings = [] begin_pos = format.find("(") end_pos = -1 while begin_pos > -1: if begin_pos > end_pos + 1: substrings.append(format[end_pos+1:begin_pos]) end_pos = format.find(")", begin_pos) substrings.append(format[begin_pos:end_pos+1]) begin_pos = format.find("(", end_pos) if end_pos+1 < len(format): substrings.append(format[end_pos+1:len(format)]) return substrings
a5f7acb09c96a8aa0f3ad41d3b5c956ee7e575ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/a5f7acb09c96a8aa0f3ad41d3b5c956ee7e575ce/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2139, 1787, 67, 2463, 67, 1717, 10219, 12, 2890, 16, 740, 4672, 3019, 87, 273, 5378, 2376, 67, 917, 273, 740, 18, 4720, 2932, 2932, 13, 679, 67, 917, 273, 300, 21, 1323, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2139, 1787, 67, 2463, 67, 1717, 10219, 12, 2890, 16, 740, 4672, 3019, 87, 273, 5378, 2376, 67, 917, 273, 740, 18, 4720, 2932, 2932, 13, 679, 67, 917, 273, 300, 21, 1323, 23...
host.ensure_up()
host.wait_up(timeout=30)
def run(self, control_file, results_dir = '.', host = None, timeout=None): """ Run an autotest job on the remote machine. Args: control_file: an open file-like-obj of the control file results_dir: a str path where the results should be stored on the local filesystem host: a Host instance on which the control file should be run Raises: AutotestRunError: if there is a problem executing the control file """ results_dir = os.path.abspath(results_dir) if not host: host = self.host if not self.installed: self.install(host)
0ad1d8b9ee781d694fc8b2408af6261e0543551e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/0ad1d8b9ee781d694fc8b2408af6261e0543551e/autotest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 16, 3325, 67, 768, 16, 1686, 67, 1214, 273, 2611, 16, 1479, 273, 599, 16, 2021, 33, 7036, 4672, 3536, 1939, 392, 2059, 352, 395, 1719, 603, 326, 2632, 5228, 18, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 16, 3325, 67, 768, 16, 1686, 67, 1214, 273, 2611, 16, 1479, 273, 599, 16, 2021, 33, 7036, 4672, 3536, 1939, 392, 2059, 352, 395, 1719, 603, 326, 2632, 5228, 18, 225, ...
color = (255, 0, 0)
color = color_dot
def draw_answers(self, frozen, solutions, model, correct, good, bad, undet, im_id = None): base = 0 color_good = (0, 164, 0) color_bad = (0, 0, 255) color_dot = (255, 0, 0) color = (255, 0, 0) if self.status['cells']: for corners in self.corner_matrixes: for i in range(0, len(corners) - 1): d = self.decisions[base + i] if d > 0: if correct is not None: if correct[base + i]: color = color_good else: color = color_bad draw_cell_highlight(self.image_drawn, self.centers[base + i][d - 1], self.diagonals[base + i][d - 1], color) if solutions is not None and not correct[base + i]: ans = solutions[base + i] draw_cell_center(self.image_drawn, self.centers[base + i][ans - 1], color_dot) base += len(corners) - 1 if model is not None: text = "Model %s: %d / %d"%(chr(65 + model), good, bad) else: text = "Model ?: %d / %d"%(good, bad) if undet > 0: color = (0, 0, 255) text = text + " / " + str(undet) else: color = (255, 0, 0) draw_text(self.image_drawn, text, color, (10, self.image_drawn.height - 20)) if frozen: if im_id is not None: if self.status['infobits'] and model is not None: color = (255, 0, 0) else: color = (0, 0, 255) draw_text(self.image_drawn, str(im_id), color, (10, 65)) if self.id is not None: draw_text(self.image_drawn, self.id, color_dot, (10, 30)) else: self.draw_status_bar() if self.options['show-status']: self.draw_status_flags() self.draw_hough_threshold()
cae754875f5de1816d975292ac57ceee57d8654e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12267/cae754875f5de1816d975292ac57ceee57d8654e/imageproc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 67, 22340, 12, 2890, 16, 12810, 16, 22567, 16, 938, 16, 3434, 16, 7494, 16, 5570, 16, 640, 8238, 16, 709, 67, 350, 273, 599, 4672, 1026, 273, 374, 2036, 67, 19747, 273, 261, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3724, 67, 22340, 12, 2890, 16, 12810, 16, 22567, 16, 938, 16, 3434, 16, 7494, 16, 5570, 16, 640, 8238, 16, 709, 67, 350, 273, 599, 4672, 1026, 273, 374, 2036, 67, 19747, 273, 261, 20...
self.menu_entries.set_entry("File/Export",1,self.gdal_tool_cb) def gdal_tool_cb(self,*args):
self.menu_entries.set_entry("File/Export", 1, self.gdal_tool_cb) def gdal_tool_cb(self, *args):
def init_menu(self): self.menu_entries.set_entry("File/Export",1,self.gdal_tool_cb)
18bebfddf000a5af98d1ab83e4246e700756e2a4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11090/18bebfddf000a5af98d1ab83e4246e700756e2a4/Tool_Export.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 5414, 12, 2890, 4672, 365, 18, 5414, 67, 8219, 18, 542, 67, 4099, 2932, 812, 19, 6144, 3113, 21, 16, 2890, 18, 19016, 287, 67, 6738, 67, 7358, 13, 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, 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, 1208, 67, 5414, 12, 2890, 4672, 365, 18, 5414, 67, 8219, 18, 542, 67, 4099, 2932, 812, 19, 6144, 3113, 21, 16, 2890, 18, 19016, 287, 67, 6738, 67, 7358, 13, 2, -100, -100, -100, -100...
parser_output_zpt.feed(output_html)
parser_output_zpt.feed(text)
def send(self): """Sends the newsletter """ # preparations request = self.REQUEST enl = self.aq_inner.aq_parent
d67238bd61facb19b2081e8d9a7312150d54dd69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5110/d67238bd61facb19b2081e8d9a7312150d54dd69/ENLIssue.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 12, 2890, 4672, 3536, 10501, 326, 14783, 13449, 3536, 468, 675, 1065, 1012, 590, 273, 365, 18, 5519, 570, 80, 273, 365, 18, 69, 85, 67, 7872, 18, 69, 85, 67, 2938, 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, 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, 1366, 12, 2890, 4672, 3536, 10501, 326, 14783, 13449, 3536, 468, 675, 1065, 1012, 590, 273, 365, 18, 5519, 570, 80, 273, 365, 18, 69, 85, 67, 7872, 18, 69, 85, 67, 2938, 2, -100, -10...
self.priv["tasklist"]["columns"].insert(self.TASKLIST_COL_DDATE, ddate_col)
self.priv["tasklist"]["columns"].insert( self.TASKLIST_COL_DDATE, ddate_col)
def __create_task_tview(self):
fac54dcba973acc5967f43b60fb540659a1a87a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/fac54dcba973acc5967f43b60fb540659a1a87a8/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2640, 67, 4146, 67, 88, 1945, 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, 1001, 2640, 67, 4146, 67, 88, 1945, 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, ...
ref_obj = self.pool.get(field._obj) if ref_obj: ref = ref_obj._table
if field._obj in ('res.user', 'res.group'): ref = field._obj.replace('.','_')
"has changed size (DB = %d, def = %d), strings will be truncated !" % \ (k, self._table, f_pg_size, field.size))
41956ffcbcbbddc0f33819219e60421c2889691f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/41956ffcbcbbddc0f33819219e60421c2889691f/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 315, 5332, 3550, 963, 261, 2290, 273, 738, 72, 16, 1652, 273, 738, 72, 3631, 2064, 903, 506, 15282, 29054, 738, 521, 261, 79, 16, 365, 6315, 2121, 16, 284, 67, 8365, 67, 1467, 16, 652, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 315, 5332, 3550, 963, 261, 2290, 273, 738, 72, 16, 1652, 273, 738, 72, 3631, 2064, 903, 506, 15282, 29054, 738, 521, 261, 79, 16, 365, 6315, 2121, 16, 284, 67, 8365, 67, 1467, 16, 652, 18,...
The returned mesh is not compacted.
The returned Mesh is not compacted. The complimentary operation is `unselect`.
def select(self,selected): """Return a mesh with selected elements from the original.
1535ec04433cfb4131e357412c0648be4a5d903a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2499/1535ec04433cfb4131e357412c0648be4a5d903a/mesh.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 12, 2890, 16, 8109, 4672, 3536, 990, 279, 6986, 598, 3170, 2186, 628, 326, 2282, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 12, 2890, 16, 8109, 4672, 3536, 990, 279, 6986, 598, 3170, 2186, 628, 326, 2282, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
k = self.k
def block_order(self): """ Return a block order for self where each round is a block.
cd82551727ddbae04c5b28f55b59ec14654a84ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/cd82551727ddbae04c5b28f55b59ec14654a84ab/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1203, 67, 1019, 12, 2890, 4672, 3536, 2000, 279, 1203, 1353, 364, 365, 1625, 1517, 3643, 353, 279, 1203, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1203, 67, 1019, 12, 2890, 4672, 3536, 2000, 279, 1203, 1353, 364, 365, 1625, 1517, 3643, 353, 279, 1203, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
django.core.management.call_command("loaddata", fixture_labels=['initial_version'], verbosity=0)
django.core.management.call_command("loaddata", 'initial_version.xml', verbosity=0)
def dosync(): """Function to do the syncronisation for the models""" # try to detect if it's a fresh new database try: cursor = connection.cursor() # If this table goes missing then don't forget to change it to the new one cursor.execute("Select * from reports_client") # if we get here with no error then the database has existing tables fresh = False except: logger.debug("there was an error while detecting the freshness of the database") #we should get here if the database is new fresh = True # ensure database connection are close, so that the management can do it's job right cursor.close() connection.close() # Do the syncdb according to the django version if "call_command" in dir(django.core.management): # this is available since django 1.0 alpha. # not yet tested for full functionnality django.core.management.call_command("syncdb", interactive=False, verbosity=0) if fresh: django.core.management.call_command("loaddata", fixture_labels=['initial_version'], verbosity=0) elif "syncdb" in dir(django.core.management): # this exist only for django 0.96.* django.core.management.syncdb(interactive=False, verbosity=0) if fresh: logger.debug("loading the initial_version fixtures") django.core.management.load_data(fixture_labels=['initial_version'], verbosity=0) else: logger.warning("Don't forget to run syncdb")
a4c1a4a486e581009f54aa4c0afabb3d2c601e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/a4c1a4a486e581009f54aa4c0afabb3d2c601e86/updatefix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16153, 1209, 13332, 3536, 2083, 358, 741, 326, 3792, 1949, 10742, 364, 326, 3679, 8395, 468, 775, 358, 5966, 309, 518, 1807, 279, 12186, 394, 2063, 775, 30, 3347, 273, 1459, 18, 9216, 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, 16153, 1209, 13332, 3536, 2083, 358, 741, 326, 3792, 1949, 10742, 364, 326, 3679, 8395, 468, 775, 358, 5966, 309, 518, 1807, 279, 12186, 394, 2063, 775, 30, 3347, 273, 1459, 18, 9216, 14...
player.physics.add(physics.speed_limiter((10, 8000)), components.physics.GROUP_VELOCITY)
player.physics.add(physics.speed_limiter((10, 10000)), components.physics.GROUP_VELOCITY)
def create_viking(datadir, clock, keyboard, key_left, key_right, key_jump, key_punch): idle_right = load_frame(datadir, 'model') idle_left = flip_frame(idle_right) punch_frames_right = load_frame_sequence(datadir, 'punch', 3) punch_frames_left = map(flip_frame, punch_frames_right) punch_frames_right = [idle_right] + punch_frames_right punch_frames_left = [idle_left] + punch_frames_left punch_delays = [2, 8, 6, 8, 2] punch_frames_right = list(iterate_with_delays(punch_frames_right, punch_delays)) punch_frames_left = list(iterate_with_delays(punch_frames_left, punch_delays)) run_frames_right = load_frame_sequence(datadir, 'run', 6) run_frames_left = map(flip_frame, run_frames_right) run_delays = [5] * 6 run_frames_right = list(iterate_with_delays(run_frames_right, run_delays)) run_frames_left = list(iterate_with_delays(run_frames_left, run_delays)) jump_frames_right = load_frame_sequence(datadir, 'jump', 4) jump_frames_left = map(flip_frame, jump_frames_right) jump_delays = [3, 15, 18, 20] jump_frames_right = list(iterate_with_delays(jump_frames_right, jump_delays)) jump_frames_left = list(iterate_with_delays(jump_frames_left, jump_delays)) player = components.entity('Player', clock, keyboard, location=(0, 0), motion=components.motion(), hitbox_passive=idle_right['hbp'], hitbox_active=idle_right['hba'], graphics=components.graphics(idle_right['sprite'], idle_right['sp'])) physics.regular_physics(player) player.physics.add(physics.ground_limiter(550), components.physics.GROUP_LOCATION) player.physics.add(wall, components.physics.GROUP_LOCATION) player.physics.add(physics.apply_friction(3), components.physics.GROUP_VELOCITY) player.physics.add(physics.speed_limiter((10, 8000)), components.physics.GROUP_VELOCITY) # movement left/right idle_right_state = controls.looped_animation(player, [idle_right], (0, 0)) idle_left_state = controls.looped_animation(player, [idle_left], (0, 0)) walk_right_state = controls.loop_while_keydown(player, run_frames_right, (5, 0), key_right, idle_right_state) walk_left_state = controls.loop_while_keydown(player, run_frames_left, (-5, 0), key_left, idle_left_state) jump_right_state = controls.animation_while_keydown(player, jump_frames_right, key_jump, idle_right_state) jump_left_state = controls.animation_while_keydown(player, jump_frames_left, key_jump, idle_left_state) jump_right_walk_state = controls.animation_while_keydown(player, jump_frames_right, key_jump, walk_right_state) jump_left_walk_state = controls.animation_while_keydown(player, jump_frames_left, key_jump, walk_left_state) punch_right_state = controls.animation(player, punch_frames_right, idle_right_state) punch_left_state = controls.animation(player, punch_frames_left, idle_left_state) idle_right_state.transitions[key_left] = walk_left_state idle_right_state.transitions[key_right] = walk_right_state idle_right_state.transitions[key_punch] = punch_right_state idle_right_state.transitions[key_jump] = jump_right_state idle_left_state.transitions[key_left] = walk_left_state idle_left_state.transitions[key_right] = walk_right_state idle_left_state.transitions[key_punch] = punch_left_state idle_left_state.transitions[key_jump] = jump_left_state walk_right_state.transitions[key_left] = walk_left_state walk_right_state.transitions[key_punch] = punch_right_state walk_right_state.transitions[key_jump] = jump_right_walk_state walk_left_state.transitions[key_right] = walk_right_state walk_left_state.transitions[key_punch] = punch_left_state walk_left_state.transitions[key_jump] = jump_left_walk_state idle_right_state.start() # jumping controls.jump_when_key_pressed(player, key_jump, (0, -3.0), 12) return player
908436b7a4b343bf9640611d4cf7a63b56f6f6a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13911/908436b7a4b343bf9640611d4cf7a63b56f6f6a4/project_viking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 522, 79, 310, 12, 3404, 361, 481, 16, 7268, 16, 16263, 16, 498, 67, 4482, 16, 498, 67, 4083, 16, 498, 67, 24574, 16, 498, 67, 84, 4384, 4672, 12088, 67, 4083, 273, 1262, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 522, 79, 310, 12, 3404, 361, 481, 16, 7268, 16, 16263, 16, 498, 67, 4482, 16, 498, 67, 4083, 16, 498, 67, 24574, 16, 498, 67, 84, 4384, 4672, 12088, 67, 4083, 273, 1262, 6...
sys.stderr.write(msg+'\n')
sys.stderr.write(msg+'\\n')
def selfdoc(): 'Display man page' prognm = os.path.basename(sys.argv[0]) if prognm[0] == 'M' and prognm[-3:] == '.py': # User testing code in his local directory prognm = 'sf' + prognm[1:-3] msg = 'Self-doc may be out of synch, do "scons install" in RSFSRC' sys.stderr.write(msg+'\n') prog = rsfdoc.progs.get(prognm) if prog != None: prog.document() else: sys.stderr.write('No installed man page for ' + prognm+'\n')
177b8c46b320b00293440533725050670da01b64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3143/177b8c46b320b00293440533725050670da01b64/rsfdoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 365, 2434, 13332, 296, 4236, 3161, 1363, 11, 450, 1600, 81, 273, 1140, 18, 803, 18, 13909, 12, 9499, 18, 19485, 63, 20, 5717, 309, 450, 1600, 81, 63, 20, 65, 422, 296, 49, 11, 471, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 365, 2434, 13332, 296, 4236, 3161, 1363, 11, 450, 1600, 81, 273, 1140, 18, 803, 18, 13909, 12, 9499, 18, 19485, 63, 20, 5717, 309, 450, 1600, 81, 63, 20, 65, 422, 296, 49, 11, 471, ...
{'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1\xe2\x81\x84683 watt per steradian.',
{'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1/683 watt per steradian.',
def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys()))
860975ef5915b61f5edf6269dc06fda67c357f91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/860975ef5915b61f5edf6269dc06fda67c357f91/units.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5302, 4873, 1576, 13332, 3536, 6910, 777, 326, 533, 924, 434, 326, 2836, 1576, 2190, 635, 3675, 12697, 10138, 16, 471, 10736, 2690, 1308, 4606, 364, 28769, 434, 999, 18, 1220, 445, 353, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5302, 4873, 1576, 13332, 3536, 6910, 777, 326, 533, 924, 434, 326, 2836, 1576, 2190, 635, 3675, 12697, 10138, 16, 471, 10736, 2690, 1308, 4606, 364, 28769, 434, 999, 18, 1220, 445, 353, ...
logger.debug('This is not my activity: waiting for a tube...')
logging.debug('This is not my activity: waiting for a tube...')
def _joined_cb(self, activity): if not self._shared_activity: return
3a49b60a6de588c9ec4840acc5b9555570894754 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5598/3a49b60a6de588c9ec4840acc5b9555570894754/shared.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5701, 329, 67, 7358, 12, 2890, 16, 5728, 4672, 309, 486, 365, 6315, 11574, 67, 9653, 30, 327, 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, 5701, 329, 67, 7358, 12, 2890, 16, 5728, 4672, 309, 486, 365, 6315, 11574, 67, 9653, 30, 327, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
ET.SubElement(root, 'upnp:createclass').text = self.createClass
ET.SubElement(root, qname('createclass',UPNP_NS)).text = self.createClass
def toElement(self,**kwargs):
e9c4345533fd24eede4febe6e6cd4c5c3b16e15c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/e9c4345533fd24eede4febe6e6cd4c5c3b16e15c/DIDLLite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 1046, 12, 2890, 16, 636, 4333, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 1046, 12, 2890, 16, 636, 4333, 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,...
'depends': [dep.name for dep in module.dependencies_id if self.search(cr, uid, [ ('name', '=', dep.name), ('web', '=', True) ], context=context)],
'depends': list(self._web_dependencies( cr, uid, module, context=context)),
def get_web(self, cr, uid, names, context=False): """ get_web(cr, uid, [module_name], context) -> [{name, depends, content}]
60f6882c37c9473de9e0bfc1588fa203e700b7e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/60f6882c37c9473de9e0bfc1588fa203e700b7e2/module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4875, 12, 2890, 16, 4422, 16, 4555, 16, 1257, 16, 819, 33, 8381, 4672, 3536, 336, 67, 4875, 12, 3353, 16, 4555, 16, 306, 2978, 67, 529, 6487, 819, 13, 317, 20031, 529, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4875, 12, 2890, 16, 4422, 16, 4555, 16, 1257, 16, 819, 33, 8381, 4672, 3536, 336, 67, 4875, 12, 3353, 16, 4555, 16, 306, 2978, 67, 529, 6487, 819, 13, 317, 20031, 529, 16, ...
things = self.items
things = self.items[:]
def __sqlrepr__(self, db): select = "SELECT %s" % ", ".join([sqlrepr(v, db) for v in self.items])
bca0e9fd36edbf852dcecac4dcfd4130cf722931 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8798/bca0e9fd36edbf852dcecac4dcfd4130cf722931/sqlbuilder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4669, 12715, 972, 12, 2890, 16, 1319, 4672, 2027, 273, 315, 4803, 738, 87, 6, 738, 3104, 3552, 5701, 3816, 4669, 12715, 12, 90, 16, 1319, 13, 364, 331, 316, 365, 18, 3319, 5717, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4669, 12715, 972, 12, 2890, 16, 1319, 4672, 2027, 273, 315, 4803, 738, 87, 6, 738, 3104, 3552, 5701, 3816, 4669, 12715, 12, 90, 16, 1319, 13, 364, 331, 316, 365, 18, 3319, 5717, ...
vars = self.variables()
vars = self.arguments()
def __call__(self, *args, **kwds): """ EXAMPLES: sage: x,y=var('x,y') sage: f = x+y sage: f.variables() (x, y) sage: f() y + x sage: f(3) y + 3 sage: f(3,4) 7 sage: f(2,3,4) Traceback (most recent call last): ... ValueError: the number of arguments must be less than or equal to 2
8fe47715223083603b3630ee3c59cf52da89b3e0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/8fe47715223083603b3630ee3c59cf52da89b3e0/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 380, 1968, 16, 2826, 25577, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 619, 16, 93, 33, 1401, 2668, 92, 16, 93, 6134, 272, 410, 30, 284, 273, 619...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 380, 1968, 16, 2826, 25577, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 619, 16, 93, 33, 1401, 2668, 92, 16, 93, 6134, 272, 410, 30, 284, 273, 619...
def __init__(self, firsttime, score): self.firstRun = firsttime
def __init__(self):
def __init__(self, firsttime, score): #Class constructor self.firstRun = firsttime #Add game over sound self.gameOverSound = loader.loadSfx("smas44.mp3") self.gameOverSound.setVolume(4) self.gameOverSound.setPlayRate(1) if self.firstRun == 1: self.startScore = 270710 self.actualScore = self.startScore MainMenu() props = WindowProperties() props.setCursorHidden(1) base.win.requestProperties(props) render.setAntialias(AntialiasAttrib.MAuto) #anti aliasing base.camLens.setFar(5100) base.camLens.setFov(100) base.cTrav = CollisionTraverser('ctrav') base.cTrav.setRespectPrevTransform(True) base.enableParticles() self.loadLevel(1) self.msg = MessageManager() self.accept('player-death', self.evtPlayerDeath) self.accept('game-levelwin', self.evtLevelWin) else: self.actualScore = score
bd2cf555f80d535aa25511a61d82267027e3adb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4878/bd2cf555f80d535aa25511a61d82267027e3adb4/Gaivota.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1122, 957, 16, 4462, 4672, 468, 797, 3885, 365, 18, 3645, 1997, 273, 1122, 957, 468, 986, 7920, 1879, 14190, 365, 18, 13957, 4851, 24331, 273, 4088, 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, 1001, 2738, 972, 12, 2890, 16, 1122, 957, 16, 4462, 4672, 468, 797, 3885, 365, 18, 3645, 1997, 273, 1122, 957, 468, 986, 7920, 1879, 14190, 365, 18, 13957, 4851, 24331, 273, 4088, 18, ...
elif opt in ('-p', '--private', '--private'): options['private']=1
elif opt in ('--private',): options['private'] = 1 options['tests']['private'] = 1
def _parse_args(): """ Process the command line arguments; return a dictionary containing the relevant info. @return: A dictionary mapping from configuration parameters to values. If a parameter is specified on the command line, then that value is used; otherwise, a default value is used. Currently, the following configuration parameters are set: C{target}, C{modules}, C{verbosity}, C{prj_name}, C{output}, C{show_imports}, C{frames}, C{private}, C{debug}, C{top}, C{list_classes_separately}, C{docformat}, C{inheritance}, C{autogen_vars}, and C{test}. @rtype: C{None} """ # Default values. options = {'target':None, 'modules':[], 'verbosity':1, 'prj_name':'', 'action':'html', 'show_imports':0, 'frames':1, 'private':None, 'list_classes_separately': 0, 'debug':0, 'docformat':None, 'top':None, 'inheritance': 'grouped', 'autogen_vars': 1, 'tests':{}} # Get the command-line arguments, using getopts. shortopts = 'c:fh:n:o:pt:u:Vvq?:' longopts = ('check frames help= usage= helpfile= help-file= '+ 'help_file= output= target= url= version verbose ' + 'private-css= private_css= quiet show-imports '+ 'show_imports css= no_private no-private name= '+ 'builtins no-frames no_frames noframes debug '+ 'docformat= doc-format= doc_format= top= navlink= '+ 'nav_link= nav-link= latex html dvi ps pdf '+ 'separate-classes separate_classes '+ 'inheritance= inheritence= '+ 'test= tests= checks= private'+ 'no-autogen-vars no_autogen_vars').split() try: (opts, modules) = getopt.getopt(sys.argv[1:], shortopts, longopts) except getopt.GetoptError, e: if e.opt in ('h', '?', 'help', 'usage'): _usage(0) print >>sys.stderr, ('%s; run "%s -h" for usage' % (e,os.path.basename(sys.argv[0]))) sys.exit(1) # Parse the arguments. for (opt, val) in opts: if opt in ('--check',): options['action'] = 'check' elif opt in ('--css', '-c'): options['css'] = val elif opt in ('--debug',): options['debug']=1 elif opt in ('--dvi',): options['action'] = 'dvi' elif opt in ('--docformat', '--doc-format', '--doc_format'): from epydoc.objdoc import set_default_docformat set_default_docformat(val) elif opt in ('--frames', '-f'): print ('Warning: the "--frames" argument is depreciated; '+ 'frames are now\n generated by default.') elif opt in ('--no-frames', '--no_frames', '--noframes'): options['frames'] = 0 elif opt in ('--help', '-?', '--usage', '-h'): _help(val) elif opt in ('--helpfile', '--help-file', '--help_file'): options['help'] = val elif opt in ('--html',): options['action'] = 'html' elif opt in ('--inheritance', '--inheritence'): options['inheritance']=val.lower() elif opt in ('--latex',): options['action']='latex' elif opt in ('--name', '-n'): options['prj_name']=val elif opt in ('--navlink', '--nav-link', '--nav_link'): options['prj_link'] = val elif opt in ('--no-autogen-vars', '--no_autogen_vars'): options['autogen_vars'] = 0 elif opt in ('--no-private', '--no_private'): options['private']=0 elif opt in ('--output', '--target', '-o'): options['target']=val elif opt in ('--pdf',): options['action'] = 'pdf' elif opt in ('-p', '--private', '--private'): options['private']=1 elif opt in ('--private-css', '--private_css'): options['private_css'] = val elif opt in ('--ps',): options['action'] = 'ps' elif opt in ('--quiet', '-q'): options['verbosity'] -= 1 elif opt in ('--separate-classes', '--separate_classes'): options['list_classes_separately'] = 1 elif opt in ('--show-imports', '--show_imports'): options['show_imports'] = 1 elif opt in ('-t', '--top'): options['top'] = val elif opt in ('--url', '-u'): options['prj_url']=val elif opt in ('--verbose', '-v'): options['verbosity'] += 1 elif opt in ('--version', '-V'): _version() elif opt in ('--builtins',): modules += sys.builtin_module_names modules.remove('__main__') elif opt in ('--test', '--tests', '--checks'): for test in re.split('\s*[,\s]\s*', val.lower()): options['tests'][test] = 1 else: _usage() # Make sure inheritance has a valid value if options['inheritance'] not in ('grouped', 'listed', 'included'): estr = 'Bad inheritance style. Valid options are ' estr += 'grouped, listed, included' print >>sys.stderr, ('%s;\nrun "%s -h" for usage.' % (estr,os.path.basename(sys.argv[0]))) sys.exit(1) # Make sure tests has a valid value. for test in options['tests']: if test not in TESTS: estr = 'Bad epydoc test %r. Valid options are:' % test for t in TESTS: estr += '\n - %r' % t print >>sys.stderr, ('%s\nrun "%s -h" for usage.' % (estr,os.path.basename(sys.argv[0]))) sys.exit(1) # Pick a default target directory, if none was specified. if options['target'] is None: if options['action'] == 'html': options['target'] = 'html' elif options['action'] in ('latex', 'dvi', 'ps', 'pdf'): options['target'] = 'latex' # Default for private depends on action. if options['private'] is None: if options['action'] == 'html': options['private'] = 1 else: options['private'] = 0 # Check that the options all preceed the filenames. for m in modules: if m == '-': break elif m[0:1] == '-': estr = 'options must preceed modules' print >>sys.stderr, ('%s; run "%s -h" for usage.' % (estr,os.path.basename(sys.argv[0]))) sys.exit(1) # Make sure we got some modules. modules = [m for m in modules if m != '-'] if len(modules) == 0: print >>sys.stderr, ('no modules specified; run "%s -h" for usage.' % os.path.basename(sys.argv[0])) sys.exit(1) options['modules'] = modules return options
5397b1945fdf3feb9813ef60349d76c37defaafe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5397b1945fdf3feb9813ef60349d76c37defaafe/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 1968, 13332, 3536, 4389, 326, 1296, 980, 1775, 31, 327, 279, 3880, 4191, 326, 9368, 1123, 18, 225, 632, 2463, 30, 432, 3880, 2874, 628, 1664, 1472, 358, 924, 18, 225, 97...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2670, 67, 1968, 13332, 3536, 4389, 326, 1296, 980, 1775, 31, 327, 279, 3880, 4191, 326, 9368, 1123, 18, 225, 632, 2463, 30, 432, 3880, 2874, 628, 1664, 1472, 358, 924, 18, 225, 97...
if prefs.background_syncing: event.arguments['Text'] = _(u'Disable background syncing') else: event.arguments['Text'] = _(u'Enable background syncing')
try: enabled = prefs.background_syncing except AttributeError: logger.exception('*********** Bug 5544\nprefs=%s\nprefs.itsView=%s', prefs, prefs.itsView) else: if enabled: event.arguments['Text'] = _(u'Disable background syncing') else: event.arguments['Text'] = _(u'Enable background syncing')
def onActivateBackgroundSyncingEventUpdateUI (self, event): prefs = schema.ns('osaf.sharing', self.itsView).prefs if prefs.background_syncing: event.arguments['Text'] = _(u'Disable background syncing') else: event.arguments['Text'] = _(u'Enable background syncing')
6dee6534b9148fa0ca9e4e314149a94ebb3082bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/6dee6534b9148fa0ca9e4e314149a94ebb3082bc/Main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 21370, 8199, 4047, 310, 1133, 1891, 5370, 261, 2890, 16, 871, 4672, 15503, 273, 1963, 18, 2387, 2668, 538, 1727, 18, 31615, 2187, 365, 18, 1282, 1767, 2934, 1484, 2556, 309, 15503, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21370, 8199, 4047, 310, 1133, 1891, 5370, 261, 2890, 16, 871, 4672, 15503, 273, 1963, 18, 2387, 2668, 538, 1727, 18, 31615, 2187, 365, 18, 1282, 1767, 2934, 1484, 2556, 309, 15503, ...
texts.append( t )
texts.append( t )
def pie( self, explode = None, colors = None, autopct = None, pctdistance = 0.6, shadow = False ):
e1fab6a8b4522a8c8de872b610947c90d87e201a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/e1fab6a8b4522a8c8de872b610947c90d87e201a/PieGraph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 1385, 12, 365, 16, 3172, 273, 599, 16, 5740, 273, 599, 16, 2059, 556, 299, 273, 599, 16, 19857, 8969, 273, 374, 18, 26, 16, 10510, 273, 1083, 262, 30, 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, 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, 293, 1385, 12, 365, 16, 3172, 273, 599, 16, 5740, 273, 599, 16, 2059, 556, 299, 273, 599, 16, 19857, 8969, 273, 374, 18, 26, 16, 10510, 273, 1083, 262, 30, 2, -100, -100, -100, -100,...
if not safe_encode: raise arg = repr(arg)
try: arg = arg.encode('utf-8') except: if not safe_encode: raise arg = repr(arg)
def prints(*args, **kwargs): ''' Print unicode arguments safely by encoding them to preferred_encoding Has the same signature as the print function from Python 3, except for the additional keyword argument safe_encode, which if set to True will cause the function to use repr when encoding fails. ''' file = kwargs.get('file', sys.stdout) sep = kwargs.get('sep', ' ') end = kwargs.get('end', '\n') enc = preferred_encoding safe_encode = kwargs.get('safe_encode', False) if 'CALIBRE_WORKER' in os.environ: enc = 'utf-8' for i, arg in enumerate(args): if isinstance(arg, unicode): try: arg = arg.encode(enc) except UnicodeEncodeError: if not safe_encode: raise arg = repr(arg) if not isinstance(arg, str): try: arg = str(arg) except ValueError: arg = unicode(arg) if isinstance(arg, unicode): try: arg = arg.encode(enc) except UnicodeEncodeError: if not safe_encode: raise arg = repr(arg) file.write(arg) if i != len(args)-1: file.write(sep) file.write(end)
b41704341f392de44aa6379f3825eb29476d7bc9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/b41704341f392de44aa6379f3825eb29476d7bc9/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14971, 30857, 1968, 16, 2826, 4333, 4672, 9163, 3038, 5252, 1775, 15303, 635, 2688, 2182, 358, 9119, 67, 5999, 4393, 326, 1967, 3372, 487, 326, 1172, 445, 628, 6600, 890, 16, 1335, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14971, 30857, 1968, 16, 2826, 4333, 4672, 9163, 3038, 5252, 1775, 15303, 635, 2688, 2182, 358, 9119, 67, 5999, 4393, 326, 1967, 3372, 487, 326, 1172, 445, 628, 6600, 890, 16, 1335, 364, ...
def lookup_query_terms(lookup_type, field, value):
def lookup_query_expression(lookup_type, field, value):
def lookup_query_terms(lookup_type, field, value): if lookup_type in QUERY_TERMS_MAPPING: return curry(QUERY_TERMS_MAPPING[lookup_type], field, value) elif lookup_type == 'contains': return curry(field.like, '%%%s%%' % value) elif lookup_type == 'icontains': raise NotImplemented() elif lookup_type == 'in': raise NotImplemented() elif lookup_type == 'startswith': raise NotImplemented() elif lookup_type == 'istartswith': raise NotImplemented() elif lookup_type == 'endswith': raise NotImplemented() elif lookup_type == 'iendswith': raise NotImplemented() elif lookup_type == 'range': raise NotImplemented() elif lookup_type == 'year': raise NotImplemented() elif lookup_type == 'month': raise NotImplemented() elif lookup_type == 'day': raise NotImplemented() elif lookup_type == 'search': raise NotImplemented() elif lookup_type == 'regex': raise NotImplemented() elif lookup_type == 'iregex': raise NotImplemented() elif lookup_type == 'isnull': return curry(operator.eq, field, None) else: return None
50bbf4031eeb3fda39a8cee6a43ff7b0ae0856e2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1224/50bbf4031eeb3fda39a8cee6a43ff7b0ae0856e2/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3689, 67, 2271, 67, 8692, 12, 8664, 67, 723, 16, 652, 16, 460, 4672, 309, 3689, 67, 723, 316, 17089, 67, 2560, 3537, 67, 20450, 30, 327, 662, 1176, 12, 10753, 67, 2560, 3537, 67, 204...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3689, 67, 2271, 67, 8692, 12, 8664, 67, 723, 16, 652, 16, 460, 4672, 309, 3689, 67, 723, 316, 17089, 67, 2560, 3537, 67, 20450, 30, 327, 662, 1176, 12, 10753, 67, 2560, 3537, 67, 204...
return S_ERROR("Couldn't create workflows for %s." \
return S_ERROR("Couldn't get results from %s." \
def create_workflow(self): """ !!! Note: 1 level parent=master assumed !!! """ rdict = dict(request.params) for x in ['RequestID','Template','Subrequests']: if not x in rdict: return S_ERROR('Required parameter %s is not specified' % x) try: id = long(rdict['RequestID']) tpl_name = str(request.params['Template']) operation = str(request.params.get('Operation','Simple')) sstr = str(request.params['Subrequests']) if sstr: slist = [long(x) for x in sstr.split(',')] else: slist = [] sdict = dict.fromkeys(slist,None) del rdict['RequestID'] del rdict['Template'] del rdict['Subrequests'] if 'Operation' in rdict: del rdict['Operation'] except Exception, e: return S_ERROR('Wrong parameters (%s)' % str(e))
0cbfeadd30ca0fe24a89912bce4c995e4974485a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12767/0cbfeadd30ca0fe24a89912bce4c995e4974485a/ProductionRequest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 13815, 12, 2890, 4672, 3536, 401, 8548, 3609, 30, 404, 1801, 982, 33, 7525, 12034, 401, 8548, 3536, 436, 1576, 273, 2065, 12, 2293, 18, 2010, 13, 364, 619, 316, 10228, 691, 73...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13815, 12, 2890, 4672, 3536, 401, 8548, 3609, 30, 404, 1801, 982, 33, 7525, 12034, 401, 8548, 3536, 436, 1576, 273, 2065, 12, 2293, 18, 2010, 13, 364, 619, 316, 10228, 691, 73...
- excample: the Example object that failed
- example: the Example object that failed
def output_difference(self, example, got, optionflags): """ Return a string describing the differences between the expected output for a given example (`example`) and the actual output (`got`). `optionflags` is the set of option flags used to compare `want` and `got`. """ want = example.want # If <BLANKLINE>s are being used, then replace blank lines # with <BLANKLINE> in the actual output string. if not (optionflags & DONT_ACCEPT_BLANKLINE): got = re.sub('(?m)^[ ]*(?=\n)', BLANKLINE_MARKER, got)
a21caf4ef2e424075342f511405b41f0579ce841 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a21caf4ef2e424075342f511405b41f0579ce841/doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 67, 23444, 12, 2890, 16, 3454, 16, 2363, 16, 1456, 7133, 4672, 3536, 2000, 279, 533, 16868, 326, 16440, 3086, 326, 2665, 876, 364, 279, 864, 3454, 21863, 8236, 24065, 471, 326, 3214...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 876, 67, 23444, 12, 2890, 16, 3454, 16, 2363, 16, 1456, 7133, 4672, 3536, 2000, 279, 533, 16868, 326, 16440, 3086, 326, 2665, 876, 364, 279, 864, 3454, 21863, 8236, 24065, 471, 326, 3214...
('fs_is', '=', fs_id),
('fs_id', '=', fs_id),
def get_id(self, cursor, user, module, fs_id): """ Return for an fs_id the corresponding db_id.
2d34f56769b131e29b31f190fe902f86fba96744 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/2d34f56769b131e29b31f190fe902f86fba96744/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 350, 12, 2890, 16, 3347, 16, 729, 16, 1605, 16, 2662, 67, 350, 4672, 3536, 2000, 364, 392, 2662, 67, 350, 326, 4656, 1319, 67, 350, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 350, 12, 2890, 16, 3347, 16, 729, 16, 1605, 16, 2662, 67, 350, 4672, 3536, 2000, 364, 392, 2662, 67, 350, 326, 4656, 1319, 67, 350, 18, 2, -100, -100, -100, -100, -100, -100...
'query_string': 'q=&language=Python'}
'query_string': 'q=&toughness=&language=Python'}
def test_toughness_facet(self): # What options do we expect? toughness_option_bitesize = {'name': 'bitesize', 'count': 1, 'query_string': 'q=&toughness=bitesize&language=Python'} toughness_option_any = {'name': 'any', 'count': 2, 'query_string': 'q=&language=Python'} expected_toughness_facet_options = [toughness_option_bitesize, toughness_option_any]
a35d9cb0088dc8954841b6a6810c5266efe0a501 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11976/a35d9cb0088dc8954841b6a6810c5266efe0a501/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 869, 2127, 4496, 67, 21568, 12, 2890, 4672, 468, 18734, 702, 741, 732, 4489, 35, 358, 2127, 4496, 67, 3482, 67, 70, 2997, 554, 273, 13666, 529, 4278, 296, 70, 2997, 554, 2187...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 869, 2127, 4496, 67, 21568, 12, 2890, 4672, 468, 18734, 702, 741, 732, 4489, 35, 358, 2127, 4496, 67, 3482, 67, 70, 2997, 554, 273, 13666, 529, 4278, 296, 70, 2997, 554, 2187...
self.assertTrue(context.devices is devices)
self.assertTrue(hw_context.devices is devices)
def test_construction_2(self): devices = object() hw_context = HardwareContext(devices) self.assertTrue(context.devices is devices)
ce54aa5c679c13f696fb5cc82e3ec222c5d9d937 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/ce54aa5c679c13f696fb5cc82e3ec222c5d9d937/test_dashboard_bundle_format_1_0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 591, 4549, 67, 22, 12, 2890, 4672, 7166, 273, 733, 1435, 16139, 67, 2472, 273, 27438, 1042, 12, 12506, 13, 365, 18, 11231, 5510, 12, 2472, 18, 12506, 353, 7166, 13, 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, 1842, 67, 591, 4549, 67, 22, 12, 2890, 4672, 7166, 273, 733, 1435, 16139, 67, 2472, 273, 27438, 1042, 12, 12506, 13, 365, 18, 11231, 5510, 12, 2472, 18, 12506, 353, 7166, 13, 2, -100, ...
pfx = '%s.changes.%d' % (self.prefix, self.changeno)
self.changeno += 1 pfx = '%s.changes.%d.line' % (self.prefix, self.changeno)
def writeline(self, text): match = header_re.search(text) if match: self.hdf.setValue('%s.name.old' % self.prefix, match.group(1)) self.hdf.setValue('%s.name.new' % self.prefix, match.group(2)) return self.count = self.count + 1 if self.count < 3: return match = line_re.search(text) if match: pfx = '%s.changes.%d' % (self.prefix, self.changeno) self.print_block() self.hdf.setValue('%s.old' % pfx, match.group(1)) self.hdf.setValue('%s.new' % pfx, match.group(3)) self.changeno += 1 return ttype = text[0] text = text[1:] text = space_re.sub('&nbsp; ', text.expandtabs(8)) if ttype == self.ttype: self.block.append(text) else: if ttype == '+' and self.ttype == '-': self.p_block = self.block self.p_type = self.ttype else: self.print_block() self.block = [text] self.ttype = ttype
2485ff40d6b782ae035e8552e634ed7309b6dccd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/2485ff40d6b782ae035e8552e634ed7309b6dccd/Changeset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2518, 3027, 12, 2890, 16, 977, 4672, 845, 273, 1446, 67, 266, 18, 3072, 12, 955, 13, 309, 845, 30, 365, 18, 26428, 18, 542, 620, 29909, 87, 18, 529, 18, 1673, 11, 738, 365, 18, 323...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2518, 3027, 12, 2890, 16, 977, 4672, 845, 273, 1446, 67, 266, 18, 3072, 12, 955, 13, 309, 845, 30, 365, 18, 26428, 18, 542, 620, 29909, 87, 18, 529, 18, 1673, 11, 738, 365, 18, 323...
branch_url = BRANCH_URL.replace("$branch", options.branch) checkoutRevision(url, revision, branch_url)
if not options.local: branch_url = BRANCH_URL.replace("$branch", options.branch) checkoutRevision(url, revision, branch_url)
def main(options, args): revision = options.revert or options.merge # Initialize some variables used below. They can be overwritten by # the drover.properties file. BASE_URL = "svn://svn.chromium.org/chrome" TRUNK_URL = BASE_URL + "/trunk/src" BRANCH_URL = BASE_URL + "/branches/$branch/src" SKIP_CHECK_WORKING = True PROMPT_FOR_AUTHOR = False DEFAULT_WORKING = "drover_" + str(revision) if options.branch: DEFAULT_WORKING += ("_" + options.branch) if not isMinimumSVNVersion(1,5): print "You need to use at least SVN version 1.5.x" sys.exit(1) # Override the default properties if there is a drover.properties file. global file_pattern_ if os.path.exists("drover.properties"): file = open("drover.properties") exec(file) file.close() if FILE_PATTERN: file_pattern_ = FILE_PATTERN if options.revert and options.branch: url = BRANCH_URL.replace("$branch", options.branch) elif options.merge and options.sbranch: url = BRANCH_URL.replace("$branch", options.sbranch) else: url = TRUNK_URL working = options.workdir or DEFAULT_WORKING command = 'svn log ' + url + " -r "+str(revision) + " -v" os.system(command) if not (options.revertbot or prompt("Is this the correct revision?")): sys.exit(0) if (os.path.exists(working)): if not (options.revertbot or SKIP_CHECK_WORKING or prompt("Working directory: '%s' already exists, clobber?" % working)): sys.exit(0) deltree(working) os.makedirs(working) os.chdir(working) if options.merge: action = "Merge" branch_url = BRANCH_URL.replace("$branch", options.branch) # Checkout everything but stuff that got added into a new dir checkoutRevision(url, revision, branch_url) # Merge everything that changed mergeRevision(url, revision) # "Export" files that were added from the source and add them to branch exportRevision(url, revision) # Delete directories that were deleted (file deletes are handled in the # merge). deleteRevision(url, revision) elif options.revert: action = "Revert" if options.branch: url = BRANCH_URL.replace("$branch", options.branch) checkoutRevision(url, revision, url, True) revertRevision(url, revision) revertExportRevision(url, revision) # Check the base url so we actually find the author who made the change if options.auditor: author = options.auditor else: author = getAuthor(url, revision) if not author: author = getAuthor(TRUNK_URL, revision) filename = str(revision)+".txt" out = open(filename,"w") out.write(action +" " + str(revision) + " - ") out.write(getRevisionLog(url, revision)) if (author): out.write("TBR=" + author) out.close() change_cmd = 'change ' + str(revision) + " " + filename if options.revertbot: change_cmd += ' --silent' runGcl(change_cmd) os.unlink(filename) print author print revision print ("gcl upload " + str(revision) + " --send_mail --no_try --no_presubmit --reviewers=" + author) if options.revertbot or prompt("Would you like to upload?"): if PROMPT_FOR_AUTHOR: author = text_prompt("Enter new author or press enter to accept default", author) if options.revertbot and options.revertbot_reviewers: author += "," author += options.revertbot_reviewers gclUpload(revision, author) else: print "Deleting the changelist." print "gcl delete " + str(revision) runGcl("delete " + str(revision)) sys.exit(0) # We commit if the reverbot is set to commit automatically, or if this is # not the revertbot and the user agrees. if options.revertbot_commit or (not options.revertbot and prompt("Would you like to commit?")): print "gcl commit " + str(revision) + " --no_presubmit --force" runGcl("commit " + str(revision) + " --no_presubmit --force") else: sys.exit(0)
d42a8acd1d66ae2ca28a46c1c9f84911bda1b3ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/d42a8acd1d66ae2ca28a46c1c9f84911bda1b3ad/drover.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 2116, 16, 833, 4672, 6350, 273, 702, 18, 266, 1097, 578, 702, 18, 2702, 225, 468, 9190, 2690, 3152, 1399, 5712, 18, 16448, 848, 506, 15345, 635, 468, 326, 31473, 502, 18, 473...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 2116, 16, 833, 4672, 6350, 273, 702, 18, 266, 1097, 578, 702, 18, 2702, 225, 468, 9190, 2690, 3152, 1399, 5712, 18, 16448, 848, 506, 15345, 635, 468, 326, 31473, 502, 18, 473...
big.append((fname.capitalize(), fval))
big.append((f.capitalize(), fval))
def format_props(self): tkt = self.ticket tkt['id'] = '%s' % tkt['id'] t = self.modtime or tkt['time'] tkt['modified'] = time.strftime('%c', time.localtime(t)) fields = ['id', 'status', 'component', 'modified', 'severity', 'milestone', 'priority', 'version', 'owner', 'reporter'] fields.extend(filter(lambda f: f.startswith('custom_'), self.ticket.keys())) i = 1 width = [0,0,0,0] for f in fields: if not tkt.has_key(f): continue fval = str(tkt[f]) if fval.find('\n') > -1: continue fname = f.startswith('custom_') and f[7:] or f idx = 2*(i % 2) if len(fname) > width[idx]: width[idx] = len(fname) if len(fval) > width[idx+1]: width[idx+1] = len(fval) i += 1 format = (' %%%is: %%-%is%s' % (width[0], width[1], CRLF), '%%%is: %%-%is | ' % (width[2], width[3])) i = 1 l = (width[2] + width[3] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big=[] for f in fields: if not tkt.has_key(f): continue fval = tkt[f] fname = f.startswith('custom_') and f[7:] or f if '\n' in str(fval): big.append((fname.capitalize(), fval)) else: txt += format[i%2] % (fname.capitalize(), fval) i += 1 if i % 2 == 0: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
ded62a2a8bea3ff7ebdabe21a68b4f5e1fcdd8f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/ded62a2a8bea3ff7ebdabe21a68b4f5e1fcdd8f8/Notify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 268, 8629, 3292, 350, 3546, 273, 1995, 87, 11, 738, 268, 8629, 3292, 350, 3546, 268, 273, 365, 18, 1711, 957, 578, 268, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 268, 8629, 3292, 350, 3546, 273, 1995, 87, 11, 738, 268, 8629, 3292, 350, 3546, 268, 273, 365, 18, 1711, 957, 578, 268, ...
old_fval = f(xk,*args)
old_fval = f(xk)
def fmin_cg(f, x0, fprime=None, args=(), gtol=1e-5, norm=Inf, epsilon=_epsilon, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Polak and Ribiere See Wright, and Nocedal 'Numerical Optimization', 1999, pg. 120-122. Inputs: f -- the Python function or method to be minimized. x0 -- the initial guess for the minimizer. fprime -- a function to compute the gradient of f. args -- extra arguments to f and fprime. gtol -- stop when norm of gradient is less than gtol norm -- order of vector norm to use epsilon -- if fprime is approximated use this value for the step size (can be scalar or vector) Outputs: (xopt, {fopt, func_calls, grad_calls, warnflag}, {allvecs}) xopt -- the minimizer of f. fopt -- the value of f(xopt). func_calls -- the number of function_calls. grad_calls -- the number of gradient calls. warnflag -- an integer warning flag: 1 : 'Maximum number of iterations exceeded.' 2 : 'Gradient and/or function calls not changing' allvecs -- if retall then this vector of the iterates is returned Additional Inputs: maxiter -- the maximum number of iterations. full_output -- if non-zero then return fopt, func_calls, grad_calls, and warnflag in addition to xopt. disp -- print convergence message if non-zero. retall -- return a list of results at each iteration if True """ app_fprime = 0 if fprime is None: app_fprime = 1 x0 = asarray(x0) if maxiter is None: maxiter = len(x0)*200 func_calls = 0 grad_calls = 0 k = 0 N = len(x0) xk = x0 old_fval = f(xk,*args) old_old_fval = old_fval + 5000 func_calls +=1 if app_fprime: gfk = apply(approx_fprime,(x0,f,epsilon)+args) myfprime = (approx_fprime,epsilon) func_calls = func_calls + len(x0) + 1 else: gfk = apply(fprime,(x0,)+args) myfprime = fprime grad_calls = grad_calls + 1 if retall: allvecs = [xk] sk = [2*gtol] warnflag = 0 pk = -gfk gnorm = vecnorm(gfk,ord=norm) while (gnorm > gtol) and (k < maxiter): deltak = Num.dot(gfk,gfk) alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ linesearch.line_search(f,myfprime,xk,pk,gfk,old_fval, old_old_fval,args=args,c2=0.4) if alpha_k is None: # line search failed -- use different one. func_calls += fc grad_calls += gc alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ line_search(f,myfprime,xk,pk,gfk, old_fval,old_old_fval,args=args) func_calls += fc grad_calls += gc xk = xk + alpha_k*pk if retall: allvecs.append(xk) if gfkp1 is None: if app_fprime: gfkp1 = apply(approx_fprime,(xk,f,epsilon)+args) func_calls = func_calls + len(x0) + 1 else: gfkp1 = apply(fprime,(xk,)+args) grad_calls = grad_calls + 1 yk = gfkp1 - gfk beta_k = pymax(0,Num.dot(yk,gfkp1)/deltak) pk = -gfkp1 + beta_k * pk gfk = gfkp1 gnorm = vecnorm(gfk,ord=norm) k = k + 1 if disp or full_output: fval = old_fval if warnflag == 2: if disp: print "Warning: Desired error not necessarily achieved due to precision loss" print " Current function value: %f" % fval print " Iterations: %d" % k print " Function evaluations: %d" % func_calls print " Gradient evaluations: %d" % grad_calls elif k >= maxiter: warnflag = 1 if disp: print "Warning: Maximum number of iterations has been exceeded" print " Current function value: %f" % fval print " Iterations: %d" % k print " Function evaluations: %d" % func_calls print " Gradient evaluations: %d" % grad_calls else: if disp: print "Optimization terminated successfully." print " Current function value: %f" % fval print " Iterations: %d" % k print " Function evaluations: %d" % func_calls print " Gradient evaluations: %d" % grad_calls if full_output: retlist = xk, fval, func_calls, grad_calls, warnflag if retall: retlist += (allvecs,) else: retlist = xk if retall: retlist = (xk, allvecs) return retlist
926e615eebcd9f2ca3373b1887f74b532b10bda4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/926e615eebcd9f2ca3373b1887f74b532b10bda4/optimize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1154, 67, 26275, 12, 74, 16, 619, 20, 16, 284, 16382, 33, 7036, 16, 833, 33, 9334, 314, 3490, 33, 21, 73, 17, 25, 16, 4651, 33, 13149, 16, 12263, 33, 67, 13058, 10327, 16, 257...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26275, 12, 74, 16, 619, 20, 16, 284, 16382, 33, 7036, 16, 833, 33, 9334, 314, 3490, 33, 21, 73, 17, 25, 16, 4651, 33, 13149, 16, 12263, 33, 67, 13058, 10327, 16, 257...
port = 0 baudrate = 9600 rtscts = 0 xonxoff = 0
ser.port = 0 ser.baudrate = 9600 ser.rtscts = False ser.xonxoff = False ser.timeout = 1
def usage(): print >>sys.stderr, """USAGE: %s [options] Simple Terminal Programm for the serial port. options: -p, --port=PORT: serial port, a number, defualt = 0 or a device name -b, --baud=BAUD: baudrate, default 9600 -r, --rtscts: enable RTS/CTS flow control (default off) -x, --xonxoff: enable software flow control (default off) -P, --localport: TCP/IP port on which to run the server (default 7777) """ % sys.argv[0]
fb947cb47fa5d0c2e4f05e39bc7ef609059d9d72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2937/fb947cb47fa5d0c2e4f05e39bc7ef609059d9d72/tcp_serial_redirect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1172, 1671, 9499, 18, 11241, 16, 3536, 29550, 30, 738, 87, 306, 2116, 65, 4477, 18778, 13586, 81, 364, 326, 2734, 1756, 18, 225, 702, 30, 300, 84, 16, 1493, 655, 33, 6354,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4084, 13332, 1172, 1671, 9499, 18, 11241, 16, 3536, 29550, 30, 738, 87, 306, 2116, 65, 4477, 18778, 13586, 81, 364, 326, 2734, 1756, 18, 225, 702, 30, 300, 84, 16, 1493, 655, 33, 6354,...
def store_entries(entries_list, dbmodel, conn):
progress_count = 100 def store_entries(entries_list, dbmodel, curs):
def store_entries(entries_list, dbmodel, conn): """ Given a list of entries to be stored, try to store as much data as possible in the given database model.""" curs = conn.cursor() # Drop the old data from this document from the previous tables. tables = [x.table for x in entries_list] sources = [x.source for x in entries_list] for table in tables: if table not in dbmodel: continue for source in sources: curs.execute("DELETE FROM %s WHERE %s = %%s" % (table, col_source), (source,)) dbmodel = dict((k, dict(v)) for (k,v) in dbmodel.iteritems()) for e in entries_list: try: dbcols = dbmodel[e.table] except KeyError: pass # Table for available. outcols = [col_source] outvalues = [e.source] colseen = set() for cname, cvalue in e.values: cname = cname # If the columns cannot be stored in the current model, don't. if cname not in dbcols: continue if cname in colseen: logging.warning("Duplicate field name at %s" % e.locator) continue else: colseen.add(cname) dbtype = dbcols[cname].lower() if dbtype in ('text', 'varchar', 'char'): value = unicode(cvalue) elif dbtype in ('integer',): value = int(cvalue) elif dbtype in ('numeric', 'float'): value = float(cvalue) else: raise NotImplementedError("Unsupported type: '%s'" % dbtype) outcols.append(cname) outvalues.append(value) if outvalues: curs.execute(""" INSERT INTO %s (%s) VALUES (%s) """ % (e.table, ','.join(outcols), ','.join(['%s'] * len(outvalues))), outvalues) conn.commit()
195761e01f96d3c6a5eea7d9f46db5a14e52b2ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/195761e01f96d3c6a5eea7d9f46db5a14e52b2ca/rstlime.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4007, 67, 1883, 273, 2130, 225, 1652, 1707, 67, 8219, 12, 8219, 67, 1098, 16, 1319, 2284, 16, 25326, 4672, 3536, 16803, 279, 666, 434, 3222, 358, 506, 4041, 16, 775, 358, 1707, 487, 9816, 50...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4007, 67, 1883, 273, 2130, 225, 1652, 1707, 67, 8219, 12, 8219, 67, 1098, 16, 1319, 2284, 16, 25326, 4672, 3536, 16803, 279, 666, 434, 3222, 358, 506, 4041, 16, 775, 358, 1707, 487, 9816, 50...
instance_class_slot.__set__(inst, value)
instance_class_slot.__set__(self, value)
def __setattr__(self, name, value): if name == '__dict__': if not isinstance(value, dict): raise TypeError("__dict__ must be set to a dictionary") obj_setattr(self, '__dict__', value) elif name == '__class__': if not isinstance(value, classobj): raise TypeError("__class__ must be set to a class") instance_class_slot.__set__(inst, value) else: setattr = instance_getattr1(self, '__setattr__', exc=False) if setattr is not None: setattr(name, value) else: self.__dict__[name] = value
166a6128c6b79c65817f8fd81c4e5a2389872b30 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/166a6128c6b79c65817f8fd81c4e5a2389872b30/_classobj.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 1747, 972, 12, 2890, 16, 508, 16, 460, 4672, 309, 508, 422, 4940, 1576, 972, 4278, 309, 486, 1549, 12, 1132, 16, 2065, 4672, 1002, 3580, 2932, 972, 1576, 972, 1297, 506, 444...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 542, 1747, 972, 12, 2890, 16, 508, 16, 460, 4672, 309, 508, 422, 4940, 1576, 972, 4278, 309, 486, 1549, 12, 1132, 16, 2065, 4672, 1002, 3580, 2932, 972, 1576, 972, 1297, 506, 444...
for d in docs] onclick = ("doclink('%s', '%s', '%s'); return false;" % (uid, name, ','.join(targets))) return uid, onclick
for d in docs]) if targets in self.doclink_targets_cache: onclick = ("return doclink('%s', '%s', '%s');" % (uid, name, self.doclink_targets_cache[targets])) return uid, onclick, None else: self.doclink_targets_cache[targets] = uid onclick = ("return doclink('%s', '%s', '%s');" % (uid, name, uid)) return uid, onclick, targets
def doclink(self, name, docs): uid = 'link-%s' % self._next_uid self._next_uid += 1 context = [n for n in self.context if n is not None] container = DottedName(self.module_name, *context) #else: # container = None targets = ['%s=%s' % (str(self.doc_descr(d,container)), str(self.url_func(d))) for d in docs] onclick = ("doclink('%s', '%s', '%s'); return false;" % (uid, name, ','.join(targets))) return uid, onclick
5bc1065ae92ac1cb6e043d081151eb3bcfca80a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/5bc1065ae92ac1cb6e043d081151eb3bcfca80a3/html_colorize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1232, 12, 2890, 16, 508, 16, 3270, 4672, 4555, 273, 296, 1232, 6456, 87, 11, 738, 365, 6315, 4285, 67, 1911, 365, 6315, 4285, 67, 1911, 1011, 404, 819, 273, 306, 82, 364, 290, 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, 997, 1232, 12, 2890, 16, 508, 16, 3270, 4672, 4555, 273, 296, 1232, 6456, 87, 11, 738, 365, 6315, 4285, 67, 1911, 365, 6315, 4285, 67, 1911, 1011, 404, 819, 273, 306, 82, 364, 290, 3...
[14.134725142, 21.022039637, 25.010857582, 30.424876124]
[14.1347251, 21.0220396, 25.0108575, 30.4248761]
def zeros(self, n, L=''): """ Return the imaginary parts of the first $n$ nontrivial zeros of the $L$-function in the upper half plane, as 32-bit reals.
190d721b928fa19159704505db9bd5cd1aafd024 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/190d721b928fa19159704505db9bd5cd1aafd024/lcalc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4922, 12, 2890, 16, 290, 16, 511, 2218, 11, 4672, 3536, 2000, 326, 30852, 2140, 434, 326, 1122, 271, 82, 8, 1661, 313, 20109, 4922, 434, 326, 271, 48, 8, 17, 915, 316, 326, 3854, 881...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4922, 12, 2890, 16, 290, 16, 511, 2218, 11, 4672, 3536, 2000, 326, 30852, 2140, 434, 326, 1122, 271, 82, 8, 1661, 313, 20109, 4922, 434, 326, 271, 48, 8, 17, 915, 316, 326, 3854, 881...
if restricted and \ not (npath.startswith(path) or path.startswith(npath)):
if (restricted and not (npath == path or npath.startswith(path + '/') or path.startswith(npath + '/'))):
def get_changes(): old_node = new_node = None for npath, kind, change, opath, orev in chgset.get_changes(): if restricted and \ not (npath.startswith(path) # npath is below or path.startswith(npath)): # npath is above continue if change != Changeset.ADD: old_node = repos.get_node(opath, orev) if change != Changeset.DELETE: new_node = repos.get_node(npath, rev) yield old_node, new_node, kind, change
70a8f0b7f6f51874af0c4b301617d3abdaa2da2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/70a8f0b7f6f51874af0c4b301617d3abdaa2da2b/changeset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6329, 13332, 1592, 67, 2159, 273, 394, 67, 2159, 273, 599, 364, 290, 803, 16, 3846, 16, 2549, 16, 320, 803, 16, 320, 9083, 316, 462, 75, 542, 18, 588, 67, 6329, 13332, 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, 336, 67, 6329, 13332, 1592, 67, 2159, 273, 394, 67, 2159, 273, 599, 364, 290, 803, 16, 3846, 16, 2549, 16, 320, 803, 16, 320, 9083, 316, 462, 75, 542, 18, 588, 67, 6329, 13332, 309, ...
for line in file:
for line in fp:
def _get_string_keys(path): """Grab all the string keys of out a language file""" re_key = re.compile("^ *ui_strings\.([^ ]*)") file = codecs.open(path, "r", "utf_8_sig") lang_keys = set() for line in file: lang_keys.update(re_key.findall(line)) file.close() return lang_keys
b1c013d0daad4a8a6ea9dfc8e40bac88ebbb3921 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10922/b1c013d0daad4a8a6ea9dfc8e40bac88ebbb3921/dfbuild.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 1080, 67, 2452, 12, 803, 4672, 3536, 14571, 70, 777, 326, 533, 1311, 434, 596, 279, 2653, 585, 8395, 283, 67, 856, 273, 283, 18, 11100, 2932, 66, 380, 4881, 67, 10219, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 1080, 67, 2452, 12, 803, 4672, 3536, 14571, 70, 777, 326, 533, 1311, 434, 596, 279, 2653, 585, 8395, 283, 67, 856, 273, 283, 18, 11100, 2932, 66, 380, 4881, 67, 10219, ...
testResults = ExperimentResults(times, [l.name for l in learners], values, weight!=0, basevalue)
classVar = examples.domain.classVar if examples.domain.classVar.varType == orange.VarTypes.Discrete: values = classVar.values.native() baseValue = classVar.baseValue else: values = None baseValue = -1 testResults = ExperimentResults(times, [l.name for l in learners], values, weight!=0, baseValue)
def proportionTest(learners, examples, learnProp, times=10, strat=orange.MakeRandomIndices.StratifiedIfPossible, pps=[], callback=None, **argkw): """train-and-test evaluation (train on a subset, test on remaing examples)""" # randomGenerator is set either to what users provided or to orange.RandomGenerator(0) # If we left it None or if we set MakeRandomIndices2.randseed, it would give same indices each time it's called randomGenerator = argkw.get("indicesrandseed", 0) or argkw.get("randseed", 0) or argkw.get("randomGenerator", 0) pick = orange.MakeRandomIndices2(stratified = strat, p0 = learnProp, randomGenerator = randomGenerator) examples, weight = demangleExamples(examples) if examples.domain.classVar.varType == orange.VarTypes.Discrete: values = list(examples.domain.classVar.values) basevalue = examples.domain.classVar.baseValue else: basevalue = values = None testResults = ExperimentResults(times, [l.name for l in learners], values, weight!=0, basevalue) for time in range(times): indices = pick(examples) learnset = examples.selectref(indices, 0) testset = examples.selectref(indices, 1) learnAndTestOnTestData(learners, (learnset, weight), (testset, weight), testResults, time, pps, **argkw) if callback: callback() return testResults
a4efcaebbd4f5cf515830443c9d40062ce40880f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/a4efcaebbd4f5cf515830443c9d40062ce40880f/orngTest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23279, 4709, 12, 21346, 414, 16, 10991, 16, 16094, 4658, 16, 4124, 33, 2163, 16, 609, 270, 33, 280, 726, 18, 6464, 8529, 8776, 18, 1585, 270, 939, 2047, 13576, 16, 293, 1121, 22850, 64...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 23279, 4709, 12, 21346, 414, 16, 10991, 16, 16094, 4658, 16, 4124, 33, 2163, 16, 609, 270, 33, 280, 726, 18, 6464, 8529, 8776, 18, 1585, 270, 939, 2047, 13576, 16, 293, 1121, 22850, 64...
self.logger.log('very large resultSet - passing CQL for repeat search')
self.logger.log('Large resultSet - passing CQL for repeat search')
def search(self, form, maxResultSetSize=None): firstrec = int(form.get('firstrec', 1)) numreq = int(form.get('numreq', 20)) highlight = int(form.get('highlight', 1)) rsid = form.get('rsid', None) qString = form.get('query', form.get('cqlquery', None)) withinCollection = form.get('withinCollection', None)
51c4864bb9efdde7305f1cca91b49e2220b7771c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11263/51c4864bb9efdde7305f1cca91b49e2220b7771c/eadSearchHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2890, 16, 646, 16, 943, 13198, 1225, 33, 7036, 4672, 1122, 3927, 273, 509, 12, 687, 18, 588, 2668, 3645, 3927, 2187, 404, 3719, 818, 3658, 273, 509, 12, 687, 18, 588, 2668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1623, 12, 2890, 16, 646, 16, 943, 13198, 1225, 33, 7036, 4672, 1122, 3927, 273, 509, 12, 687, 18, 588, 2668, 3645, 3927, 2187, 404, 3719, 818, 3658, 273, 509, 12, 687, 18, 588, 2668, ...
sock.write("%s: %s\n" % now, msg)
sock.write("%s: %s\n" % (now, msg))
def dprint(msg): from time import strftime global options now = strftime("%Y-%m-%d %H:%M:%S") if options.debug: print now + ": " + msg if options.log: sock = open(options.log, "a") sock.write("%s: %s\n" % now, msg) sock.close()
ea1d79673ffcd39a868147e88230799f9d227728 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10034/ea1d79673ffcd39a868147e88230799f9d227728/skyped.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 1188, 12, 3576, 4672, 628, 813, 1930, 10405, 2552, 702, 225, 2037, 273, 10405, 27188, 61, 6456, 81, 6456, 72, 738, 44, 5319, 49, 5319, 55, 7923, 225, 309, 702, 18, 4148, 30, 1172,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 302, 1188, 12, 3576, 4672, 628, 813, 1930, 10405, 2552, 702, 225, 2037, 273, 10405, 27188, 61, 6456, 81, 6456, 72, 738, 44, 5319, 49, 5319, 55, 7923, 225, 309, 702, 18, 4148, 30, 1172,...
pass
remove(self.__file_name)
def __del__( self ): """ Delete method, cleanup temp file if needed. """ if self.__file_delete and self.__file_name != "": # delete temp file ++++ pass
081caa4112e4523e94d21ab16a9f9b8a69049317 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13212/081caa4112e4523e94d21ab16a9f9b8a69049317/node.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3771, 972, 12, 365, 262, 30, 3536, 2504, 707, 16, 6686, 1906, 585, 309, 3577, 18, 3536, 309, 365, 16186, 768, 67, 3733, 471, 365, 16186, 768, 67, 529, 480, 1408, 30, 468, 1430, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3771, 972, 12, 365, 262, 30, 3536, 2504, 707, 16, 6686, 1906, 585, 309, 3577, 18, 3536, 309, 365, 16186, 768, 67, 3733, 471, 365, 16186, 768, 67, 529, 480, 1408, 30, 468, 1430, ...
if self["device"] and self["device"].keys() not in [ "scsi", "eth" ]: raise ValueError, "device: type not valid."
if self["device"]: for key in self["device"].keys(): if key not in [ "scsi", "eth" ]: raise ValueError, "device: type %s not valid." % key
def verify(self): for tag in self.REQUIRED_TAGS: if not self[tag]: raise ValueError, "ERROR: %s is required." % tag
49029ce9fc48e78d523e0bd8ca666315444868ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/49029ce9fc48e78d523e0bd8ca666315444868ff/kickstart.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 12, 2890, 4672, 364, 1047, 316, 365, 18, 14977, 67, 29915, 30, 309, 486, 365, 63, 2692, 14542, 1002, 2068, 16, 315, 3589, 30, 738, 87, 353, 1931, 1199, 738, 1047, 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, 3929, 12, 2890, 4672, 364, 1047, 316, 365, 18, 14977, 67, 29915, 30, 309, 486, 365, 63, 2692, 14542, 1002, 2068, 16, 315, 3589, 30, 738, 87, 353, 1931, 1199, 738, 1047, 2, -100, -100, ...
self.assertNotEqual(
self.assertEqual(
def testRetrieveAutoDiscounts(self): products = [i.product for i in self.order.orderitem_set.all()] discounts = find_auto_discounts(products)
1e334e1855e755f1ce0d69631daba5a7b073c1e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13656/1e334e1855e755f1ce0d69631daba5a7b073c1e5/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 5767, 4965, 1669, 8008, 12, 2890, 4672, 10406, 273, 306, 77, 18, 5896, 364, 277, 316, 365, 18, 1019, 18, 1019, 1726, 67, 542, 18, 454, 1435, 65, 1015, 8008, 273, 1104, 67, 6079, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 5767, 4965, 1669, 8008, 12, 2890, 4672, 10406, 273, 306, 77, 18, 5896, 364, 277, 316, 365, 18, 1019, 18, 1019, 1726, 67, 542, 18, 454, 1435, 65, 1015, 8008, 273, 1104, 67, 6079, ...
<title>%s WMI: %s</title>
<title>%s %s</title>
def head(title = _("administration %s") % configuration.app_name): """Build the HTML Page header. Bubble Tooltips come from: http://www.dustindiaz.com/sweet-titles Rounded Divs comme from : http://www.html.it/articoli/niftycube/index.html """ return """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
00a7c63aee2a4aa090cfef3676b7f9fe6fe8c0d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/00a7c63aee2a4aa090cfef3676b7f9fe6fe8c0d5/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 910, 12, 2649, 273, 389, 2932, 3666, 4218, 738, 87, 7923, 738, 1664, 18, 2910, 67, 529, 4672, 3536, 3116, 326, 3982, 3460, 1446, 18, 605, 14787, 13288, 88, 7146, 12404, 628, 30, 202, 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, 910, 12, 2649, 273, 389, 2932, 3666, 4218, 738, 87, 7923, 738, 1664, 18, 2910, 67, 529, 4672, 3536, 3116, 326, 3982, 3460, 1446, 18, 605, 14787, 13288, 88, 7146, 12404, 628, 30, 202, 2...
A = Epetra.CrsMatrix(Epetra.Copy, map, 0)
A = Epetra.CrsMatrix(Epetra.Copy, map2, 0)
def main(): failures = 0 tolerance = 1.0e-12 # Construct a vector x and populate with random values n = 10 * numProc map = Epetra.Map(n, 0, comm) x = Epetra.Vector(map) x.Random() # ==================================================== # # Write map to file "map.mm" in MatrixMarket format, # # read "map.mm" into map2, then check that map2 equals # # map. # # ==================================================== # if iAmRoot: print "I/O for BlockMap ... ", EpetraExt.BlockMapToMatrixMarketFile("map.mm", map) (ierr, map2) = EpetraExt.MatrixMarketFileToBlockMap("map.mm", comm) print "ierr =", ierr print "map2 =", map2 if map2.SameAs(map): if iAmRoot: print "ok" else: if iAmRoot: print "FAILED" failures += 1 # ===================================================== # # Write vector x to file "x.mm" in MatrixMarket format, # # read "x.mm" into y, then check that y equals x # # ===================================================== # if iAmRoot: print "I/O for MultiVector ... ", EpetraExt.MultiVectorToMatrixMarketFile("x.mm", x) (ierr, y) = EpetraExt.MatrixMarketFileToMultiVector("x.mm", map) y.Update(1.0, x, -1.0) norm = y.Norm2() if abs(norm) < tolerance: if iAmRoot: print "ok" else: if iAmRoot: print "FAILED" failures += 1 # ===================================================== # # Creates a simple CrsMatrix (diagonal) and # # write matrix A to file "A.mm" in MatrixMarket format, # # read "A.mm" into B, then check that B equals A # # ===================================================== # if iAmRoot: print "I/O for CrsMatrix ... ", A = Epetra.CrsMatrix(Epetra.Copy, map, 0) Indices = Epetra.IntSerialDenseVector(1) Values = Epetra.SerialDenseVector(1) for lrid in range(A.NumMyRows()): grid = A.GRID(lrid) Indices[0] = grid Values[0] = grid A.InsertGlobalValues(grid, 1, Values, Indices) A.FillComplete() EpetraExt.RowMatrixToMatrixMarketFile("A.mm", A) (ierr, B) = EpetraExt.MatrixMarketFileToCrsMatrix("A.mm", map) EpetraExt.Add(A, False, 1.0, B, -1.0) norm = B.NormInf() if abs(norm) < tolerance: if iAmRoot: print "ok" else: if iAmRoot: print "FAILED" failures += 1 return failures
ba767dd9705db64228df088b12705005efdf6dcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1130/ba767dd9705db64228df088b12705005efdf6dcc/exInputOutput.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 225, 11720, 225, 273, 374, 10673, 273, 404, 18, 20, 73, 17, 2138, 225, 468, 14291, 279, 3806, 619, 471, 6490, 598, 2744, 924, 290, 4202, 273, 1728, 380, 818, 15417, 852, 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, 2774, 13332, 225, 11720, 225, 273, 374, 10673, 273, 404, 18, 20, 73, 17, 2138, 225, 468, 14291, 279, 3806, 619, 471, 6490, 598, 2744, 924, 290, 4202, 273, 1728, 380, 818, 15417, 852, 3...
self._stash_rewrite_and_call(EX_MADE, ( (ParseTests, ['test_read_made', 'test_parse_made']), (TreeTests, ['test_Confidence', 'test_Polygon']), ))
global EX_MADE orig_fname = EX_MADE try: EX_MADE = DUMMY self._rewrite_and_call(orig_fname, ( (ParseTests, ['test_read_made', 'test_parse_made']), (TreeTests, ['test_Confidence', 'test_Polygon']), )) finally: EX_MADE = orig_fname
def test_made(self): """Round-trip parsing and serialization of made_up.xml.""" self._stash_rewrite_and_call(EX_MADE, ( (ParseTests, ['test_read_made', 'test_parse_made']), (TreeTests, ['test_Confidence', 'test_Polygon']), ))
ad1a618def838d98432e9623367cffb595eadecd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/ad1a618def838d98432e9623367cffb595eadecd/test_PhyloXML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 81, 2486, 12, 2890, 4672, 3536, 11066, 17, 25125, 5811, 471, 11854, 434, 7165, 67, 416, 18, 2902, 12123, 365, 6315, 25915, 67, 21489, 67, 464, 67, 1991, 12, 2294, 67, 5535, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 81, 2486, 12, 2890, 4672, 3536, 11066, 17, 25125, 5811, 471, 11854, 434, 7165, 67, 416, 18, 2902, 12123, 365, 6315, 25915, 67, 21489, 67, 464, 67, 1991, 12, 2294, 67, 5535, 1...
track.time_released = time.mktime(ipod_date) + 2082844800
track.time_released = int(time.mktime(ipod_date) + 2082844800)
def add_episode_from_channel( self, channel, episode): if not ipod_supported(): return False if self.callback_status != None: channeltext = channel.title if channel.is_music_channel: channeltext = _('%s (to "%s")') % ( channel.title, channel.device_playlist_name ) gobject.idle_add( self.callback_status, episode.title, channeltext) if self.episode_is_on_ipod( channel, episode): # episode is already here :) return True log( '(ipodsync) Adding item: %s from %s', episode.title, channel.title) local_filename = str(channel.getPodcastFilename( episode.url)) try: if use_mechanism == MAD: log( '(ipodsync) Using pymad to get file length') mad_info = mad.MadFile( local_filename) track_length = mad_info.total_time() elif use_mechanism == EYED3: log( '(ipodsync) Using eyeD3 to get file length') eyed3_info = eyeD3.Mp3AudioFile( local_filename) track_length = eyed3_info.getPlayTime() * 1000 # TODO: how to get length of video (mov, mp4, m4v) files?? except: print '(ipodsync) Warning: cannot get length for %s, will use 1 hour' % episode.title track_length = 20*60*1000 # hmm.. (20m so we can skip on video/audio with unknown length) track = gpod.itdb_track_new() if channel.is_music_channel: track.artist = str(channel.title) else: track.artist = 'gPodder podcast' self.set_podcast_flags( track) # Add release time to track if pubDate is parseable ipod_date = email.Utils.parsedate(episode.pubDate) if ipod_date != None: # + 2082844800 for unixtime => mactime (1970 => 1904) track.time_released = time.mktime(ipod_date) + 2082844800 track.title = str(episode.title) track.album = str(channel.title) track.tracklen = track_length track.filetype = 'mp3' # huh?! harcoded?! well, well :) FIXME, i'd say track.description = str(episode.description) track.podcasturl = str(episode.url) track.podcastrss = str(channel.url) track.size = os.path.getsize( local_filename) gpod.itdb_track_add( self.itdb, track, -1) playlist = self.get_playlist_for_channel( channel) gpod.itdb_playlist_add_track( playlist, track, -1)
d405261077d76adcb416b19bd77a15ccf93159c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12778/d405261077d76adcb416b19bd77a15ccf93159c1/libipodsync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 29687, 67, 2080, 67, 4327, 12, 365, 16, 1904, 16, 17054, 4672, 309, 486, 2359, 369, 67, 4127, 13332, 327, 1083, 309, 365, 18, 3394, 67, 2327, 480, 599, 30, 1904, 955, 273, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 29687, 67, 2080, 67, 4327, 12, 365, 16, 1904, 16, 17054, 4672, 309, 486, 2359, 369, 67, 4127, 13332, 327, 1083, 309, 365, 18, 3394, 67, 2327, 480, 599, 30, 1904, 955, 273, 1...
import time import heapq
def dshield(inner, asn, dedup, use_cymru_whois=False, url="http://dshield.org/asdetailsascii.html"): asn = str(asn) # The current DShield csv fields, in order. headers = ["ip", "reports", "targets", "firstseen", "lastseen", "updated"] # Probably a kosher-ish way to create an ASN specific URL. parsed = urlparse.urlparse(url) parsed = list(parsed) parsed[4] = urllib.urlencode({ "as" : asn }) url = urlparse.urlunparse(parsed) print "ASN%s: connecting" % asn opened = yield inner.thread(urllib2.urlopen, url) print "ASN%s: downloading" % asn data = yield inner.thread(read_data, opened) print "ASN%s: downloaded" % asn count = 0 try: # Lazily filter away empty lines and lines starting with '#' filtered = (x for x in data if x.strip() and not x.startswith("#") and dedup.add(x)) reader = csv.DictReader(filtered, headers, delimiter="\t") for row in reader: row["ip"] = sanitize_ip(row.get("ip", None)) count += 1 if count % 100 == 0: print "ASN%s: fed %d events" % (asn, count) event = events.Event() event.add("feed", "dshield") if use_cymru_whois: event.add("dshield asn", unicode(asn)) else: event.add("asn", unicode(asn)) for key, value in row.items(): if value is None: continue event.add(key, util.guess_encoding(value).strip()) inner.send(event) yield list(inner) finally: print "ASN%s: done with %d events" % (asn, count) opened.close()
5a8559a2402b986c17f00e6c18e5a90f05a7e7cc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14361/5a8559a2402b986c17f00e6c18e5a90f05a7e7cc/dshield.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 674, 491, 12, 7872, 16, 12211, 16, 31782, 16, 999, 67, 2431, 81, 8653, 67, 3350, 19606, 33, 8381, 16, 880, 1546, 2505, 2207, 72, 674, 491, 18, 3341, 19, 345, 6395, 9184, 18, 262...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 674, 491, 12, 7872, 16, 12211, 16, 31782, 16, 999, 67, 2431, 81, 8653, 67, 3350, 19606, 33, 8381, 16, 880, 1546, 2505, 2207, 72, 674, 491, 18, 3341, 19, 345, 6395, 9184, 18, 262...
Param.__init__(self, keyword, help='', **kwargs)
Param.__init__(self, keyword, help=help, **kwargs)
def __init__(self, keyword, choices, default=None, help='', **kwargs): Param.__init__(self, keyword, help='', **kwargs) self.choices = [entry[1] for entry in choices] self.keys = [entry[0] for entry in choices] if default is not None and default in self.choices: self.default = self.keys[self.choices.index(default)] else: self.default = self.keys(0)
c6ce594be97dab931071a20dafd4d07525497c32 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/c6ce594be97dab931071a20dafd4d07525497c32/userparams.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4932, 16, 7246, 16, 805, 33, 7036, 16, 2809, 2218, 2187, 2826, 4333, 4672, 3014, 16186, 2738, 972, 12, 2890, 16, 4932, 16, 2809, 33, 5201, 16, 2826, 4333...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4932, 16, 7246, 16, 805, 33, 7036, 16, 2809, 2218, 2187, 2826, 4333, 4672, 3014, 16186, 2738, 972, 12, 2890, 16, 4932, 16, 2809, 33, 5201, 16, 2826, 4333...
return (4,)
return (4, 1)
def c_code_cache_version(self): return (4,)
262fcf78e9cb7102895cb00af4a0f2a608c2b519 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/262fcf78e9cb7102895cb00af4a0f2a608c2b519/elemwise.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 67, 710, 67, 2493, 67, 1589, 12, 2890, 4672, 327, 261, 24, 16, 13, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 67, 710, 67, 2493, 67, 1589, 12, 2890, 4672, 327, 261, 24, 16, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
cmd.append(self.pbase)
cmd.append(self.source)
def post_compile (self): """ Run makeindex if needed, with appropriate options and environment. """ if not os.path.exists(self.source): msg.log(_("strange, there is no %s") % self.source, pkg="index") return 0 if not self.run_needed(): return 0
83e15aff8f37055b316114051eb562a884eee441 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/83e15aff8f37055b316114051eb562a884eee441/index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 67, 11100, 261, 2890, 4672, 3536, 1939, 1221, 1615, 309, 3577, 16, 598, 5505, 702, 471, 3330, 18, 3536, 309, 486, 1140, 18, 803, 18, 1808, 12, 2890, 18, 3168, 4672, 1234, 18, 133...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 67, 11100, 261, 2890, 4672, 3536, 1939, 1221, 1615, 309, 3577, 16, 598, 5505, 702, 471, 3330, 18, 3536, 309, 486, 1140, 18, 803, 18, 1808, 12, 2890, 18, 3168, 4672, 1234, 18, 133...
pass
def handleEvents(self): #print 'RECORDSERVER HANDLING EVENT' event = rc_object.get_event()
028d3a2c77c822349393ac7e42144948da5e2f3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/028d3a2c77c822349393ac7e42144948da5e2f3c/recordserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 3783, 12, 2890, 4672, 468, 1188, 296, 22261, 4370, 24166, 26789, 9964, 11, 871, 273, 4519, 67, 1612, 18, 588, 67, 2575, 1435, 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, 0, 0, 0, 0, 0, 0, 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, 1640, 3783, 12, 2890, 4672, 468, 1188, 296, 22261, 4370, 24166, 26789, 9964, 11, 871, 273, 4519, 67, 1612, 18, 588, 67, 2575, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -10...
self.cb(elt, sw, pyobj, **kw)
self.cb(elt, sw, pyobj, name=name, **kw)
def serialize(self, elt, sw, pyobj, inline=False, name=None, **kw): if inline or self.inline: self.cb(elt, sw, pyobj, **kw) else: objid = _get_idstr(pyobj) n = name or self.pname or ('E' + objid) el = elt.createAppendElement(None, n) el.setAttributeNS(None, 'href', "#%s" %objid) sw.AddCallback(self.cb, elt, sw, pyobj)
7345179294b76759ddb897d4d80aefa2d01212cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/7345179294b76759ddb897d4d80aefa2d01212cc/TCcompound.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4472, 12, 2890, 16, 11572, 16, 1352, 16, 2395, 2603, 16, 6370, 33, 8381, 16, 508, 33, 7036, 16, 2826, 9987, 4672, 309, 6370, 578, 365, 18, 10047, 30, 365, 18, 7358, 12, 20224, 16, 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, 4472, 12, 2890, 16, 11572, 16, 1352, 16, 2395, 2603, 16, 6370, 33, 8381, 16, 508, 33, 7036, 16, 2826, 9987, 4672, 309, 6370, 578, 365, 18, 10047, 30, 365, 18, 7358, 12, 20224, 16, 13...
skiplist : skiplist LT skiplist_comma GT """ pass
skiplist : skiplist LT skiplist_comma GT skiplist """ pass precedence = ( ('right', 'LT', 'GT'), )
def p_skiplist(t): """ skiplist : skiplist_base skiplist : skiplist LT skiplist_comma GT """ pass
d53bba01a8a947f1fa2d7bbb49e927e76b41666c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/d53bba01a8a947f1fa2d7bbb49e927e76b41666c/ddf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 67, 7771, 77, 17842, 12, 88, 4672, 3536, 4343, 77, 17842, 294, 4343, 77, 17842, 67, 1969, 4343, 77, 17842, 294, 4343, 77, 17842, 11807, 4343, 77, 17842, 67, 25034, 19688, 3536, 1342...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 293, 67, 7771, 77, 17842, 12, 88, 4672, 3536, 4343, 77, 17842, 294, 4343, 77, 17842, 67, 1969, 4343, 77, 17842, 294, 4343, 77, 17842, 11807, 4343, 77, 17842, 67, 25034, 19688, 3536, 1342...
display_map = (not request.session['geolocation:location'] is None)
display_map = (not request.session.get('geolocation:location') is None)
def initial_context(cls, request, control_number): items = search.ControlNumberSearch(control_number, cls.conf) if len(items) == 0: raise Http404
b62a6accbba29b32bb5ac4f6fb3331e505b3593b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/b62a6accbba29b32bb5ac4f6fb3331e505b3593b/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2172, 67, 2472, 12, 6429, 16, 590, 16, 3325, 67, 2696, 4672, 1516, 273, 1623, 18, 3367, 1854, 2979, 12, 7098, 67, 2696, 16, 2028, 18, 3923, 13, 309, 562, 12, 3319, 13, 422, 374, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2172, 67, 2472, 12, 6429, 16, 590, 16, 3325, 67, 2696, 4672, 1516, 273, 1623, 18, 3367, 1854, 2979, 12, 7098, 67, 2696, 16, 2028, 18, 3923, 13, 309, 562, 12, 3319, 13, 422, 374, 30, ...
try:
try:
def load_dict(self, localsDict, globalsDict, force=0): self.DeleteAllItems() row = 0 for name, local in self.watches: if local: try: value = self.repr.repr(localsDict[name]) except: try: value = eval(name, globalsDict, localsDict) except Exception, message: value = '??? (%s)' % message idx = 3 else: try: value = self.repr.repr(globalsDict[name]) except: try: value = eval(name, globalsDict) except Exception, message: value = '??? (%s)' % message idx = 4
872f754eafee36b7b9b20954604570707e5cd36c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/872f754eafee36b7b9b20954604570707e5cd36c/Debugger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 1576, 12, 2890, 16, 8985, 5014, 16, 10941, 5014, 16, 2944, 33, 20, 4672, 365, 18, 2613, 1595, 3126, 1435, 1027, 273, 374, 364, 508, 16, 1191, 316, 365, 18, 7585, 281, 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, 1262, 67, 1576, 12, 2890, 16, 8985, 5014, 16, 10941, 5014, 16, 2944, 33, 20, 4672, 365, 18, 2613, 1595, 3126, 1435, 1027, 273, 374, 364, 508, 16, 1191, 316, 365, 18, 7585, 281, 30, 3...
dest="groups_to_add", default = None,
dest="groups_to_add", default=None,
def mod_user_parse_arguments(app, configuration): usage_text = "\n\t%s user --login=<login> [--gecos=<new GECOS>] [--password=<new passwd> | --auto-password] [--password-size=<size>]\n" % stylize(ST_APPNAME, "%prog") \ + '\t\t[--lock|--unlock] [--add-groups=<group1[[,group2][,…]]>] [--del-groups=<group1[[,group2][,…]]>]\n' \ + '\t\t[--shell=<new shell>]\n' \ "\t%s user --login=<login> --apply-skel=<squelette>" % stylize(ST_APPNAME, "%prog") parser = OptionParser(usage=usage_text, version=build_version_string(app, version)) # common behaviour group parser.add_option_group(common_behaviour_group(app, parser, 'mod_user')) parser.add_option_group(common_filter_group(app, parser, 'mod', 'users')) user = OptionGroup(parser, stylize(ST_OPTION, "Modify user options ")) user.add_option("--password", '-p', dest="newpassword", default = None, help="specify user's new password.") user.add_option("--auto-password", '-P', action="store_true", dest="auto_passwd", help="let the system generate a random password for this user.") user.add_option("--password-size", '-S', type='int', dest="passwd_size", default=configuration.users.min_passwd_size, help="choose the new password length (default %s)." % configuration.users.min_passwd_size) user.add_option("--gecos", dest="newgecos", default = None, help="specify user's new GECOS string (generaly first and last names).") user.add_option("--shell", dest="newshell", default = None, help="specify user's shell (generaly /bin/something).") user.add_option('-l', "--lock", action="store_true", dest="lock", default = None, help="lock the account (user wn't be able to login under Linux and Windows/MAC until unlocked).") user.add_option('-L', "--unlock", action="store_false", dest="lock", default = None, help="unlock the user account and restore login ability.") user.add_option("--add-groups", dest="groups_to_add", default = None, help="make user member of these groups.") user.add_option("--del-groups", dest="groups_to_del", default = None, help="remove user from these groups.") user.add_option("--apply-skel", action="store", type="string", dest="apply_skel", default = None, help="re-apply the user's skel (use with caution, it will overwrite the dirs/files belonging to the skel in the user's home dir.") parser.add_option_group(user) return parser.parse_args()
461c24b546b5d0469c4e29582a85905d96b60351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/461c24b546b5d0469c4e29582a85905d96b60351/argparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 681, 67, 1355, 67, 2670, 67, 7099, 12, 2910, 16, 1664, 4672, 225, 4084, 67, 955, 273, 1548, 82, 64, 88, 9, 87, 729, 1493, 5819, 27127, 5819, 34, 306, 413, 75, 557, 538, 27127, 2704, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 681, 67, 1355, 67, 2670, 67, 7099, 12, 2910, 16, 1664, 4672, 225, 4084, 67, 955, 273, 1548, 82, 64, 88, 9, 87, 729, 1493, 5819, 27127, 5819, 34, 306, 413, 75, 557, 538, 27127, 2704, ...
if self.__denominator._is_atomic() and denom_string.find( "*" ) < 0 and denom_string.find( "/" ) < 0:
if self.__denominator._is_atomic() and not ('*' in denom_string or '/' in denom_string):
def _repr_(self): if self.is_zero(): return "0" s = "%s"%self.__numerator if self.__denominator != 1: denom_string = str( self.__denominator ) if self.__denominator._is_atomic() and denom_string.find( "*" ) < 0 and denom_string.find( "/" ) < 0: s = "%s/%s"%(self.__numerator._coeff_repr(no_space=False),denom_string) else: s = "%s/(%s)"%(self.__numerator._coeff_repr(no_space=False),denom_string) return s
316125932a4d0e29630ed5e91d94ed57ad1e91f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/316125932a4d0e29630ed5e91d94ed57ad1e91f6/fraction_field_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12715, 67, 12, 2890, 4672, 309, 365, 18, 291, 67, 7124, 13332, 327, 315, 20, 6, 272, 273, 2213, 87, 28385, 2890, 16186, 2107, 7385, 309, 365, 16186, 13002, 26721, 480, 404, 30, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12715, 67, 12, 2890, 4672, 309, 365, 18, 291, 67, 7124, 13332, 327, 315, 20, 6, 272, 273, 2213, 87, 28385, 2890, 16186, 2107, 7385, 309, 365, 16186, 13002, 26721, 480, 404, 30, 10...
def GetValues(*args): return _Xdmf.XdmfDataStructure_GetValues(*args) def GetFormat(*args): return _Xdmf.XdmfDataStructure_GetFormat(*args) def SetFormat(*args): return _Xdmf.XdmfDataStructure_SetFormat(*args) def SetArrayIsMine(*args): return _Xdmf.XdmfDataStructure_SetArrayIsMine(*args) def GetArrayIsMine(*args): return _Xdmf.XdmfDataStructure_GetArrayIsMine(*args)
def SetItemType(*args): return _Xdmf.XdmfDataStructure_SetItemType(*args) def GetItemType(*args): return _Xdmf.XdmfDataStructure_GetItemType(*args)
def GetValues(*args): return _Xdmf.XdmfDataStructure_GetValues(*args)
599eb65a085caa62838b9a4b822da5a5798dac84 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/962/599eb65a085caa62838b9a4b822da5a5798dac84/Xdmf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 1972, 30857, 1968, 4672, 327, 389, 60, 10956, 74, 18, 60, 10956, 74, 751, 6999, 67, 967, 1972, 30857, 1968, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 1972, 30857, 1968, 4672, 327, 389, 60, 10956, 74, 18, 60, 10956, 74, 751, 6999, 67, 967, 1972, 30857, 1968, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
""" <directives namespace="http://namespaces.zope.org/zope"> <directive name="permission" attributes="id title description" handler=" zope.app.security.metaconfigure.definePermission" /> </directives>
''' <include package="zope.app.security" file="meta.zcml" />
def testProtectedPageViews(self): ztapi.provideUtility(IPermission, Permission('p', 'P'), 'p')
1cfc7ddd1cac0110cca3e909215477e1c59bbca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9523/1cfc7ddd1cac0110cca3e909215477e1c59bbca3/test_directives.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 15933, 1964, 9959, 12, 2890, 4672, 998, 88, 2425, 18, 685, 6768, 6497, 12, 2579, 2635, 16, 8509, 2668, 84, 2187, 296, 52, 19899, 296, 84, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 15933, 1964, 9959, 12, 2890, 4672, 998, 88, 2425, 18, 685, 6768, 6497, 12, 2579, 2635, 16, 8509, 2668, 84, 2187, 296, 52, 19899, 296, 84, 6134, 2, -100, -100, -100, -100, -100, -...
if options.verbose: print "- %s already in Satellite, skipping" % (rpm_name)
if options.verbose: print timestamp(), "- %s already in Satellite, skipping" % (rpm_name)
def main(): if options.demo: key = False current_channels = {} current_channel_labels = ['rhel-x86_64-server-5'] else: # Login to Satellite server key = login(options.user, options.password) # Build existing channel list current_channels = client.channel.list_all_channels(key) current_channel_labels = [] for channel in current_channels: current_channel_labels.append(channel['label']) if options.debug: print "DEBUG: Channels on current Satellite server:", current_channel_labels if client.api.get_version() < 5.1: # TODO: Haven't tested with Spacewalk, not sure how it is reported print "This script uses features not available with Satellite versions older than 5.1" sys.exit(1) if not options.client_actions_only: # This begins the server actions section if not os.path.exists(options.localdir): try: os.makedirs(options.localdir) except: print "Error: Unable to create %s" % (options.localdir) raise if (not options.delete) and (not options.no_rsync): # Sync local Dell repo with public Dell repo returncode = get_dell_repo(DELL_REPO_URL, options.localdir) if not returncode == 0: print "rsync process exited with returncode:", returncode # Build child channels based on dell repo as needed systems = build_channel_list(options.localdir, SYSTEM_VENDOR_ID) systems['platform_independent'] = PLATFORM_INDEPENDENT # Iterate through list of supported RHEL versions and archs, create parent channels if needed channels = {} print "Checking base channels on Satellite server" for parent in SUPPORTED_CHANNELS: if options.verbose: print "Checking base channel", parent # Check each supported base channel, skip if it does not exist on Satellite server if parent not in current_channel_labels: if options.verbose: print "-%s is not a current base channel, skipping." % (parent) continue else: channels[parent] = SUPPORTED_CHANNELS[parent] channels[parent]['child_channels'] = [] # Initialize key for child channels if options.verbose: print "+%s found on Satellite server, checking child channels." % (parent) if channels[parent]['arch'] == 'i386': # This is because Satellite stores x86 as 'ia32' arch = 'channel-ia32' else: arch = 'channel-' + channels[parent]['arch'] subdir = channels[parent]['subdir'] print " Checking child channels for %s" % parent for system in systems: # use system name plus parent to create a unique child channel c_label = DELL_INFO['label'] + '-' + system + '-' + parent c_name = DELL_INFO['name'] + ' on ' + systems[system] + ' for ' + parent c_summary = DELL_INFO['summary'] + ' on ' + systems[system] + ' running ' + parent c_arch = arch c_dir = options.localdir + system + '/' + subdir if options.verbose: print " Checking child channel:", c_label if channel_exists(key, c_label, current_channels): if options.delete: # Delete child channels if requested if options.demo: print "Deleting channel:", c_label else: delete_channel(key, c_label) else: if options.debug: print "DEBUG: checking for dir:", c_dir if options.verbose: print "Child channel already exists:", c_label if os.path.isdir(c_dir): channels[parent]['child_channels'].append(system) else: if not options.delete: # Build child channels if needed if options.debug: print "DEBUG: checking for dir:", c_dir if os.path.isdir(c_dir): channels[parent]['child_channels'].append(system) if options.debug: print "DEBUG: %s exists for %s, creating channel" % (subdir, system) if options.demo: if options.verbose: print "Creating child channel:", c_label else: create_channel(key, c_label, c_name, c_summary, c_arch, parent) else: if options.debug: print "DEBUG: %s does not exists for %s" % (subdir, system) if (not options.delete) and (not options.no_packages): # Iterate through channels, pushing rpms from the local repo as needed # TODO: check if rpm is already uploaded and orphaned or part of another channel if options.debug: print "DEBUG: Channel mapping:", channels print "Syncing rpms as needed" for parent in channels: print " Syncing rpms for child channels in %s" % parent for child in channels[parent]['child_channels']: dir = options.localdir + child + '/' + channels[parent]['subdir'] channel = DELL_INFO['label'] + '-' + child + '-' + parent if options.verbose: print " Syncing rpms to child channel", channel if options.debug: print "DEBUG: Looking for rpms in", dir rpms = gen_rpm_list(dir) # Get all packages in child channel existing_packages = client.channel.software.list_all_packages(key, channel) if options.debug: print "DEBUG: Existing packages in", channel, existing_packages for rpm in rpms: if options.debug: print "DEBUG: Working on:", rpm # Strip off '.rpm' at end of file to match against existing entries rpm_name = rpm.split('.rpm')[0] # Now strip off any preceeding paths rpm_name = rpm_name.split('/')[-1] # Iterate through existing packages, and skip existing ones if options.verbose: print "Checking if %s is already on the Satellite server in %s" % (rpm_name, channel) for package in existing_packages: existing_rpm_name = reconstruct_name(package) if options.debug: print "DEBUG: Checking match for %s and %s" % (rpm_name, existing_rpm_name) if existing_rpm_name == rpm_name: # This means the intended rpm is already in Satellite, so skip if options.verbose: print "- %s already in Satellite, skipping" % (rpm_name) break else: if options.verbose: print "+ %s is not in Satellite, adding" % (rpm_name) if options.debug: print "DEBUG: Calling: push_rpm(",rpm, channel, options.user, options.password, options.satserver, ")" returncode = push_rpm(rpm, channel, options.user, options.password, options.satserver) if not returncode == 0: print "rhnpush process exited with returncode:", returncode if returncode == 255: print "You may force package uploads with --force" sys.exit(1) print "Completed uploading rpms." if (not options.server_actions_only) and (not options.demo) and (not options.delete): # This is the client actions section print "Subscribing registered systems to the %s channel" % (PLATFORM_INDEPENDENT) client_systems = subscribe_clients(key) print "Scheduling software installation and actions on clients" client_systems = schedule_actions(key, client_systems) print "Waiting for client actions to complete" client_systems = get_action_results(key, client_systems) print "All actions completed.\n" show_client_results(client_systems) if not options.demo: logout(key)
07e2421549e748ccb09a392c60834eaea3e54917 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3457/07e2421549e748ccb09a392c60834eaea3e54917/dell-satellite-sync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 309, 702, 18, 27928, 30, 498, 273, 1083, 783, 67, 9114, 273, 2618, 783, 67, 4327, 67, 5336, 273, 10228, 30138, 292, 17, 92, 5292, 67, 1105, 17, 3567, 17, 25, 3546, 469, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 309, 702, 18, 27928, 30, 498, 273, 1083, 783, 67, 9114, 273, 2618, 783, 67, 4327, 67, 5336, 273, 10228, 30138, 292, 17, 92, 5292, 67, 1105, 17, 3567, 17, 25, 3546, 469, ...
"Binaries" : self.binarypath.getValue(),
def saveSettings(self, button): # save the settings to the registry here. Mostly it's simple stuff, will probably expand, # but for a first release, this should work OK #print self.rendererMenu.getValue() settings = { "renderer" : self.rendererMenu.getValue(), "Binaries" : self.binarypath.getValue(), "Shaders" : self.shaderpaths.getValue(), "Archives" : self.archivepaths.getValue(), "Textures" : self.texturepaths.getValue(), "Procedurals" : self.proceduralpaths.getValue(), "Displays" : self.displaypaths.getValue(), "outputPath" : self.outputpath.getValue(), "use_slparams" : self.useSlParams.getValue() } if self.haveSetup: Blender.Registry.RemoveKey("BtoR", True) Blender.Registry.SetKey("BtoR", settings, True) self.haveSetup = True
74bddf362fa2502791a0646abd613f6613d08c8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11560/74bddf362fa2502791a0646abd613f6613d08c8a/BtoRMain.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 2628, 12, 2890, 16, 3568, 4672, 468, 1923, 326, 1947, 358, 326, 4023, 2674, 18, 22099, 715, 518, 1807, 4143, 10769, 16, 903, 8656, 4542, 16, 468, 1496, 364, 279, 1122, 3992, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 2628, 12, 2890, 16, 3568, 4672, 468, 1923, 326, 1947, 358, 326, 4023, 2674, 18, 22099, 715, 518, 1807, 4143, 10769, 16, 903, 8656, 4542, 16, 468, 1496, 364, 279, 1122, 3992, 16, ...
context_id_info = self.pool.get('project.task').fields_get(cr, uid, ['context_id'])
context_id_info = self.pool.get('project.task').fields_get(cr, uid, ['context_id'], context=context)
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): res = super(project_task,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) search_extended = False timebox_obj = self.pool.get('project.gtd.timebox') access_pool = self.pool.get('ir.model.access') if (res['type'] == 'search') and access_pool.check_groups(cr, uid, "project_gtd.group_project_getting"): tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[])) search_extended ='''<newline/><group col="%d" expand="%d" string="%s">''' % (len(tt)+7,1,_('Getting Things Done')) search_extended += '''<filter domain="[('timebox_id','=', False)]" context="{'set_editable':True,'set_visible':True,'gtd_visible':True,'user_invisible':True}" icon="gtk-new" help="Undefined Timebox" string="%s"/>''' % (_('Inbox'),) search_extended += '''<filter context="{'set_editable':True,'set_visible':True,'gtd_visible':True,'user_invisible':True}" icon="gtk-new" help="Getting things done" string="%s"/>''' % (_('GTD'),) search_extended += '''<separator orientation="vertical"/>''' for time in tt: if time.icon: icon = time.icon else : icon="" search_extended += '''<filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" icon="''' + icon + '''" string="''' + time.name + '''" context="{'gtd_visible':True, 'user_invisible': True}"/>''' search_extended += ''' <separator orientation="vertical"/> <field name="context_id" select="1" widget="selection"/> </group> </search> ''' if search_extended: res['arch'] = unicode(res['arch'], 'utf8').replace('</search>', search_extended) attrs_sel = self.pool.get('project.gtd.context').name_search(cr, uid, '', [], context=context) context_id_info = self.pool.get('project.task').fields_get(cr, uid, ['context_id']) context_id_info['context_id']['selection'] = attrs_sel res['fields'].update(context_id_info) return res
52e91e76204d4fbbf8d07dda160212bf5f2eb648 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/52e91e76204d4fbbf8d07dda160212bf5f2eb648/project_gtd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1466, 67, 1945, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 1476, 67, 350, 33, 7036, 16, 1476, 67, 723, 2218, 687, 2187, 819, 33, 7036, 16, 12748, 33, 8381, 16, 27539, 33, 8381, 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, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1466, 67, 1945, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 1476, 67, 350, 33, 7036, 16, 1476, 67, 723, 2218, 687, 2187, 819, 33, 7036, 16, 12748, 33, 8381, 16, 27539, 33, 8381, 4672,...
with_width += 1 wplus = (w - used_width) / (len(self.container.children) - with_width)
without_width -= 1 if without_width: wplus = (w - used_width) / without_width else: wplus = 0
def layout(self): layout_style = self.container.style.get('layout', {}) if layout_style: padding = layout_style.get('padding', 0) else: padding = 0
f53e616ee8929e813855e8aca45fe6d6c5205385 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10761/f53e616ee8929e813855e8aca45fe6d6c5205385/ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3511, 12, 2890, 4672, 3511, 67, 4060, 273, 365, 18, 3782, 18, 4060, 18, 588, 2668, 6741, 2187, 2618, 13, 309, 3511, 67, 4060, 30, 4992, 273, 3511, 67, 4060, 18, 588, 2668, 9598, 2187, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3511, 12, 2890, 4672, 3511, 67, 4060, 273, 365, 18, 3782, 18, 4060, 18, 588, 2668, 6741, 2187, 2618, 13, 309, 3511, 67, 4060, 30, 4992, 273, 3511, 67, 4060, 18, 588, 2668, 9598, 2187, ...
import time from qt import QStringList, QProcess dir, fil, ext = fileparse(fn) tmpdir = platform.find_or_make_Nanorex_subdir('temp') mmpfile = os.path.join(tmpdir, fil + ".mmp") self.saveFile(mmpfile, brag=False) result = self.runBabel(mmpfile, fn) if result and os.path.exists(fn): env.history.message( "File exported: [ " + fn + " ]" ) else: print 'Problem:', mmpfile, '->', fn env.history.message(redmsg("File translation failed.")) self.glpane.scale = self.assy.bbox.scale() self.glpane.gl_update() self.mt.mt_update() dir, fil = os.path.split(fn) self.setCurrentWorkingDirectory(dir)
if platform.atom_debug: linenum() print 'file translation failed' print 'Problem:', mmpfile, '->', fn env.history.message(redmsg("File translation failed.")) self.glpane.scale = self.assy.bbox.scale() self.glpane.gl_update() self.mt.mt_update() dir, fil = os.path.split(fn) if platform.atom_debug: linenum() print 'fileExport changing working directory to %s' % repr(dir) self.setCurrentWorkingDirectory(dir) if platform.atom_debug: linenum() print 'finish fileExport()'
def fileExport(self): # Code copied from fileInsert() slot method. Mark 060731. """Slot method for 'File > Export'. """ cmd = greenmsg("Export File: ") # This format list generated from the Open Babel wiki page: # http://openbabel.sourceforge.net/wiki/Babel#File_Formats
c34d7d945d8ff6c872ce439bf596bb96c25753a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/c34d7d945d8ff6c872ce439bf596bb96c25753a8/ops_files.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 585, 6144, 12, 2890, 4672, 468, 3356, 9268, 628, 585, 4600, 1435, 4694, 707, 18, 6622, 374, 4848, 27, 6938, 18, 3536, 8764, 707, 364, 296, 812, 405, 11054, 10332, 3536, 1797, 273, 10004,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 585, 6144, 12, 2890, 4672, 468, 3356, 9268, 628, 585, 4600, 1435, 4694, 707, 18, 6622, 374, 4848, 27, 6938, 18, 3536, 8764, 707, 364, 296, 812, 405, 11054, 10332, 3536, 1797, 273, 10004,...
file = StringIO.StringIO(data)
file = BytesIO(data)
def test_parse_file(self): # Try parsing a file out = self.Outputter() parser = expat.ParserCreate(namespace_separator='!') parser.returns_unicode = 1 for name in self.handler_names: setattr(parser, name, getattr(out, name)) file = StringIO.StringIO(data)
7f37c666d735ff934d9f7837fe205cc955f11870 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/7f37c666d735ff934d9f7837fe205cc955f11870/test_pyexpat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2670, 67, 768, 12, 2890, 4672, 468, 6161, 5811, 279, 585, 596, 273, 365, 18, 1447, 387, 1435, 2082, 273, 1329, 270, 18, 2678, 1684, 12, 4937, 67, 11287, 2218, 5124, 13, 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, 1842, 67, 2670, 67, 768, 12, 2890, 4672, 468, 6161, 5811, 279, 585, 596, 273, 365, 18, 1447, 387, 1435, 2082, 273, 1329, 270, 18, 2678, 1684, 12, 4937, 67, 11287, 2218, 5124, 13, 2082,...
data_file += str(data_decl) + str(data_comp) + str(data_period) + str(data_clientinfo) + '\n</VatList>'
data_file += tools.ustr(data_decl) + tools.ustr(data_comp) + tools.ustr(data_period) + tools.ustr(data_clientinfo) + '\n</VatList>'
def _create_xml(self, cr, uid, data, context): datas=[] seq_controlref = pooler.get_pool(cr.dbname).get('ir.sequence').get(cr, uid,'controlref') seq_declarantnum = pooler.get_pool(cr.dbname).get('ir.sequence').get(cr, uid,'declarantnum') obj_cmpny = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id company_vat = obj_cmpny.partner_id.vat if not company_vat: raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
642160ddd7dbe9e1e9ff557768880da86ff79c67 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/642160ddd7dbe9e1e9ff557768880da86ff79c67/partner_vat_listing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 2902, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 5386, 33, 8526, 3833, 67, 7098, 1734, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2640, 67, 2902, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 5386, 33, 8526, 3833, 67, 7098, 1734, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 26...
str += '\\title{%s}\n' % self._text_to_latex(self._prj_name)
str += '\\title{%s}\n' % self._text_to_latex(self._prj_name, 1)
def _topfile(self): str = self._header('Inclue File')
1b5f466231dbfc7286669dc947d092bb3efedb7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1b5f466231dbfc7286669dc947d092bb3efedb7c/latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3669, 768, 12, 2890, 4672, 609, 273, 365, 6315, 3374, 2668, 382, 830, 344, 1387, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3669, 768, 12, 2890, 4672, 609, 273, 365, 6315, 3374, 2668, 382, 830, 344, 1387, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
child_process.stdin.close() status = child_process.wait()
child_process.communicate() value = child_process.returncode
def do_alignment(command_line, alphabet=None): """Perform an alignment with the given command line. Arguments: o command_line - A command line object that can give out the command line we will input into clustalw. o alphabet - the alphabet to use in the created alignment. If not specified IUPAC.unambiguous_dna and IUPAC.protein will be used for dna and protein alignment respectively. Returns: o A clustal alignment object corresponding to the created alignment. If the alignment type was not a clustal object, None is returned. """ #Try and use subprocess (available in python 2.4+) try : import subprocess #We don't need to supply any piped input, but we setup the #standard input pipe anyway as a work around for a python #bug if this is called from a Windows GUI program. For #details, see http://bugs.python.org/issue1124861 child_process = subprocess.Popen(str(command_line), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform!="win32") ) child_process.stdin.close() status = child_process.wait() except ImportError : #Fall back for python 2.3 run_clust = os.popen(str(command_line)) status = run_clust.close() # The exit status is the second byte of the termination status # TODO - Check this holds on win32... value = 0 if status: value = status / 256 # check the return value for errors, as on 1.81 the return value # from Clustalw is actually helpful for figuring out errors # 1 => bad command line option if value == 1: raise ValueError("Bad command line option in the command: %s" % str(command_line)) # 2 => can't open sequence file elif value == 2: raise IOError("Cannot open sequence file %s" % command_line.sequence_file) # 3 => wrong format in sequence file elif value == 3: raise IOError("Sequence file %s has an invalid format." % command_line.sequence_file) # 4 => sequence file only has one sequence elif value == 4: raise IOError("Sequence file %s has only one sequence present." % command_line.sequence_file) # if an output file was specified, we need to grab it if command_line.output_file: out_file = command_line.output_file else: out_file = os.path.splitext(command_line.sequence_file)[0] + '.aln' # if we can't deal with the format, just return None if command_line.output_type and command_line.output_type != 'CLUSTAL': return None # otherwise parse it into a ClustalAlignment object else: if not alphabet: alphabet = (IUPAC.unambiguous_dna, IUPAC.protein)[ command_line.type == 'PROTEIN'] # check if the outfile exists before parsing if not(os.path.exists(out_file)): raise IOError("Output .aln file %s not produced, commandline: %s" % (out_file, command_line)) return parse_file(out_file, alphabet)
d1cebedc8eab60c55286affd30aa358cc95df2a4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/d1cebedc8eab60c55286affd30aa358cc95df2a4/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 14409, 12, 3076, 67, 1369, 16, 10877, 33, 7036, 4672, 3536, 4990, 392, 8710, 598, 326, 864, 1296, 980, 18, 225, 13599, 30, 320, 1296, 67, 1369, 300, 432, 1296, 980, 733, 716, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14409, 12, 3076, 67, 1369, 16, 10877, 33, 7036, 4672, 3536, 4990, 392, 8710, 598, 326, 864, 1296, 980, 18, 225, 13599, 30, 320, 1296, 67, 1369, 300, 432, 1296, 980, 733, 716, ...
prod_pool=self.pool.get('product.product')
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): if context is None: context = {} company_id = context.get('company_id',False) if not partner_id: raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") ) if not product: if type in ('in_invoice', 'in_refund'): return {'value': {'categ_id': False}, 'domain':{'product_uom':[]}} else: return {'value': {'price_unit': 0.0, 'categ_id': False}, 'domain':{'product_uom':[]}} part = self.pool.get('res.partner').browse(cr, uid, partner_id) fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False
9d3752728703af0f57a66468fda2058d9e5cfcdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9d3752728703af0f57a66468fda2058d9e5cfcdc/invoice.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3017, 67, 350, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 3017, 16, 582, 362, 16, 26667, 33, 20, 16, 508, 2218, 2187, 618, 2218, 659, 67, 16119, 2187, 19170, 67, 350, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3017, 67, 350, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 3017, 16, 582, 362, 16, 26667, 33, 20, 16, 508, 2218, 2187, 618, 2218, 659, 67, 16119, 2187, 19170, 67, 350, 33, ...
tx.setTextWordSpacing(1.0 * extraspace / len(words))
tx.setWordSpace(extraspace / float(len(words)-1))
def drawPara(self,debug=0): """Draws a paragraph according to the given style. Returns the final y position at the bottom. Not safe for paragraphs without spaces e.g. Japanese; wrapping algorithm will go infinite."""
3dd09ba0a8c191e9a461830ab6d4962f0799d9a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/3dd09ba0a8c191e9a461830ab6d4962f0799d9a6/layout.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 23529, 12, 2890, 16, 4148, 33, 20, 4672, 3536, 25113, 279, 10190, 4888, 358, 326, 864, 2154, 18, 2860, 326, 727, 677, 1754, 622, 326, 5469, 18, 2288, 4183, 364, 24552, 2887, 7292, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3724, 23529, 12, 2890, 16, 4148, 33, 20, 4672, 3536, 25113, 279, 10190, 4888, 358, 326, 864, 2154, 18, 2860, 326, 727, 677, 1754, 622, 326, 5469, 18, 2288, 4183, 364, 24552, 2887, 7292, ...
sizer.Add(text2, 1, wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, padding) text2.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.NORMAL))
sizer.Add(text2, 1, wx.ALIGN_CENTER) text2.SetFont(font)
def __init__(self, parent, bmp): padding = 7 # padding under and right of the progress percent text (in pixels) fontsize = 12 # font size of the progress text (in pixels) super(StartupSplash, self).__init__(parent=parent, title=_(u'Chandler starting...'), style=wx.SIMPLE_BORDER) sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(sizer) self.CenterOnScreen() self.SetBackgroundColour(wx.WHITE)
ea56cab82d96d9ef8b515666658423a7e87ee79a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/ea56cab82d96d9ef8b515666658423a7e87ee79a/Application.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 324, 1291, 4672, 4992, 273, 2371, 377, 468, 4992, 3613, 471, 2145, 434, 326, 4007, 5551, 977, 261, 267, 8948, 13, 14869, 273, 2593, 282, 468, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 982, 16, 324, 1291, 4672, 4992, 273, 2371, 377, 468, 4992, 3613, 471, 2145, 434, 326, 4007, 5551, 977, 261, 267, 8948, 13, 14869, 273, 2593, 282, 468, 35...
printer = get_pdf_printer() printer.setPaperSize(QSizeF(self.size[0] * 10, self.size[1] * 10), QPrinter.Millimeter) printer.setPageMargins(0, 0, 0, 0, QPrinter.Point) printer.setOrientation(orientation(self.opts.orientation)) printer.setOutputFormat(QPrinter.PdfFormat)
printer = get_pdf_printer(self.opts)
def render_images(self, outpath, mi, items): printer = get_pdf_printer() printer.setPaperSize(QSizeF(self.size[0] * 10, self.size[1] * 10), QPrinter.Millimeter) printer.setPageMargins(0, 0, 0, 0, QPrinter.Point) printer.setOrientation(orientation(self.opts.orientation)) printer.setOutputFormat(QPrinter.PdfFormat) printer.setOutputFileName(outpath) printer.setDocName(mi.title) printer.setCreator(u'%s [%s]'%(__appname__, __version__)) # Seems to be no way to set author printer.setFullPage(True)
30050f00334c855e9f432f7a0ceb581cd4e5eee2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/30050f00334c855e9f432f7a0ceb581cd4e5eee2/writer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 7369, 12, 2890, 16, 596, 803, 16, 12837, 16, 1516, 4672, 12539, 273, 336, 67, 7699, 67, 30439, 12, 2890, 18, 4952, 13, 12539, 18, 542, 1447, 4771, 12, 659, 803, 13, 12539, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 7369, 12, 2890, 16, 596, 803, 16, 12837, 16, 1516, 4672, 12539, 273, 336, 67, 7699, 67, 30439, 12, 2890, 18, 4952, 13, 12539, 18, 542, 1447, 4771, 12, 659, 803, 13, 12539, ...
return _apply(s.index, args)
return s.index(*args)
def index(s, *args): """index(s, sub [,start [,end]]) -> int Like find but raises ValueError when the substring is not found. """ return _apply(s.index, args)
722edbc15fc2faab0937de48f2fc8ce9eaa963d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/722edbc15fc2faab0937de48f2fc8ce9eaa963d1/string.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 12, 87, 16, 380, 1968, 4672, 3536, 1615, 12, 87, 16, 720, 306, 16, 1937, 306, 16, 409, 65, 5717, 317, 509, 225, 23078, 1104, 1496, 14183, 2068, 1347, 326, 3019, 353, 486, 1392, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 12, 87, 16, 380, 1968, 4672, 3536, 1615, 12, 87, 16, 720, 306, 16, 1937, 306, 16, 409, 65, 5717, 317, 509, 225, 23078, 1104, 1496, 14183, 2068, 1347, 326, 3019, 353, 486, 1392, ...
cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), password.encode('utf-8')))
if password: cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), password.encode('utf-8'))) else: cr.execute('select id from res_users where login=%s and password is null and active', (login.encode('utf-8'),))
def login(db, login, password): cr = pooler.get_db(db).cursor() cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), password.encode('utf-8'))) res = cr.fetchone() cr.close() if res: return res[0] else: return False
655eada141079901ef8fb16eea5890a92db19608 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/655eada141079901ef8fb16eea5890a92db19608/security.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 1966, 16, 3925, 16, 2201, 4672, 4422, 273, 2845, 264, 18, 588, 67, 1966, 12, 1966, 2934, 9216, 1435, 309, 2201, 30, 4422, 18, 8837, 2668, 4025, 612, 628, 400, 67, 5577, 1625,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 1966, 16, 3925, 16, 2201, 4672, 4422, 273, 2845, 264, 18, 588, 67, 1966, 12, 1966, 2934, 9216, 1435, 309, 2201, 30, 4422, 18, 8837, 2668, 4025, 612, 628, 400, 67, 5577, 1625,...
p = _pool(listeners=[snoop])
p = self._queuepool_fixture(listeners=[snoop])
def assert_listeners(p, total, conn, fconn, cout, cin): for instance in (p, p.recreate()): self.assert_(len(instance.dispatch.on_connect) == conn) self.assert_(len(instance.dispatch.on_first_connect) == fconn) self.assert_(len(instance.dispatch.on_checkout) == cout) self.assert_(len(instance.dispatch.on_checkin) == cin)
7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4/test_pool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1815, 67, 16072, 12, 84, 16, 2078, 16, 1487, 16, 284, 4646, 16, 276, 659, 16, 276, 267, 4672, 364, 791, 316, 261, 84, 16, 293, 18, 266, 2640, 1435, 4672, 365, 18, 11231, 67, 12, 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, 1815, 67, 16072, 12, 84, 16, 2078, 16, 1487, 16, 284, 4646, 16, 276, 659, 16, 276, 267, 4672, 364, 791, 316, 261, 84, 16, 293, 18, 266, 2640, 1435, 4672, 365, 18, 11231, 67, 12, 18...
self.__sturm_bound = self.group().sturm_bound(self.weight())+1
self.__sturm_bound = G.sturm_bound(self.weight())+1
def sturm_bound(self, M=None): r""" For a space M of modular forms, this function returns an integer B such that two modular forms in either self or M are equal if and only if their q-expansions are equal to precision B (note that this is 1+ the usual Sturm bound, since `O(q^\mathrm{prec})` has precision prec). If M is none, then M is set equal to self. EXAMPLES:: sage: S37=CuspForms(37,2) sage: S37.sturm_bound() 8 sage: M = ModularForms(11,2) sage: M.sturm_bound() 3 sage: ModularForms(Gamma1(15),2).sturm_bound() 33 .. note::
effc3ad03fe4dd602c740e2cd93685b34d86c56c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/effc3ad03fe4dd602c740e2cd93685b34d86c56c/space.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 384, 27430, 67, 3653, 12, 2890, 16, 490, 33, 7036, 4672, 436, 8395, 2457, 279, 3476, 490, 434, 681, 2490, 10138, 16, 333, 445, 1135, 392, 3571, 605, 4123, 716, 2795, 681, 2490, 10138, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 384, 27430, 67, 3653, 12, 2890, 16, 490, 33, 7036, 4672, 436, 8395, 2457, 279, 3476, 490, 434, 681, 2490, 10138, 16, 333, 445, 1135, 392, 3571, 605, 4123, 716, 2795, 681, 2490, 10138, ...
b2.util.path.relpath(parent_dir, our_dir))
os.path.relpath(our_dir, parent_dir)) attributes.set("build-dir", build_dir, exact=True)
def inherit_attributes(self, project_module, parent_module): """Make 'project-module' inherit attributes of project root and parent module."""
3c3d67ecb01ccdc6843e7d00cf7995220a75c4d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9981/3c3d67ecb01ccdc6843e7d00cf7995220a75c4d8/project.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6811, 67, 4350, 12, 2890, 16, 1984, 67, 2978, 16, 982, 67, 2978, 4672, 3536, 6464, 296, 4406, 17, 2978, 11, 6811, 1677, 434, 1984, 1365, 471, 982, 1605, 12123, 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, 6811, 67, 4350, 12, 2890, 16, 1984, 67, 2978, 16, 982, 67, 2978, 4672, 3536, 6464, 296, 4406, 17, 2978, 11, 6811, 1677, 434, 1984, 1365, 471, 982, 1605, 12123, 2, -100, -100, -100, -10...
if path_mv > path_to and (position is gtk.TREE_VIEW_DROP_AFTER or position is gtk.TREE_VIEW_DROP_INTO_OR_AFTER):
if position is gtk.TREE_VIEW_DROP_AFTER or\ position is gtk.TREE_VIEW_DROP_INTO_OR_AFTER:
def _on_pres_drag_received(self, treeview, context, x, y, selection, info, timestamp): 'A presentation was reordered.' drop_info = treeview.get_dest_row_at_pos(x, y) model = treeview.get_model() sched = self.pres_list.get_model() #Gets the current schedule path_mv = int(selection.data) if drop_info: path_to, position = drop_info itr_to = sched.get_iter(path_to) else: #Assumes that if there's no drop info, it's at the end of the list path_to = path_mv + 1 position = gtk.TREE_VIEW_DROP_BEFORE itr_to = None itr_mv = sched.get_iter(path_mv) if path_mv > path_to and (position is gtk.TREE_VIEW_DROP_AFTER or position is gtk.TREE_VIEW_DROP_INTO_OR_AFTER): sched.move_after(itr_mv, itr_to) elif path_mv < path_to and (position is gtk.TREE_VIEW_DROP_BEFORE or position is gtk.TREE_VIEW_DROP_INTO_OR_BEFORE): sched.move_before(itr_mv, itr_to) context.finish(True, False) return
598d936f4ccb2c969aa88c0d39fef9a487eebd27 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5029/598d936f4ccb2c969aa88c0d39fef9a487eebd27/application.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 265, 67, 12202, 67, 15997, 67, 15213, 12, 2890, 16, 2151, 1945, 16, 819, 16, 619, 16, 677, 16, 4421, 16, 1123, 16, 2858, 4672, 296, 37, 22525, 1703, 283, 9885, 1093, 3640, 67, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 265, 67, 12202, 67, 15997, 67, 15213, 12, 2890, 16, 2151, 1945, 16, 819, 16, 619, 16, 677, 16, 4421, 16, 1123, 16, 2858, 4672, 296, 37, 22525, 1703, 283, 9885, 1093, 3640, 67, 1...
QFrame.__init__(self,parent,name)
print "don't know about type == %r" % (type,)
def __init__(self, parent = None, desc = None, name = None, modal = 0, fl = 0, env = None, is_dialog = True): if env is None: import env # this is a little weird... probably it'll be ok, and logically it seems correct. self.desc = desc
c73ef807a157ef1b98d95dae6f4d28dad060cbcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/c73ef807a157ef1b98d95dae6f4d28dad060cbcc/ParameterDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 273, 599, 16, 3044, 273, 599, 16, 508, 273, 599, 16, 13010, 273, 374, 16, 1183, 273, 374, 16, 1550, 273, 599, 16, 353, 67, 12730, 273, 1053, 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, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 273, 599, 16, 3044, 273, 599, 16, 508, 273, 599, 16, 13010, 273, 374, 16, 1183, 273, 374, 16, 1550, 273, 599, 16, 353, 67, 12730, 273, 1053, 4672,...
f1 = open(file1) f2 = open(file2)
f1 = open(file1, 'rb') f2 = open(file2, 'rb')
def DoCompare(file1, file2): f1 = open(file1) f2 = open(file2) d1 = f1.read() d2 = f2.read() f1.close() f2.close() if (d1 == d2): print "OK" else: raise("Files " + file + " and " + file2 + " do not match")
ccb0fe62ee9273ea776dcfb81b0a3950de89563f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5710/ccb0fe62ee9273ea776dcfb81b0a3950de89563f/Bento4CryptoTester.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2256, 8583, 12, 768, 21, 16, 225, 585, 22, 4672, 284, 21, 273, 1696, 12, 768, 21, 16, 296, 6731, 6134, 284, 22, 273, 1696, 12, 768, 22, 16, 296, 6731, 6134, 225, 302, 21, 273, 284,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2256, 8583, 12, 768, 21, 16, 225, 585, 22, 4672, 284, 21, 273, 1696, 12, 768, 21, 16, 296, 6731, 6134, 284, 22, 273, 1696, 12, 768, 22, 16, 296, 6731, 6134, 225, 302, 21, 273, 284,...
f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
first = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR) second = os.dup(first) try: retries = 0 while second != first + 1: os.close(first) retries += 1 if retries > 10: print("couldn't allocate two consecutive fds, " "skipping test_closerange", file=sys.stderr) return first, second = second, os.dup(second) finally: os.close(second)
def test_closerange(self): f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR) # close a fd that is open, and one that isn't os.closerange(f, f+2) self.assertRaises(OSError, os.write, f, "a")
44e93539cc516f21e5099aec1c4bbed7edb0b79c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/44e93539cc516f21e5099aec1c4bbed7edb0b79c/test_os.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 27736, 726, 12, 2890, 4672, 1122, 273, 1140, 18, 3190, 12, 13261, 18, 16961, 19793, 16, 1140, 18, 51, 67, 5458, 789, 96, 538, 18, 51, 67, 20403, 7181, 13, 565, 2205, 273, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 27736, 726, 12, 2890, 4672, 1122, 273, 1140, 18, 3190, 12, 13261, 18, 16961, 19793, 16, 1140, 18, 51, 67, 5458, 789, 96, 538, 18, 51, 67, 20403, 7181, 13, 565, 2205, 273, 1...
if (optlevel==1): cmd += ' ' if (optlevel==2): cmd += ' '
if (optlevel==1): cmd += ' -D_DEBUG' if (optlevel==2): cmd += ' -D_DEBUG'
def CompileIgate(woutd,wsrc,opts): outbase = os.path.basename(woutd)[:-3] woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx" wobj = FindLocation(outbase + "_igate.obj", []) srcdir = GetValueOption(opts, "SRCDIR:") module = GetValueOption(opts, "IMOD:") library = GetValueOption(opts, "ILIB:") ipath = GetListOption(opts, "DIR:") if (PkgSkip("PYTHON")): WriteFile(woutc,"") WriteFile(woutd,"") CompileCxx(wobj,woutc,opts) ConditionalWriteFile(woutd,"") return cmd = GetOutputDir()+"/bin/interrogate -srcdir "+srcdir+" -I"+srcdir cmd += ' -Dvolatile -Dmutable' if (COMPILER=="MSVC"): cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32' #NOTE: this 1500 value is the version number for VC2008. cmd += ' -D_MSC_VER=1500 -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall' if (COMPILER=="LINUX") and (platform.architecture()[0]=="64bit"): cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D__const=const -D_LP64' if (COMPILER=="LINUX") and (platform.architecture()[0]=="32bit"): cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D__const=const -D__i386__' optlevel=GetOptimizeOption(opts) if (optlevel==1): cmd += ' ' if (optlevel==2): cmd += ' ' if (optlevel==3): cmd += ' -DFORCE_INLINING' if (optlevel==4): cmd += ' -DNDEBUG -DFORCE_INLINING' cmd += ' -oc ' + woutc + ' -od ' + woutd cmd += ' -fnames -string -refcount -assert -python-native' cmd += ' -S' + GetOutputDir() + '/include/parser-inc' for x in ipath: cmd += ' -I' + BracketNameWithQuotes(x) for (opt,dir) in INCDIRECTORIES: if (opt=="ALWAYS") or (opts.count(opt)): cmd += ' -S' + BracketNameWithQuotes(dir) for (opt,var,val) in DEFSYMBOLS: if (opt=="ALWAYS") or (opts.count(opt)): cmd += ' -D' + var + '=' + val building = GetValueOption(opts, "BUILDING:") if (building): cmd += " -DBUILDING_"+building if ("LINK_ALL_STATIC" in opts): cmd += " -DLINK_ALL_STATIC" cmd += ' -module ' + module + ' -library ' + library for x in wsrc: cmd += ' ' + BracketNameWithQuotes(os.path.basename(x)) oscmd(cmd) CompileCxx(wobj,woutc,opts) return
1988a0def18227c103bda4f23b9cdbc345b99d9b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/1988a0def18227c103bda4f23b9cdbc345b99d9b/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16143, 45, 10115, 12, 91, 659, 72, 16, 4749, 1310, 16, 4952, 4672, 596, 1969, 273, 1140, 18, 803, 18, 13909, 12, 91, 659, 72, 13, 10531, 17, 23, 65, 341, 659, 71, 273, 968, 1447, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16143, 45, 10115, 12, 91, 659, 72, 16, 4749, 1310, 16, 4952, 4672, 596, 1969, 273, 1140, 18, 803, 18, 13909, 12, 91, 659, 72, 13, 10531, 17, 23, 65, 341, 659, 71, 273, 968, 1447, 1...
scsi_dev_sysfs = "/sys/block/" + scsi_dev + "/device/scsi_device" udev_op = "/bin/ls -l " + scsi_dev_sysfs + "*"
scsi_dev_sysfs = "/sys/block/" + scsi_dev + "/device" udev_op = "/bin/ls -l " + scsi_dev_sysfs
def pscsi_createvirtdev(path, params):
d05a73a285262c8c803be130efd73e3d6562be6f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8449/d05a73a285262c8c803be130efd73e3d6562be6f/tcm_pscsi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 1017, 7722, 67, 2640, 14035, 5206, 12, 803, 16, 859, 4672, 225, 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,...
[ 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, 293, 1017, 7722, 67, 2640, 14035, 5206, 12, 803, 16, 859, 4672, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
vbox_buttons.set_size_request(121, -1) hbox.set_size_request(-1, 470)
def __init__(self, model, obj_id, parent): self.dialog = gtk.Dialog( title = _("Attachment"), parent = parent, flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT | gtk.WIN_POS_CENTER_ON_PARENT | gtk.gdk.WINDOW_TYPE_HINT_DIALOG,) dialog_vbox = gtk.VBox() dialog_vbox.set_size_request(740,590) vpaned = gtk.VPaned() vpaned.set_position(432) dialog_vbox.pack_start(vpaned, True, True, 0) hpaned2 = gtk.HPaned() hpaned2.set_position(553) vpaned.pack1(hpaned2, False, True) vbox_preview = gtk.VBox(False, 0) hpaned2.pack1(vbox_preview, False, True) self.attach_filename = gtk.Label(_("Preview:")) vbox_preview.pack_start(self.attach_filename, False, False, 0)
b8afe78a9bd4cf45f26deeec30919fe280b56452 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/b8afe78a9bd4cf45f26deeec30919fe280b56452/attachment.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 938, 16, 1081, 67, 350, 16, 982, 4672, 365, 18, 12730, 273, 22718, 18, 6353, 12, 2077, 273, 225, 389, 2932, 6803, 6, 3631, 982, 273, 982, 16, 2943, 273...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 938, 16, 1081, 67, 350, 16, 982, 4672, 365, 18, 12730, 273, 22718, 18, 6353, 12, 2077, 273, 225, 389, 2932, 6803, 6, 3631, 982, 273, 982, 16, 2943, 273...
drv_module = apply(imp.load_module, info)
drv_module = _imp.load_module(*info)
def _create_parser(parser_name): info = _rec_find_module(parser_name) drv_module = apply(imp.load_module, info) return drv_module.create_parser()
43010c9f3abf1aeb5adbe11344cd928edba5878e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/43010c9f3abf1aeb5adbe11344cd928edba5878e/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 4288, 12, 4288, 67, 529, 4672, 1123, 273, 389, 3927, 67, 4720, 67, 2978, 12, 4288, 67, 529, 13, 302, 4962, 67, 2978, 273, 389, 14532, 18, 945, 67, 2978, 30857, 1376, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 4288, 12, 4288, 67, 529, 4672, 1123, 273, 389, 3927, 67, 4720, 67, 2978, 12, 4288, 67, 529, 13, 302, 4962, 67, 2978, 273, 389, 14532, 18, 945, 67, 2978, 30857, 1376, 1...
print "Enter 'quit' to leave this interactive mode"
if verbosity >= VERB_STD: print "Enter 'quit' to leave this interactive mode"
def ttyloop(task, nodeset, gather, timeout, label): """Manage the interactive prompt to run command""" has_readline = False if task.info("USER_interactive"): assert sys.stdin.isatty() readline_avail = False try: import readline readline_setup() readline_avail = True except ImportError: pass print "Enter 'quit' to leave this interactive mode" rc = 0 ns = NodeSet(nodeset) ns_info = True cmd = "" while task.info("USER_running") or cmd.lower() != 'quit': try: if task.info("USER_interactive") and not task.info("USER_running"): if ns_info: print "Working with nodes: %s" % ns ns_info = False prompt = "clush> " else: prompt = "" cmd = raw_input(prompt) except EOFError: print return except UpdatePromptException: if task.info("USER_interactive"): continue return if task.info("USER_running"): ns_reg, ns_unreg = NodeSet(), NodeSet() for c in task._engine.clients(): if c.registered: ns_reg.add(c.key) else: ns_unreg.add(c.key) if ns_unreg: pending = "\nclush: pending(%d): %s" % (len(ns_unreg), ns_unreg) else: pending = "" print >>sys.stderr, "clush: interrupt (^C to abort task)\n" \ "clush: in progress(%d): %s%s" % (len(ns_reg), ns_reg, pending) else: cmdl = cmd.lower() try: ns_info = True if cmdl.startswith('+'): ns.update(cmdl[1:]) elif cmdl.startswith('-'): ns.difference_update(cmdl[1:]) elif cmdl.startswith('@'): ns = NodeSet(cmdl[1:]) elif not cmdl.startswith('?'): # if ?, just print ns_info ns_info = False except NodeSetParseError: print >>sys.stderr, "clush: nodeset parse error (ignoring)" if ns_info: continue if cmdl.startswith('!'): run_command(task, cmd[1:], None, gather, timeout, None) elif cmdl != "quit": if not cmd: continue if readline_avail: readline.write_history_file(get_history_file()) run_command(task, cmd, ns, gather, timeout, label) return rc
5167874ae64af9b176b7e4ba878c2ae933f4f9e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11479/5167874ae64af9b176b7e4ba878c2ae933f4f9e6/clush.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21520, 6498, 12, 4146, 16, 2199, 278, 16, 11090, 16, 2021, 16, 1433, 4672, 3536, 21258, 326, 12625, 6866, 358, 1086, 1296, 8395, 711, 67, 896, 1369, 273, 1083, 309, 1562, 18, 1376, 2932,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21520, 6498, 12, 4146, 16, 2199, 278, 16, 11090, 16, 2021, 16, 1433, 4672, 3536, 21258, 326, 12625, 6866, 358, 1086, 1296, 8395, 711, 67, 896, 1369, 273, 1083, 309, 1562, 18, 1376, 2932,...
self._printer = pAdicPrinter(self, print_mode, True, None, None, None)
self._printer = pAdicPrinter(self, print_mode)
def __init__(self, p, prec, print_mode, names, element_class): sage.rings.padics.local_generic.LocalGeneric.__init__(self, prec, names) #if prec <= 100: # self.prime_pow = PowComputer(p, prec, prec, self.is_field()) #else: # self.prime_pow = PowComputer(p, 3, prec, self.is_field()) self._printer = pAdicPrinter(self, print_mode, True, None, None, None) self._element_class = element_class
30a764f77f807a9f30b4503dfb3c45d3268a9450 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/30a764f77f807a9f30b4503dfb3c45d3268a9450/padic_generic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 293, 16, 13382, 16, 1172, 67, 3188, 16, 1257, 16, 930, 67, 1106, 4672, 272, 410, 18, 86, 899, 18, 6982, 2102, 18, 3729, 67, 13540, 18, 2042, 7014, 1618...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 293, 16, 13382, 16, 1172, 67, 3188, 16, 1257, 16, 930, 67, 1106, 4672, 272, 410, 18, 86, 899, 18, 6982, 2102, 18, 3729, 67, 13540, 18, 2042, 7014, 1618...
print 'WARNING: ' + warning
print 'WARNING: ' + str(warning)
def eclass_teilar_gr(): b = StringIO.StringIO() fd, cookie_path = tempfile.mkstemp(prefix='eclass_', dir='/tmp') login_form_seq = [ ('uname', settings.ECLASS_USER), ('pass', settings.ECLASS_PASSWORD), ('submit', 'E%95%CE%AF%CF%83%CE%BF%CE%B4%CE%BF%CF%82') ] login_form_data = urllib.urlencode(login_form_seq) conn.setopt(pycurl.FOLLOWLOCATION, 1) conn.setopt(pycurl.COOKIEFILE, cookie_path) conn.setopt(pycurl.COOKIEJAR, cookie_path) conn.setopt(pycurl.URL, 'http://openclass.teilar.gr/index.php') conn.setopt(pycurl.POST, 1) conn.setopt(pycurl.POSTFIELDS, login_form_data) conn.setopt(pycurl.WRITEFUNCTION, b.write) conn.perform() output = unicode(b.getvalue(), 'utf-8', 'ignore') soup = BeautifulSoup(output).find('table', 'FormData') i = 0 lessonslist = soup.findAll('a') for item in lessonslist: if (i%2 == 0): cid = str(soup.findAll('a')[i].contents[0]).split('-')[0] lesson = '' for j in xrange(len((soup.findAll('a')[i].contents[0]).split('-')) - 1): lesson += str(soup.findAll('a')[i].contents[0]).split('-')[j+1].strip() + ' ' eclass = Id( urlid = str(cid), name = lesson.strip(), department = '', email = '', ) try: eclass.save() print 'ADDED ' + lesson.strip() except IntegrityError: pass except MySQLdb.Warning, warning: print 'ADDED ' + lesson.strip() print 'WARNING: ' + warning pass except Exception as error: print 'ERROR: ' + lesson.strip() print 'ERROR: ' + str(error) pass i += 1 os.close(fd) os.remove(cookie_path)
61dba877c00de51c45a686c602b61eee135ffedc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11011/61dba877c00de51c45a686c602b61eee135ffedc/id.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 425, 1106, 67, 736, 5611, 67, 3197, 13332, 324, 273, 15777, 18, 780, 4294, 1435, 5194, 16, 3878, 67, 803, 273, 13275, 18, 24816, 19781, 84, 12, 3239, 2218, 557, 459, 67, 2187, 1577, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 425, 1106, 67, 736, 5611, 67, 3197, 13332, 324, 273, 15777, 18, 780, 4294, 1435, 5194, 16, 3878, 67, 803, 273, 13275, 18, 24816, 19781, 84, 12, 3239, 2218, 557, 459, 67, 2187, 1577, 22...
href = '
href = hash_char + node['refid']
def visit_reference(self, node): # for pdflatex hyperrefs might be supported if node.has_key('refuri'): href = node['refuri'] elif node.has_key('refid'): href = '#' + node['refid'] elif node.has_key('refname'): href = '#' + self.document.nameids[node['refname']] ##self.body.append('[visit_reference]') self.body.append('\\href{%s}{' % href)
51da635e400baa72cb517e802318c85e072209f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/51da635e400baa72cb517e802318c85e072209f3/latex2e.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 6180, 12, 2890, 16, 756, 4672, 468, 364, 8169, 26264, 9512, 9316, 4825, 506, 3260, 309, 756, 18, 5332, 67, 856, 2668, 1734, 1650, 11, 4672, 3897, 273, 756, 3292, 1734, 1650, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3757, 67, 6180, 12, 2890, 16, 756, 4672, 468, 364, 8169, 26264, 9512, 9316, 4825, 506, 3260, 309, 756, 18, 5332, 67, 856, 2668, 1734, 1650, 11, 4672, 3897, 273, 756, 3292, 1734, 1650, ...
self.execBegin()
self.execBegin(first=False)
def popCurrent(self): if len(self.dialog_stack): self.current_dialog = self.dialog_stack.pop() self.execBegin() else: self.current_dialog = None
5e74dc98aad36025621d14b36faeb0c649bf8b9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/5e74dc98aad36025621d14b36faeb0c649bf8b9b/mytest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1843, 3935, 12, 2890, 4672, 309, 562, 12, 2890, 18, 12730, 67, 3772, 4672, 365, 18, 2972, 67, 12730, 273, 365, 18, 12730, 67, 3772, 18, 5120, 1435, 365, 18, 4177, 8149, 12, 3645, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1843, 3935, 12, 2890, 4672, 309, 562, 12, 2890, 18, 12730, 67, 3772, 4672, 365, 18, 2972, 67, 12730, 273, 365, 18, 12730, 67, 3772, 18, 5120, 1435, 365, 18, 4177, 8149, 12, 3645, 33, ...
user = os.environ.get('LOGNAME')
user = getpass.getuser()
def __init__(self, path, user, server, print_log, debug, reply_debug): """ Create a cached instance of a connection to the frontend
4055514746960c04d184f50bc7b806c49a5c0370 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/4055514746960c04d184f50bc7b806c49a5c0370/frontend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 589, 16, 729, 16, 1438, 16, 1172, 67, 1330, 16, 1198, 16, 4332, 67, 4148, 4672, 3536, 1788, 279, 3472, 791, 434, 279, 1459, 358, 326, 15442, 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, 1001, 2738, 972, 12, 2890, 16, 589, 16, 729, 16, 1438, 16, 1172, 67, 1330, 16, 1198, 16, 4332, 67, 4148, 4672, 3536, 1788, 279, 3472, 791, 434, 279, 1459, 358, 326, 15442, 2, -100, -...
>>> plt.subplot(121)
def hanning(M): """ Return the Hanning window. The Hanning window is a taper formed by using a weighted cosine. Parameters ---------- M : int Number of points in the output window. If zero or less, an empty array is returned. Returns ------- out : ndarray, shape(M,) The window, normalized to one (the value one appears only if `M` is odd). See Also -------- bartlett, blackman, hamming, kaiser Notes ----- The Hanning window is defined as .. math:: w(n) = 0.5 - 0.5cos\\left(\\frac{2\\pi{n}}{M-1}\\right) \\qquad 0 \\leq n \\leq M-1 The Hanning was named for Julius van Hann, an Austrian meterologist. It is also known as the Cosine Bell. Some authors prefer that it be called a Hann window, to help avoid confusion with the very similar Hamming window. Most references to the Hanning window come from the signal processing literature, where it is used as one of many windowing functions for smoothing values. It is also known as an apodization (which means "removing the foot", i.e. smoothing discontinuities at the beginning and end of the sampled signal) or tapering function. References ---------- .. [1] Blackman, R.B. and Tukey, J.W., (1958) The measurement of power spectra, Dover Publications, New York. .. [2] E.R. Kanasewich, "Time Sequence Analysis in Geophysics", The University of Alberta Press, 1975, pp. 106-108. .. [3] Wikipedia, "Window function", http://en.wikipedia.org/wiki/Window_function .. [4] W.H. Press, B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling, "Numerical Recipes", Cambridge University Press, 1986, page 425. Examples -------- >>> from numpy import hanning >>> hanning(12) array([ 0. , 0.07937323, 0.29229249, 0.57115742, 0.82743037, 0.97974649, 0.97974649, 0.82743037, 0.57115742, 0.29229249, 0.07937323, 0. ]) Plot the window and its frequency response: >>> from numpy.fft import fft, fftshift >>> import matplotlib.pyplot as plt >>> window = np.hanning(51) >>> plt.subplot(121) >>> plt.plot(window) >>> plt.title("Hann window") >>> plt.ylabel("Amplitude") >>> plt.xlabel("Sample") >>> A = fft(window, 2048) / 25.5 >>> mag = abs(fftshift(A)) >>> freq = np.linspace(-0.5,0.5,len(A)) >>> response = 20*np.log10(mag) >>> response = np.clip(response,-100,100) >>> plt.subplot(122) >>> plt.plot(freq, response) >>> plt.title("Frequency response of the Hann window") >>> plt.ylabel("Magnitude [dB]") >>> plt.xlabel("Normalized frequency [cycles per sample]") >>> plt.axis('tight'); plt.show() """ if M < 1: return array([]) if M == 1: return ones(1, float) n = arange(0,M) return 0.5-0.5*cos(2.0*pi*n/(M-1))
d3133f1ed2d3c2e56853d14a5b3e5e1f2cff11e2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/d3133f1ed2d3c2e56853d14a5b3e5e1f2cff11e2/function_base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 366, 10903, 12, 49, 4672, 3536, 2000, 326, 670, 10903, 2742, 18, 225, 1021, 670, 10903, 2742, 353, 279, 268, 7294, 20010, 635, 1450, 279, 13747, 31633, 18, 225, 7012, 12181, 490, 294, 50...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 366, 10903, 12, 49, 4672, 3536, 2000, 326, 670, 10903, 2742, 18, 225, 1021, 670, 10903, 2742, 353, 279, 268, 7294, 20010, 635, 1450, 279, 13747, 31633, 18, 225, 7012, 12181, 490, 294, 50...
self._framesize = self._framesize / 2
self._framesize = self._framesize // 2
def _read_comm_chunk(self, chunk): self._nchannels = _read_short(chunk) self._nframes = _read_long(chunk) self._sampwidth = (_read_short(chunk) + 7) / 8 self._framerate = int(_read_float(chunk)) self._framesize = self._nchannels * self._sampwidth if self._aifc: #DEBUG: SGI's soundeditor produces a bad size :-( kludge = 0 if chunk.chunksize == 18: kludge = 1 print 'Warning: bad COMM chunk size' chunk.chunksize = 23 #DEBUG end self._comptype = chunk.read(4) #DEBUG start if kludge: length = ord(chunk.file.read(1)) if length & 1 == 0: length = length + 1 chunk.chunksize = chunk.chunksize + length chunk.file.seek(-1, 1) #DEBUG end self._compname = _read_string(chunk) if self._comptype != 'NONE': if self._comptype == 'G722': try: import audioop except ImportError: pass else: self._convert = self._adpcm2lin self._framesize = self._framesize / 4 return # for ULAW and ALAW try Compression Library try: import cl except ImportError: if self._comptype == 'ULAW': try: import audioop self._convert = self._ulaw2lin self._framesize = self._framesize / 2 return except ImportError: pass raise Error, 'cannot read compressed AIFF-C files' if self._comptype == 'ULAW': scheme = cl.G711_ULAW self._framesize = self._framesize / 2 elif self._comptype == 'ALAW': scheme = cl.G711_ALAW self._framesize = self._framesize / 2 else: raise Error, 'unsupported compression type' self._decomp = cl.OpenDecompressor(scheme) self._convert = self._decomp_data else: self._comptype = 'NONE' self._compname = 'not compressed'
c48d059737cd9e7ff23c71cfd59d2a61045dd248 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/c48d059737cd9e7ff23c71cfd59d2a61045dd248/aifc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 896, 67, 5702, 67, 6551, 12, 2890, 16, 2441, 4672, 365, 6315, 82, 9114, 273, 389, 896, 67, 6620, 12, 6551, 13, 365, 6315, 82, 10278, 273, 389, 896, 67, 5748, 12, 6551, 13, 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, 389, 896, 67, 5702, 67, 6551, 12, 2890, 16, 2441, 4672, 365, 6315, 82, 9114, 273, 389, 896, 67, 6620, 12, 6551, 13, 365, 6315, 82, 10278, 273, 389, 896, 67, 5748, 12, 6551, 13, 365, ...
info = self.check_libs(os.path.join(prefix,'lib'),
atlas = self.check_libs(os.path.join(prefix,'lib'),
def calc_info_debian(self,prefix): print 'Trying Debian setup' info = self.check_libs(os.path.join(prefix,'lib'), ['cblas','f77blas','atlas'],[]) if not info: return lapack = self.check_libs(os.path.join(prefix,'lib','atlas'),['lapack'],[]) if not lapack: lapack = self.check_libs(os.path.join(prefix,'lib'),['lapack'],[]) if not lapack: return h = (combine_paths(prefix,'include','cblas.h') or [None])[0] if h: dict_append(info,include_dirs=[os.path.dirname(h)]) dict_append(info,**lapack) self.set_info(**info)
136097468c3b5317bed520eb2a74fd9eaea920c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/136097468c3b5317bed520eb2a74fd9eaea920c1/system_info.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 1376, 67, 31888, 2779, 12, 2890, 16, 3239, 4672, 1172, 296, 18038, 1505, 70, 2779, 3875, 11, 22339, 273, 365, 18, 1893, 67, 21571, 12, 538, 18, 803, 18, 5701, 12, 3239, 11189...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7029, 67, 1376, 67, 31888, 2779, 12, 2890, 16, 3239, 4672, 1172, 296, 18038, 1505, 70, 2779, 3875, 11, 22339, 273, 365, 18, 1893, 67, 21571, 12, 538, 18, 803, 18, 5701, 12, 3239, 11189...