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
Subwidgets Class ---------- ----- btns StdButtonBox fsbox FileSelectBox""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixFileSelectDialog', ['options'], cnf, kw) self.subwidget_list['btns'] = _dummyStdButtonBox(self, 'btns') self.subwidget_list['fsbox'] = _dummyFileSelectBox(self, 'fsbox')
Subwidgets Class ---------- ----- btns StdButtonBox fsbox FileSelectBox""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixFileSelectDialog', ['options'], cnf, kw) self.subwidget_list['btns'] = _dummyStdButtonBox(self, 'btns') self.subwidget_list['fsbox'] = _dummyFileSelectBox(self, 'fsbox')
def invoke(self):
86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
self.dump_children(element, output, list_level=list_level)
self.dump_children(element, output, list_level=list_level)
def dump_children(self, list, output, list_level = -1): if list.text: output.append(list.text)
ac41eeba50a29c9fd21ae17bc66b910ea7d1d577 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4103/ac41eeba50a29c9fd21ae17bc66b910ea7d1d577/latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 67, 5906, 12, 2890, 16, 666, 16, 876, 16, 666, 67, 2815, 273, 300, 21, 4672, 309, 666, 18, 955, 30, 876, 18, 6923, 12, 1098, 18, 955, 13, 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, 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, 4657, 67, 5906, 12, 2890, 16, 666, 16, 876, 16, 666, 67, 2815, 273, 300, 21, 4672, 309, 666, 18, 955, 30, 876, 18, 6923, 12, 1098, 18, 955, 13, 2, -100, -100, -100, -100, -100, -10...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 445) else quickfix.IntField.__init__(self, 445, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 1059, 7950, 13, 469, 9549, 904, 18, 1702, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 1059, 7950, 13, 469, 9549, 904, 18, 1702, 974, 16186, 2738, ...
broken = nuninst[arch][:]
nuninst[arch + "+all"] = [x for x in nuninst_comp[arch + "+all"] if x in binaries[arch][0]] broken = nuninst[arch + "+all"][:]
def iter_packages(self, packages, selected, hint=False, nuninst=None): """Iter on the list of actions and apply them one-by-one
333b76f04c83e940fd1667457dc7d9c0a58c6aa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/333b76f04c83e940fd1667457dc7d9c0a58c6aa6/britney.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 67, 10308, 12, 2890, 16, 5907, 16, 3170, 16, 7380, 33, 8381, 16, 290, 318, 8591, 33, 7036, 4672, 3536, 2360, 603, 326, 666, 434, 4209, 471, 2230, 2182, 1245, 17, 1637, 17, 476, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1400, 67, 10308, 12, 2890, 16, 5907, 16, 3170, 16, 7380, 33, 8381, 16, 290, 318, 8591, 33, 7036, 4672, 3536, 2360, 603, 326, 666, 434, 4209, 471, 2230, 2182, 1245, 17, 1637, 17, 476, ...
func.WriteHandlerValidation(file)
def WriteImmediateHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" func.WriteHandlerValidation(file) file.Write(" DeleteGLObjects<GL%sHelper>(n, %s);\n" % (func.original_name, func.GetLastOriginalArg().name))
f542468aabd3f9a507d2438f7a635134fd3dca43 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/f542468aabd3f9a507d2438f7a635134fd3dca43/build_gles2_cmd_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 22651, 1503, 13621, 261, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 585, 18, 3067, 2932, 225, 2504, 11261, 4710, 32, 11261, 9, 87, 2276, 34, 12,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 22651, 1503, 13621, 261, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 585, 18, 3067, 2932, 225, 2504, 11261, 4710, 32, 11261, 9, 87, 2276, 34, 12,...
(Q,Q_err2) = axis_manip.wavelength_to_scalar_Q(l_f[0], l_f[1], angle/2.0, angle_err2/2.0)
Q = axis_manip.wavelength_to_scalar_Q(l_f[0], l_f[1], angle / 2.0, angle_err2 / 2.0)
def create_2D_dist(som,*args,**kwargs): """ This function takes a SOM of single spectrum with energy transfer axes and rebins those axes to a given axis and converts the spectra into a single I(Q,E) spectrum. Parameters: ---------- -> som is the input SOM with energy transfer axis SOs -> *args is a mandatory list of axes for rebinning. There is a particular order to them. They should be present in the following order: Without errors 1. Energy transfer 2. Momentum transfer With errors 1. Energy transfer 2. Energy transfer error^2 3. Momentum transfer 4. Momentum transfer error ^2 -> **kwargs is a dictionary of optional keywords that pass information to the function. Here are the currently accepted keywords: - withXVar=<string>. The string will either be True or False. If the keyword is not present, the default value will be False - data_type=<string> The string can be either histogram, density or coordinate. If the keyword is not present, the default value will be histogram - so_id=<identifier> The identifier represents a number, string, tuple or other object that describes the resulting SO - y_label=<string> This is a string that sets the y axis label - y_units=<string> This is a string that sets the y axis units - x_labels=<list of strings> This is a list of strings that sets the individual x axes labels - x_units=<list of string> This is a list of strings that sets the individual x axes units Returns: ------- <- A SOM with a single 2D SO with E and Q axes Exceptions: ---------- <- RuntimeError is raised if the parameter given to the keyword argument withXVar is not True or False <- RuntimeError is raised if the parameter given to the keyword argument data_type is not histogram or density or coordinate <- RuntimeError is raised is the number of given arguments (x-axes) is not either 2 (no errors) or 4 (with errors) """ import common_lib import hlr_utils import nessi_list import SOM # Setup some variables dim = 2 N_y = [] N_tot = 1 N_args = len(args) # Check withXVar keyword argument and also check number of given args. # Set xvar and Q_pos (position of the momentum transfer axis in the args # list) to the appropriate values try: value = kwargs["withXVar"] if value.lower() == "true": if N_args != 4: raise RuntimeError, "Since you have requested x errors, 4 x "\ +"axes must be provided." else: xvar = True Q_pos = 2 elif value.lower() == "false": if N_args != 2: raise RuntimeError, "Since you did not requested x errors, 2 "\ +"x axes must be provided." else: xvar = False Q_pos = 1 else: raise RuntimeError, "Do not understand given parameter %s" % \ value except KeyError: if N_args != 2: raise RuntimeError, "Since you did not requested x errors, 2 "\ +"x axes must be provided." else: xvar = False Q_pos = 1 # Check dataType keyword argument. An offset will be set to 1 for the # histogram type and 0 for either density or coordinate try: type = kwargs["data_type"] if type.lower() == "histogram": offset = 1 elif type.lower() == "density" or type.lower() == "coordinate": offset = 0 else: raise RuntimeError, "Do not understand data type given: %s" % \ type # Default is offset for histogram except KeyError: offset = 1 so_dim = SOM.SO(dim) for i in range(dim): # Set the x-axis arguments from the *args list into the new SO if not xvar: # Axis positions are 1 (Q) and 0 (E) position = dim-i-1 so_dim.axis[i].val = args[position] else: # Axis positions are 2 (Q), 3 (eQ), 0 (E), 1 (eE) position = dim-2*i so_dim.axis[i].val = args[position] so_dim.axis[i].var = args[position+1] # Set individual value axis sizes (not x-axis size) N_y.append(len(args[position]) - offset) # Calculate total 2D array size N_tot = N_tot * N_y[-1] # Create y and var_y lists from total 2D size so_dim.y = nessi_list.NessiList(N_tot) so_dim.var_y = nessi_list.NessiList(N_tot) # Rebin data to E axis som1 = common_lib.rebin_axis_1D(som, args[0]) som = None del som inst = som1.attr_list.instrument lambda_final = som1.attr_list["Wavelength_final"] import array_manip import axis_manip for i in range(hlr_utils.get_length(som1)): # Find Q for pixel so = hlr_utils.get_value(som1,i,"SOM","all") (angle,angle_err2) = hlr_utils.get_parameter("polar",so,inst) l_f = hlr_utils.get_special(lambda_final, so) (Q,Q_err2) = axis_manip.wavelength_to_scalar_Q(l_f[0], l_f[1], angle/2.0, angle_err2/2.0) # Find Q value in given momentum transfer axis index = -1 for j in range(N_y[0]): if Q >= args[Q_pos][j] and Q < args[Q_pos][j+1]: index = j break if index != -1: start = index * N_y[1] finish = (index + 1) * N_y[1] length = finish - start + 1 val = hlr_utils.get_value(som1, i, "SOM") err2 = hlr_utils.get_err2(som1, i, "SOM") (so_dim.y, so_dim.var_y) = array_manip.add_ncerr(so_dim.y, so_dim.var_y, val, err2, a_start=start, b_size=length) # If the Q value is not found in the given axis, do nothing and # continue else: pass # Check for so_id keyword argument if kwargs.has_key("so_id"): so_dim.id = kwargs["so_id"] else: so_dim.id = 0 comb_som = SOM.SOM() comb_som.copyAttributes(som1) # Check for y_label keyword argument if kwargs.has_key("y_label"): comb_som.setYLabel(kwargs["y_label"]) else: comb_som.setYLabel("Counts") # Check for y_units keyword argument if kwargs.has_key("y_units"): comb_som.setYUnits(kwargs["y_units"]) else: comb_som.setYUnits("Counts / THz A^-1") # Check for x_labels keyword argument if kwargs.has_key("x_labels"): comb_som.setAllAxisLabels(kwargs["x_labels"]) else: comb_som.setAllAxisLabels(["Momentum transfer","Energy transfer"]) # Check for x_units keyword argument if kwargs.has_key("x_units"): comb_som.setAllAxisUnits(kwargs["x_units"]) else: comb_som.setAllAxisUnits(["A^-1","THz"]) comb_som.append(so_dim) return comb_som
8c0e478ff0fa2abc2e5d85a427bbaf1028f81580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/8c0e478ff0fa2abc2e5d85a427bbaf1028f81580/hlr_create_2D_dist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 22, 40, 67, 4413, 12, 87, 362, 16, 14, 1968, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 279, 348, 1872, 434, 2202, 17970, 598, 12929, 7412, 6515, 471, 283, 11862, 5348, 6515,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 22, 40, 67, 4413, 12, 87, 362, 16, 14, 1968, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 279, 348, 1872, 434, 2202, 17970, 598, 12929, 7412, 6515, 471, 283, 11862, 5348, 6515,...
remvd = remvd and tagn_('%(items)s removed', '%(items)s removed',
remvd = remvd and tagn_("%(items)s removed", "%(items)s removed",
def _render_property_diff(self, req, ticket, field, old, new, resource_new=None): rendered = None # per type special rendering of diffs type_ = None for f in ticket.fields: if f['name'] == field: type_ = f['type'] break if type_ == 'checkbox': rendered = new == '1' and _('set') or _('unset') elif type_ == 'textarea': if not resource_new: rendered = _('modified') else: href = get_resource_url(self.env, resource_new, req.href, action='diff') # TRANSLATOR: modified ('diff') (link) diff = tag.a(_('diff'), href=href) rendered = tag_('modified (%(diff)s)', diff=diff)
8a7505f666e8590328936fd32f0bc362d6e2a6a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/8a7505f666e8590328936fd32f0bc362d6e2a6a0/web_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5902, 67, 4468, 67, 5413, 12, 2890, 16, 1111, 16, 9322, 16, 652, 16, 1592, 16, 394, 16, 1058, 67, 2704, 33, 7036, 4672, 7935, 273, 599, 468, 1534, 618, 4582, 9782, 434, 15250, 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, 389, 5902, 67, 4468, 67, 5413, 12, 2890, 16, 1111, 16, 9322, 16, 652, 16, 1592, 16, 394, 16, 1058, 67, 2704, 33, 7036, 4672, 7935, 273, 599, 468, 1534, 618, 4582, 9782, 434, 15250, 6...
class GLcharHandler(TypeHandler):
class GLcharHandler(CustomHandler):
def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" const int kSomeBaseValueToTestWith = 51;\n") file.Write(" static %s data[] = {\n" % func.info.data_type) for v in range(0, func.info.count * 2): file.Write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" % (func.info.data_type, v)) file.Write(" };\n") file.Write(" int8 buf[256] = { 0, };\n") file.Write(" %s& cmd = *static_cast<%s*>(static_cast<void*>(&buf));\n" % (func.name, func.name)) file.Write(" void* next_cmd = cmd.Set(\n") file.Write(" &cmd") args = func.GetCmdArgs() value = 1 for arg in args: file.Write(",\n static_cast<%s>(%d)" % (arg.type, value)) value += 1 file.Write(",\n data);\n") args = func.GetCmdArgs() value = 1 file.Write(" EXPECT_EQ(static_cast<uint32>(%s::kCmdId),\n" % func.name) file.Write(" cmd.header.command);\n") file.Write(" EXPECT_EQ(sizeof(cmd) +\n") file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)),\n") file.Write(" cmd.header.size * 4u);\n") file.Write(" EXPECT_EQ(static_cast<char*>(next_cmd),\n") file.Write(" reinterpret_cast<char*>(&cmd) + sizeof(cmd) +\n") file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n") for arg in args: file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % (arg.type, value, arg.name)) value += 1 file.Write(" // TODO(gman): Check that data was inserted;\n") file.Write("}\n") file.Write("\n")
a115074299ce0ef525addadc3040aeb6715c121a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/a115074299ce0ef525addadc3040aeb6715c121a/build_gles2_cmd_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 22651, 1630, 4709, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 585, 18, 3067, 2932, 16961, 12, 43, 11386, 22, 1630, 4709, 16, 738, 87, 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, 2598, 22651, 1630, 4709, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 585, 18, 3067, 2932, 16961, 12, 43, 11386, 22, 1630, 4709, 16, 738, 87, 13, ...
harvested_document_table.c.source_id.add() harvested_document_table.c.package_id.add()
harvested_document_table.c.guid.create() harvested_document_table.c.source_id.create() harvested_document_table.c.package_id.create()
def upgrade(): harvested_document_table.c.url.drop() harvested_document_table.c.source_id.add() harvested_document_table.c.package_id.add()
42cb40085b6dad762f4f944a29dabb1b3bf0eaf8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/265/42cb40085b6dad762f4f944a29dabb1b3bf0eaf8/027_adjust_harvester.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8400, 13332, 17895, 90, 3149, 67, 5457, 67, 2121, 18, 71, 18, 718, 18, 7285, 1435, 17895, 90, 3149, 67, 5457, 67, 2121, 18, 71, 18, 14066, 18, 2640, 1435, 17895, 90, 3149, 67, 5457, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8400, 13332, 17895, 90, 3149, 67, 5457, 67, 2121, 18, 71, 18, 718, 18, 7285, 1435, 17895, 90, 3149, 67, 5457, 67, 2121, 18, 71, 18, 14066, 18, 2640, 1435, 17895, 90, 3149, 67, 5457, ...
tokenlist[ikey] = (dictvalue,i)
tokenlist[ikey] = ParseResultsWithOffset(dictvalue,i)
def postParse( self, instring, loc, tokenlist ): for i,tok in enumerate(tokenlist): ikey = _ustr(tok[0]).strip() if len(tok)==1: tokenlist[ikey] = ("",i) elif len(tok)==2 and not isinstance(tok[1],ParseResults): tokenlist[ikey] = (tok[1],i) else: dictvalue = tok.copy() #ParseResults(i) del dictvalue[0] if len(dictvalue)!= 1 or (isinstance(dictvalue,ParseResults) and dictvalue.keys()): tokenlist[ikey] = (dictvalue,i) else: tokenlist[ikey] = (dictvalue[0],i)
650d792a37f78360ec5c808bdf6777fcbadd8761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12364/650d792a37f78360ec5c808bdf6777fcbadd8761/pyparsing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 3201, 12, 365, 16, 316, 1080, 16, 1515, 16, 1147, 1098, 262, 30, 364, 277, 16, 17692, 316, 4241, 12, 2316, 1098, 4672, 277, 856, 273, 389, 27008, 12, 17692, 63, 20, 65, 2934, 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, 1603, 3201, 12, 365, 16, 316, 1080, 16, 1515, 16, 1147, 1098, 262, 30, 364, 277, 16, 17692, 316, 4241, 12, 2316, 1098, 4672, 277, 856, 273, 389, 27008, 12, 17692, 63, 20, 65, 2934, 6...
grouplist = Group.objects.get(courseoffering = course)
grouplist = Group.objects.filter(courseoffering = course)
def groupmanage(request, course_slug): course = CourseOffering.objects.get(slug=course_slug) p = get_object_or_404(Person, userid = request.user.username) m = get_object_or_404(Member, person = p, offering=course) try: grouplist = Group.objects.get(courseoffering = course) except: grouplist = None memberlist = GroupMember.objects.none() if m.role == 'STUD': gs = Group.objects.filter(courseoffering=course, groupmember__student=m) g = None if gs is not None: try: g = gs.get(confirmed=True) except: g = None if g is not None: memberlist = GroupMember.objects.filter(group = g) else: memberlist = None return render_to_response('groups/student.html', {'course_slug':course_slug, 'groups':gs, 'group':g,'memberlist':memberlist,'grouplist':grouplist}, context_instance = RequestContext(request)) elif m.role == 'INST': return render_to_response('groups/instructor.html', {'course_slug':course_slug, 'grouplist':grouplist}, context_instance = RequestContext(request))
578435e10c42fce3db52080e16d33cc371a37bfb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6634/578435e10c42fce3db52080e16d33cc371a37bfb/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1041, 12633, 12, 2293, 16, 4362, 67, 6436, 4672, 4362, 273, 385, 3117, 17800, 18, 6911, 18, 588, 12, 6436, 33, 5566, 67, 6436, 13, 293, 273, 336, 67, 1612, 67, 280, 67, 11746, 12, 83...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1041, 12633, 12, 2293, 16, 4362, 67, 6436, 4672, 4362, 273, 385, 3117, 17800, 18, 6911, 18, 588, 12, 6436, 33, 5566, 67, 6436, 13, 293, 273, 336, 67, 1612, 67, 280, 67, 11746, 12, 83...
(-59997896/67387681 : -641260644409/553185473329 : 1)
(-59997896/67387681 : 88075171080/553185473329 : 1)
def padic_height_pairing_matrix(self, p, prec=20, height=None, check_hypotheses=True): r""" Computes the cyclotomic $p$-adic height pairing matrix of this curve with respect to the basis self.gens() for the Mordell-Weil group for a given odd prime p of good ordinary reduction.
490bf41219e08182aa07ee3edf473cac45224f99 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/490bf41219e08182aa07ee3edf473cac45224f99/ell_rational_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4627, 335, 67, 4210, 67, 6017, 310, 67, 5667, 12, 2890, 16, 293, 16, 13382, 33, 3462, 16, 2072, 33, 7036, 16, 866, 67, 76, 879, 10370, 281, 281, 33, 5510, 4672, 436, 8395, 14169, 281...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4627, 335, 67, 4210, 67, 6017, 310, 67, 5667, 12, 2890, 16, 293, 16, 13382, 33, 3462, 16, 2072, 33, 7036, 16, 866, 67, 76, 879, 10370, 281, 281, 33, 5510, 4672, 436, 8395, 14169, 281...
elif fn.endswith("~") or fn.endswith("-bak") or ".pbl" in fn:
elif fn.endswith("~") or fn.endswith("-bak") or \ ".pbl" in fn or ".exe" in fn or ".com" in fn or \ ".bat" in fn or ".scr" in fn or ".sh":
def put_dir(name, path): data = wmldata.DataSub("dir") data.set_text_val("name", name) for fn in glob.glob(path + "/*"): if os.path.isdir(fn): sub = put_dir(os.path.basename(fn), fn) elif fn.endswith("~") or fn.endswith("-bak") or ".pbl" in fn: continue else: sub = put_file(os.path.basename(fn), file(fn)) data.insert(sub) return data
c5e9d097a82111d8042351a6f4a20d904ef5b91d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9355/c5e9d097a82111d8042351a6f4a20d904ef5b91d/campaignserver_client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 67, 1214, 12, 529, 16, 589, 4672, 501, 273, 341, 781, 892, 18, 751, 1676, 2932, 1214, 7923, 501, 18, 542, 67, 955, 67, 1125, 2932, 529, 3113, 508, 13, 364, 2295, 316, 4715, 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, 1378, 67, 1214, 12, 529, 16, 589, 4672, 501, 273, 341, 781, 892, 18, 751, 1676, 2932, 1214, 7923, 501, 18, 542, 67, 955, 67, 1125, 2932, 529, 3113, 508, 13, 364, 2295, 316, 4715, 18,...
"""%(table, less))
"""%(table_name, less))
def drop_column(self, table, col_name): """ Takes a while, thanks to SQLite...
85d02cb25b26fc015382d67ed0b0b5b5529e5568 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/85d02cb25b26fc015382d67ed0b0b5b5529e5568/database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3640, 67, 2827, 12, 2890, 16, 1014, 16, 645, 67, 529, 4672, 3536, 23004, 279, 1323, 16, 286, 19965, 358, 16192, 2777, 2, 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, 3640, 67, 2827, 12, 2890, 16, 1014, 16, 645, 67, 529, 4672, 3536, 23004, 279, 1323, 16, 286, 19965, 358, 16192, 2777, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
name = object.__name__
realname = object.__name__ name = name or realname
def docclass(self, object): """Produce text documentation for a given class object.""" name = object.__name__ bases = object.__bases__
2c3f3ddf9452a1f3f228e0d8c7abdbeed214a6b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2c3f3ddf9452a1f3f228e0d8c7abdbeed214a6b7/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1106, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 864, 667, 733, 12123, 2863, 529, 273, 733, 16186, 529, 972, 508, 273, 508, 578, 2863, 529, 8337, 273, 733, 16186, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1106, 12, 2890, 16, 733, 4672, 3536, 25884, 977, 7323, 364, 279, 864, 667, 733, 12123, 2863, 529, 273, 733, 16186, 529, 972, 508, 273, 508, 578, 2863, 529, 8337, 273, 733, 16186, ...
def NotestFullUpdateWipeStateful(self):
def testFullUpdateWipeStateful(self):
def NotestFullUpdateWipeStateful(self): """Tests if we can update after cleaning the stateful partition.
f38f249eb440154afdc1e6ac647fdbd20f170077 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/f38f249eb440154afdc1e6ac647fdbd20f170077/cros_au_test_harness.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 5080, 1891, 59, 3151, 1119, 2706, 12, 2890, 4672, 3536, 14650, 309, 732, 848, 1089, 1839, 24225, 326, 28188, 3590, 18, 2, 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, 1842, 5080, 1891, 59, 3151, 1119, 2706, 12, 2890, 4672, 3536, 14650, 309, 732, 848, 1089, 1839, 24225, 326, 28188, 3590, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if not int(event_var['es_userteam']) == 3: return
def player_spawn(event_var): userid = event_var['userid'] if isSpectator(userid): return if isDead(userid): return # Check to see if this player is a CT if not int(event_var['es_userteam']) == 3: return # Are we in a map that has a bombzone? if not len(es.createentitylist('func_bomb_target')): return # Do we want to give a defuser? if not int(gg_player_defuser): return # Make sure the player doesn't already have a defuser if not getPlayer(userid).defuser: getPlayer(userid).defuser = 1
b5a79e9be4b89eb33754e23ead57e63dfd80751d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4555/b5a79e9be4b89eb33754e23ead57e63dfd80751d/gg_map_obj.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7291, 67, 1752, 9533, 12, 2575, 67, 1401, 4672, 6709, 273, 871, 67, 1401, 3292, 8339, 3546, 225, 309, 11604, 1181, 639, 12, 8339, 4672, 327, 225, 309, 353, 11852, 12, 8339, 4672, 327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7291, 67, 1752, 9533, 12, 2575, 67, 1401, 4672, 6709, 273, 871, 67, 1401, 3292, 8339, 3546, 225, 309, 11604, 1181, 639, 12, 8339, 4672, 327, 225, 309, 353, 11852, 12, 8339, 4672, 327, ...
self.tk.call('tixSetSilent', self._w, value)
self.tk.call('tixSetSilent', self._w, value)
def set_silent(self, value):
b0e44d61d9e592e1acd6aa05eac9704ba5776f61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b0e44d61d9e592e1acd6aa05eac9704ba5776f61/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 21862, 12, 2890, 16, 460, 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, 444, 67, 21862, 12, 2890, 16, 460, 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, ...
def __init__(self, requirements = []):
def __init__(self, requirements=None): if requirements == None: requirements = []
def __init__(self, requirements = []): self.requirements = requirements
644d652a9515f003700691b3487169186c9a453d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1098/644d652a9515f003700691b3487169186c9a453d/qualification.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8433, 33, 7036, 4672, 309, 8433, 422, 599, 30, 8433, 273, 5378, 365, 18, 16175, 273, 8433, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8433, 33, 7036, 4672, 309, 8433, 422, 599, 30, 8433, 273, 5378, 365, 18, 16175, 273, 8433, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
"named %s, but the package name is %s.
"named %s, but the package name is %s. "
def CheckSharedLibraryNamingPolicy(pkg_data, error_mgr, logger, messenger): pkgname = pkg_data["basic_stats"]["pkgname"] shared_libs = set(su.GetSharedLibs(pkg_data)) linkable_shared_libs = [] for binary_info in pkg_data["binaries_dump_info"]: if binary_info["path"] in shared_libs: if su.IsLibraryLinkable(binary_info["path"]): # It is a shared library and other projects might link to it. if "soname" in binary_info and binary_info["soname"]: soname = binary_info["soname"] else: soname = os.path.split(binary_info["path"])[1] linkable_shared_libs.append((soname, binary_info)) check_names = True if len(linkable_shared_libs) > 1: sonames = [x[0] for x in linkable_shared_libs] multilib_pkgname = su.MakePackageNameBySonameCollection(sonames) if not multilib_pkgname: error_mgr.ReportError( "non-uniform-lib-versions-in-package", "sonames=%s" % sorted(set(sonames))) messenger.Message( "Package %s contains shared libraries with sonames that " "don't have compatible versions: %s. This means that " "they are best placed in own packages, with each package " "named after library name and version. " % (pkgname, sonames)) # If the sonames aren't uniform, there's no point in trying to match # sonames versus pkgname. check_names = False else: if multilib_pkgname != pkgname: error_mgr.ReportError( "shared-lib-pkgname-mismatch", "sonames=%s " "pkgname=%s " "expected=%s " % (sorted(set(sonames)), pkgname, multilib_pkgname)) messenger.Message( "The collection of sonames (%s) " "is expected to be in package " "named %s, but the package name is %s. "More information: " "http://wiki.opencsw.org/checkpkg-error-tags" % (sonames, multilib_pkgname, pkgname)) if check_names: for soname, binary_info in linkable_shared_libs: tmp = su.MakePackageNameBySoname(soname) policy_pkgname_list, policy_catalogname_list = tmp if pkgname not in policy_pkgname_list: error_mgr.ReportError( "shared-lib-pkgname-mismatch", "file=%s " "soname=%s " "pkgname=%s " "expected=%s" "More information: " "http://wiki.opencsw.org/checkpkg-error-tags" % (binary_info["path"], soname, pkgname, policy_pkgname_list)) suggested_pkgname = policy_pkgname_list[0] messenger.SuggestGarLine( "PACKAGES += %s" % suggested_pkgname) messenger.SuggestGarLine( "PKGFILES_%s += %s" % (suggested_pkgname, binary_info["path"])) lib_basename, lib_filename = os.path.split(binary_info["path"]) messenger.SuggestGarLine( "PKGFILES_%s += %s/%s.*" % (suggested_pkgname, lib_basename, soname)) messenger.OneTimeMessage( soname, "This shared library (%s) is in a directory indicating that it " "is likely to be linked to by other programs. If this is the " "case, the library is best packaged separately, in a package " "with a library-specific name. Examples of such names include: " "%s. If this library is not meant to be linked to by other " "packages, it's best moved to a 'private' directory. " "For example, instead of /opt/csw/lib/foo.so, " "try /opt/csw/lib/projectname/foo.so. " "More information: http://wiki.opencsw.org/checkpkg-error-tags" % (binary_info["path"], policy_pkgname_list))
ec6734f34bdc7813e85eebe06f874cfabd4ea1ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3137/ec6734f34bdc7813e85eebe06f874cfabd4ea1ca/package_checks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2073, 7887, 9313, 24102, 2582, 12, 10657, 67, 892, 16, 555, 67, 13552, 16, 1194, 16, 31086, 4672, 29348, 273, 3475, 67, 892, 9614, 13240, 67, 5296, 6, 6362, 6, 10657, 529, 11929, 5116, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2073, 7887, 9313, 24102, 2582, 12, 10657, 67, 892, 16, 555, 67, 13552, 16, 1194, 16, 31086, 4672, 29348, 273, 3475, 67, 892, 9614, 13240, 67, 5296, 6, 6362, 6, 10657, 529, 11929, 5116, ...
pass
if method not in self._debug_ignore_list : if self._debug > 3 : print "NCBIXML: Ignored: " + method self._debug_ignore_list.append(method)
def startElement(self, name, attr): """Found XML start tag
222c25b5ffb6f82620be0e71c5d11e486994dbfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/222c25b5ffb6f82620be0e71c5d11e486994dbfb/NCBIXML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13591, 12, 2890, 16, 508, 16, 1604, 4672, 3536, 2043, 3167, 787, 1047, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13591, 12, 2890, 16, 508, 16, 1604, 4672, 3536, 2043, 3167, 787, 1047, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
result.addError(self,self.__exc_info())
result.addError(self,sys.exc_info())
def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return
17a781bc69d73326455ca7f129bdf57528f4ad8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17a781bc69d73326455ca7f129bdf57528f4ad8b/unittest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 563, 33, 7036, 4672, 309, 563, 353, 599, 30, 563, 273, 365, 18, 1886, 4709, 1253, 1435, 563, 18, 1937, 4709, 12, 2890, 13, 1842, 1305, 273, 3869, 12, 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, 1001, 1991, 972, 12, 2890, 16, 563, 33, 7036, 4672, 309, 563, 353, 599, 30, 563, 273, 365, 18, 1886, 4709, 1253, 1435, 563, 18, 1937, 4709, 12, 2890, 13, 1842, 1305, 273, 3869, 12, 2...
if hasattr(platform, 'mac_ver') and platform.mac_ver()[0][:4] < '10.6':
if hasattr(platform, 'mac_ver') and platform.mac_ver()[0][:4] == '10.5':
def GenerateBrowserCommandLine(self, browser_path, extra_args, profile_dir, url): """Generates the command line for a process to run Browser
fba02dc5081cbae8f91bdd2d4051308e7ad3f2c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12156/fba02dc5081cbae8f91bdd2d4051308e7ad3f2c1/ffprocess_mac.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 9132, 21391, 12, 2890, 16, 4748, 67, 803, 16, 2870, 67, 1968, 16, 3042, 67, 1214, 16, 880, 4672, 3536, 6653, 326, 1296, 980, 364, 279, 1207, 358, 1086, 15408, 2, 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, 6654, 9132, 21391, 12, 2890, 16, 4748, 67, 803, 16, 2870, 67, 1968, 16, 3042, 67, 1214, 16, 880, 4672, 3536, 6653, 326, 1296, 980, 364, 279, 1207, 358, 1086, 15408, 2, -100, -100, -100...
if os.path.exists(info):
if os.path.exists(info):
def get_info(name): """ Get info for a locally installed campaign. If expects a direct path to the info.cfg file. """ if not os.path.exists(name): return None, None p = wmlparser.Parser(None) p.parse_file(name) info = wmldata.DataSub("WML") p.parse_top(info) uploads = info.get_or_create_sub("info").get_text_val("uploads", "") version = info.get_or_create_sub("info").get_text_val("version", "") return uploads, version
2f63e47f8260b9331767ef9c983bda3eb6df2759 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9355/2f63e47f8260b9331767ef9c983bda3eb6df2759/campaigns_client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1376, 12, 529, 4672, 3536, 968, 1123, 364, 279, 13760, 5876, 8965, 18, 971, 10999, 279, 2657, 589, 358, 326, 1123, 18, 7066, 585, 18, 3536, 309, 486, 1140, 18, 803, 18, 1808, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1376, 12, 529, 4672, 3536, 968, 1123, 364, 279, 13760, 5876, 8965, 18, 971, 10999, 279, 2657, 589, 358, 326, 1123, 18, 7066, 585, 18, 3536, 309, 486, 1140, 18, 803, 18, 1808, ...
self.__punct_property.icon = IBUS_PINYIN_LOCATION + "/icons/full-punct.svg"
self.__punct_property.icon = path.join(IBUS_PINYIN_LOCATION, "icons", "full-punct.svg")
def __refresh_properties(self): if self.__mode == 1: # refresh mode self.__status_property.icon = IBUS_PINYIN_LOCATION + "/icons/chinese.svg" self.__status_property.label = _(u"CN") self.__status_property.tooltip = _(u"Switch to English mode") else: self.__status_property.icon = IBUS_PINYIN_LOCATION + "/icons/english.svg" self.__status_property.label = _(u"EN") self.__status_property.tooltip = _(u"Switch to Chinese mode")
a135c88d75f76711683993abaa040c03ba7a39f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/471/a135c88d75f76711683993abaa040c03ba7a39f5/pinyin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9144, 67, 4738, 12, 2890, 4672, 309, 365, 16186, 3188, 422, 404, 30, 468, 4460, 1965, 365, 16186, 2327, 67, 4468, 18, 3950, 273, 467, 3000, 55, 67, 52, 31853, 706, 67, 15277, 397...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9144, 67, 4738, 12, 2890, 4672, 309, 365, 16186, 3188, 422, 404, 30, 468, 4460, 1965, 365, 16186, 2327, 67, 4468, 18, 3950, 273, 467, 3000, 55, 67, 52, 31853, 706, 67, 15277, 397...
raise _('The unlink method is not implemented on this object !')
raise NotImplementedError(_('The unlink method is not implemented on this object !'))
def unlink(self, cr, uid, ids, context=None): raise _('The unlink method is not implemented on this object !')
3f71dc76c6ecde0acad529b68c21ad9f1df0aff8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3f71dc76c6ecde0acad529b68c21ad9f1df0aff8/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8255, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 1002, 389, 2668, 1986, 8255, 707, 353, 486, 8249, 603, 333, 733, 401, 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, 8255, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 1002, 389, 2668, 1986, 8255, 707, 353, 486, 8249, 603, 333, 733, 401, 6134, 2, -100, -100, -100, -100, -100, -100...
self.out.write(" virtual void SendContents(Atlas::Bridge* b);\n")
self.out.write(" virtual void SendContents(Atlas::Bridge* b) const;\n")
def interface(self, obj): print "Output of interface for:" outfile = self.outdir + '/' + self.classname + ".h" print outfile self.out = open(outfile + ".tmp", "w") if outdir != ".": self.header(['Atlas', 'Objects', outdir, self.classname, "H"]) else: self.header(['Atlas', 'Objects', self.classname, "H"]) for parent in obj.attr['parents'].value: self.out.write('#include "') if parent == "root": self.out.write('../') self.out.write(classize(parent) + '.h"\n') self.out.write("\n\n") if outdir != ".": self.ns_open(['Atlas', 'Objects', outdir]) else: self.ns_open(['Atlas', 'Objects']) self.out.write("\n") self.out.write("/** " + obj.attr['description'].value + "\n") self.out.write("\n") self.out.write(obj.attr['long_description'].value + "\n\n") self.out.write("*/\n") self.out.write("class " + self.classname) parentlist = map(lambda parent:"public " + classize(parent), \ obj.attr['parents'].value) if len(parentlist) > 0: self.out.write(" : ") self.out.write(string.join(parentlist, ", ")) self.out.write("\n{\n") self.out.write("public:\n") self.constructors_if(obj) self.doc(4, "Default destructor.") self.out.write(" virtual ~" + self.classname + "() { }\n") self.out.write("\n") self.doc(4, "Create a new instance of " + self.classname + ".") self.out.write(" static " + self.classname + " Instantiate();\n") self.out.write("\n") static_attrs = filter(lambda attr,obj=obj:(not attr.name in descr_attrs) \ and (not find_in_parents(obj.attr['parents'].value, attr.name)), \ obj.attr_list) if len(static_attrs) > 0: self.doc(4, 'Check whether the attribute "name" exists.') self.out.write(" virtual bool HasAttr(const std::string& name)"\ + "const;\n") self.doc(4, 'Retrieve the attribute "name". Throws ' \ +'NoSuchAttrException if it does') self.doc(4, 'not exist.') self.out.write(" virtual Atlas::Message::Object GetAttr(") self.out.write("const std::string& name)\n") self.out.write(" const throw (NoSuchAttrException);\n") self.doc(4, 'Set the attribute "name" to the value given by' \ + '"attr"') self.out.write(" virtual void SetAttr(const std::string& name,\n") self.out.write(" ") self.out.write("const Atlas::Message::Object& attr);\n") self.doc(4, 'Remove the attribute "name". This will not work for '\ + 'static attributes.') self.out.write(" virtual void RemoveAttr(") self.out.write("const std::string& name);\n") self.out.write("\n") self.doc(4, 'Send the contents of this object to a Bridge.') self.out.write(" virtual void SendContents(Atlas::Bridge* b);\n") self.out.write("\n") self.doc(4, 'Convert this object to a Message::Object.') self.out.write(" virtual Atlas::Message::Object AsObject() const;\n") self.out.write("\n") for attr in static_attrs: self.doc(4, 'Set the "%s" attribute.' % attr.name) self.out.write(" inline void Set" + classize(attr.name)) self.out.write('(' + cpp_param_type[attr.type] + ' val);\n') self.out.write('\n') for attr in static_attrs: self.doc(4, 'Retrieve the "%s" attribute.' % attr.name) self.out.write(' inline %s Get' % cpp_param_type[attr.type]) self.out.write(classize(attr.name) + '() const;\n') self.doc(4, 'Retrieve the "%s" attribute as a non-const reference.' % attr.name) self.out.write(' inline %s Get' % cpp_param_type2[attr.type]) self.out.write(classize(attr.name) + '();\n') self.out.write('\n') self.out.write("protected:\n") if len(static_attrs) > 0: for attr in static_attrs: self.out.write(' %s attr_%s;\n' % (cpp_type[attr.type], attr.name)) self.out.write('\n') for attr in static_attrs: self.out.write(" inline void Send" + classize(attr.name)) self.out.write('(Atlas::Bridge*) const;\n') self.out.write('\n') self.out.write("};\n\n") if len(static_attrs) > 0: self.out.write('//\n// Inlined member functions follow.\n//\n\n') self.static_inline_sets(obj, static_attrs) self.static_inline_gets(obj, static_attrs) self.static_inline_sends(obj, static_attrs) self.out.write('\n') if outdir != ".": self.ns_close(['Atlas', 'Objects', outdir]) self.footer(['Atlas', 'Objects', outdir, self.classname, "H"]) else: self.ns_close(['Atlas', 'Objects']) self.footer(['Atlas', 'Objects', self.classname, "H"]) self.out.close() if os.access(outfile, os.F_OK): if cmp.cmp(outfile + ".tmp", outfile) == 0: os.remove(outfile) os.rename(outfile + ".tmp", outfile) else: print "Output file same as existing one, not updating" os.remove(outfile + ".tmp") else: os.rename(outfile + ".tmp", outfile)
9735567828cceff0576f75d0dc23ff6b13b4f601 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12931/9735567828cceff0576f75d0dc23ff6b13b4f601/gen_cc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1560, 12, 2890, 16, 1081, 4672, 1172, 315, 1447, 434, 1560, 364, 2773, 8756, 273, 365, 18, 659, 1214, 397, 2023, 397, 365, 18, 18340, 397, 3552, 76, 6, 1172, 8756, 365, 18, 659, 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, 1560, 12, 2890, 16, 1081, 4672, 1172, 315, 1447, 434, 1560, 364, 2773, 8756, 273, 365, 18, 659, 1214, 397, 2023, 397, 365, 18, 18340, 397, 3552, 76, 6, 1172, 8756, 365, 18, 659, 273, ...
def SetSegmentType(segea, type):
def SetSegmentType(segea, segtype):
def SetSegmentType(segea, type): """ Set segment type @param segea: any address within segment @param type: new segment type: @return: !=0 - ok """ seg = idaapi.getseg(segea) if not seg: return False seg.type = type return seg.update()
244a3cd02a580c0095170004ec30e922f0d1a8a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6984/244a3cd02a580c0095170004ec30e922f0d1a8a6/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1000, 4131, 559, 12, 307, 908, 69, 16, 2291, 723, 4672, 3536, 1000, 3267, 618, 225, 632, 891, 695, 908, 69, 30, 1281, 1758, 3470, 3267, 632, 891, 618, 30, 394, 3267, 618, 30, 225, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1000, 4131, 559, 12, 307, 908, 69, 16, 2291, 723, 4672, 3536, 1000, 3267, 618, 225, 632, 891, 695, 908, 69, 30, 1281, 1758, 3470, 3267, 632, 891, 618, 30, 394, 3267, 618, 30, 225, 63...
self.assertEqual(d.items(), [])
self.assertEqual(set(d.items()), set())
def test_items(self): d = {} self.assertEqual(d.items(), [])
8bf08b39d5891e323e83e126df578c383352fb98 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/8bf08b39d5891e323e83e126df578c383352fb98/test_dict.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3319, 12, 2890, 4672, 302, 273, 2618, 365, 18, 11231, 5812, 12, 72, 18, 3319, 9334, 5378, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3319, 12, 2890, 4672, 302, 273, 2618, 365, 18, 11231, 5812, 12, 72, 18, 3319, 9334, 5378, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def stat(self,statType, fromDT, toDT, message, layoutID, scheduleID, mediaID): abstract
def stat(self,statType, fromDT, toDT, tag, layoutID, scheduleID, mediaID): abstract
def stat(self,statType, fromDT, toDT, message, layoutID, scheduleID, mediaID): abstract
5c8d4110bbeaa26351f10ba8e247d948fef80858 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5464/5c8d4110bbeaa26351f10ba8e247d948fef80858/XiboClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 610, 12, 2890, 16, 5642, 559, 16, 628, 9081, 16, 358, 9081, 16, 883, 16, 3511, 734, 16, 4788, 734, 16, 3539, 734, 4672, 8770, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 610, 12, 2890, 16, 5642, 559, 16, 628, 9081, 16, 358, 9081, 16, 883, 16, 3511, 734, 16, 4788, 734, 16, 3539, 734, 4672, 8770, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' print ' g_printerr("Using new image composite functions\n");' print ' }' print '' print ' if (!gimp_composite_options.initialised) {'
print ' if (! gimp_composite_options.initialised)' print ' {'
def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'void' print 'gimp_composite_init()' print '{' print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' print ' g_printerr("Using new image composite functions\n");' print ' }' print '' print ' if (!gimp_composite_options.initialised) {' for o in function_tables: print ' %s_init();' % (functionnameify(o[0])) pass print ' gimp_composite_options.initialised = 1;' print ' }' print '}' pass
73af860ff4a9ad2d64dbee32023a1ec49e63a340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/73af860ff4a9ad2d64dbee32023a1ec49e63a340/make-gimp-composite-dispatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 14532, 67, 27676, 67, 2738, 12, 915, 67, 9373, 4672, 364, 320, 316, 445, 67, 9373, 30, 1172, 296, 338, 798, 918, 738, 87, 67, 2738, 1435, 4359, 738, 261, 915, 529, 1164, 12, 83,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 314, 14532, 67, 27676, 67, 2738, 12, 915, 67, 9373, 4672, 364, 320, 316, 445, 67, 9373, 30, 1172, 296, 338, 798, 918, 738, 87, 67, 2738, 1435, 4359, 738, 261, 915, 529, 1164, 12, 83,...
address += str(tools.ustr(add.country_id.name.encode('ascii','replace')))
address += tools.ustr(add.country_id.name)
def GetMap(self, cr, uid, ids, context={}): res = {} res_inv = {} res_cus = {} address = ' ' coordinates = [] addresslist = [] country_list = [] coordinates_text = ' ' number_customer=0 number_supplier=0 colors = ['9f8080ff', '9f0000ff']
7804a8b91c64352d8cb758b580b6e9243f736b09 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/7804a8b91c64352d8cb758b580b6e9243f736b09/google_earth.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 863, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 400, 273, 2618, 400, 67, 5768, 273, 2618, 400, 67, 71, 407, 273, 2618, 1758, 273, 296, 296, 5513, 273, 5378, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 863, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 400, 273, 2618, 400, 67, 5768, 273, 2618, 400, 67, 71, 407, 273, 2618, 1758, 273, 296, 296, 5513, 273, 5378, 1...
return Map(nodes, edges, geomap.cellImage.size() * scale)
if labelImageSize == None: labelImageSize = geomap.cellImage.size() * scale return Map(nodes, edges, labelImageSize)
def pixelMap2subPixelMap(geomap, scale = 1.0, offset = Vector2(0, 0)): nodes, edges = pixelMapData(geomap, offset, scale) return Map(nodes, edges, geomap.cellImage.size() * scale)
8a4b243de44be7b611228d95d7601eef8d0040d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10394/8a4b243de44be7b611228d95d7601eef8d0040d7/pixelmap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4957, 863, 22, 1717, 9037, 863, 12, 10049, 438, 16, 3159, 273, 404, 18, 20, 16, 1384, 273, 5589, 22, 12, 20, 16, 374, 3719, 30, 2199, 16, 5231, 273, 4957, 863, 751, 12, 10049, 438, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4957, 863, 22, 1717, 9037, 863, 12, 10049, 438, 16, 3159, 273, 404, 18, 20, 16, 1384, 273, 5589, 22, 12, 20, 16, 374, 3719, 30, 2199, 16, 5231, 273, 4957, 863, 751, 12, 10049, 438, ...
def outlier_utils(args):
def run(command_name, args):
def outlier_utils(args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plots = StringIO() log.register(label="log_buffer", file_object=string_buffer) phil_objects = [] argument_interpreter = libtbx.phil.command_line.argument_interpreter( master_params=master_params, home_scope="outlier_detection") for arg in args: command_line_params = None arg_is_processed = False # is it a file? if arg=="--quiet": arg_is_processed = True if (os.path.isfile(arg)): ## is this a file name? # check if it is a phil file try: command_line_params = iotbx.phil.parse(file_name=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass else: try: command_line_params = argument_interpreter.process(arg=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass if not arg_is_processed: print >> log, "##----------------------------------------------##" print >> log, "## Unknown file or keyword:", arg print >> log, "##----------------------------------------------##" print >> log raise Sorry("Unknown file or keyword: %s" % arg) effective_params = master_params.fetch(sources=phil_objects) params = effective_params.extract() # now get the unit cell from the pdb file hkl_xs = None if params.outlier_utils.input.xray_data.file_name is not None: hkl_xs = crystal_symmetry_from_any.extract_from( file_name=params.outlier_utils.input.xray_data.file_name) pdb_xs = None if params.outlier_utils.input.model.file_name is not None: pdb_xs = crystal_symmetry_from_any.extract_from( file_name=params.outlier_utils.input.model.file_name) phil_xs = crystal.symmetry( unit_cell=params.outlier_utils.input.unit_cell, space_group_info=params.outlier_utils.input.space_group ) combined_xs = select_crystal_symmetry( None,phil_xs, [pdb_xs],[hkl_xs]) # inject the unit cell and symmetry in the phil scope please params.outlier_utils.input.unit_cell = combined_xs.unit_cell() params.outlier_utils.input.space_group = \ sgtbx.space_group_info( group = combined_xs.space_group() ) new_params = master_params.format(python_object=params) new_params.show(out=log) if params.outlier_utils.input.unit_cell is None: raise Sorry("unit cell not specified") if params.outlier_utils.input.space_group is None: raise Sorry("space group not specified") if params.outlier_utils.input.xray_data.file_name is None: raise Sorry("Xray data not specified") if params.outlier_utils.input.model.file_name is None: print "PDB file not specified. Basic wilson outlier rejections only." #----------------------------------------------------------- # # step 1: read in the reflection file # phil_xs = crystal.symmetry( unit_cell=params.outlier_utils.input.unit_cell, space_group_info=params.outlier_utils.input.space_group ) xray_data_server = reflection_file_utils.reflection_file_server( crystal_symmetry = phil_xs, force_symmetry = True, reflection_files=[]) miller_array = None miller_array = xray_data_server.get_xray_data( file_name = params.outlier_utils.input.xray_data.file_name, labels = params.outlier_utils.input.xray_data.obs_labels, ignore_all_zeros = True, parameter_scope = 'outlier_utils.input.xray_data', parameter_name = 'obs_labels' ) info = miller_array.info() miller_array = miller_array.map_to_asu() miller_array = miller_array.select( miller_array.indices() != (0,0,0)) miller_array = miller_array.select( miller_array.data() > 0 ) if miller_array.sigmas() is not None: miller_array = miller_array.select( miller_array.sigmas() > 0 ) if (miller_array.is_xray_intensity_array()): miller_array = miller_array.f_sq_as_f() elif (miller_array.is_complex_array()): miller_array = abs(miller_array) miller_array.set_info(info) merged_anomalous=False if miller_array.anomalous_flag(): miller_array = miller_array.average_bijvoet_mates().set_observation_type( miller_array ) merged_anomalous=True miller_array = miller_array.map_to_asu() # get the free reflections please free_flags = None if params.outlier_utils.input.xray_data.free_flags is None: free_flags = miller_array.generate_r_free_flags( fraction=params.outlier_utils.\ additional_parameters.free_flag_generation.fraction, max_free=params.outlier_utils.\ additional_parameters.free_flag_generation.max_number, lattice_symmetry_max_delta=params.outlier_utils.\ additional_parameters.free_flag_generation.lattice_symmetry_max_delta, use_lattice_symmetry=params.outlier_utils.\ additional_parameters.free_flag_generation.use_lattice_symmetry ) else: free_flags = xray_data_server.get_xray_data( file_name = params.outlier_utils.input.xray_data.file_name, labels = params.outlier_utils.input.xray_data.free_flags, ignore_all_zeros = True, parameter_scope = 'outlier_utils.input.xray_data', parameter_name = 'free_flags' ) if miller_array.anomalous_flag(): free_flags = free_flags.miller_array.average_bijvoet_mates() merged_anomalous=True free_flags = free_flags.common_set( miller_array ) free_flags = free_flags.customized_copy( data = flex.bool( free_flags.data()== 1 )) free_flags = free_flags.common_set( miller_array ).map_to_asu() free_flags, miller_array = free_flags.common_sets( miller_array ) print >> log print >> log, "Summary info of observed data" print >> log, "=============================" miller_array.show_summary(f=log) if merged_anomalous: print >> log, "For outlier detection purposes, the Bijvoet pairs have been merged." print >> log print >> log, "Constructing an outlier manager" print >> log, "===============================" print >> log outlier_manager = outlier_rejection.outlier_manager( miller_array, out=log) basic_array = None extreme_array = None model_based_array = None basic_array = outlier_manager.basic_wilson_outliers( p_basic_wilson = params.outlier_utils.outlier_detection.\ parameters.basic_wilson.level, return_array = True) extreme_array = outlier_manager.extreme_wilson_outliers( p_extreme_wilson = params.outlier_utils.outlier_detection.parameters.\ extreme_wilson.level, return_array = True) #---------------------------------------------------------------- # Step 2: get an xray structure from the PDB file # if params.outlier_utils.input.model.file_name is not None: model = xray_structure.from_pdb( file_name=params.outlier_utils.input.model.file_name, crystal_symmetry=phil_xs, force_symmetry=True) print >> log, "Atomic model summary" print >> log, "====================" model.show_summary(f=log) print >> log # please make an f_model object for bulk solvent scaling etc etc f_model_object = f_model.manager( f_obs = miller_array, r_free_flags = free_flags, xray_structure = model ) print >> log, "Bulk solvent scaling of the data" print >> log, "================================" print >> log, "Maximum likelihood bulk solvent scaling." print >> log f_model_object.update_solvent_and_scale(out=log) b_cart = f_model_object.b_cart() k_sol = f_model_object.k_sol() b_sol = f_model_object.b_sol() ls_scale = 1.0/f_model_object.scale_k1() print >> log print >> log, "The observed data is scaled by a multiplier" print >> log, "equal to %5.2e"%(ls_scale) print >> log, "This brings the data to an approximate absolute scale." # update the outlier object please outlier_manager.apply_scale_to_original_data( ls_scale) free_flags = free_flags.common_set( outlier_manager.miller_obs ) # redo the f model object please f_model_object = f_model.manager( f_obs = outlier_manager.miller_obs, r_free_flags = free_flags, xray_structure = model) # reset the bulk solvent parameters please f_model_object.update_core(b_cart=b_cart, k_sol=k_sol, b_sol=b_sol) f_model_data = f_model_object.f_model() plot_out = StringIO() # get alphas and betas please alpha,beta = f_model_object.alpha_beta() # get suspected outliers model_based_array = outlier_manager.model_based_outliers( f_model_data, alpha, beta, level=params.outlier_utils.outlier_detection.parameters.model_based.level, return_array=True, plot_out=plot_out) #check what needs to be put out please if params.outlier_utils.output.hklout is not None: if params.outlier_utils.outlier_detection.protocol == "model": if params.outlier_utils.input.model.file_name == None: print >> log, "Model based rejections requested. No model was supplied." print >> log, "Switching to writing out rejections based on extreme value Wilson statistics." params.outlier_utils.outlier_detection.protocol="extreme" output_array = None print >> log if params.outlier_utils.outlier_detection.protocol == "basic": print >> log, "Outliers found by the basic wilson statistics" print >> log, "protocol will be written out." output_array = basic_array new_set_of_free_flags = free_flags.common_set( basic_array ) if params.outlier_utils.outlier_detection.protocol == "extreme": print >> log, "Outliers found by the extreme value wilson statistics" print >> log, "protocol will be written out." output_array = extreme_array new_set_of_free_flags = free_flags.common_set( extreme_array ) if params.outlier_utils.outlier_detection.protocol == "model": print >> log, "Outliers found by the model based" print >> log, "protocol will be written out to the file:" print >> log, params.outlier_utils.output.hklout print >> log output_array = model_based_array new_set_of_free_flags = free_flags.common_set( model_based_array ) mtz_dataset = output_array.as_mtz_dataset( column_root_label="FOBS") mtz_dataset = mtz_dataset.add_miller_array( miller_array = new_set_of_free_flags, column_root_label = "Free_R_Flag" ) mtz_dataset.mtz_object().write( file_name=params.outlier_utils.output.hklout) if params.outlier_utils.output.logfile is not None: final_log = StringIO() print >> final_log, string_buffer.getvalue() print >> final_log print >> final_log, plot_out.getvalue() outfile = open( params.outlier_utils.output.logfile, 'w' ) outfile.write( final_log.getvalue() ) print >> log print >> log, "A logfile named %s was created."%( params.outlier_utils.output.logfile) print >> log, "This logfile contains the screen output and" print >> log, "(possibly) some ccp4 style loggraph plots"
95ea40706150efdd497c59bd7453515caa13e6e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/95ea40706150efdd497c59bd7453515caa13e6e4/remove_outliers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 3076, 67, 529, 16, 833, 4672, 309, 562, 12, 1968, 13, 631, 20, 30, 1172, 67, 5201, 1435, 1327, 261, 5238, 5201, 6, 316, 833, 262, 30, 1172, 67, 5201, 1435, 1327, 261, 5238,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3076, 67, 529, 16, 833, 4672, 309, 562, 12, 1968, 13, 631, 20, 30, 1172, 67, 5201, 1435, 1327, 261, 5238, 5201, 6, 316, 833, 262, 30, 1172, 67, 5201, 1435, 1327, 261, 5238,...
default = set(self._site.family.disambig('_default'))
try: default = set(self._site.family.disambig('_default')) except KeyError: default = set(u'Disambig')
def isDisambig(self, get_Index=True): """Return True if this is a disambiguation page, False otherwise.
aa521c91b2ce11be34010ff73fd32b99743e8eda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/aa521c91b2ce11be34010ff73fd32b99743e8eda/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 1669, 2536, 360, 12, 2890, 16, 336, 67, 1016, 33, 5510, 4672, 3536, 990, 1053, 309, 333, 353, 279, 1015, 26011, 367, 1363, 16, 1083, 3541, 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, 0, 0, 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, 353, 1669, 2536, 360, 12, 2890, 16, 336, 67, 1016, 33, 5510, 4672, 3536, 990, 1053, 309, 333, 353, 279, 1015, 26011, 367, 1363, 16, 1083, 3541, 18, 2, -100, -100, -100, -100, -100, -10...
self.__redraw ()
if self.__offscreen: self.__update_from_offscreen () else: self.__redraw ()
def __handle_expose_event (self, self_, event):
8d5093e4a2340e29c99296ea4204ff46670eb549 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12310/8d5093e4a2340e29c99296ea4204ff46670eb549/Timeline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4110, 67, 338, 4150, 67, 2575, 261, 2890, 16, 365, 67, 16, 871, 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...
[ 1, 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, 1001, 4110, 67, 338, 4150, 67, 2575, 261, 2890, 16, 365, 67, 16, 871, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
open('tmp/tiff57.tif','w').write(open('data/byte.tif').read())
open('tmp/tiff57.tif','wb').write(open('data/byte.tif', 'rb').read())
def tiff_write_57(): drv = gdal.GetDriverByName( 'GTiff' ) md = drv.GetMetadata() # Expected to fail with libtiff < 4.0 as it needs TIFFUnsetField, so skip it if string.find(md['DMD_CREATIONOPTIONLIST'],'BigTIFF') == -1: return 'skip' # copy a file to tmp dir to modify. open('tmp/tiff57.tif','w').write(open('data/byte.tif').read()) # open and set a non-northup geotransform. ds = gdal.Open('tmp/tiff57.tif',gdal.GA_Update) ds.SetGeoTransform([100,1,3,200,3,1]) ds = None ds = gdal.Open('tmp/tiff57.tif') gt = ds.GetGeoTransform() ds = None if gt != (100,1,3,200,3,1): print gt gdaltest.post_reason( 'did not get expected geotransform, perhaps unset is not working?' ) return 'fail' gdal.GetDriverByName('GTiff').Delete('tmp/tiff57.tif') return 'success'
35934889d5ed539bbdd1a35e3dcba778d841c9b4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10289/35934889d5ed539bbdd1a35e3dcba778d841c9b4/tiff_write.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 3048, 67, 2626, 67, 10321, 13332, 225, 302, 4962, 273, 15551, 287, 18, 967, 4668, 5911, 12, 296, 16506, 3048, 11, 262, 3481, 273, 302, 4962, 18, 967, 2277, 1435, 468, 13219, 358, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 3048, 67, 2626, 67, 10321, 13332, 225, 302, 4962, 273, 15551, 287, 18, 967, 4668, 5911, 12, 296, 16506, 3048, 11, 262, 3481, 273, 302, 4962, 18, 967, 2277, 1435, 468, 13219, 358, ...
finalDict['TotalRecords'] = len(records) return S_OK(finalDict)
finalDict['TotalRecords'] = len( records ) return S_OK( finalDict )
def getUserSummaryWeb(self,selectDict, sortList, startItem, maxItems): """ Get the summary of user jobs in a standard form for the Web portal. Pagination and global sorting is supported. """
99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4735, 4733, 4079, 12, 2890, 16, 4025, 5014, 16, 1524, 682, 16, 787, 1180, 16, 943, 3126, 4672, 3536, 968, 326, 4916, 434, 729, 6550, 316, 279, 4529, 646, 364, 326, 2999, 11899, 18, 169...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4735, 4733, 4079, 12, 2890, 16, 4025, 5014, 16, 1524, 682, 16, 787, 1180, 16, 943, 3126, 4672, 3536, 968, 326, 4916, 434, 729, 6550, 316, 279, 4529, 646, 364, 326, 2999, 11899, 18, 169...
args.append( "'%s'" % (arg.replace("'", '%c%c%c%c%c' % (0x27,0x22,0x27,0x22,0x27))) )
args.append( arg )
def infof( self, format, *args ): line = format % args self._file.write( line ) cfg.infof( '%s', line )
1b493e75d8e0b99789847ab53ff3127b336cb1fb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13161/1b493e75d8e0b99789847ab53ff3127b336cb1fb/configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1123, 74, 12, 365, 16, 740, 16, 380, 1968, 262, 30, 980, 273, 740, 738, 833, 365, 6315, 768, 18, 2626, 12, 980, 262, 2776, 18, 1376, 74, 12, 1995, 87, 2187, 980, 262, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1123, 74, 12, 365, 16, 740, 16, 380, 1968, 262, 30, 980, 273, 740, 738, 833, 365, 6315, 768, 18, 2626, 12, 980, 262, 2776, 18, 1376, 74, 12, 1995, 87, 2187, 980, 262, 2, -100, -100...
mimetype = mimetypes.guess_type(path)[0]
if force_mimetype : mimetype = force_mimetype else : mimetype = mimetypes.guess_type(path)[0]
def get_media_internal (request, path, use_cache=True) : # get media type mimetype = mimetypes.guess_type(path)[0] contents = get_mime_handler(mimetype)(request, file(path, "rb"), path=path) return ( contents, mimetype, 200, rfc822.formatdate(os.stat(path)[stat.ST_MTIME]), )
118e8e2c4fddd63f6cf6650853c68cb0b173aa7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4349/118e8e2c4fddd63f6cf6650853c68cb0b173aa7b/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 5829, 67, 7236, 261, 2293, 16, 589, 16, 999, 67, 2493, 33, 5510, 13, 294, 468, 336, 3539, 618, 309, 2944, 67, 22571, 294, 12595, 273, 2944, 67, 22571, 469, 294, 12595, 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, 336, 67, 5829, 67, 7236, 261, 2293, 16, 589, 16, 999, 67, 2493, 33, 5510, 13, 294, 468, 336, 3539, 618, 309, 2944, 67, 22571, 294, 12595, 273, 2944, 67, 22571, 469, 294, 12595, 273, ...
return washer.wash(value, allowed_attribute_whitelist=[], allowed_tag_whitelist=[] )
try: return washer.wash(value, allowed_attribute_whitelist=[], allowed_tag_whitelist=[] ) except HTMLParseError: return cgi.escape(value)
def escape_field(value, mode=0): """ Utility function used to escape the value of a field in given mode. - mode 0: no escaping - mode 1: escaping all HTML/XML characters (escaped chars are shown as escaped) - mode 2: escaping unsafe HTML tags to avoid XSS, but keep basic one (such as <br />) Escaped tags are removed. - mode 3: mix of mode 1 and mode 2. If field_value starts with <!--HTML-->, then use mode 2. Else use mode 1. - mode 4: escaping all HTML/XML tags (escaped tags are removed) - mode 5: same as 2, but allows more tags, like <img> - mode 6: same as 3, but allows more tags, like <img> """ if mode == 1: return cgi.escape(value) elif mode in [2, 5]: allowed_attribute_whitelist = cfg_html_buffer_allowed_attribute_whitelist allowed_tag_whitelist = cfg_html_buffer_allowed_tag_whitelist + \ ['class'] if mode == 5: allowed_attribute_whitelist += ['src', 'alt', 'width', 'height', 'style'] allowed_tag_whitelist += ['img'] return washer.wash(value, allowed_attribute_whitelist=\ allowed_attribute_whitelist, allowed_tag_whitelist= \ allowed_tag_whitelist ) elif mode in [3, 6]: if value.lstrip(' \n').startswith(html_field): allowed_attribute_whitelist = cfg_html_buffer_allowed_attribute_whitelist allowed_tag_whitelist = cfg_html_buffer_allowed_tag_whitelist + \ ['class'] if mode == 6: allowed_attribute_whitelist += ['src', 'alt', 'width', 'height', 'style'] allowed_tag_whitelist += ['img'] return washer.wash(value, allowed_attribute_whitelist=\ allowed_attribute_whitelist, allowed_tag_whitelist=\ allowed_tag_whitelist ) else: return cgi.escape(value) elif mode == 4: return washer.wash(value, allowed_attribute_whitelist=[], allowed_tag_whitelist=[] ) else: return value
d37904acbe4c5b7ec0d9d2fcabebfe1b7742dba8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/d37904acbe4c5b7ec0d9d2fcabebfe1b7742dba8/bibformat_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4114, 67, 1518, 12, 1132, 16, 1965, 33, 20, 4672, 3536, 13134, 445, 1399, 358, 4114, 326, 460, 434, 279, 652, 316, 864, 1965, 18, 225, 300, 1965, 374, 30, 1158, 20604, 300, 1965, 404, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4114, 67, 1518, 12, 1132, 16, 1965, 33, 20, 4672, 3536, 13134, 445, 1399, 358, 4114, 326, 460, 434, 279, 652, 316, 864, 1965, 18, 225, 300, 1965, 374, 30, 1158, 20604, 300, 1965, 404, ...
raises(ImportError "__import__('uu', globals(), locals(), [])")
raises(ImportError, "__import__('uu', globals(), locals(), [])")
def test_bad_pyc(self): import zipimport import sys m0 = ord(self.test_pyc[0]) m0 ^= 0x04 test_pyc = chr(m0) + self.test_pyc[1:] self.writefile(self, "uu.pyc", test_pyc) raises(ImportError "__import__('uu', globals(), locals(), [])") assert 'uu' not in sys.modules
91c6b9d32753f7f155f105d803022fcb179766f2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/91c6b9d32753f7f155f105d803022fcb179766f2/test_zipimport.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 8759, 67, 2074, 71, 12, 2890, 4672, 1930, 3144, 5666, 1930, 2589, 312, 20, 273, 4642, 12, 2890, 18, 3813, 67, 2074, 71, 63, 20, 5717, 312, 20, 10352, 374, 92, 3028, 1842, 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, 1842, 67, 8759, 67, 2074, 71, 12, 2890, 4672, 1930, 3144, 5666, 1930, 2589, 312, 20, 273, 4642, 12, 2890, 18, 3813, 67, 2074, 71, 63, 20, 5717, 312, 20, 10352, 374, 92, 3028, 1842, 6...
def schedule(self): """ send messages to new peers, if necessary """ if self.finished: return l = self.found.values() l.sort(self.sort) for node in l[:K]: if node.id == self.target: self.finished=1 return self.callback([node]) if (not self.queried.has_key(node.id)) and node.id != self.table.node.id: df = node.findNode(self.target, self.table.node.senderDict()) df.addCallbacks(self.handleGotNodes, self.makeMsgFailed(node)) self.outstanding = self.outstanding + 1 self.queried[node.id] = 1 if self.outstanding >= const.CONCURRENT_REQS: break assert(self.outstanding) >=0 if self.outstanding == 0: self.finished=1 reactor.callFromThread(self.callback, l[:K])
def schedule(self): """ send messages to new peers, if necessary """ if self.finished: return l = self.found.values() l.sort(self.sort)
def schedule(self):
815cbec78a6e942fe1dd3e3ef1b578ab1c471873 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/665/815cbec78a6e942fe1dd3e3ef1b578ab1c471873/actions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4788, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4788, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
template, company_id, context=context,
company_id, context=context,
def create_tax_code(self, cursor, user, template, company_id, context=None, template2tax_code=None, parent_id=False): ''' Create recursively tax codes based on template.
e86c36fdb94ed128bdaad6eec9e91c5862a4c57d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9290/e86c36fdb94ed128bdaad6eec9e91c5862a4c57d/tax.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 8066, 67, 710, 12, 2890, 16, 3347, 16, 729, 16, 1542, 16, 9395, 67, 350, 16, 819, 33, 7036, 16, 1542, 22, 8066, 67, 710, 33, 7036, 16, 982, 67, 350, 33, 8381, 4672, 9163, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 67, 8066, 67, 710, 12, 2890, 16, 3347, 16, 729, 16, 1542, 16, 9395, 67, 350, 16, 819, 33, 7036, 16, 1542, 22, 8066, 67, 710, 33, 7036, 16, 982, 67, 350, 33, 8381, 4672, 9163, ...
parameterName = classes[i][1]
parameterName = classes[i][0]
def __updateChildUIs( self ) : classes = self.parameter.getClasses( True ) # delete any uis for parameters which have disappeared parameterNamesSet = set( [ c[1] for c in classes ] ) for parameterName in self.__childUIs.keys() : if parameterName not in parameterNamesSet : maya.cmds.deleteUI( self.__childUIs[parameterName]._topLevelUI() ) del self.__childUIs[parameterName] # and create or reorder uis for remaining parameters attachForm = [ ( self.__addButton, "left", 20 + IECoreMaya.CompoundParameterUI._labelIndent( self.__kw["hierarchyDepth"] + 1 ) ), ( self.__addButton, "bottom", 5 ), ] attachControl = [] attachNone = [] prevChildUI = None for i in range( 0, len( classes ) ) : parameterName = classes[i][1] childUI = self.__childUIs.get( parameterName, None ) if childUI : # delete it if it's not the right sort any more if childUI.__className!=classes[i][2] or childUI.__classVersion!=classes[i][3] : maya.cmds.deleteUI( childUI._topLevelUI() ) childUI = None if not childUI : with IECoreMaya.UITemplate( "attributeEditorTemplate" ) : maya.cmds.setParent( self.__formLayout ) childUI = ChildUI( self.parameter[parameterName], **self.__kw ) childUI.__className = classes[i][2] childUI.__classVersion = classes[i][3] self.__childUIs[parameterName] = childUI attachForm += [ ( childUI._topLevelUI(), "left", 0 ), ( childUI._topLevelUI(), "right", 0 ), ] if i==0 : attachForm.append( ( childUI._topLevelUI(), "top", 5 ) ) else : attachControl.append( ( childUI._topLevelUI(), "top", 0, prevChildUI._topLevelUI() ) ) attachNone.append( ( childUI._topLevelUI(), "bottom" ) ) prevChildUI = childUI
519835b54d3869fcd55ad2b4a1c9117b1550acc6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9042/519835b54d3869fcd55ad2b4a1c9117b1550acc6/ClassVectorParameterUI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2725, 1763, 57, 2520, 12, 365, 262, 294, 225, 3318, 273, 365, 18, 6775, 18, 588, 4818, 12, 1053, 262, 225, 468, 1430, 1281, 582, 291, 364, 1472, 1492, 1240, 1015, 438, 347, 2258,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2725, 1763, 57, 2520, 12, 365, 262, 294, 225, 3318, 273, 365, 18, 6775, 18, 588, 4818, 12, 1053, 262, 225, 468, 1430, 1281, 582, 291, 364, 1472, 1492, 1240, 1015, 438, 347, 2258,...
self._selection_changed()
cursel = int(self.listbox.curselection()[0]) self._change_start(self.completions[cursel])
def listupdate_event(self, event): if not self.is_active(): return self.userwantswindow = True self._selection_changed()
4caee3e62f43c46b049bd7e1bacc6e03cf1f633f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/4caee3e62f43c46b049bd7e1bacc6e03cf1f633f/AutoCompleteWindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 2725, 67, 2575, 12, 2890, 16, 871, 4672, 309, 486, 365, 18, 291, 67, 3535, 13332, 327, 365, 18, 1355, 91, 4388, 5668, 273, 1053, 365, 6315, 10705, 67, 6703, 1435, 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, 666, 2725, 67, 2575, 12, 2890, 16, 871, 4672, 309, 486, 365, 18, 291, 67, 3535, 13332, 327, 365, 18, 1355, 91, 4388, 5668, 273, 1053, 365, 6315, 10705, 67, 6703, 1435, 2, -100, -100, ...
1/0
1./0
def f(p): 1/0
33715f480fc70c2d6211595f77c5fb72a0d256c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/33715f480fc70c2d6211595f77c5fb72a0d256c5/test_profilehooks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 12, 84, 4672, 404, 19, 20, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 12, 84, 4672, 404, 19, 20, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
byte_size = height * pitch
def _wrap_bitmap_bits_in_array(bitmap, shape, dtype): """Return an ndarray view on the data in a FreeImage bitmap. Only valid for as long as the bitmap is loaded (if single page) / locked in memory (if multipage). """ pitch = _FI.FreeImage_GetPitch(bitmap) height = shape[-1] byte_size = height * pitch itemsize = dtype.itemsize if len(shape) == 3: strides = (itemsize, shape[0]*itemsize, pitch) else: strides = (itemsize, pitch) bits = _FI.FreeImage_GetBits(bitmap) class DummyArray: __array_interface__ = { 'data': (bits, False), 'strides': strides, 'typestr': dtype.str, 'shape': tuple(shape), } # Still segfaulting on 64-bit machine because of illegal memory access return numpy.array(DummyArray())
30b4ff227457ee1922da64123d4c9bf09abcf91f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12573/30b4ff227457ee1922da64123d4c9bf09abcf91f/freeimage_plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4113, 67, 3682, 1458, 67, 6789, 67, 267, 67, 1126, 12, 3682, 1458, 16, 2179, 16, 3182, 4672, 3536, 990, 392, 8304, 1476, 603, 326, 501, 316, 279, 15217, 2040, 9389, 18, 5098, 923,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4113, 67, 3682, 1458, 67, 6789, 67, 267, 67, 1126, 12, 3682, 1458, 16, 2179, 16, 3182, 4672, 3536, 990, 392, 8304, 1476, 603, 326, 501, 316, 279, 15217, 2040, 9389, 18, 5098, 923,...
lines[0] = "
lines[0] = "
def write(self, file): if self.comments: file.write(self.comments) if (isinstance(self.msgid, MessageID) and self.msgid != self.msgid.default) or ( isinstance(self.msgid, Message) and self.msgid.default is not None): default = self.msgid.default.strip() lines = normalize(default).split("\n") lines[0] = "# Default: %s\n" % lines[0] for i in range(1, len(lines)): lines[i] = "# %s\n" % lines[i] file.write("".join(lines)) file.write('msgid %s\n' % normalize(self.msgid)) file.write('msgstr ""\n') file.write('\n')
62c8758173e77db1c2eb56c52650f838fe49bbfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9527/62c8758173e77db1c2eb56c52650f838fe49bbfc/extract.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 585, 4672, 309, 365, 18, 9231, 30, 585, 18, 2626, 12, 2890, 18, 9231, 13, 309, 261, 291, 1336, 12, 2890, 18, 3576, 350, 16, 2350, 734, 13, 471, 365, 18, 3576, 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, 1045, 12, 2890, 16, 585, 4672, 309, 365, 18, 9231, 30, 585, 18, 2626, 12, 2890, 18, 9231, 13, 309, 261, 291, 1336, 12, 2890, 18, 3576, 350, 16, 2350, 734, 13, 471, 365, 18, 3576, 3...
ProperlyCloseFilesTestCase.numberRounds = resource.getrlimit(resource.RLIMIT_NOFILE)[0] + 10
numRounds = resource.getrlimit(resource.RLIMIT_NOFILE)[0] + 10 ProperlyCloseFilesTestCase.numberRounds = numRounds
def testWriteNotificationRaises(self): self.client.writeConnectionLost = self.aBug self.client.transport.loseWriteConnection() spinUntil(lambda :self.client.closed) log.flushErrors(RuntimeError)
68998e21ef533677da748f03432912990acb38b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68998e21ef533677da748f03432912990acb38b1/test_tcp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 3067, 4386, 12649, 6141, 12, 2890, 4672, 365, 18, 2625, 18, 2626, 1952, 19024, 273, 365, 18, 69, 19865, 365, 18, 2625, 18, 13049, 18, 2061, 3067, 1952, 1435, 12490, 9716, 12, 14661...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 3067, 4386, 12649, 6141, 12, 2890, 4672, 365, 18, 2625, 18, 2626, 1952, 19024, 273, 365, 18, 69, 19865, 365, 18, 2625, 18, 13049, 18, 2061, 3067, 1952, 1435, 12490, 9716, 12, 14661...
path_iterator = [(os.path.dirname(top_path), [], [os.path.basename(top_path)])]
path_iterator = [(os.path.dirname(self.top_path), [], [os.path.basename(self.top_path)])]
def do(self): sys.stdout.write("JOBDESC: Scanning files for keywords.\n") sys.stdout.write("MESSAGE: Loading keywords...\n") sys.stdout.flush() keywords = Keyword.objects.all()
76be4c9ed94775c054b500425d9dfd716593e570 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4227/76be4c9ed94775c054b500425d9dfd716593e570/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 12, 2890, 4672, 2589, 18, 10283, 18, 2626, 2932, 18321, 10964, 30, 2850, 10903, 1390, 364, 7093, 8403, 82, 7923, 2589, 18, 10283, 18, 2626, 2932, 8723, 30, 4444, 310, 7093, 2777, 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, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 12, 2890, 4672, 2589, 18, 10283, 18, 2626, 2932, 18321, 10964, 30, 2850, 10903, 1390, 364, 7093, 8403, 82, 7923, 2589, 18, 10283, 18, 2626, 2932, 8723, 30, 4444, 310, 7093, 2777, 64...
ioctl(self.dev, 0x3701, struct.pack("HH", address, data))
ioctl(self.dev, 0x3701, struct.pack("HB", address, data))
def poke(self, address, data): """Store the given address/data pair""" ioctl(self.dev, 0x3701, struct.pack("HH", address, data))
9eacd11461486285270fae6a3dfa621a6fbf2100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/9eacd11461486285270fae6a3dfa621a6fbf2100/rcpod.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 3056, 12, 2890, 16, 1758, 16, 501, 4672, 3536, 2257, 326, 864, 1758, 19, 892, 3082, 8395, 2527, 12930, 12, 2890, 18, 5206, 16, 374, 92, 6418, 1611, 16, 1958, 18, 2920, 2932, 17500...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 293, 3056, 12, 2890, 16, 1758, 16, 501, 4672, 3536, 2257, 326, 864, 1758, 19, 892, 3082, 8395, 2527, 12930, 12, 2890, 18, 5206, 16, 374, 92, 6418, 1611, 16, 1958, 18, 2920, 2932, 17500...
type -- type of the s.d. code; one of 1,2,3, or 4.
typ -- type of the s.d. code; one of 1,2,3, or 4.
def sd_zeta_polynomial(C,type=1): r""" Returns the Duursma zeta function of a self-dual code using the construction in [D].
24267b4dbde13a19b59225e71b0b95cf6a68a709 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/24267b4dbde13a19b59225e71b0b95cf6a68a709/linear_code.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8349, 67, 94, 1066, 67, 3915, 13602, 12, 39, 16, 723, 33, 21, 4672, 436, 8395, 2860, 326, 463, 89, 25152, 2540, 998, 1066, 445, 434, 279, 365, 17, 72, 1462, 981, 1450, 326, 16171, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8349, 67, 94, 1066, 67, 3915, 13602, 12, 39, 16, 723, 33, 21, 4672, 436, 8395, 2860, 326, 463, 89, 25152, 2540, 998, 1066, 445, 434, 279, 365, 17, 72, 1462, 981, 1450, 326, 16171, 31...
O_opts[o_arg] = True
opts[o_arg] = True
def _parse_options(o_str): opts = {} if not o_str: return opts o_args = o_str.split(',') for o_arg in o_args: o_arg = o_arg.strip() try: o_key, o_val = o_arg.split('=') o_key = o_key.strip() o_val = o_val.strip() except ValueError: O_opts[o_arg] = True else: O_opts[o_key] = o_val return opts
dad05e84c38c47fe4b429bb298a8d307fb964d01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6148/dad05e84c38c47fe4b429bb298a8d307fb964d01/cmdline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 2116, 12, 83, 67, 701, 4672, 1500, 273, 2618, 309, 486, 320, 67, 701, 30, 327, 1500, 320, 67, 1968, 273, 320, 67, 701, 18, 4939, 12, 2187, 6134, 364, 320, 67, 3175, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2116, 12, 83, 67, 701, 4672, 1500, 273, 2618, 309, 486, 320, 67, 701, 30, 327, 1500, 320, 67, 1968, 273, 320, 67, 701, 18, 4939, 12, 2187, 6134, 364, 320, 67, 3175, ...
asyncore.loop(use_poll=self.usepoll)
asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
def test_simple_producer(self): s = echo_server() s.start() time.sleep(0.5) # Give server time to initialize c = echo_client('\n') data = "hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll)#, count=5, timeout=5) s.join()
dc11e0c6f75ccb21dc266afee4f3afbdf3db4198 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/dc11e0c6f75ccb21dc266afee4f3afbdf3db4198/test_asynchat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9647, 67, 11776, 2750, 12, 2890, 4672, 272, 273, 3376, 67, 3567, 1435, 272, 18, 1937, 1435, 813, 18, 19607, 12, 20, 18, 25, 13, 468, 22374, 1438, 813, 358, 4046, 276, 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, 1842, 67, 9647, 67, 11776, 2750, 12, 2890, 4672, 272, 273, 3376, 67, 3567, 1435, 272, 18, 1937, 1435, 813, 18, 19607, 12, 20, 18, 25, 13, 468, 22374, 1438, 813, 358, 4046, 276, 273, ...
self.block_size = 4096 self.max_block = 100
self.block_size = block_size self.max_block = block_count
def __init__(self, file, file_size): self.file = file self.file_size = file_size self.block_size = 4096 self.max_block = 100 self.blocks = {}
fd111dc80b6122bcd7074fc0a60484ba18098368 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2280/fd111dc80b6122bcd7074fc0a60484ba18098368/file.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 585, 16, 585, 67, 1467, 4672, 365, 18, 768, 273, 585, 365, 18, 768, 67, 1467, 273, 585, 67, 1467, 365, 18, 2629, 67, 1467, 273, 1203, 67, 1467, 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, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 585, 16, 585, 67, 1467, 4672, 365, 18, 768, 273, 585, 365, 18, 768, 67, 1467, 273, 585, 67, 1467, 365, 18, 2629, 67, 1467, 273, 1203, 67, 1467, 365, ...
def __init__(self, order=None, params=None, dtype=0):
def __init__(self, order, params=None, dtype=0):
def __init__(self, order=None, params=None, dtype=0): functional.__init__(self, name="evenpoly", order=order, params= params, dtype=dtype) if params is None: self.set_parameters([v+1. for v in self.parameters()])
181fc45332a548d05739eb951d6b72074ad435a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7472/181fc45332a548d05739eb951d6b72074ad435a8/functional.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1353, 16, 859, 33, 7036, 16, 3182, 33, 20, 4672, 18699, 16186, 2738, 972, 12, 2890, 16, 508, 1546, 16728, 16353, 3113, 1353, 33, 1019, 16, 859, 33, 859, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1353, 16, 859, 33, 7036, 16, 3182, 33, 20, 4672, 18699, 16186, 2738, 972, 12, 2890, 16, 508, 1546, 16728, 16353, 3113, 1353, 33, 1019, 16, 859, 33, 859, ...
0, 0, 0)
0, 0, 0)
def resize(self, newsize): self.check_valid() self.check_resizeable() if _POSIX: if not has_mremap: msg = "mmap: resizing not available -- no mremap()" raise REnvironmentError(msg) # resize the underlying file first try: os.ftruncate(self.fd, newsize) except OSError, e: raise REnvironmentError(os.strerror(e.errno)) # now resize the mmap newdata = c_mremap(self.getptr(0), self.size, newsize, MREMAP_MAYMOVE or 0) self.setdata(newdata, newsize) elif _MS_WINDOWS: # disconnect the mapping self.unmapview() CloseHandle(self.map_handle)
f53cdc52815837ae3e6f65a826fcb8f8fb920d3f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/f53cdc52815837ae3e6f65a826fcb8f8fb920d3f/rmmap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7041, 12, 2890, 16, 394, 1467, 4672, 365, 18, 1893, 67, 877, 1435, 225, 365, 18, 1893, 67, 15169, 429, 1435, 225, 309, 389, 2419, 31773, 30, 309, 486, 711, 67, 81, 266, 1458, 30, 123...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7041, 12, 2890, 16, 394, 1467, 4672, 365, 18, 1893, 67, 877, 1435, 225, 365, 18, 1893, 67, 15169, 429, 1435, 225, 309, 389, 2419, 31773, 30, 309, 486, 711, 67, 81, 266, 1458, 30, 123...
self.assertEqual(mod.st[0][1:],
self.assertEqual(revise(*mod.st[0][1:]),
def test_stack(self): self.assert_(len(mod.st) >= 5) self.assertEqual(mod.st[0][1:], (modfile, 16, 'eggs', [' st = inspect.stack()\n'], 0)) self.assertEqual(mod.st[1][1:], (modfile, 9, 'spam', [' eggs(b + d, c + f)\n'], 0)) self.assertEqual(mod.st[2][1:], (modfile, 43, 'argue', [' spam(a, b, c)\n'], 0)) self.assertEqual(mod.st[3][1:], (modfile, 39, 'abuse', [' self.argue(a, b, c)\n'], 0))
a3538ebfe3120cf7478f91bd76674234b8cffda8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/a3538ebfe3120cf7478f91bd76674234b8cffda8/test_inspect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3772, 12, 2890, 4672, 365, 18, 11231, 67, 12, 1897, 12, 1711, 18, 334, 13, 1545, 1381, 13, 365, 18, 11231, 5812, 12, 9083, 784, 30857, 1711, 18, 334, 63, 20, 6362, 21, 2689...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3772, 12, 2890, 4672, 365, 18, 11231, 67, 12, 1897, 12, 1711, 18, 334, 13, 1545, 1381, 13, 365, 18, 11231, 5812, 12, 9083, 784, 30857, 1711, 18, 334, 63, 20, 6362, 21, 2689...
'hg qselect [OPTION...] [GUARD...]'),
'hg qselect [OPTION]... [GUARD]...'),
def _branchtags(self): q = self.mq if not q.applied: return super(mqrepo, self)._branchtags()
71e846bae6c4bf70906b0dae2f96fcc5a4bb8cb9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/71e846bae6c4bf70906b0dae2f96fcc5a4bb8cb9/mq.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7500, 4156, 12, 2890, 4672, 1043, 273, 365, 18, 11636, 309, 486, 1043, 18, 438, 3110, 30, 327, 2240, 12, 11636, 7422, 16, 365, 2934, 67, 7500, 4156, 1435, 2, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7500, 4156, 12, 2890, 4672, 1043, 273, 365, 18, 11636, 309, 486, 1043, 18, 438, 3110, 30, 327, 2240, 12, 11636, 7422, 16, 365, 2934, 67, 7500, 4156, 1435, 2, -100, -100, -100, -10...
"\nSummary of tests performed:\n" \ "-----------------------------\n"
"\n\n-------------------\n" \ "Summary of Results:\n" \ "-------------------\n"
def getSummaryEmailSectionStr(inOptions): summaryEmailSectionStr = \ "\nSummary of tests performed:\n" \ "-----------------------------\n" summaryEmailSectionStr += \ getTestCaseEmailSummary(inOptions.withMpiDebug, "MPI_DEBUG") summaryEmailSectionStr += \ getTestCaseEmailSummary(inOptions.withSerialRelease, "SERIAL_RELEASE") return summaryEmailSectionStr
7c078c06311143fac818db16e9886cd6a1f60c3d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1130/7c078c06311143fac818db16e9886cd6a1f60c3d/CheckinTest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1322, 27804, 4134, 5285, 1585, 12, 267, 1320, 4672, 4916, 4134, 5285, 1585, 273, 521, 1548, 82, 64, 82, 1271, 6062, 64, 82, 6, 521, 315, 4733, 434, 10351, 5581, 82, 6, 521, 315, 1271, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1322, 27804, 4134, 5285, 1585, 12, 267, 1320, 4672, 4916, 4134, 5285, 1585, 273, 521, 1548, 82, 64, 82, 1271, 6062, 64, 82, 6, 521, 315, 4733, 434, 10351, 5581, 82, 6, 521, 315, 1271, ...
self._data_channel.wait()
while True: notification = self._data_channel.wait() if notification.name == 'SIPRegistrationDidEnd': break
def _CH_unregister(self, command): notification_center = NotificationCenter() # Cancel any timer which would restart the registration process if self._refresh_timer is not None and self._refresh_timer.active(): self._refresh_timer.cancel() self._refresh_timer = None if self._registration is not None: self._registration.end(timeout=2) try: self._data_channel.wait() except SIPRegistrationDidNotEnd, e: notification_center.post_notification('SIPAccountRegistrationDidNotEnd', sender=self.account, data=TimestampedNotificationData(code=e.code, reason=e.reason, registration=self._registration)) else: notification_center.post_notification('SIPAccountRegistrationDidEnd', sender=self.account, data=TimestampedNotificationData(registration=self._registration)) finally: notification_center.remove_observer(self, sender=self._registration) self._registration = None command.signal()
acf3defabaf48767a177cbf61b78e3f5f810ebf3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/acf3defabaf48767a177cbf61b78e3f5f810ebf3/account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1792, 67, 318, 4861, 12, 2890, 16, 1296, 4672, 3851, 67, 5693, 273, 8050, 8449, 1435, 468, 10347, 1281, 5441, 1492, 4102, 7870, 326, 7914, 1207, 309, 365, 6315, 9144, 67, 12542, 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, 389, 1792, 67, 318, 4861, 12, 2890, 16, 1296, 4672, 3851, 67, 5693, 273, 8050, 8449, 1435, 468, 10347, 1281, 5441, 1492, 4102, 7870, 326, 7914, 1207, 309, 365, 6315, 9144, 67, 12542, 353...
anm1s[i] += sum([m*Z_Fbasis[i]*adj[i].__int__()//adj[self.d].__int__() for i in range(self.d)])
anm1s[i] += sum([m*Z_Fbasis[ii]*int(adj[ii])//int(adj[self.d]) for ii in range(self.d)])
def __init__(self, F, m, B, a=None): r""" Initialization routine (constructor).
ee3306b6e27b9defe901572ea884830c55a913c3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ee3306b6e27b9defe901572ea884830c55a913c3/totallyreal_rel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 478, 16, 312, 16, 605, 16, 279, 33, 7036, 4672, 436, 8395, 26586, 12245, 261, 12316, 2934, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 478, 16, 312, 16, 605, 16, 279, 33, 7036, 4672, 436, 8395, 26586, 12245, 261, 12316, 2934, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.view_main_window.connect('activate', self.minimize, self.plugin_api)
self.view_main_window_signal = self.view_main_window.connect(\ 'activate', \ self.minimize, \ self.plugin_api)
def create_static_menu(self): self.menu = gtk.Menu() self.view_main_window = gtk.CheckMenuItem(_("_View Main Window")) self.view_main_window.set_active(True) self.view_main_window.connect('activate', self.minimize, self.plugin_api) self.menu.append(self.view_main_window) # menuItem = gtk.ImageMenuItem(gtk.STOCK_ABOUT) # menuItem.connect('activate', self.about, self.plugin_api) # self.menu.append(menuItem) # self.menu.append(gtk.SeparatorMenuItem()) menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT) menuItem.connect('activate', self.exit, self.statusicon) self.menu.append(menuItem) self.menu.append(gtk.SeparatorMenuItem()) menuItem = gtk.ImageMenuItem(gtk.STOCK_ADD) menuItem.get_children()[0].set_label(_('Add _New Task')) menuItem.connect('activate', self.open_task) self.menu.append(menuItem)
464c5358289f97f6d870b3a41713c6ac3d79d7d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/464c5358289f97f6d870b3a41713c6ac3d79d7d4/notification_area.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 3845, 67, 5414, 12, 2890, 4672, 365, 18, 5414, 273, 22718, 18, 4599, 1435, 365, 18, 1945, 67, 5254, 67, 5668, 273, 22718, 18, 1564, 12958, 24899, 2932, 67, 1767, 12740, 6076, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3845, 67, 5414, 12, 2890, 4672, 365, 18, 5414, 273, 22718, 18, 4599, 1435, 365, 18, 1945, 67, 5254, 67, 5668, 273, 22718, 18, 1564, 12958, 24899, 2932, 67, 1767, 12740, 6076, ...
if join_keys != None and join_dict != None: for elem in join_keys: k = elem v = join_dict[k] if (self.already_joined.count(k) < 1): self.j = self.j.join(k,onclause=v) self.already_joined.append(k)
if join_dict != None: for elem in join_dict: for k,v in elem.iteritems(): if (self.already_joined.count(k) < 1): if hasattr(cls_ref,'column_conditional_join'): columns = cls_ref.column_conditional_join if columns.count(column.lower()) < 1: continue self.j = self.j.outerjoin(k,onclause=v) self.already_joined.append(k)
def append_results(self,cls_ref,value,column,operation): """ append_results() will take a value, column and operation from the search field, as well as the class of which the search pertains to, and will append the join and the filter needed to return the correct results.
8e587daf7228badc8abea580ab7d8e8cb9c6f51e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14755/8e587daf7228badc8abea580ab7d8e8cb9c6f51e/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 67, 4717, 12, 2890, 16, 6429, 67, 1734, 16, 1132, 16, 2827, 16, 7624, 4672, 3536, 714, 67, 4717, 1435, 903, 4862, 279, 460, 16, 1057, 471, 1674, 628, 326, 1623, 652, 16, 487, 54...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 714, 67, 4717, 12, 2890, 16, 6429, 67, 1734, 16, 1132, 16, 2827, 16, 7624, 4672, 3536, 714, 67, 4717, 1435, 903, 4862, 279, 460, 16, 1057, 471, 1674, 628, 326, 1623, 652, 16, 487, 54...
mimetype = r.headers.getheader("content-type")
if force_mimetype : mimetype = force_mimetype else : mimetype = r.headers.getheader("content-type")
def get_media_external (request, path, use_cache=True, ) : req = urllib2.Request(path) if request.META.get("HTTP_REFERER", None) : req.add_header("Referer", request.META.get("HTTP_REFERER")) if request.META.get("HTTP_IF_MODIFIED_SINCE", None) : req.add_header( "If-Modified-Since", request.META.get("HTTP_IF_MODIFIED_SINCE") ) if request.META.get("HTTP_IF_NONE_MATCH", None) : req.add_header( "If-None-Match", request.META.get("HTTP_IF_NONE_MATCH") ) try : r = urllib2.urlopen(req) except urllib2.HTTPError, e : (contents, mimetype, status_code, last_modified, ) = ( "", None, e.code, e.headers.getheader("last-modified"), ) else : mimetype = r.headers.getheader("content-type") # save in tmp try : path = "%s/%s%s" % ( DMS_TMP_DIR, md5.new(str(random.random())).hexdigest(), mimetypes.guess_extension(mimetype), ) tmp = file(path, "w") tmp.write(r.read()) tmp.close() except : return (r.read(), mimetype, status_code, last_modified, ) last_modified = r.headers.getheader("last-modified") status_code = 200 contents = get_mime_handler(mimetype)(request, file(path, "rb"), path=path) os.remove(path) return (contents, mimetype, status_code, last_modified, )
118e8e2c4fddd63f6cf6650853c68cb0b173aa7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4349/118e8e2c4fddd63f6cf6650853c68cb0b173aa7b/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 5829, 67, 9375, 261, 2293, 16, 589, 16, 999, 67, 2493, 33, 5510, 16, 262, 294, 1111, 273, 11527, 22, 18, 691, 12, 803, 13, 309, 590, 18, 19294, 18, 588, 2932, 3693, 67, 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, 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, 5829, 67, 9375, 261, 2293, 16, 589, 16, 999, 67, 2493, 33, 5510, 16, 262, 294, 1111, 273, 11527, 22, 18, 691, 12, 803, 13, 309, 590, 18, 19294, 18, 588, 2932, 3693, 67, 30...
logging.debug("Using preferred CE " + ceMap[long(prefSite)])
logging.info("Using preferred CE " + ceMap[long(prefSite)])
def preferredSite(self): """ Generate command line option for ngsub for submitting to a preferred site, if such exist.
4ef3db3cbc3340b7e68535ecf0f0d1611752f3a1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/4ef3db3cbc3340b7e68535ecf0f0d1611752f3a1/ARCSubmitter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9119, 4956, 12, 2890, 4672, 3536, 6654, 1296, 980, 1456, 364, 290, 564, 373, 364, 4879, 1787, 358, 279, 9119, 2834, 16, 309, 4123, 1005, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9119, 4956, 12, 2890, 4672, 3536, 6654, 1296, 980, 1456, 364, 290, 564, 373, 364, 4879, 1787, 358, 279, 9119, 2834, 16, 309, 4123, 1005, 18, 2, -100, -100, -100, -100, -100, -100, -100, ...
def update_contact(self, *args, **kargs): new_data = kargs['contact'] if hasattr(new_data, 'tel'): logger.info("updating contact") if 'name_field' in kargs.keys(): new_data.name = args[0].part_text_get(kargs['name_field']) if 'num_field' in kargs.keys(): new_data.tel = args[0].part_text_get(kargs['num_field']) args[0].signal_emit('back','back-button') else: logger.info("creating new contact contact") contacts_service = tichy.Service.get('Contacts') try: new_contact = contacts_service.create(str(new_data.name),tel=str(new_data.number)) contacts_service.add(new_contact) new_data = empty_contact() except Exception,e: logger.error("Got error in save_number : %s", e) else: args[0].signal_emit('success','back-button') args[0].signal_emit('back','back-button')
def save_contact(self, emission, signal, source, contact): pass
25918bc2efce0ef02bb9eb9b253fbd65dc59d594 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/25918bc2efce0ef02bb9eb9b253fbd65dc59d594/people.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 67, 8994, 12, 2890, 16, 801, 19710, 16, 4277, 16, 1084, 16, 5388, 4672, 1342, 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, ...
[ 1, 1, 1, 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, 1923, 67, 8994, 12, 2890, 16, 801, 19710, 16, 4277, 16, 1084, 16, 5388, 4672, 1342, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
_raise_invalid_type(type_, code)
if modname == classname: code = module_or_class else: _raise_invalid_type(type_, code)
def import_(name, type_='test library'): """Imports Python class/module or Java class with given name. 'name' can also be a path to the library and in that case the directory containing the lib is automatically put into sys.path and removed there afterwards. 'type_' is used in error message if importing fails. Class can either live in a module/package or be 'standalone'. In the former case tha name is something like 'MyClass' and in the latter it could be 'your.package.YourLibrary'). Python classes always live in a module but if the module name is exactly same as the class name the former also works in Python. Example: If you have a Python class 'MyLibrary' in a module 'mymodule' it must be imported with name 'mymodule.MyLibrary'. If the name of the module is also 'MyLibrary' then it is possible to use only name 'MyLibrary'. """ if os.path.exists(name): moddir, name = _split_path_to_module(name) sys.path.insert(0, moddir) pop_sys_path = True else: pop_sys_path = False if '.' in name: parts = name.split('.') modname = '.'.join(parts[:-1]) classname = parts[-1] fromlist = [str(classname)] # Unicode not generally accepted else: modname = name classname = name fromlist = [] try: try: # It seems that we get class when importing java class from file system # or from a default package of a jar file. Otherwise we get a module. module_or_class = __import__(modname, {}, {}, fromlist) except: _raise_import_failed(type_, name) finally: if pop_sys_path: sys.path.pop(0) try: code = getattr(module_or_class, classname) except AttributeError: if fromlist: _raise_no_lib_in_module(type_, modname, fromlist[0]) code = module_or_class if not isinstance(code, (ModuleType, ClassType, TypeType)): _raise_invalid_type(type_, code) try: source = module_or_class.__file__ if not source: raise AttributeError dirpath, filename = os.path.split(os.path.abspath(source)) source = os.path.join(normpath(dirpath), filename) except AttributeError: # Java classes not packaged in a jar file do not have __file__. source = '<unknown>' return code, source
ea4a48db078f6136536b318913449ed230f7feb7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6988/ea4a48db078f6136536b318913449ed230f7feb7/importing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 12, 529, 16, 618, 67, 2218, 3813, 5313, 11, 4672, 3536, 13347, 6600, 667, 19, 2978, 578, 5110, 667, 598, 864, 508, 18, 225, 296, 529, 11, 848, 2546, 506, 279, 589, 358, 326...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 12, 529, 16, 618, 67, 2218, 3813, 5313, 11, 4672, 3536, 13347, 6600, 667, 19, 2978, 578, 5110, 667, 598, 864, 508, 18, 225, 296, 529, 11, 848, 2546, 506, 279, 589, 358, 326...
if not os.path.exists(destination): if destination.endswith(os.sep): parent = destination
if not os.path.exists(dest): if dest_is_dir: parent = dest
def _copy_file(self, source, destination): if not os.path.exists(source): raise DataError("Source file '%s' does not exist" % source) if not os.path.isfile(source): raise DataError("Source file '%s' is not a regular file" % source) if not os.path.exists(destination): if destination.endswith(os.sep): parent = destination else: parent = os.path.dirname(os.path.normpath(destination)) if not os.path.exists(parent): os.makedirs(parent) shutil.copy(source, destination)
8394d54a14ff248630063a73df253438178dff53 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/8394d54a14ff248630063a73df253438178dff53/OperatingSystem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3530, 67, 768, 12, 2890, 16, 1084, 16, 2929, 4672, 309, 486, 1140, 18, 803, 18, 1808, 12, 3168, 4672, 1002, 1910, 668, 2932, 1830, 585, 1995, 87, 11, 1552, 486, 1005, 6, 738, 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, 3530, 67, 768, 12, 2890, 16, 1084, 16, 2929, 4672, 309, 486, 1140, 18, 803, 18, 1808, 12, 3168, 4672, 1002, 1910, 668, 2932, 1830, 585, 1995, 87, 11, 1552, 486, 1005, 6, 738, 10...
def setCookie(request, u):
def setCookie(request, u, cookie_name='MOIN_ID', cookie_string=None):
def setCookie(request, u): """ Set cookie for the user obj u cfg.cookie_lifetime and the user 'remember_me' setting set the lifetime of the cookie. lifetime in int hours, see table: value cookie lifetime ---------------------------------------------------------------- = 0 forever, ignoring user 'remember_me' setting > 0 n hours, or forever if user checked 'remember_me' < 0 -n hours, ignoring user 'remember_me' setting """ # Calculate cookie maxage and expires lifetime = int(request.cfg.cookie_lifetime) * 3600 forever = 10*365*24*3600 # 10 years now = time.time() if not lifetime: maxage = forever elif lifetime > 0: if u.remember_me: maxage = forever else: maxage = lifetime elif lifetime < 0: maxage = (-lifetime) expires = now + maxage cookie = makeCookie(request, u.id, maxage, expires) # Set cookie request.setHttpHeader(cookie) # IMPORTANT: Prevent caching of current page and cookie request.disableHttpCaching()
52d72a54d36dd3229ef30015f18438b64a2efc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/52d72a54d36dd3229ef30015f18438b64a2efc64/auth.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26793, 12, 2293, 16, 582, 16, 3878, 67, 529, 2218, 5980, 706, 67, 734, 2187, 3878, 67, 1080, 33, 7036, 4672, 3536, 1000, 3878, 364, 326, 729, 1081, 582, 225, 2776, 18, 8417, 67, 17155,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26793, 12, 2293, 16, 582, 16, 3878, 67, 529, 2218, 5980, 706, 67, 734, 2187, 3878, 67, 1080, 33, 7036, 4672, 3536, 1000, 3878, 364, 326, 729, 1081, 582, 225, 2776, 18, 8417, 67, 17155,...
gid_psutil = psutil.Process(self.pid).uid
gid_psutil = psutil.Process(self.pid).gid
def test_process_gid(self): gid_ps = ps("ps --no-headers -o rgid -p %s" %self.pid) gid_psutil = psutil.Process(self.pid).uid self.assertEqual(gid_ps, gid_psutil)
dc94cf78d771e4eb6561060d656fd50babd50c2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7296/dc94cf78d771e4eb6561060d656fd50babd50c2b/_posix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2567, 67, 15780, 12, 2890, 4672, 11399, 67, 1121, 273, 4250, 2932, 1121, 1493, 2135, 17, 2485, 300, 83, 14524, 350, 300, 84, 738, 87, 6, 738, 2890, 18, 6610, 13, 11399, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2567, 67, 15780, 12, 2890, 4672, 11399, 67, 1121, 273, 4250, 2932, 1121, 1493, 2135, 17, 2485, 300, 83, 14524, 350, 300, 84, 738, 87, 6, 738, 2890, 18, 6610, 13, 11399, 67, ...
path = path + tail
path += tail
def expandvars(path): """Expand shell variables of form $var and ${var}. Unknown variables are left unchanged.""" global _varprog if '$' not in path: return path if not _varprog: import re _varprog = re.compile(r'\$(\w+|\{[^}]*\})') i = 0 while True: m = _varprog.search(path, i) if not m: break i, j = m.span(0) name = m.group(1) if name[:1] == '{' and name[-1:] == '}': name = name[1:-1] if name in os.environ: tail = path[j:] path = path[:i] + os.environ[name] i = len(path) path = path + tail else: i = j return path
3ee13a55a709833ffc7258daf6b67bc26a7e3a01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3ee13a55a709833ffc7258daf6b67bc26a7e3a01/posixpath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4542, 4699, 12, 803, 4672, 3536, 12271, 5972, 3152, 434, 646, 271, 1401, 471, 3531, 1401, 5496, 225, 9077, 3152, 854, 2002, 14827, 12123, 2552, 389, 1401, 14654, 309, 11874, 486, 316, 589,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4542, 4699, 12, 803, 4672, 3536, 12271, 5972, 3152, 434, 646, 271, 1401, 471, 3531, 1401, 5496, 225, 9077, 3152, 854, 2002, 14827, 12123, 2552, 389, 1401, 14654, 309, 11874, 486, 316, 589,...
muleh rsi, flags=(OF,CF)
muleh ah, flags=(OF,CF)
def macroop MUL_B_P
8842581024d216a07539150bf665ece64520e35c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7385/8842581024d216a07539150bf665ece64520e35c/multiply_and_divide.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11522, 556, 490, 1506, 67, 38, 67, 52, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 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, 11522, 556, 490, 1506, 67, 38, 67, 52, 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, ...
elif o in ('--scons'):
elif o in ('--scons',):
def do_run(self, argv): """ """ run_number_list = [None]
67b8280e3e3a5fcdde21a536adf595f1d889e4da /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12817/67b8280e3e3a5fcdde21a536adf595f1d889e4da/scons-time.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 2681, 12, 2890, 16, 5261, 4672, 3536, 3536, 1086, 67, 2696, 67, 1098, 273, 306, 7036, 65, 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, 741, 67, 2681, 12, 2890, 16, 5261, 4672, 3536, 3536, 1086, 67, 2696, 67, 1098, 273, 306, 7036, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print >> sys.stdout, get_keywords_from_text(text_lines, output_mode=_OPTIONS["output_mode"], output_limit=_OPTIONS["output_limit"], spires=_OPTIONS["spires"], match_mode=_OPTIONS["match_mode"], with_explicit=_OPTIONS["with_explicit"])
print >> sys.stdout, get_keywords_from_text(text_lines, output_mode=_OPTIONS["output_mode"], output_limit=_OPTIONS["output_limit"], spires=_OPTIONS["spires"], match_mode=_OPTIONS["match_mode"], with_explicit=_OPTIONS["with_explicit"])
def main(): """Main function """ read_options(sys.argv[1:]) # Ontology check if _OPTIONS["check_ontology"]: print >> sys.stdout, ("Checking ontology file %s" % _OPTIONS["ontology_file"]) # End of ontology check. # Initialize cache get_regular_expressions(_OPTIONS["ontology_file"], _OPTIONS["rebuild_cache"], _OPTIONS["no_cache"]) for entry in _OPTIONS["text_files"]: text_lines = None source = "" if os.path.isdir(entry): for filename in os.listdir(entry): if (os.path.isfile(entry + filename) and is_pdf(entry + filename)): source = filename text_lines = text_lines_from_local_file(entry + filename) elif os.path.isfile(entry): text_lines = text_lines_from_local_file(entry) source = os.path.basename(entry) else: # Treat as a URL. text_lines = text_lines_from_url(entry) source = entry.split("/")[-1] if text_lines is not None: print >> sys.stdout, source print >> sys.stdout, get_keywords_from_text(text_lines, output_mode=_OPTIONS["output_mode"], output_limit=_OPTIONS["output_limit"], spires=_OPTIONS["spires"], match_mode=_OPTIONS["match_mode"], with_explicit=_OPTIONS["with_explicit"])
b7a42590308deb38aca52c76bec6ae7be3ae88f5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2594/b7a42590308deb38aca52c76bec6ae7be3ae88f5/bibclassify_cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 6376, 445, 3536, 855, 67, 2116, 12, 9499, 18, 19485, 63, 21, 30, 5717, 225, 468, 29683, 866, 309, 389, 12422, 9614, 1893, 67, 1580, 4676, 11929, 30, 1172, 1671, 2589, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3536, 6376, 445, 3536, 855, 67, 2116, 12, 9499, 18, 19485, 63, 21, 30, 5717, 225, 468, 29683, 866, 309, 389, 12422, 9614, 1893, 67, 1580, 4676, 11929, 30, 1172, 1671, 2589, ...
def populate_inspiral_tables(MBTA_frame, UID, set_keys = MBTA_set_keys, \ process_id = 'process:process_id:0', \ event_id_dict = insp_event_id_dict, \ coinc_event_id_base=InspiralCoincIdBase):
def populate_inspiral_tables(MBTA_frame, set_keys = MBTA_set_keys, \ event_id_dict = insp_event_id_dict):
def populate_inspiral_tables(MBTA_frame, UID, set_keys = MBTA_set_keys, \ process_id = 'process:process_id:0', \ event_id_dict = insp_event_id_dict, \ coinc_event_id_base=InspiralCoincIdBase): """ create xml file and populate the SnglInspiral and CoincInspiral tables from a coinc .gwf file from MBTA xmldoc: xml file to append the tables to MBTA_frame: frame file to get info about triggers from set_keys: columns in the SnglInspiral Table to set process_id: process_id event_id_dict: {ifo:event_id} dictionary to assign event_id's coinc_event_id: coinc_event_id detectors: detectors participating in the coinc returns xmldoc and contents of the comment field """ #initialize xml document xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) #dictionaries to store about individual triggers end_time_s = {} end_time_ns = {} snr = {} mass1 = {} mass2 = {} Deff = {} mchirp = {} eta = {} #extract the information from the frame file events = Fr.frgetevent(MBTA_frame) #get the ifos from the event name for event in events: if 'MbtaHLV' in event['name']: detectors = H1L1V1_detlist elif 'MbtaHL' in event['name']: detectors = H1L1_detlist elif 'MbtaHV' in event['name']: detectors = H1V1_detlist elif 'MbtaH' in event['name']: detectors = H1_detlist elif 'MbtaLV' in event['name']: detectors = L1V1_detlist elif 'MbtaL' in event['name']: detectors = L1_detlist elif 'MbtaV' in event['name']: detectors = V1_detlist else: raise ValueError, "Invalid FrEvent name" log_data = event['comment'] + '\n' far = [line.split(':')[1].split()[0] for line in log_data.splitlines() if \ 'False Alarm Rate' in line][0] for ifo in detectors: end_time_s[ifo], end_time_ns[ifo] = str(event[ifo+':end_time']).split('.') snr[ifo] = float(event[ifo+':SNR']) mass1[ifo] = float(event[ifo+':mass1']) mass2[ifo] = float(event[ifo+':mass2']) mchirp[ifo], eta[ifo] = compute_mchirp_eta(mass1[ifo],mass2[ifo]) Deff[ifo] = float(event[ifo+':eff_distance']) #fill the SnglInspiralTable sin_table = lsctables.New(lsctables.SnglInspiralTable) xmldoc.childNodes[0].appendChild(sin_table) for ifo in detectors: row = sin_table.RowType() row.ifo = ifo row.search = 'MBTA' row.end_time = int(end_time_s[ifo]) row.end_time_ns = int(end_time_ns[ifo]) row.mass1 = mass1[ifo] row.mass2 = mass2[ifo] row.mchirp = mchirp[ifo] row.mtotal = mass1[ifo] + mass2[ifo] row.eta = eta[ifo] row.snr = snr[ifo] row.eff_distance = Deff[ifo] row.event_id = event_id_dict[ifo] row.process_id = process_id row.channel = '' #zero out the rest of the columns #should work in chi2 and chi2cut for key in sin_table.validcolumns.keys(): if key not in set_keys: setattr(row,key,None) sin_table.append(row) #CoincInspiralTable #using the conventions found in: #https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/S6Plan/ #090505160219S6PlanningNotebookCoinc_and_Experiment_Tables_ihope_implementation? #highlight=%28coinc%29|%28table%29 if len(detectors) < 2: return xmldoc, log_data, detectors coinc_event_id = coinc_event_id_base + str(UID) cin_table = lsctables.New(lsctables.CoincInspiralTable) xmldoc.childNodes[0].appendChild(cin_table) row = cin_table.RowType() row.set_ifos(detectors) row.coinc_event_id = coinc_event_id row.end_time = int(end_time_s['H1']) row.end_time_ns = int(end_time_ns['H1']) row.mass = (sum(mass1.values()) + sum(mass2.values()))/3 row.mchirp = sum(mchirp.values())/3 #the snr here is really the snr NOT effective snr row.snr = pow(sum([x*x for x in snr.values()]),0.5) #far is triggers/day row.false_alarm_rate = float(far) row.combined_far = 0 cin_table.append(row) return xmldoc, log_data, detectors
eef4ba73b78b2df6877b14e65982a2b0927a899b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/eef4ba73b78b2df6877b14e65982a2b0927a899b/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 67, 267, 1752, 481, 287, 67, 9373, 12, 7969, 9833, 67, 3789, 16, 444, 67, 2452, 273, 17897, 9833, 67, 542, 67, 2452, 16, 521, 871, 67, 350, 67, 1576, 273, 316, 1752, 67, 2575, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 67, 267, 1752, 481, 287, 67, 9373, 12, 7969, 9833, 67, 3789, 16, 444, 67, 2452, 273, 17897, 9833, 67, 542, 67, 2452, 16, 521, 871, 67, 350, 67, 1576, 273, 316, 1752, 67, 2575, ...
lines, lineno = inspect.getsourcelines(obj)
lines, lineno = getsourcelines(obj)
def do_source(self, arg): """source expression Try to get source code for the given object and display it. """ try: obj = self._getval(arg) except: return try: lines, lineno = inspect.getsourcelines(obj) except (IOError, TypeError) as err: self.error(err) return self._print_lines(lines, lineno, [], -1, -1)
5ed2b5a92ab4f5c4c8ad77ec95a4f7add3083432 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/5ed2b5a92ab4f5c4c8ad77ec95a4f7add3083432/pdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 3168, 12, 2890, 16, 1501, 4672, 3536, 3168, 2652, 6161, 358, 336, 1084, 981, 364, 326, 864, 733, 471, 2562, 518, 18, 3536, 775, 30, 1081, 273, 365, 6315, 588, 1125, 12, 3175, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3168, 12, 2890, 16, 1501, 4672, 3536, 3168, 2652, 6161, 358, 336, 1084, 981, 364, 326, 864, 733, 471, 2562, 518, 18, 3536, 775, 30, 1081, 273, 365, 6315, 588, 1125, 12, 3175, ...
if not os.path.isdir(self.build_dir): self.warn("'%s' does not exist -- cannot test" % self.build_dir) return
def test (self): if not os.path.isdir(self.build_dir): self.warn("'%s' does not exist -- cannot test" % self.build_dir) return
c7a3ef46174a0d7c40995ec52d364bb4d93cd945 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/97/c7a3ef46174a0d7c40995ec52d364bb4d93cd945/di_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 261, 2890, 4672, 309, 486, 1140, 18, 803, 18, 291, 1214, 12, 2890, 18, 3510, 67, 1214, 4672, 365, 18, 8935, 29823, 9, 87, 11, 1552, 486, 1005, 1493, 2780, 1842, 6, 738, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 261, 2890, 4672, 309, 486, 1140, 18, 803, 18, 291, 1214, 12, 2890, 18, 3510, 67, 1214, 4672, 365, 18, 8935, 29823, 9, 87, 11, 1552, 486, 1005, 1493, 2780, 1842, 6, 738, 365, 18...
captxt = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_INACTIVE_CAPTION_TEXT_COLOUR)
captxt = self._frame.GetDockArt().GetColour(wx.aui.AUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR)
def UpdateColors(self): bk = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_BACKGROUND_COLOUR) self._background_color.SetBitmapLabel(self.CreateColorBitmap(bk)) cap = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_INACTIVE_CAPTION_COLOUR) self._inactive_caption_color.SetBitmapLabel(self.CreateColorBitmap(cap)) capgrad = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR) self._inactive_caption_gradient_color.SetBitmapLabel(self.CreateColorBitmap(capgrad)) captxt = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_INACTIVE_CAPTION_TEXT_COLOUR) self._inactive_caption_text_color.SetBitmapLabel(self.CreateColorBitmap(captxt)) acap = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_ACTIVE_CAPTION_COLOUR) self._active_caption_color.SetBitmapLabel(self.CreateColorBitmap(acap)) acapgrad = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR) self._active_caption_gradient_color.SetBitmapLabel(self.CreateColorBitmap(acapgrad)) acaptxt = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_ACTIVE_CAPTION_TEXT_COLOUR) self._active_caption_text_color.SetBitmapLabel(self.CreateColorBitmap(acaptxt)) sash = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_SASH_COLOUR) self._sash_color.SetBitmapLabel(self.CreateColorBitmap(sash)) border = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_BORDER_COLOUR) self._border_color.SetBitmapLabel(self.CreateColorBitmap(border)) gripper = self._frame.GetDockArt().GetColour(wx.aui.AUI_ART_GRIPPER_COLOUR) self._gripper_color.SetBitmapLabel(self.CreateColorBitmap(gripper))
de824c0c9cec70a6369d011fb635c8ba12bdacea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/de824c0c9cec70a6369d011fb635c8ba12bdacea/AUI_DockingWindowMgr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2315, 12570, 12, 2890, 4672, 225, 22723, 273, 365, 6315, 3789, 18, 967, 40, 975, 4411, 7675, 967, 26404, 12, 27226, 18, 69, 4881, 18, 37, 5370, 67, 4928, 67, 8720, 20166, 67, 3865, 150...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2315, 12570, 12, 2890, 4672, 225, 22723, 273, 365, 6315, 3789, 18, 967, 40, 975, 4411, 7675, 967, 26404, 12, 27226, 18, 69, 4881, 18, 37, 5370, 67, 4928, 67, 8720, 20166, 67, 3865, 150...
if 0 : buildPackage( "flac",
if 1 : buildPackage( "flac",
def buildPackage(name, uri, checkVersion, downloadUri, tarballName, buildCommand, srcdir=None, deps="", pinnedVersion = None, ) : print "Module:", name subst = dict( sandbox = sandbox, prefix = prefix, target = target, sfmirror = sfmirror, apachemirror = apachemirror, name = name, pinned = pinnedVersion if pinnedVersion else "None", ) availableVersion = output(checkVersion).strip() availableVersion or die("No online version found for the package\n Command used:\n%s" % checkVersion) print "Found version: '%s'" % availableVersion if (pinnedVersion and pinnedVersion != availableVersion) : warning("Package: Pinning to version %s, although version %s is available" % (pinnedVersion, availableVersion)) version = pinnedVersion if pinnedVersion else availableVersion subst.update ( version = version, majorversion = ".".join(version.split(".")[:1]), minorversion = ".".join(version.split(".")[:2]), ) subst.update( tarball = tarballName % subst, srcdir = ("%(sandbox)s/src/" + (srcdir or "%(name)s-%(version)s/")) % subst, ) print "srcdir:", subst['srcdir'] download(downloadUri % subst) extractSource(subst['tarball']) patches = glob.glob(scriptRelative("mingw-"+name+"*")) patches.sort() print patches for patch in patches : applyPatch(subst['srcdir'], patch, level=1) run(buildCommand % subst)
9516624bdaf457fb48cb287da6115af5d509bbca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1456/9516624bdaf457fb48cb287da6115af5d509bbca/setup_mingw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 2261, 12, 529, 16, 2003, 16, 866, 1444, 16, 4224, 3006, 16, 29441, 461, 16, 1361, 2189, 16, 1705, 1214, 33, 7036, 16, 8740, 1546, 3113, 26193, 1444, 273, 599, 16, 262, 294, 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, 1361, 2261, 12, 529, 16, 2003, 16, 866, 1444, 16, 4224, 3006, 16, 29441, 461, 16, 1361, 2189, 16, 1705, 1214, 33, 7036, 16, 8740, 1546, 3113, 26193, 1444, 273, 599, 16, 262, 294, 1172,...
font1 = font.nametofont("TkDefaultFont") font2 = font.nametofont("TkDefaultFont")
fontname = "TkDefaultFont" try: f = font.Font(name=fontname, exists=True) except tkinter._tkinter.TclError: f = font.Font(name=fontname, exists=False) font1 = font.nametofont(fontname) font2 = font.nametofont(fontname)
def test_font_eq(self): font1 = font.nametofont("TkDefaultFont") font2 = font.nametofont("TkDefaultFont") self.assertIsNot(font1, font2) self.assertEqual(font1, font2) self.assertNotEqual(font1, font1.copy()) self.assertNotEqual(font1, 0)
a8515f0503a5f094ffcf5a26bfae0ea5e480c0b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/a8515f0503a5f094ffcf5a26bfae0ea5e480c0b3/test_font.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5776, 67, 11253, 12, 2890, 4672, 3512, 529, 273, 315, 56, 79, 1868, 5711, 6, 775, 30, 284, 273, 3512, 18, 5711, 12, 529, 33, 5776, 529, 16, 1704, 33, 5510, 13, 1335, 13030,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5776, 67, 11253, 12, 2890, 4672, 3512, 529, 273, 315, 56, 79, 1868, 5711, 6, 775, 30, 284, 273, 3512, 18, 5711, 12, 529, 33, 5776, 529, 16, 1704, 33, 5510, 13, 1335, 13030,...
voutput += "%s,Recid:%s,Score:%s<br>" % (i,reclist[len(reclist) - i][0],reclist[len(reclist) - i][1])
voutput += "%s,Recid:%s,Score:%s<br>" % (i,reclist[len(reclist) - i][0],reclist[len(reclist) - i][1])
def rank_method_stat(rank_method_code, reclist, lwords): """Shows some statistics about the searchresult. rank_method_code - name field from rnkMETHOD reclist - a list of sorted and ranked records lwords - the words in the query""" global voutput if len(reclist) > 20: j = 20 else: j = len(reclist) voutput += "<br>Rank statistics:<br>" for i in range(1, j + 1): voutput += "%s,Recid:%s,Score:%s<br>" % (i,reclist[len(reclist) - i][0],reclist[len(reclist) - i][1]) for (term, table) in lwords: term_recs = run_sql("""SELECT hitlist FROM %s WHERE term=%s""", (table, term)) if term_recs: term_recs = deserialize_via_marshal(term_recs[0][0]) if term_recs.has_key(reclist[len(reclist) - i][0]): voutput += "%s-%s / " % (term, term_recs[reclist[len(reclist) - i][0]]) voutput += "<br>" voutput += "<br>Score variation:<br>" count = {} for i in range(0, len(reclist)): count[reclist[i][1]] = count.get(reclist[i][1], 0) + 1 i = 100 while i >= 0: if count.has_key(i): voutput += "%s-%s<br>" % (i, count[i]) i -= 1
65057a59d7844e5dc821df793923e70a6a071b3b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/65057a59d7844e5dc821df793923e70a6a071b3b/bibrank_record_sorter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6171, 67, 2039, 67, 5642, 12, 11500, 67, 2039, 67, 710, 16, 283, 830, 376, 16, 328, 3753, 4672, 3536, 24548, 2690, 7691, 2973, 326, 1623, 2088, 18, 6171, 67, 2039, 67, 710, 300, 508, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6171, 67, 2039, 67, 5642, 12, 11500, 67, 2039, 67, 710, 16, 283, 830, 376, 16, 328, 3753, 4672, 3536, 24548, 2690, 7691, 2973, 326, 1623, 2088, 18, 6171, 67, 2039, 67, 710, 300, 508, ...
except KeyboardInterrupt: print "Process was interrupted." print "The first unfinished subject is:",sa.firstSubject().pl().asasciilink()
except: sa.dump('interwiki.dump')
def compareLanguages(old, new): removing = [] adding = [] modifying = [] for code in old.keys(): if code not in new.keys(): removing.append(code) elif old[code] != new[code]: modifying.append(code) for code2 in new.keys(): if code2 not in old.keys(): adding.append(code2) s = "" if adding: s = s + " %s:" % (msg[msglang][0]) + ",".join(adding) if removing: s = s + " %s:" % (msg[msglang][1]) + ",".join(removing) if modifying: s = s + " %s:" % (msg[msglang][2]) + ",".join(modifying) return s,removing
4588b7cf8686140936dfc837887f2e33792c2da7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/4588b7cf8686140936dfc837887f2e33792c2da7/interwiki.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3400, 12912, 12, 1673, 16, 394, 4672, 9427, 273, 5378, 6534, 273, 5378, 21920, 273, 5378, 364, 981, 316, 1592, 18, 2452, 13332, 309, 981, 486, 316, 394, 18, 2452, 13332, 9427, 18, 6923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3400, 12912, 12, 1673, 16, 394, 4672, 9427, 273, 5378, 6534, 273, 5378, 21920, 273, 5378, 364, 981, 316, 1592, 18, 2452, 13332, 309, 981, 486, 316, 394, 18, 2452, 13332, 9427, 18, 6923, ...
elif self._cache.lift() % self.parent().prime_pow(halt - self.valuation()) > right._cache % self.parent().prime_pow(halt - right.valuation()):
elif self._cache.lift() % self.parent().prime_pow(halt - self.valuation()) > right._cache.lift() % self.parent().prime_pow(halt - right.valuation()):
def __cmp__(self, right, halt = None): if halt is None: halt = self.parent().halting_parameter() #print "self = %s, type = %s"%(self, type(self)) #print "right = %s, type = %s"%(right, type(right)) if self.valuation() < right.valuation(): return -1 elif self.valuation() > right.valuation(): return 1 elif self.valuation() is infinity and right.valuation() is infinity: return 0 #comparing valuations can throw an exception if self and right are both congruent to zero modulo p^halt, but we want this to be passed upstream. We now know that the valuations are equal and both less than halt, so both have type Integer now rather than Valuation. if self._cache.lift() % self.parent().prime_pow(halt - self.valuation()) < right._cache % self.parent().prime_pow(halt - right.valuation()): return -1 elif self._cache.lift() % self.parent().prime_pow(halt - self.valuation()) > right._cache % self.parent().prime_pow(halt - right.valuation()): return 1 if self._cache != right._cache: #According to spec, we only compare up to halt. We now know that self and right are equal up to halt, but unequal above. In order to maintain consistency with previous calls to __cmp__, we throw an exception here. raise PrecisionError, "I'm supposed to tell you these are equal, because they're congruent modulo p^halt, but " jump = 1 start = min(self.precision_absolute(), right.precision_absolute()) end = halt - start while jump <= end: self.set_precision_absolute(start + jump) right.set_precision_absolute(start + jump) if self._cache != right._cache: if self._cache.lift() % self.parent().prime_pow(start + jump) < right._cache.lift() % self.parent().prime_pow(start + jump): return -1 elif self._cache.lift() % self.parent().prime_pow(start + jump) < right._cache.lift() % self.parent().prime_pow(start + jump): return 1 jump = 2 * jump self.set_precision_absolute(halt) right.set_precision_absolute(halt) if self._cache != right._cache: if self._cache.lift() % self.parent().prime_pow(start + jump) < right._cache.lift() % self.parent().prime_pow(start + jump): return -1 elif self._cache.lift() % self.parent().prime_pow(start + jump) < right._cache.lift() % self.parent().prime_pow(start + jump): return 1 return 0
c453742d8b2d37c307d396c85a9147db93687af6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/c453742d8b2d37c307d396c85a9147db93687af6/padic_lazy_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9625, 972, 12, 2890, 16, 2145, 16, 18389, 273, 599, 4672, 309, 18389, 353, 599, 30, 18389, 273, 365, 18, 2938, 7675, 22314, 1787, 67, 6775, 1435, 468, 1188, 315, 2890, 273, 738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9625, 972, 12, 2890, 16, 2145, 16, 18389, 273, 599, 4672, 309, 18389, 353, 599, 30, 18389, 273, 365, 18, 2938, 7675, 22314, 1787, 67, 6775, 1435, 468, 1188, 315, 2890, 273, 738, ...
of TF-8 characters, without possible mis-truncation in the middle
of UTF-8 characters, without possible mis-truncation in the middle
def wash_index_term(term, max_char_length=50): """ Return washed form of the index term TERM that would be suitable for storing into idxWORD* tables. I.e., lower the TERM, and truncate it safely to MAX_CHAR_LENGTH UTF-8 characters (meaning, in principle, 4*MAX_CHAR_LENGTH bytes). The function works by an internal conversion of TERM, when needed, from its input Python UTF-8 binary string format into Python Unicode format, and then truncating it safely to the given number of TF-8 characters, without possible mis-truncation in the middle of a multi-byte UTF-8 character that could otherwise happen if we would have been working with UTF-8 binary representation directly. Note that MAX_CHAR_LENGTH corresponds to the length of the term column in idxINDEX* tables. """ washed_term = unicode(term, 'utf-8').lower() if len(washed_term) <= max_char_length: # no need to truncate the term, because it will fit # nicely even if it uses four-byte UTF-8 characters return washed_term.encode('utf-8') else: # truncate the term in a safe position: return washed_term[:max_char_length].encode('utf-8')
5a4d8f5a5db8b9a24d079a4865bc85865b4e3e5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2139/5a4d8f5a5db8b9a24d079a4865bc85865b4e3e5b/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 341, 961, 67, 1615, 67, 6408, 12, 6408, 16, 943, 67, 3001, 67, 2469, 33, 3361, 4672, 3536, 2000, 341, 13912, 646, 434, 326, 770, 2481, 20772, 49, 716, 4102, 506, 10631, 364, 15729, 136...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 341, 961, 67, 1615, 67, 6408, 12, 6408, 16, 943, 67, 3001, 67, 2469, 33, 3361, 4672, 3536, 2000, 341, 13912, 646, 434, 326, 770, 2481, 20772, 49, 716, 4102, 506, 10631, 364, 15729, 136...
self.fileSize = -1
self.fileSize = ''
def __init__(self): self.done = 0 self.file = '' self.fileSize = -1 self.activity = '' self.status = '' self.progress = '' self.downloadTo = '' self.downRate = '---' self.upRate = '---' self.errors = []
475bc2502a2632d7599dddb0ed5ed686f6cf773d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/475bc2502a2632d7599dddb0ed5ed686f6cf773d/btdownloadcurses.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 8734, 273, 374, 365, 18, 768, 273, 875, 365, 18, 768, 1225, 273, 875, 365, 18, 9653, 273, 875, 365, 18, 2327, 273, 875, 365, 18, 8298, 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, 4672, 365, 18, 8734, 273, 374, 365, 18, 768, 273, 875, 365, 18, 768, 1225, 273, 875, 365, 18, 9653, 273, 875, 365, 18, 2327, 273, 875, 365, 18, 8298, 273, ...
Resolution.*?<br>\s+(?P<resolution>\S+)
resolution.*?<br>\s+(?P<resolution>\S+)
def strip_tags(s): while '<' in s and '>' in s: s = str(s[:s.find('<')]) + str(s[s.find('>')+1:]) return s
e8fe9b90fe8c3b2a631e37b6e97e0ae67ab54887 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3104/e8fe9b90fe8c3b2a631e37b6e97e0ae67ab54887/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 4156, 12, 87, 4672, 1323, 9138, 316, 272, 471, 7481, 316, 272, 30, 272, 273, 609, 12, 87, 10531, 87, 18, 4720, 2668, 32, 6134, 5717, 397, 609, 12, 87, 63, 87, 18, 4720, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 4156, 12, 87, 4672, 1323, 9138, 316, 272, 471, 7481, 316, 272, 30, 272, 273, 609, 12, 87, 10531, 87, 18, 4720, 2668, 32, 6134, 5717, 397, 609, 12, 87, 63, 87, 18, 4720, 2...
if users>0:
if len(users) > 0:
def getUserFullName(self, p_username, acl_folder): #return the email of the given user id users = acl_folder.findUser(search_param='uid', search_term=p_username) if users>0: return unicode(users[0].get('cn', ''), 'iso-8859-1').encode('utf-8') else: return ''
a3395f61f0214ce1a9633e9de61434ad970e0240 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/a3395f61f0214ce1a9633e9de61434ad970e0240/plugLDAPUserFolder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4735, 19223, 12, 2890, 16, 293, 67, 5053, 16, 7895, 67, 5609, 4672, 468, 2463, 326, 2699, 434, 326, 864, 729, 612, 3677, 273, 7895, 67, 5609, 18, 4720, 1299, 12, 3072, 67, 891, 2218, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4735, 19223, 12, 2890, 16, 293, 67, 5053, 16, 7895, 67, 5609, 4672, 468, 2463, 326, 2699, 434, 326, 864, 729, 612, 3677, 273, 7895, 67, 5609, 18, 4720, 1299, 12, 3072, 67, 891, 2218, ...
logger.info("[favoritos.py] mainlist")
logger.info("[favoritos.py] mainlist")
def mainlist(params,url,category): logger.info("[favoritos.py] mainlist") import xbmctools # Crea un listado con las entradas de favoritos if usingsamba: ficheros = samba.get_files(BOOKMARK_PATH) else: ficheros = os.listdir(BOOKMARK_PATH) ficheros.sort() for fichero in ficheros: try: # Lee el bookmark titulo,thumbnail,plot,server,url = readbookmark(fichero) # Crea la entrada # En la categora va el nombre del fichero para poder borrarlo xbmctools.addnewvideo( CHANNELNAME , "play" , os.path.join( BOOKMARK_PATH, fichero ) , server , titulo , url , thumbnail, plot ) except: pass # Label (top-right)... xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE ) xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
cbf56e6d608cebe07c475b175224048b25f3957e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2004/cbf56e6d608cebe07c475b175224048b25f3957e/favoritos.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 1098, 12, 2010, 16, 718, 16, 4743, 4672, 1194, 18, 1376, 2932, 63, 19731, 280, 305, 538, 18, 2074, 65, 2774, 1098, 7923, 225, 1930, 15970, 81, 299, 8192, 225, 468, 5799, 69, 640,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1098, 12, 2010, 16, 718, 16, 4743, 4672, 1194, 18, 1376, 2932, 63, 19731, 280, 305, 538, 18, 2074, 65, 2774, 1098, 7923, 225, 1930, 15970, 81, 299, 8192, 225, 468, 5799, 69, 640,...
self.process.grassenv=self.grassEnv.grassenv
def __init__(self, serverSettings, grassSettings, process,formvalues,method): """ Initialization of the Execute request
c3855002844abce2ea80d30885fe9f5603e71c57 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10967/c3855002844abce2ea80d30885fe9f5603e71c57/execute.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1438, 2628, 16, 3821, 428, 2628, 16, 1207, 16, 687, 2372, 16, 2039, 4672, 3536, 26586, 434, 326, 7903, 590, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1438, 2628, 16, 3821, 428, 2628, 16, 1207, 16, 687, 2372, 16, 2039, 4672, 3536, 26586, 434, 326, 7903, 590, 2, -100, -100, -100, -100, -100, -100, -100, ...
log.log( "<directive>COM.tokenparser(), ID '%s' cmd '%s' rule '%s' action '%s'" % (self.state.ID, self.args.cmd, self.args.rule, self.args.actionList), 8 )
log.log( "<directive>COM.tokenparser(): ID '%s' cmd '%s' rule '%s'" % (self.state.ID, self.args.cmd, self.args.rule), 8 )
def tokenparser(self, toklist, toktypes, indent):
bc8dd24780027d732ae1f00fe01174be6240ac13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/bc8dd24780027d732ae1f00fe01174be6240ac13/common.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1147, 4288, 12, 2890, 16, 946, 1098, 16, 946, 2352, 16, 3504, 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, ...
[ 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, 1147, 4288, 12, 2890, 16, 946, 1098, 16, 946, 2352, 16, 3504, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
def __init__(self, n, q):
def __init__(self, n, q, name='a'):
def __init__(self, n, q): """ INPUT: n -- positive integer; the degree q -- prime power; the size of the ground field
f5e431c71f8b59df3f8c5c258afa59632134296c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/f5e431c71f8b59df3f8c5c258afa59632134296c/permgroup_named.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 290, 16, 1043, 16, 508, 2218, 69, 11, 4672, 3536, 12943, 30, 290, 1493, 6895, 3571, 31, 326, 10782, 1043, 1493, 17014, 7212, 31, 326, 963, 434, 326, 1920...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 290, 16, 1043, 16, 508, 2218, 69, 11, 4672, 3536, 12943, 30, 290, 1493, 6895, 3571, 31, 326, 10782, 1043, 1493, 17014, 7212, 31, 326, 963, 434, 326, 1920...
codec.write_uint8(mask) codec.write_uint8(20) codec.write_str8(self._schema.getKey().getPackageName()) codec.write_str8(self._schema.getKey().getClassName()) codec.write_bin128(self._schema.getKey().getHash())
codec.write_uint8(mask)
def _encodeUnmanaged(self, codec): # emit presence masks for optional properties mask = 0 bit = 0 for prop, value in self._properties: if prop.optional: if bit == 0: bit = 1 if value: mask |= bit bit = bit << 1 if bit == 256: bit = 0 codec.write_uint8(mask) mask = 0 if bit != 0: codec.write_uint8(mask)
c1ec4e0243b47bf4bb140a6ed17ef0d71009820c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/197/c1ec4e0243b47bf4bb140a6ed17ef0d71009820c/console.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3015, 984, 19360, 12, 2890, 16, 9196, 4672, 468, 3626, 9805, 20931, 364, 3129, 1790, 3066, 273, 374, 2831, 225, 273, 374, 364, 2270, 16, 460, 316, 365, 6315, 4738, 30, 309, 2270, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3015, 984, 19360, 12, 2890, 16, 9196, 4672, 468, 3626, 9805, 20931, 364, 3129, 1790, 3066, 273, 374, 2831, 225, 273, 374, 364, 2270, 16, 460, 316, 365, 6315, 4738, 30, 309, 2270, ...
counts[change] += 1 return counts['+'], counts['-']
found = True return found
def display(fn, rev, states, prevstates): counts = {'-': 0, '+': 0} filerevmatches = {} if not opts['all']: a, b, r = prevstates, states, rev else: a, b, r = states, prevstates, prev.get(fn, -1) for change, l in difflinestates(a, b): cols = [fn, str(r)] if opts['line_number']: cols.append(str(l.linenum)) if opts['all']: cols.append(change) if opts['user']: cols.append(ui.shortuser(get(r)[1])) if opts['files_with_matches']: c = (fn, r) if c in filerevmatches: continue filerevmatches[c] = 1 else: cols.append(l.line) ui.write(sep.join(cols), eol) counts[change] += 1 return counts['+'], counts['-']
68d8aa6f8792bba0d73e8b285df038642e32a5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/68d8aa6f8792bba0d73e8b285df038642e32a5c5/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 12, 4293, 16, 5588, 16, 5493, 16, 2807, 7992, 4672, 6880, 273, 13666, 17, 4278, 374, 16, 15126, 4278, 374, 97, 661, 822, 90, 8436, 273, 2618, 309, 486, 1500, 3292, 454, 3546, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 12, 4293, 16, 5588, 16, 5493, 16, 2807, 7992, 4672, 6880, 273, 13666, 17, 4278, 374, 16, 15126, 4278, 374, 97, 661, 822, 90, 8436, 273, 2618, 309, 486, 1500, 3292, 454, 3546, 30,...
def test_AuthorizedAsTag(self): self.doTestAndCheck(conn_tag, self.t2) def test_AuthorizedAsAdmin(self): self.doTestAndCheck(conn_admin, self.t2)
def test_AuthorizedAsTagDbSpelling(self): self.doTestAndCheck(conn_tag, self.t1_) def test_AuthorizedAsAdminDbSpelling(self): self.doTestAndCheck(conn_admin, self.t1_) def doTestAndCheck12X(self, conn): response = conn.request_put(self.tx, headers=jsonheader, body=C12_tx) self.failUnlessEqual('204', response[u'headers']['status']) response = conn_none.request_get(self.c, headers=jsonheader) self.failUnlessEqual('200', response[u'headers']['status']) j1 = JSONDecoder().decode(response[u'body']) self.failUnlessEqual(j1, C1234_tx_r) response = conn_none.request_get(self.tx, headers=jsonheader) self.failUnlessEqual('200', response[u'headers']['status']) j1 = JSONDecoder().decode(response[u'body']) self.failUnlessEqual(j1, C12_tx_r) def test_AuthorizedAsTagNewTagSpecOwner(self): self.doTestAndCheck12X(conn_tag) def test_AuthorizedAsAdminNewTagSpecOwner(self): self.doTestAndCheck12X(conn_admin) def doTestAndCheckNewTagUnspecifiedOwner(self, conn): response = conn.request_post(self.tx, headers=jsonheader, body=C12_full) self.failUnlessEqual('400', response[u'headers']['status']) self.failIf(response[u'body'].find("Tag ownership for TX undefined in db and payload") == -1) def test_AuthorizedAsTagNewTagUnspecifiedOwner(self): self.doTestAndCheckNewTagUnspecifiedOwner(conn_tag) def test_AuthorizedAsAdminNewTagUnspecifiedOwner(self): self.doTestAndCheckNewTagUnspecifiedOwner(conn_admin)
def test_AuthorizedAsTag(self): self.doTestAndCheck(conn_tag, self.t2)
ef4cc693560ff5a4ceaa722f54845ea97fce9b0b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6226/ef4cc693560ff5a4ceaa722f54845ea97fce9b0b/cftest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 15341, 1463, 1805, 12, 2890, 4672, 365, 18, 2896, 4709, 31151, 12, 4646, 67, 2692, 16, 365, 18, 88, 22, 13, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 15341, 1463, 1805, 12, 2890, 4672, 365, 18, 2896, 4709, 31151, 12, 4646, 67, 2692, 16, 365, 18, 88, 22, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
this = apply(_quickfix.new_MiscFeeBasis, args)
this = _quickfix.new_MiscFeeBasis(*args)
def __init__(self, *args): this = apply(_quickfix.new_MiscFeeBasis, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 11729, 71, 14667, 11494, 291, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 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, 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, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 11729, 71, 14667, 11494, 291, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, ...
pos=wxPoint(88, 59), size=wxSize(16, 16), style=0)
pos=wxPoint(88, 70), size=wxSize(16, 16), style=0)
def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(true) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize)
aac0471ac41eaa175cbaa05604248123746b2b22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/aac0471ac41eaa175cbaa05604248123746b2b22/STCStyleEditor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2738, 67, 16277, 87, 12, 2890, 16, 846, 496, 4672, 468, 4374, 707, 16, 2727, 1404, 3874, 7075, 6353, 16186, 2738, 972, 12, 2890, 16, 612, 33, 27226, 734, 67, 882, 39, 15066, 10776...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2738, 67, 16277, 87, 12, 2890, 16, 846, 496, 4672, 468, 4374, 707, 16, 2727, 1404, 3874, 7075, 6353, 16186, 2738, 972, 12, 2890, 16, 612, 33, 27226, 734, 67, 882, 39, 15066, 10776...
class POLYPOLYGON(POLYPOLYLINE):
class _POLYPOLYGON(_POLYPOLYLINE):
def str_extra(self): txt=StringIO() start=0 for n in range(self.nPolys): txt.write("\tPolygon %d: %d points\n" % (n,self.aPolyCounts[n])) txt.write("\t\t%s\n" % str(self.aptl[start:start+self.aPolyCounts[n]])) start+=self.aPolyCounts[n] return txt.getvalue()
688318604ffe18a54bb261a3bde4bf6e1784a8de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8136/688318604ffe18a54bb261a3bde4bf6e1784a8de/pyemf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 609, 67, 7763, 12, 2890, 4672, 6463, 33, 780, 4294, 1435, 787, 33, 20, 364, 290, 316, 1048, 12, 2890, 18, 82, 5850, 1900, 4672, 6463, 18, 2626, 31458, 88, 11787, 738, 72, 30, 738, 72...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 609, 67, 7763, 12, 2890, 4672, 6463, 33, 780, 4294, 1435, 787, 33, 20, 364, 290, 316, 1048, 12, 2890, 18, 82, 5850, 1900, 4672, 6463, 18, 2626, 31458, 88, 11787, 738, 72, 30, 738, 72...
def print_records(req, recIDs, jrec=1, rg=10, format='hb', ot='', ln=cdslang, relevances=[], relevances_prologue="(", relevances_epilogue="%%)", decompress=zlib.decompress, search_pattern=''):
def print_records(req, recIDs, jrec=1, rg=10, format='hb', ot='', ln=cdslang, relevances=[], relevances_prologue="(", relevances_epilogue="%%)", decompress=zlib.decompress, search_pattern='', print_header_p=True, print_footer_p=True):
def print_records(req, recIDs, jrec=1, rg=10, format='hb', ot='', ln=cdslang, relevances=[], relevances_prologue="(", relevances_epilogue="%%)", decompress=zlib.decompress, search_pattern=''): """Prints list of records 'recIDs' formatted accoding to 'format' in groups of 'rg' starting from 'jrec'. Assumes that the input list 'recIDs' is sorted in reverse order, so it counts records from tail to head. A value of 'rg=-9999' means to print all records: to be used with care. Print also list of RELEVANCES for each record (if defined), in between RELEVANCE_PROLOGUE and RELEVANCE_EPILOGUE. """ # load the right message language _ = gettext_set_language(ln) # sanity checking: if req is None: return # get user id (for formatting based on priviledge) uid = getUid(req) if len(recIDs): nb_found = len(recIDs) if rg == -9999: # print all records rg = nb_found else: rg = abs(rg) if jrec < 1: # sanity checks jrec = 1 if jrec > nb_found: jrec = max(nb_found-rg+1, 1) # will print records from irec_max to irec_min excluded: irec_max = nb_found - jrec irec_min = nb_found - jrec - rg if irec_min < 0: irec_min = -1 if irec_max >= nb_found: irec_max = nb_found - 1 #req.write("%s:%d-%d" % (recIDs, irec_min, irec_max)) if format.startswith('x'): # we are doing XML output: first choose XML envelope: if format.startswith('xm'): format_prologue = websearch_templates.tmpl_xml_marc_prologue() format_epilogue = websearch_templates.tmpl_xml_marc_epilogue() elif format.startswith('xn'): format_prologue = websearch_templates.tmpl_xml_nlm_prologue() format_epilogue = websearch_templates.tmpl_xml_nlm_epilogue() elif format.startswith('xr'): format_prologue = websearch_templates.tmpl_xml_rss_prologue() format_epilogue = websearch_templates.tmpl_xml_rss_epilogue() else: format_prologue = websearch_templates.tmpl_xml_default_prologue() format_epilogue = websearch_templates.tmpl_xml_default_epilogue() # now that XML envelope is chosen, do it: recIDs_to_print = [recIDs[x] for x in range(irec_max, irec_min, -1)] req.write(format_records(recIDs_to_print, format, prologue=format_prologue, epilogue=format_epilogue, ln=ln, search_pattern=search_pattern, record_separator="\n", uid=uid)) elif format.startswith('t') or str(format[0:3]).isdigit(): # we are doing plain text output: for irec in range(irec_max, irec_min, -1): x = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, uid=uid) req.write(x) if x: req.write('\n') elif format == 'excel': recIDs_to_print = [recIDs[x] for x in range(irec_max, irec_min, -1)] create_excel(recIDs=recIDs_to_print, req=req, ln=ln) else: # we are doing HTML output: if format == 'hp' or format.startswith("hb_") or format.startswith("hd_"): # portfolio and on-the-fly formats: for irec in range(irec_max, irec_min, -1): req.write(print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, uid=uid)) elif format.startswith("hb"): # HTML brief format: rows = [] for irec in range(irec_max, irec_min, -1): temp = { 'number' : jrec+irec_max-irec, 'recid' : recIDs[irec], } if relevances and relevances[irec]: temp['relevance'] = relevances[irec] else: temp['relevance'] = '' temp['record'] = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, uid=uid) rows.append(temp) req.write(websearch_templates.tmpl_records_format_htmlbrief( ln = ln, weburl = weburl, rows = rows, relevances_prologue = relevances_prologue, relevances_epilogue = relevances_epilogue, )) else: # HTML detailed format: # print other formatting choices: rows = [] for irec in range(irec_max, irec_min, -1): temp = { 'record' : print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, uid=uid), 'recid' : recIDs[irec], 'creationdate': '', 'modifydate' : '', } if record_exists(recIDs[irec])==1: temp['creationdate'] = get_creation_date(recIDs[irec]) temp['modifydate'] = get_modification_date(recIDs[irec]) if CFG_EXPERIMENTAL_FEATURES: r = calculate_cited_by_list(recIDs[irec]) if r: temp ['citinglist'] = r temp ['citationhistory'] = create_citation_history_graph_and_box(recIDs[irec], ln) r = calculate_co_cited_with_list(recIDs[irec]) if r: temp ['cociting'] = r if CFG_BIBRANK_SHOW_DOWNLOAD_GRAPHS: r = calculate_reading_similarity_list(recIDs[irec], "downloads") if r: temp ['downloadsimilarity'] = r temp ['downloadhistory'] = create_download_history_graph_and_box(recIDs[irec], ln) # Get comments and reviews for this record if exist # FIXME: templatize me if CFG_WEBCOMMENT_ALLOW_COMMENTS or CFG_WEBCOMMENT_ALLOW_REVIEWS: from invenio.webcomment import get_first_comments_or_remarks (comments, reviews) = get_first_comments_or_remarks(recID=recIDs[irec], ln=ln, nb_comments=CFG_WEBCOMMENT_NB_COMMENTS_IN_DETAILED_VIEW, nb_reviews=CFG_WEBCOMMENT_NB_REVIEWS_IN_DETAILED_VIEW) temp['comments'] = comments temp['reviews'] = reviews r = calculate_reading_similarity_list(recIDs[irec], "pageviews") if r: temp ['viewsimilarity'] = r rows.append(temp) req.write(websearch_templates.tmpl_records_format_other( ln = ln, weburl = weburl, url_argd = req.argd, rows = rows, format = format, )) else: print_warning(req, _("Use different search terms."))
0462fb48e82b03c43123c816fc8396276d7c691e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/0462fb48e82b03c43123c816fc8396276d7c691e/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 7094, 12, 3658, 16, 1950, 5103, 16, 525, 3927, 33, 21, 16, 14524, 33, 2163, 16, 740, 2218, 76, 70, 2187, 15835, 2218, 2187, 7211, 33, 4315, 2069, 539, 16, 6707, 90, 6872, 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, 1172, 67, 7094, 12, 3658, 16, 1950, 5103, 16, 525, 3927, 33, 21, 16, 14524, 33, 2163, 16, 740, 2218, 76, 70, 2187, 15835, 2218, 2187, 7211, 33, 4315, 2069, 539, 16, 6707, 90, 6872, 2...