rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
self.newDelta(localTime, newDelta, newUncertainty)
self.newDelta(localTime, newDelta, newUncertainty, trustNew = trustNew)
def resynchronize(self, localTime, networkTime, newUncertainty, trustNew = 1): """resynchronize(self, float localTime, int32 networkTime, float newUncertainty)
64d2dbdbdfb0c0ec4a9f75ce63854c1736d67aed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/64d2dbdbdfb0c0ec4a9f75ce63854c1736d67aed/ClockDelta.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 400, 2600, 554, 12, 2890, 16, 1191, 950, 16, 2483, 950, 16, 394, 984, 7593, 1598, 93, 16, 10267, 1908, 273, 404, 4672, 3536, 455, 2600, 554, 12, 2890, 16, 1431, 1191, 950, 16, 509, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 400, 2600, 554, 12, 2890, 16, 1191, 950, 16, 2483, 950, 16, 394, 984, 7593, 1598, 93, 16, 10267, 1908, 273, 404, 4672, 3536, 455, 2600, 554, 12, 2890, 16, 1431, 1191, 950, 16, 509, 1...
sage: sr = mq.SR(1,1,1,8,gf2=True)
sage: sr = mq.SR(1, 1, 1, 8, gf2=True)
def inversion_polynomials_single_sbox(self, x= None, w=None, biaffine_only=None, correct_only=None): """ Generator for S-Box inversion polynomials of a single sbox.
26b5b14a2a46b23848ccefac3b41425cf353e86a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/26b5b14a2a46b23848ccefac3b41425cf353e86a/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 1589, 67, 3915, 13602, 87, 67, 7526, 67, 87, 2147, 12, 2890, 16, 619, 33, 599, 16, 341, 33, 7036, 16, 324, 1155, 1403, 558, 67, 3700, 33, 7036, 16, 3434, 67, 3700, 33, 7036, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 1589, 67, 3915, 13602, 87, 67, 7526, 67, 87, 2147, 12, 2890, 16, 619, 33, 599, 16, 341, 33, 7036, 16, 324, 1155, 1403, 558, 67, 3700, 33, 7036, 16, 3434, 67, 3700, 33, 7036, 4...
framebuffer-mode rgba double-buffer depth multisample hardware software
framebuffer-mode rgba double-buffer depth hardware
if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
f832775b46ffeb3bd8495df1ef102dab6760c433 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/f832775b46ffeb3bd8495df1ef102dab6760c433/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 309, 261, 1125, 422, 296, 2124, 12904, 11, 4672, 2195, 273, 2195, 397, 6619, 318, 536, 315, 397, 498, 397, 1548, 82, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 309, 261, 1125, 422, 296, 2124, 12904, 11, 4672, 2195, 273, 2195, 397, 6619, 318, 536, 315, 397, 498, 397, 1548, 82, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
raise ValueError('No such content type: %s' % type_name)
raise ValueError('No such content type: %s' % typeid)
def allowedTypesReadable(self, instance): """Returns a dictionary that maps portal_type to its human readable form.""" tool = getToolByName(instance, 'portal_types') if tool is None: msg = "Couldn't get portal_types tool from this context" raise AttributeError(msg)
1c2789c288a1a3164e3e43e406cb950681d57968 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/1c2789c288a1a3164e3e43e406cb950681d57968/Field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2935, 2016, 14151, 12, 2890, 16, 791, 4672, 3536, 1356, 279, 3880, 716, 7565, 11899, 67, 723, 358, 2097, 8672, 7471, 646, 12123, 5226, 273, 336, 6364, 5911, 12, 1336, 16, 296, 24386, 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, 2935, 2016, 14151, 12, 2890, 16, 791, 4672, 3536, 1356, 279, 3880, 716, 7565, 11899, 67, 723, 358, 2097, 8672, 7471, 646, 12123, 5226, 273, 336, 6364, 5911, 12, 1336, 16, 296, 24386, 67,...
enable_binaural = True enable_surround = True
def write_parametrized_network(renderParams): content = file(parametrized_network_filename).read() file(generated_network_filename,'w').write(content % renderParams)
def write_parametrized_network(params): content = file('offline_networks/parametrized_on_the_fly_choreography.clamnetwork').read() file(network_filename,'w').write(content % params)
09fa45d05c27aea5742396008b47895a765c00df /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1456/09fa45d05c27aea5742396008b47895a765c00df/rendercoreo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 891, 16354, 1235, 67, 5185, 12, 2010, 4672, 913, 273, 585, 2668, 23787, 67, 19982, 19, 891, 16354, 1235, 67, 265, 67, 5787, 67, 29670, 67, 343, 479, 15669, 18, 830, 301, 5185...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 891, 16354, 1235, 67, 5185, 12, 2010, 4672, 913, 273, 585, 2668, 23787, 67, 19982, 19, 891, 16354, 1235, 67, 265, 67, 5787, 67, 29670, 67, 343, 479, 15669, 18, 830, 301, 5185...
self.assert_(callable(getattr(binascii, name)))
self.assertTrue(hasattr(getattr(binascii, name), '__call__'))
def test_functions(self): # Check presence of all functions funcs = [] for suffix in "base64", "hqx", "uu", "hex": prefixes = ["a2b_", "b2a_"] if suffix == "hqx": prefixes.extend(["crc_", "rlecode_", "rledecode_"]) for prefix in prefixes: name = prefix + suffix self.assert_(callable(getattr(binascii, name))) self.assertRaises(TypeError, getattr(binascii, name)) for name in ("hexlify", "unhexlify"): self.assert_(callable(getattr(binascii, name))) self.assertRaises(TypeError, getattr(binascii, name))
ce9fc1c5954107ba725eda2c984afc032b8c5ea2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/ce9fc1c5954107ba725eda2c984afc032b8c5ea2/test_binascii.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10722, 12, 2890, 4672, 468, 2073, 9805, 434, 777, 4186, 15630, 273, 5378, 364, 3758, 316, 315, 1969, 1105, 3113, 315, 76, 85, 92, 3113, 315, 24286, 3113, 315, 7118, 6877, 9419,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10722, 12, 2890, 4672, 468, 2073, 9805, 434, 777, 4186, 15630, 273, 5378, 364, 3758, 316, 315, 1969, 1105, 3113, 315, 76, 85, 92, 3113, 315, 24286, 3113, 315, 7118, 6877, 9419,...
norm_data = ones(len(data_array))
norm_data = 0.5*ones_like(data_array)
def map_screen(self, data_array): """ Maps an array of data values to an array of colors. """ if self._dirty: self._recalculate()
4f6aed33e977910f8275ba72aaf373ae6d9e1156 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13167/4f6aed33e977910f8275ba72aaf373ae6d9e1156/color_mapper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 852, 67, 9252, 12, 2890, 16, 501, 67, 1126, 4672, 3536, 19837, 392, 526, 434, 501, 924, 358, 392, 526, 434, 5740, 18, 3536, 309, 365, 6315, 18013, 30, 365, 6315, 266, 11162, 1435, 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, 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, 852, 67, 9252, 12, 2890, 16, 501, 67, 1126, 4672, 3536, 19837, 392, 526, 434, 501, 924, 358, 392, 526, 434, 5740, 18, 3536, 309, 365, 6315, 18013, 30, 365, 6315, 266, 11162, 1435, 2, ...
% (loc.replace('/S', '/DISABLED'), loc))
% (loc.replace('/S', '/DISABLED.S'), loc))
def InstallService(self, entry): '''Install Service entry''' print lxml.etree.tostring(entry) if not entry.attrib.has_key('status'): self.logger.info('Insufficient information for Service %s; cannot Install' % entry.get('name')) return False if not entry.attrib.has_key('FMRI'): name = self.saferun("/usr/bin/svcs -H -o FMRI %s 2>/dev/null" % entry.get('name'))[1] if name: entry.set('FMRI', name[0]) else: self.logger.info('Failed to locate FMRI for service %s' % entry.get('name')) return False self.logger.info("Installing Service %s" % (entry.get('name'))) if entry.attrib['status'] == 'off': if self.setup['dryrun']: print "Disabling Service %s" % (entry.get('name')) else: if entry.get("FMRI").startswith('lrc'): try: loc = entry.get("FMRI")[4:].replace('_', ',') self.logger.debug("Renaming file %s to %s" % \ (loc, loc.replace('/S', '/DISABLED'))) os.rename(loc, loc.replace('/S', '/DISABLED')) return True except OSError: self.logger.error("Failed to rename init script %s" % (loc)) return False cmdrc = self.saferun("/usr/sbin/svcadm disable -r %s" % (entry.attrib['FMRI']))[0] else: if self.setup['dryrun']: print "Enabling Service %s" % (entry.attrib['name']) else: if entry.get('FMRI').startswith('lrc'): loc = entry.get("FMRI")[4:].replace('_', ',') try: stat(loc.replace('/S', '/Disabled.')) self.logger.debug("Renaming file %s to %s" % \ (loc.replace('/S', '/DISABLED'), loc)) os.rename(loc.replace('/S', '/DISABLED'), loc) cmdrc = 0 except: self.logger.debug("Failed to rename %s to %s" \ % (loc.replace('/S', '/DISABLED'), loc)) cmdrc = 1 else: cmdrc = self.saferun("/usr/sbin/svcadm enable -r %s" % (entry.attrib['FMRI']))[0] return cmdrc == 0
fa29a2b8704c50baf4779b24ec4f6c76b78e7f27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/fa29a2b8704c50baf4779b24ec4f6c76b78e7f27/Solaris.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10284, 1179, 12, 2890, 16, 1241, 4672, 9163, 6410, 1956, 1241, 26418, 1172, 328, 2902, 18, 31303, 18, 14627, 371, 12, 4099, 13, 309, 486, 1241, 18, 14588, 18, 5332, 67, 856, 2668, 2327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10284, 1179, 12, 2890, 16, 1241, 4672, 9163, 6410, 1956, 1241, 26418, 1172, 328, 2902, 18, 31303, 18, 14627, 371, 12, 4099, 13, 309, 486, 1241, 18, 14588, 18, 5332, 67, 856, 2668, 2327, ...
self._METHODS = frozendict({
generic_types = {self.ITEMTYPE_T: ITEMTYPE} self._GENERIC_METHODS = frozendict({
def __init__(self, ITEMTYPE): self._ITEMTYPE = ITEMTYPE self._null = _null_list(self)
0b0ab89cf0b3d6dacc65ed030f583f369c2753be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/0b0ab89cf0b3d6dacc65ed030f583f369c2753be/ootype.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 25504, 2399, 4672, 365, 6315, 12674, 2399, 273, 25504, 2399, 365, 6315, 2011, 273, 389, 2011, 67, 1098, 12, 2890, 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, 0, 0, 0, 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, 25504, 2399, 4672, 365, 6315, 12674, 2399, 273, 25504, 2399, 365, 6315, 2011, 273, 389, 2011, 67, 1098, 12, 2890, 13, 2, -100, -100, -100, -100, -100, -100...
units of characters.
units of characters.
def _get_html_label(self, package): """ :Return: (label, depth, width) where: - ``label`` is the HTML label - ``depth`` is the depth of the package tree (for coloring) - ``width`` is the max width of the HTML label, roughly in units of characters. """ MAX_ROW_WIDTH = 80 # unit is roughly characters. pkg_name = package.canonical_name pkg_url = self.linker.url_for(package) or NOOP_URL if (not package.is_package or len(package.submodules) == 0 or self.collapsed): pkg_color = self._color(package, 1) label = self._MODULE_LABEL % (pkg_color, pkg_color, pkg_url, pkg_name, pkg_name[-1]) return (label, 1, len(pkg_name[-1])+3) # Get the label for each submodule, and divide them into rows. row_list = [''] row_width = 0 max_depth = 0 max_row_width = len(pkg_name[-1])+3 for submodule in package.submodules: if submodule in self.excluded_submodules: continue # Get the submodule's label. label, depth, width = self._get_html_label(submodule) # Check if we should start a new row. if row_width > 0 and width+row_width > MAX_ROW_WIDTH: row_list.append('') row_width = 0 # Add the submodule's label to the row. row_width += width row_list[-1] += '<TD ALIGN="LEFT">%s</TD>' % label # Update our max's. max_depth = max(depth, max_depth) max_row_width = max(row_width, max_row_width)
6c85d7d72771e3c390537e13c466becb8993527b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3512/6c85d7d72771e3c390537e13c466becb8993527b/dotgraph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 2620, 67, 1925, 12, 2890, 16, 2181, 4672, 3536, 294, 990, 30, 261, 1925, 16, 3598, 16, 1835, 13, 1625, 30, 225, 300, 12176, 1925, 10335, 353, 326, 3982, 1433, 300, 12176,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 2620, 67, 1925, 12, 2890, 16, 2181, 4672, 3536, 294, 990, 30, 261, 1925, 16, 3598, 16, 1835, 13, 1625, 30, 225, 300, 12176, 1925, 10335, 353, 326, 3982, 1433, 300, 12176,...
"id" : 42, "title" : "Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.", "assigned_to_email" : _unassigned_email, "attachments" : [_patch1, _patch2], }
"id": 42, "title": "Bug with two r+'d and cq+'d patches, one of which has an " "invalid commit-queue setter.", "assigned_to_email": _unassigned_email, "attachments": [_patch1, _patch2], }
def _id_to_object_dictionary(*objects): dictionary = {} for thing in objects: dictionary[thing["id"]] = thing return dictionary
c40aa4d55730657b1c744e6ea677416c5bf4f7d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/c40aa4d55730657b1c744e6ea677416c5bf4f7d9/mock_bugzillatool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 350, 67, 869, 67, 1612, 67, 15556, 30857, 6911, 4672, 3880, 273, 2618, 364, 7757, 316, 2184, 30, 3880, 63, 4274, 9614, 350, 11929, 65, 273, 7757, 327, 3880, 225, 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, 389, 350, 67, 869, 67, 1612, 67, 15556, 30857, 6911, 4672, 3880, 273, 2618, 364, 7757, 316, 2184, 30, 3880, 63, 4274, 9614, 350, 11929, 65, 273, 7757, 327, 3880, 225, 2, -100, -100, -1...
nodes = [] nodes.append(self.expr) if self.lower is not None: nodes.append(self.lower) if self.upper is not None: nodes.append(self.upper) return tuple(nodes)
nodelist = [] nodelist.append(self.expr) if self.lower is not None: nodelist.append(self.lower) if self.upper is not None: nodelist.append(self.upper) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.append(self.expr) if self.lower is not None: nodes.append(self.lower) if self.upper is not None: nodes.append(self.upper) return tuple(nodes)
101b9307b0d9de62f324ef9ffa6e83f8040af642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/101b9307b0d9de62f324ef9ffa6e83f8040af642/ast.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23895, 12, 2890, 4672, 2199, 273, 5378, 2199, 18, 6923, 12, 2890, 18, 8638, 13, 309, 365, 18, 8167, 353, 486, 599, 30, 5411, 2199, 18, 6923, 12, 2890, 18, 8167, 13, 309, 365, 18, 579...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23895, 12, 2890, 4672, 2199, 273, 5378, 2199, 18, 6923, 12, 2890, 18, 8638, 13, 309, 365, 18, 8167, 353, 486, 599, 30, 5411, 2199, 18, 6923, 12, 2890, 18, 8167, 13, 309, 365, 18, 579...
ret = ["--ignore=%s" % \ os.path.join(self._source_dir, "tools", "valgrind", "tsan", "ignores.txt")]
ret = [] ignore_files = ["ignores.txt"] platform_suffix = { 'darwin': 'mac', 'linux2': 'linux' }[sys.platform] ignore_files.append("ignores_%s.txt" % platform_suffix) for ignore_file in ignore_files: fullname = os.path.join(self._source_dir, "tools", "valgrind", "tsan", ignore_file) if os.path.exists(fullname): ret += ["--ignore=%s" % fullname]
def ToolSpecificFlags(self): ret = ["--ignore=%s" % \ os.path.join(self._source_dir, "tools", "valgrind", "tsan", "ignores.txt")] ret += ["--file-prefix-to-cut=%s/" % self._source_dir]
3782b4791476fdf288f6d925e354c9047d54a4cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/3782b4791476fdf288f6d925e354c9047d54a4cd/valgrind_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13288, 9969, 5094, 12, 2890, 4672, 325, 273, 5378, 225, 2305, 67, 2354, 273, 8247, 724, 3485, 18, 5830, 11929, 4072, 67, 8477, 273, 288, 296, 28076, 4278, 296, 5821, 2187, 296, 20132, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13288, 9969, 5094, 12, 2890, 4672, 325, 273, 5378, 225, 2305, 67, 2354, 273, 8247, 724, 3485, 18, 5830, 11929, 4072, 67, 8477, 273, 288, 296, 28076, 4278, 296, 5821, 2187, 296, 20132, 22...
WriteList(fp, dependencies, preamble='env.Requires(gyp_target, [\n ', postamble='\n])\n')
WriteList(fp, dependencies, preamble='dependencies = [\n ', postamble='\n]\n') fp.write('env.Requires(gyp_target, dependencies)\n') fp.write('for prerequisite in prerequisites:\n') fp.write(' env.Requires(prerequisite, dependencies)\n')
def GenerateSConscript(output_filename, spec, build_file, build_file_data): """ Generates a SConscript file for a specific target. This generates a SConscript file suitable for building any or all of the target's configurations. A SConscript file may be called multiple times to generate targets for multiple configurations. Consequently, it needs to be ready to build the target for any requested configuration, and therefore contains information about the settings for all configurations (generated into the SConscript file at gyp configuration time) as well as logic for selecting (at SCons build time) the specific configuration being built. The general outline of a generated SConscript file is: -- Header -- Import 'env'. This contains a $CONFIG_NAME construction variable that specifies what configuration to build (e.g. Debug, Release). -- Configurations. This is a dictionary with settings for the different configurations (Debug, Release) under which this target can be built. The values in the dictionary are themselves dictionaries specifying what construction variables should added to the local copy of the imported construction environment (Append), should be removed (FilterOut), and should outright replace the imported values (Replace). -- Clone the imported construction environment and update with the proper configuration settings. -- Initialize the lists of the targets' input files and prerequisites. -- Target-specific actions and rules. These come after the input file and prerequisite initializations because the outputs of the actions and rules may affect the input file list (process_outputs_as_sources) and get added to the list of prerequisites (so that they're guaranteed to be executed before building the target). -- Call the Builder for the target itself. -- Arrange for any copies to be made into installation directories. -- Set up the {name} Alias (phony Node) for the target as the primary handle for building all of the target's pieces. -- Use env.Require() to make sure the prerequisites (explicitly specified, but also including the actions and rules) are built before the target itself. -- Return the {name} Alias to the calling SConstruct file so it can be added to the list of default targets. """ scons_target = SCons.Target(spec) gyp_dir = os.path.dirname(output_filename) if not gyp_dir: gyp_dir = '.' gyp_dir = os.path.abspath(gyp_dir) output_dir = os.path.dirname(output_filename) src_dir = build_file_data['_DEPTH'] src_dir_rel = gyp.common.RelativePath(src_dir, output_dir) subdir = gyp.common.RelativePath(os.path.dirname(build_file), src_dir) src_subdir = '$SRC_DIR/' + subdir src_subdir_ = src_subdir + '/' component_name = os.path.splitext(os.path.basename(build_file))[0] target_name = spec['target_name'] if not os.path.exists(gyp_dir): os.makedirs(gyp_dir) fp = open(output_filename, 'w') fp.write(header) fp.write('\nimport os\n') fp.write('\nImport("env")\n') # fp.write('\n') fp.write('env = env.Clone(COMPONENT_NAME=%s,\n' % repr(component_name)) fp.write(' TARGET_NAME=%s)\n' % repr(target_name)) # for config in spec['configurations'].itervalues(): if config.get('scons_line_length'): fp.write(_spawn_hack) break # indent = ' ' * 12 fp.write('\n') fp.write('configurations = {\n') for config_name, config in spec['configurations'].iteritems(): fp.write(' \'%s\' : {\n' % config_name) fp.write(' \'Append\' : dict(\n') GenerateConfig(fp, config, indent, src_subdir) libraries = spec.get('libraries') if libraries: WriteList(fp, map(repr, libraries), prefix=indent, preamble='%sLIBS = [\n ' % indent, postamble='\n%s],\n' % indent) fp.write(' ),\n') fp.write(' \'FilterOut\' : dict(\n' ) for key, var in config.get('scons_remove', {}).iteritems(): fp.write(' %s = %s,\n' % (key, repr(var))) fp.write(' ),\n') fp.write(' \'Replace\' : dict(\n' ) scons_settings = config.get('scons_variable_settings', {}) for key in sorted(scons_settings.keys()): val = pprint.pformat(scons_settings[key]) fp.write(' %s = %s,\n' % (key, val)) if 'c++' in spec.get('link_languages', []): fp.write(' %s = %s,\n' % ('LINK', repr('$CXX'))) if config.get('scons_line_length'): fp.write(' SPAWN = gyp_spawn,\n') fp.write(' ),\n') fp.write(' \'ImportExternal\' : [\n' ) for var in config.get('scons_import_variables', []): fp.write(' %s,\n' % repr(var)) fp.write(' ],\n') fp.write(' \'PropagateExternal\' : [\n' ) for var in config.get('scons_propagate_variables', []): fp.write(' %s,\n' % repr(var)) fp.write(' ],\n') fp.write(' },\n') fp.write('}\n') fp.write('\n' 'config = configurations[env[\'CONFIG_NAME\']]\n' 'env.Append(**config[\'Append\'])\n' 'env.FilterOut(**config[\'FilterOut\'])\n' 'env.Replace(**config[\'Replace\'])\n' 'for _var in config[\'ImportExternal\']:\n' ' if _var in ARGUMENTS:\n' ' env[_var] = ARGUMENTS[_var]\n' ' elif _var in os.environ:\n' ' env[_var] = os.environ[_var]\n' 'for _var in config[\'PropagateExternal\']:\n' ' if _var in ARGUMENTS:\n' ' env[_var] = ARGUMENTS[_var]\n' ' elif _var in os.environ:\n' ' env[\'ENV\'][_var] = os.environ[_var]\n') # #fp.write("\nif env.has_key('CPPPATH'):\n") #fp.write(" env['CPPPATH'] = map(env.Dir, env['CPPPATH'])\n") variants = spec.get('variants', {}) for setting in sorted(variants.keys()): if_fmt = 'if ARGUMENTS.get(%s) not in (None, \'0\'):\n' fp.write('\n') fp.write(if_fmt % repr(setting.upper())) fp.write(' env.AppendUnique(\n') GenerateConfig(fp, variants[setting], indent, src_subdir) fp.write(' )\n') # scons_target.write_input_files(fp) fp.write('\n') fp.write('target_files = []\n') prerequisites = spec.get('scons_prerequisites', []) fp.write('prerequisites = %s\n' % pprint.pformat(prerequisites)) actions = spec.get('actions', []) for action in actions: a = ['cd', src_subdir, '&&'] + action['action'] message = action.get('message') if message: message = repr(message) inputs = [FixPath(f, src_subdir_) for f in action.get('inputs', [])] outputs = [FixPath(f, src_subdir_) for f in action.get('outputs', [])] if outputs: template = _command_template else: template = _alias_template fp.write(template % { 'inputs' : pprint.pformat(inputs), 'outputs' : pprint.pformat(outputs), 'action' : pprint.pformat(a), 'message' : message, 'target_name': target_name, }) if int(action.get('process_outputs_as_sources', 0)): fp.write('input_files.extend(_outputs)\n') fp.write('prerequisites.extend(_outputs)\n') rules = spec.get('rules', []) for rule in rules: name = rule['rule_name'] a = ['cd', src_subdir, '&&'] + rule['action'] message = rule.get('message') if message: message = repr(message) if int(rule.get('process_outputs_as_sources', 0)): poas_line = '_processed_input_files.extend(_generated)' else: poas_line = '_processed_input_files.append(infile)' inputs = [FixPath(f, src_subdir_) for f in rule.get('inputs', [])] outputs = [FixPath(f, src_subdir_) for f in rule.get('outputs', [])] fp.write(_rule_template % { 'inputs' : pprint.pformat(inputs), 'outputs' : pprint.pformat(outputs), 'action' : pprint.pformat(a), 'extension' : rule['extension'], 'name' : name, 'message' : message, 'process_outputs_as_sources_line' : poas_line, 'src_dir' : src_subdir_, }) scons_target.write_target(fp, src_subdir) copies = spec.get('copies', []) if copies: fp.write(_copy_action_template) for copy in copies: destdir = None files = None try: destdir = copy['destination'] except KeyError, e: gyp.common.ExceptionAppend( e, "Required 'destination' key missing for 'copies' in %s." % build_file) raise try: files = copy['files'] except KeyError, e: gyp.common.ExceptionAppend( e, "Required 'files' key missing for 'copies' in %s." % build_file) raise if not files: # TODO: should probably add a (suppressible) warning; # a null file list may be unintentional. continue if not destdir: raise Exception( "Required 'destination' key is empty for 'copies' in %s." % build_file) fmt = ('\n' '_outputs = env.Command(%s,\n' ' %s,\n' ' GYPCopy(\'$TARGET\', \'$SOURCE\'))\n') for f in copy['files']: dest = os.path.join(destdir, os.path.basename(f)) f = FixPath(f, src_subdir_) dest = FixPath(dest, src_subdir_) fp.write(fmt % (repr(dest), repr(f))) fp.write('target_files.extend(_outputs)\n') if spec.get('run_as') or int(spec.get('test', 0)): run_as = spec.get('run_as', { 'action' : ['$TARGET_NAME', '--gtest_print_time'], }) action = run_as.get('action', []) working_directory = run_as.get('working_directory') if not working_directory: working_directory = gyp_dir else: if not os.path.isabs(working_directory): working_directory = os.path.normpath(os.path.join(gyp_dir, working_directory)) if run_as.get('environment'): for (key, val) in run_as.get('environment').iteritems(): action = ['%s="%s"' % (key, val)] + action action = ['cd', '"%s"' % working_directory, '&&'] + action fp.write(_run_as_template % { 'action' : pprint.pformat(action), 'message' : run_as.get('message', ''), }) fmt = "\ngyp_target = env.Alias('%s', target_files)\n" fp.write(fmt % target_name) dependencies = spec.get('scons_dependencies', []) if dependencies: WriteList(fp, dependencies, preamble='env.Requires(gyp_target, [\n ', postamble='\n])\n') fp.write('env.Requires(gyp_target, prerequisites)\n') if spec.get('run_as', 0) or int(spec.get('test', 0)): fp.write(_run_as_template_suffix % { 'target_name': target_name, }) fp.write('Return("gyp_target")\n') fp.close()
c1673858bb92f017583c5e735be171c0ce9f333b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/c1673858bb92f017583c5e735be171c0ce9f333b/scons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 55, 442, 4263, 12, 2844, 67, 3459, 16, 857, 16, 1361, 67, 768, 16, 1361, 67, 768, 67, 892, 4672, 3536, 31902, 279, 348, 442, 4263, 585, 364, 279, 2923, 1018, 18, 225, 1220, 602...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 55, 442, 4263, 12, 2844, 67, 3459, 16, 857, 16, 1361, 67, 768, 16, 1361, 67, 768, 67, 892, 4672, 3536, 31902, 279, 348, 442, 4263, 585, 364, 279, 2923, 1018, 18, 225, 1220, 602...
except: sys.exit("Cannot open source file \""+path+"\" for reading.");
except: sys.exit("Cannot open source file \""+path+"\" for reading.")
def CxxGetIncludes(path): date = filedate(path) if (CxxIncludeCache.has_key(path)): cached = CxxIncludeCache[path] if (cached[0]==date): return cached[1] try: sfile = open(path, 'rb') except: sys.exit("Cannot open source file \""+path+"\" for reading."); include = [] for line in sfile: match = CxxIncludeRegex.match(line,0); if (match): incname = match.group(1) include.append(incname) sfile.close(); CxxIncludeCache[path] = [date, include] return include
aa9700942409f59dfc63d4542d0bad0a01230726 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/aa9700942409f59dfc63d4542d0bad0a01230726/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 385, 5279, 967, 16815, 12, 803, 4672, 1509, 273, 585, 712, 12, 803, 13, 309, 261, 39, 5279, 8752, 1649, 18, 5332, 67, 856, 12, 803, 3719, 30, 3472, 273, 385, 5279, 8752, 1649, 63, 80...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 385, 5279, 967, 16815, 12, 803, 4672, 1509, 273, 585, 712, 12, 803, 13, 309, 261, 39, 5279, 8752, 1649, 18, 5332, 67, 856, 12, 803, 3719, 30, 3472, 273, 385, 5279, 8752, 1649, 63, 80...
r'<a class="external" href="\1">\1</a>', note.text) if text != note.text:
r'<a class="external" href="\1">\1</a>', org_text) if text != org_text:
def title(request, lccn): title = get_object_or_404(models.Title, lccn=lccn) page_title = "About this Newspaper: %s" % unicode(title.name) # we call these here, because the query the db, they are not # cached by django's ORM, and we have some conditional logic # in the template that would result in them getting called more # than once. Short story: minimize database hits... related_titles = title.related_titles() succeeding_titles = title.succeeding_titles() preceeding_titles = title.preceeding_titles() profile_uri = 'http://www.openarchives.org/ore/html/' notes = [] has_external_link = False for note in title.notes.all(): text = re.sub('(http(s)?://[^\s]+[^\.])', r'<a class="external" href="\1">\1</a>', note.text) if text != note.text: has_external_link = True notes.append(text) response = render_to_response('title.html', dictionary=locals(), context_instance=RequestContext(request)) return response
6b4332a0787b3d69d7a8a093bb104ece193272cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6299/6b4332a0787b3d69d7a8a093bb104ece193272cf/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2077, 12, 2293, 16, 328, 952, 82, 4672, 2077, 273, 336, 67, 1612, 67, 280, 67, 11746, 12, 7665, 18, 4247, 16, 328, 952, 82, 33, 80, 952, 82, 13, 1363, 67, 2649, 273, 315, 24813, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2077, 12, 2293, 16, 328, 952, 82, 4672, 2077, 273, 336, 67, 1612, 67, 280, 67, 11746, 12, 7665, 18, 4247, 16, 328, 952, 82, 33, 80, 952, 82, 13, 1363, 67, 2649, 273, 315, 24813, 33...
if callable == nugen.next.im_func: try: return apply(callable, args, kwds or {}) except: self.reraise() else:
try:
def call(self, callable, args, kwds): if isinstance(callable, types.ClassType): import new try: r = new.instance(callable) except: self.reraise() if hasattr(r, '__init__'): self.call(r.__init__, args, kwds) return r if (isinstance(callable, types.MethodType) and callable.im_self is not None): args = (callable.im_self,) + args callable = callable.im_func if callable == nugen.next.im_func: try: return apply(callable, args, kwds or {}) except: self.reraise() else: return apply(callable, args, kwds or {})
8b87e80aa66eaef372ec7b69c8744ea46174e4bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/8b87e80aa66eaef372ec7b69c8744ea46174e4bf/trivial.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 12, 2890, 16, 4140, 16, 833, 16, 17149, 4672, 309, 1549, 12, 7293, 16, 1953, 18, 18328, 4672, 1930, 394, 775, 30, 436, 273, 394, 18, 1336, 12, 7293, 13, 1335, 30, 365, 18, 86, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 745, 12, 2890, 16, 4140, 16, 833, 16, 17149, 4672, 309, 1549, 12, 7293, 16, 1953, 18, 18328, 4672, 1930, 394, 775, 30, 436, 273, 394, 18, 1336, 12, 7293, 13, 1335, 30, 365, 18, 86, ...
return self.stats[key][BNI_STATS_DEVIATION]
return self.stats[key][BIN_STATS_DEVIATION]
def GetDev(self, key): if not self.stats.has_key(key): self.ComputeStats(key)
e2fc885850f99e4d981fd057c96051c1232133c2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6163/e2fc885850f99e4d981fd057c96051c1232133c2/ConfDistFuncs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 8870, 12, 2890, 16, 498, 4672, 309, 486, 365, 18, 5296, 18, 5332, 67, 856, 12, 856, 4672, 365, 18, 7018, 4195, 12, 856, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 8870, 12, 2890, 16, 498, 4672, 309, 486, 365, 18, 5296, 18, 5332, 67, 856, 12, 856, 4672, 365, 18, 7018, 4195, 12, 856, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -1...
except DiscoveryFailure, e:
except Exception, e:
def init(self): self.consumer = create_consumer(self.openid_session) openid = self.form_result.get("openid") try: authrequest = self.consumer.begin(openid) except DiscoveryFailure, e: return self._failure(openid, str(e)) if not c.user and not model.OpenID.by_id(openid): axreq = ax.FetchRequest(h.instance_url(c.instance, path='/openid/update')) axreq.add(ax.AttrInfo(AX_MAIL_SCHEMA, alias="email", required=True)) authrequest.addExtension(axreq)
69c2d5f50e559dfbbf8ad61d89ee8c3ab34762c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/69c2d5f50e559dfbbf8ad61d89ee8c3ab34762c0/openidauth.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 4672, 365, 18, 13230, 273, 752, 67, 13230, 12, 2890, 18, 20619, 67, 3184, 13, 21629, 273, 365, 18, 687, 67, 2088, 18, 588, 2932, 20619, 7923, 775, 30, 1357, 2293, 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, 1208, 12, 2890, 4672, 365, 18, 13230, 273, 752, 67, 13230, 12, 2890, 18, 20619, 67, 3184, 13, 21629, 273, 365, 18, 687, 67, 2088, 18, 588, 2932, 20619, 7923, 775, 30, 1357, 2293, 273, ...
def run():
def run(): try: os.makedirs(WIKI) except OSError, e: if e.errno != errno.EEXIST: raise
def run(): removeTestWiki() copyData() untarUnderlay()
6df283c2d2473df918fd8c15af7934b86e8710d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/6df283c2d2473df918fd8c15af7934b86e8710d4/maketestwiki.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 13332, 775, 30, 1140, 18, 81, 9477, 10539, 12, 23109, 47, 45, 13, 1335, 10002, 16, 425, 30, 309, 425, 18, 19088, 480, 8402, 18, 41, 11838, 30, 1002, 225, 1206, 4709, 25438, 1435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 13332, 775, 30, 1140, 18, 81, 9477, 10539, 12, 23109, 47, 45, 13, 1335, 10002, 16, 425, 30, 309, 425, 18, 19088, 480, 8402, 18, 41, 11838, 30, 1002, 225, 1206, 4709, 25438, 1435,...
member = self.getValidUser(userid)
member = self.getValidUser(stored_user)
def resetPassword(self, userid, randomstring, password): """Set the password (in 'password') for the user who maps to the string in 'randomstring' iff the entered 'userid' is equal to the mapped userid. (This can be turned off with the 'toggleUserCheck' method.)
8f2b0fd2f50d2622b12d9153debf08b582460d16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12219/8f2b0fd2f50d2622b12d9153debf08b582460d16/PasswordResetTool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2715, 3913, 12, 2890, 16, 6709, 16, 2744, 1080, 16, 2201, 4672, 3536, 694, 326, 2201, 261, 267, 296, 3664, 6134, 364, 326, 729, 10354, 7565, 358, 326, 533, 316, 296, 9188, 1080, 11, 21...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2715, 3913, 12, 2890, 16, 6709, 16, 2744, 1080, 16, 2201, 4672, 3536, 694, 326, 2201, 261, 267, 296, 3664, 6134, 364, 326, 729, 10354, 7565, 358, 326, 533, 316, 296, 9188, 1080, 11, 21...
link_url += quote(colldef) + ' '
link_url += quote(colldef) + '%20AND%20'
for coll, colldef in l_colls: link_url = CFG_SITE_URL + '/search?p=' if searchpattern: p = searchpattern if searchfield: if " " in searchpattern: p = searchfield + ':"' + searchpattern + '"' else: p = searchfield + ':' + searchpattern link_url += quote(p) + ' ' if colldef: link_url += quote(colldef) + ' ' if low == 0 and high == 0: link_url += quote('cited:0') else: link_url += quote('cited:%i->%i' % (low, high)) link_url += '&amp;rm=citation'; link_text = self.tmpl_nice_number(d_cites[coll], ln) out += '<td align="right"><a href="%s">%s</a></td>' % (link_url, link_text)
f65c03e4c838d646a02c0270d3c64cf2bb1a95d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/f65c03e4c838d646a02c0270d3c64cf2bb1a95d8/websearch_templates.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 364, 4508, 16, 4508, 536, 316, 328, 67, 1293, 3251, 30, 1692, 67, 718, 273, 7577, 67, 20609, 67, 1785, 397, 1173, 3072, 35, 84, 2218, 309, 1623, 4951, 30, 293, 273, 1623, 4951, 309, 1623, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 364, 4508, 16, 4508, 536, 316, 328, 67, 1293, 3251, 30, 1692, 67, 718, 273, 7577, 67, 20609, 67, 1785, 397, 1173, 3072, 35, 84, 2218, 309, 1623, 4951, 30, 293, 273, 1623, 4951, 309, 1623, ...
print "FLAAAT"
def render(self,data={}, context={}):
aa992bf3c3c1db05a456ad854df1f14f6a93471d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3323/aa992bf3c3c1db05a456ad854df1f14f6a93471d/chart.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 892, 28793, 819, 12938, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1743, 12, 2890, 16, 892, 28793, 819, 12938, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
value = self.GetXprop("^WM_CLASS\(STRING\) = \"([^\"]+)\"") value = value.lower().capitalize()
value = self.GetXprop("^WM_CLASS\(STRING\) = \"([^\"]+)\", \"([^\"]+)\"")
def GrabValue(self, widget, valueWidget, typeWidget): value = "" type = typeWidget.get_active_text()
0ec572532fcea8fccd5fe3127c6eb2da7fb18e24 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1272/0ec572532fcea8fccd5fe3127c6eb2da7fb18e24/Settings.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17150, 620, 12, 2890, 16, 3604, 16, 460, 4609, 16, 618, 4609, 4672, 460, 273, 1408, 618, 273, 618, 4609, 18, 588, 67, 3535, 67, 955, 1435, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17150, 620, 12, 2890, 16, 3604, 16, 460, 4609, 16, 618, 4609, 4672, 460, 273, 1408, 618, 273, 618, 4609, 18, 588, 67, 3535, 67, 955, 1435, 2, -100, -100, -100, -100, -100, -100, -100, ...
@locked
@stamped
def append(self, cols): # Optimize! arrays = [] names = [] sz = None for col in cols: if sz is None: sz = col.getsize() else: if sz != col.getsize(): raise omero.ValidationException("Columns are of differing length") names.extend(col.names()) arrays.extend(col.arrays()) col.append(self.__mea) # Potential corruption !!! records = numpy.rec.fromarrays(arrays, names=names) self.__mea.append(records) self.__mea.flush()
07b69b85ac63e47f61facfce48b774f97174bc16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/07b69b85ac63e47f61facfce48b774f97174bc16/tables.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 12, 2890, 16, 5347, 4672, 468, 12056, 10153, 5, 5352, 273, 5378, 1257, 273, 5378, 11262, 273, 599, 364, 645, 316, 5347, 30, 309, 11262, 353, 599, 30, 11262, 273, 645, 18, 588, 146...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 16, 5347, 4672, 468, 12056, 10153, 5, 5352, 273, 5378, 1257, 273, 5378, 11262, 273, 599, 364, 645, 316, 5347, 30, 309, 11262, 353, 599, 30, 11262, 273, 645, 18, 588, 146...
_vars = str(self.gen())
_vars = '(%s)'%self.gen()
def _singular_init_(self, singular=singular_default): """ Return a newly created Singular ring matching this ring. """ if not can_convert_to_singular(self): raise TypeError, "no conversion of this ring to a Singular ring defined" if self.ngens()==1: _vars = str(self.gen()) if "*" in _vars: # 1.000...000*x _vars = _vars.split("*")[1] order = 'lp' else: _vars = str(self.gens()) order = self.term_order().singular_str() base_ring = self.base_ring()
87605f8a1f15077b739625aa761ab81f9465464c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/87605f8a1f15077b739625aa761ab81f9465464c/polynomial_singular_interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17835, 67, 2738, 67, 12, 2890, 16, 10048, 33, 17835, 67, 1886, 4672, 3536, 2000, 279, 10894, 2522, 348, 17830, 9221, 3607, 333, 9221, 18, 3536, 309, 486, 848, 67, 6283, 67, 869, 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, 17835, 67, 2738, 67, 12, 2890, 16, 10048, 33, 17835, 67, 1886, 4672, 3536, 2000, 279, 10894, 2522, 348, 17830, 9221, 3607, 333, 9221, 18, 3536, 309, 486, 848, 67, 6283, 67, 869, 6...
client.DeferredClientFactory.__init__(self, JID(self.jid), self.password)
client.DeferredClientFactory.__init__(self, JID(self.jid_str), self.password)
def __init__(self, name): IbidSourceFactory.__init__(self, name) self.log = logging.getLogger('source.%s' % name) client.DeferredClientFactory.__init__(self, JID(self.jid), self.password) bot = JabberBot() self.addHandler(bot) bot.setHandlerParent(self)
c52f9d31dc7d82b00ec8778faa5fd41cf82d5f91 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/c52f9d31dc7d82b00ec8778faa5fd41cf82d5f91/jabber.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 508, 4672, 467, 19773, 1830, 1733, 16186, 2738, 972, 12, 2890, 16, 508, 13, 365, 18, 1330, 273, 2907, 18, 588, 3328, 2668, 3168, 7866, 87, 11, 738, 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, 1001, 2738, 972, 12, 2890, 16, 508, 4672, 467, 19773, 1830, 1733, 16186, 2738, 972, 12, 2890, 16, 508, 13, 365, 18, 1330, 273, 2907, 18, 588, 3328, 2668, 3168, 7866, 87, 11, 738, 508, ...
t.setText(text[3])
t.setText(text[4])
def drawRules(self): self.oldSelection=[r.rule for r in self.selRect] self.sort() self.clear() for r in self.rectObj: r.setCanvas(None) self.rectObj=[] text=self.text filter=[self.RuleLen, self.RuleQ, self.Coverage, self.Class, self.Dist or self.DistBar,self.Rule] l=[] #a=["Length","Quality","Coverage","Class","Distribution", "Distribution(Bar)", "Rule"] a=["Length","Quality","Coverage","Class","Distribution", "Rule"] for i, k in enumerate(a): if filter[i]: t=QCanvasText(self.headerCanvas) t.setText(k) l.append(t) l.append(QCanvasText(self.canvas)) items=[] items.append(l) self.obj.extend(l) for text in self.text: l=[] if self.RuleLen: t=QCanvasText(self.canvas) t.setText(text[0]) l.append(t) if self.RuleQ: t=QCanvasText(self.canvas) t.setText(text[1]) l.append(t) if self.Coverage: t=QCanvasText(self.canvas) t.setText(text[2]) l.append(t) if self.Class: t=QCanvasText(self.canvas) t.setText(text[3]) l.append(t) if self.Dist and not self.DistBar: t=QCanvasText(self.canvas) t.setText(text[4]) l.append(t) if self.DistBar: t=DistBar(text[4],self.Dist,self.canvas) l.append(t) if self.Rule: t=QCanvasText(self.canvas) t.setText(text[5])#self.ruleText(text[-1])) l.append(t) l.append(QCanvasText(self.canvas)) self.obj.extend(l) items.append(l) #print len(items) textMapV=[10]+map(lambda s:max([t.boundingRect().height()+10 for t in s]), items[1:]) textMapH=[[s[i].boundingRect().width()+10 for s in items] for i in range(len(items[0]))] textMapH=[10]+map(lambda s:max(s), textMapH)
f6b6b724b64646141604db59c794c0c0ee707f2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/f6b6b724b64646141604db59c794c0c0ee707f2d/OWCN2RulesViewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4478, 12, 2890, 4672, 365, 18, 1673, 6233, 22850, 86, 18, 5345, 364, 436, 316, 365, 18, 1786, 6120, 65, 365, 18, 3804, 1435, 365, 18, 8507, 1435, 364, 436, 316, 365, 18, 2607, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4478, 12, 2890, 4672, 365, 18, 1673, 6233, 22850, 86, 18, 5345, 364, 436, 316, 365, 18, 1786, 6120, 65, 365, 18, 3804, 1435, 365, 18, 8507, 1435, 364, 436, 316, 365, 18, 2607, ...
kconfig = repo.branch_from_xml(id, childnode, repositories, default_repo) kconfig.version = childnode.getAttribute('version')
branch = repo.branch_from_xml(id, childnode, repositories, default_repo) version = childnode.getAttribute('version')
def get_kconfigs(node, repositories, default_repo): id = node.getAttribute('id') kconfigs = [] for childnode in node.childNodes: if childnode.nodeType != childnode.ELEMENT_NODE or childnode.nodeName != 'kconfig': continue if childnode.hasAttribute('repo'): repo_name = childnode.getAttribute('repo') try: repo = repositories[repo_name] except KeyError: raise FatalError(_('Repository=%s not found for kconfig in linux id=%s. Possible repositories are %s') % (repo_name, id, repositories)) else: try: repo = repositories[default_repo] except KeyError: raise FatalError(_('Default Repository=%s not found for kconfig in module id=%s. Possible repositories are %s') % (default_repo, id, repositories)) kconfig = repo.branch_from_xml(id, childnode, repositories, default_repo) kconfig.version = childnode.getAttribute('version') if childnode.hasAttribute('config'): kconfig.path = os.path.join(kconfig.srcdir, childnode.getAttribute('config')) else: kconfig.path = kconfig.srcdir kconfigs.append(kconfig) if not kconfigs: raise FatalError(_('No <kconfig> elements found for module %s') % id) return kconfigs
3c3b5cab97cd85b94624d2a4563b4dc89c24dfc2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4596/3c3b5cab97cd85b94624d2a4563b4dc89c24dfc2/linux.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 79, 10955, 12, 2159, 16, 14531, 16, 805, 67, 7422, 4672, 612, 273, 756, 18, 588, 1499, 2668, 350, 6134, 225, 417, 10955, 273, 5378, 225, 364, 1151, 2159, 316, 756, 18, 3624, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 79, 10955, 12, 2159, 16, 14531, 16, 805, 67, 7422, 4672, 612, 273, 756, 18, 588, 1499, 2668, 350, 6134, 225, 417, 10955, 273, 5378, 225, 364, 1151, 2159, 316, 756, 18, 3624, ...
Should be either install (i) or uninstall (u)",
Should be either install (i) or uninstall (u) or delete\ (d) to recursively delete the directory specified in dest",
def installExe(self): debug("running installEXE") args = self.src + " " if self.branch == "1.8.0": args += "-ms -hideBanner -dd " + self.dest else: debug("running install exe for 1.8.1") args += "/S /D=" + os.path.normpath(self.dest) # Do we need a shell=True here? proc = subprocess.Popen(args) proc.wait() # TODO: throw stderr
f65adeaed4c4ca2db123fccf9b312cfc203a5bae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/f65adeaed4c4ca2db123fccf9b312cfc203a5bae/mozInstall.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 424, 73, 12, 2890, 4672, 1198, 2932, 8704, 3799, 2294, 41, 7923, 833, 273, 365, 18, 4816, 397, 315, 315, 309, 365, 18, 7500, 422, 315, 21, 18, 28, 18, 20, 6877, 833, 1011, 3701...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3799, 424, 73, 12, 2890, 4672, 1198, 2932, 8704, 3799, 2294, 41, 7923, 833, 273, 365, 18, 4816, 397, 315, 315, 309, 365, 18, 7500, 422, 315, 21, 18, 28, 18, 20, 6877, 833, 1011, 3701...
<input type="text" size="12" id="date_picker2" name="period_of_interest_to" value="%s" style='border: 1px solid
<input type="text" size="12" id="date_picker2" name="period_of_interest_to" value="%s" style='border: 1px solid
def tmpl_register_ill_article_request_step1(self, infos, admin=True, ln=CFG_SITE_LANG): """ @param infos: informations @type infos: list """
648f0875a183c65548d6b2535cea8cf25a2a9827 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/648f0875a183c65548d6b2535cea8cf25a2a9827/bibcirculation_templates.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10720, 67, 4861, 67, 737, 67, 11480, 67, 2293, 67, 4119, 21, 12, 2890, 16, 10626, 16, 3981, 33, 5510, 16, 7211, 33, 19727, 67, 20609, 67, 10571, 4672, 3536, 632, 891, 10626, 30, 26978,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10720, 67, 4861, 67, 737, 67, 11480, 67, 2293, 67, 4119, 21, 12, 2890, 16, 10626, 16, 3981, 33, 5510, 16, 7211, 33, 19727, 67, 20609, 67, 10571, 4672, 3536, 632, 891, 10626, 30, 26978,...
r.accept(card)
r.add(card)
def deal(self):
20ce2dd6aa77ea628b49c0c6b820d66211a9a61d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20ce2dd6aa77ea628b49c0c6b820d66211a9a61d/solitaire.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10490, 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, 10490, 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._check_state(cr, uid,[bug_id],val)
self._check_state(cr, uid,[bug_id],val)
def _find_project_bug(self, cr, uid,section_id,lp_server=None,context={}):
7ee1f15663eb8bfca25ecb85124286fb683d82e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/7ee1f15663eb8bfca25ecb85124286fb683d82e7/crm_lp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 4406, 67, 925, 12, 2890, 16, 4422, 16, 4555, 16, 3464, 67, 350, 16, 9953, 67, 3567, 33, 7036, 16, 2472, 12938, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 4406, 67, 925, 12, 2890, 16, 4422, 16, 4555, 16, 3464, 67, 350, 16, 9953, 67, 3567, 33, 7036, 16, 2472, 12938, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
opts['modules'] = [(hasattr(m, '__file__') and m.__file__, m.__name__) for m in self._modules] opts['modules'].sort(lambda e1, e2: cmp(e1[1], e2[1]))
def _save(self, *e): if self._filename is None: return self._saveas() try: opts = self._getopts() opts['modules'] = [(hasattr(m, '__file__') and m.__file__, m.__name__) for m in self._modules] opts['modules'].sort(lambda e1, e2: cmp(e1[1], e2[1])) dump(opts, open(self._filename, 'w')) except Exception, e: if DEBUG: print e self._top.bell()
19275515c1011eb2ed1be810d73cf19c849a3b63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/19275515c1011eb2ed1be810d73cf19c849a3b63/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5688, 12, 2890, 16, 380, 73, 4672, 309, 365, 6315, 3459, 353, 599, 30, 327, 365, 6315, 5688, 345, 1435, 775, 30, 1500, 273, 365, 6315, 588, 4952, 1435, 4657, 12, 4952, 16, 1696, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5688, 12, 2890, 16, 380, 73, 4672, 309, 365, 6315, 3459, 353, 599, 30, 327, 365, 6315, 5688, 345, 1435, 775, 30, 1500, 273, 365, 6315, 588, 4952, 1435, 4657, 12, 4952, 16, 1696, ...
elif case == model.W_CompiledMethod:
elif isinstance(casted, model.W_CompiledMethod):
def fillin_w_object(self): # below we are using an RPython idiom to 'cast' self.w_object # and pass the casted reference to the fillin_* methods casted = self.w_object case = casted.__class__ if case == model.W_PointersObject: self.fillin_pointersobject(casted) elif case == model.W_WordsObject: self.fillin_wordsobject(casted) elif case == model.W_BytesObject: self.fillin_bytesobject(casted) elif case == model.W_CompiledMethod: self.fillin_compiledmethod(casted) else: assert 0 assert casted.invariant()
8b66a62cc5e2a9b859f71d6c5ad35bf48017954d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/8b66a62cc5e2a9b859f71d6c5ad35bf48017954d/squeakimage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3636, 267, 67, 91, 67, 1612, 12, 2890, 4672, 468, 5712, 732, 854, 1450, 392, 534, 15774, 612, 14642, 358, 296, 4155, 11, 365, 18, 91, 67, 1612, 468, 471, 1342, 326, 28192, 2114, 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, 3636, 267, 67, 91, 67, 1612, 12, 2890, 4672, 468, 5712, 732, 854, 1450, 392, 534, 15774, 612, 14642, 358, 296, 4155, 11, 365, 18, 91, 67, 1612, 468, 471, 1342, 326, 28192, 2114, 358, ...
self.qOrTwoThetaOrTwoThetaUpperCake.setvalue(val)
self.qOrTwoThetaUpperCake.setvalue(val)
def mouseDragPanCakeImage(self,event): global druged, lastX, lastY
89752f51530ee1c4a0f7a52f23f4d3d965ca2311 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8973/89752f51530ee1c4a0f7a52f23f4d3d965ca2311/AreaDiffractionMachine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7644, 11728, 4069, 31089, 2040, 12, 2890, 16, 2575, 4672, 2552, 5081, 637, 329, 16, 1142, 60, 16, 1142, 61, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7644, 11728, 4069, 31089, 2040, 12, 2890, 16, 2575, 4672, 2552, 5081, 637, 329, 16, 1142, 60, 16, 1142, 61, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey, 0, win32con.KEY_READ )
key = _winreg.OpenKeyEx( _winreg.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey )
def GetTimeZoneNames( ): "Returns the names of the time zones as defined in the registry" key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey, 0, win32con.KEY_READ ) return _RegKeyEnumerator( key )
bd8808a18d9ded3524e77d1c8054398a60ba7dd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/bd8808a18d9ded3524e77d1c8054398a60ba7dd7/win32timezone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 16760, 1557, 12, 262, 30, 315, 1356, 326, 1257, 434, 326, 813, 13975, 487, 2553, 316, 326, 4023, 6, 498, 273, 389, 8082, 1574, 18, 3678, 653, 424, 12, 389, 8082, 1574, 18, 44, 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, 968, 16760, 1557, 12, 262, 30, 315, 1356, 326, 1257, 434, 326, 813, 13975, 487, 2553, 316, 326, 4023, 6, 498, 273, 389, 8082, 1574, 18, 3678, 653, 424, 12, 389, 8082, 1574, 18, 44, 3...
self.file_browser.connect("cursor-changed", self.dir_selected)
signal = self.file_browser.connect("cursor-changed", self.dir_selected)
def __init__(self, rootdir=None, startdir=None):
d62a7927a0638d64f84dd5b362e2b9c626d75499 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/735/d62a7927a0638d64f84dd5b362e2b9c626d75499/pyrenamer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1365, 1214, 33, 7036, 16, 787, 1214, 33, 7036, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1365, 1214, 33, 7036, 16, 787, 1214, 33, 7036, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
srcaddr_loc = regalloc.force_allocate_reg(srcaddr_box, forbidden_vars, selected_reg=r.r1)
srcaddr_loc = regalloc.force_allocate_reg(srcaddr_box, selected_reg=r.r1)
def _emit_copystrcontent(self, op, regalloc, fcond, is_unicode): # compute the source address args = list(op.getarglist()) base_loc, box = self._ensure_value_is_boxed(args[0], regalloc, args) args.append(box) ofs_loc, box = self._ensure_value_is_boxed(args[2], regalloc, args) args.append(box) assert args[0] is not args[1] # forbidden case of aliasing regalloc.possibly_free_var(args[0]) if args[3] is not args[2] is not args[4]: # MESS MESS MESS: don't free regalloc.possibly_free_var(args[2]) # it if ==args[3] or args[4] srcaddr_box = TempBox() forbidden_vars = [args[1], args[3], args[4], srcaddr_box] srcaddr_loc = regalloc.force_allocate_reg(srcaddr_box, forbidden_vars, selected_reg=r.r1) self._gen_address_inside_string(base_loc, ofs_loc, srcaddr_loc, is_unicode=is_unicode)
a93295df84e80acf0d6bdfc6e3a46283e0aa2547 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/a93295df84e80acf0d6bdfc6e3a46283e0aa2547/opassembler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 18356, 67, 3530, 701, 1745, 12, 2890, 16, 1061, 16, 960, 9853, 16, 284, 10013, 16, 353, 67, 9124, 4672, 468, 3671, 326, 1084, 1758, 833, 273, 666, 12, 556, 18, 588, 3175, 1098, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 18356, 67, 3530, 701, 1745, 12, 2890, 16, 1061, 16, 960, 9853, 16, 284, 10013, 16, 353, 67, 9124, 4672, 468, 3671, 326, 1084, 1758, 833, 273, 666, 12, 556, 18, 588, 3175, 1098, ...
leave_ids = []
def holidays_confirm(self, cr, uid, ids, *args): obj_hr_holiday_status = self.pool.get('hr.holidays.status') obj_emp = self.pool.get('hr.employee') wf_service = netsvc.LocalService("workflow") for record in self.browse(cr, uid, ids): user_id = False leave_asked = record.number_of_days_temp leave_ids = [] if record.holiday_type == 'employee' and record.type == 'remove': if record.employee_id and not record.holiday_status_id.limit: leaves_rest = obj_hr_holiday_status.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves'] if leaves_rest < leave_asked: raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s while there are too few remaining leave days.') % (record.employee_id.name)) nb = -(record.number_of_days_temp) elif record.holiday_type == 'category' and record.type == 'remove': if record.category_id and not record.holiday_status_id.limit: leaves_rest = obj_hr_holiday_status.get_days_cat( cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves'] if leaves_rest < leave_asked: raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for category %s while there are too few remaining leave days.') % (record.category_id.name)) nb = -(record.number_of_days_temp) # Create leave request for employees in the category emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)]) for emp in obj_emp.browse(cr, uid, emp_ids): vals = { 'name': record.name, 'holiday_status_id': record.holiday_status_id.id, 'date_from': record.date_from, 'date_to': record.date_to, 'notes': record.notes, 'number_of_days_temp': record.number_of_days_temp, 'category_holiday_id': record.id, 'employee_id': emp.id } leave_ids.append(self.create(cr, uid, vals, context=None)) # Confirm all the leave requests of the category for leave_id in leave_ids: wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr) else: nb = record.number_of_days_temp
d6451e011dbfc79f10dbf349593fa319c26ec083 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d6451e011dbfc79f10dbf349593fa319c26ec083/hr_holidays.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 28990, 67, 10927, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 1081, 67, 7256, 67, 76, 17559, 67, 2327, 273, 365, 18, 6011, 18, 588, 2668, 7256, 18, 76, 22999, 18, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 28990, 67, 10927, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 1081, 67, 7256, 67, 76, 17559, 67, 2327, 273, 365, 18, 6011, 18, 588, 2668, 7256, 18, 76, 22999, 18, 23...
if self.editCommand.hasValidStructure(): self.updateListWidgets()
def model_changed(self): """ When the editCommand is treated as a 'command' by the commandSequencer. this method will override basicCommand.model_changed. @WARNING: Ideally this property manager should implement both model_changed and selection_changed methods in the mode/command API. model_changed method will be used here when the selected atom is dragged, transmuted etc. The selection_changed method will be used when the selection (picking/ unpicking) changes. At present, selection_changed and model_changed methods are called too frequently that it doesn't matter which one you use. Its better to use only a single method for preformance reasons (at the moment). This should change when the original methods in the API are revised to be called at appropiraite time. """ newSelectionParams = self._currentSelectionParams() if same_vals(newSelectionParams, self.previousSelectionParams): return #Update the strand and segmment list widgets. #Ideally it should only update when the structure is modified #example --when structure is deleted. But as of 2008-02-21 #this feature is not easily available in the API method. #see Command class for some proposed methods such as 'something_changed' #etc. The list widgets are updated even when selection changes. if self.editCommand.hasValidStructure(): self.updateListWidgets() self.previousSelectionParams = newSelectionParams selectedStrands, selectedSegments = newSelectionParams self.strandListWidget.updateSelection(selectedStrands) self.segmentListWidget.updateSelection(selectedSegments) if len(selectedStrands) == 1: self.editStrandPropertiesButton.setEnabled(True) if self.sequenceEditor: self.sequenceEditor.update_state(bool_enable = True) if self.sequenceEditor and self.sequenceEditor.isVisible(): self._updateSequence(selectedStrands[0]) else: self.editStrandPropertiesButton.setEnabled(False) if self.sequenceEditor: self.sequenceEditor.update_state(bool_enable = False) if len(selectedSegments) == 1: self.editSegmentPropertiesButton.setEnabled(True) else: self.editSegmentPropertiesButton.setEnabled(False)
8056d7238d97857e50602a80bdbe11d566c23c63 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/8056d7238d97857e50602a80bdbe11d566c23c63/BuildDna_PropertyManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 938, 67, 6703, 12, 2890, 4672, 3536, 5203, 326, 3874, 2189, 353, 13974, 487, 279, 296, 3076, 11, 635, 326, 1296, 1761, 372, 23568, 18, 333, 707, 903, 3849, 5337, 2189, 18, 2284, 67, 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, 938, 67, 6703, 12, 2890, 4672, 3536, 5203, 326, 3874, 2189, 353, 13974, 487, 279, 296, 3076, 11, 635, 326, 1296, 1761, 372, 23568, 18, 333, 707, 903, 3849, 5337, 2189, 18, 2284, 67, 67...
if scanner.next()!=IHREAL:
if scanner.next()!="IHREAL":
def eta(): "Use computer to get estimated time of arrival for a warp jump." w1 = coord(); w2 = coord() prompt = False if damaged(DCOMPTR): prout(_("COMPUTER DAMAGED, USE A POCKET CALCULATOR.")) skip(1) return if scanner.next() != IHREAL: prompt = True scanner.chew() proutn(_("Destination quadrant and/or sector? ")) if scanner.next()!=IHREAL: huh() return w1.j = int(scanner.real-0.5) if scanner.next() != IHREAL: huh() return w1.i = int(scanner.real-0.5) if scanner.next() == IHREAL: w2.j = int(scanner.real-0.5) if scanner.next() != IHREAL: huh() return w2.i = int(scanner.real-0.5) else: if game.quadrant.j>w1.i: w2.i = 0 else: w2.i=QUADSIZE-1 if game.quadrant.i>w1.j: w2.j = 0 else: w2.j=QUADSIZE-1 if not VALID_QUADRANT(w1.i, w1.j) or not VALID_SECTOR(w2.i, w2.j): huh() return game.dist = math.sqrt((w1.j-game.quadrant.j+0.1*(w2.j-game.sector.j))**2+ (w1.i-game.quadrant.i+0.1*(w2.i-game.sector.i))**2) wfl = False if prompt: prout(_("Answer \"no\" if you don't know the value:")) while True: scanner.chew() proutn(_("Time or arrival date? ")) if scanner.next()==IHREAL: ttime = scanner.real if ttime > game.state.date: ttime -= game.state.date # Actually a star date twarp=(math.floor(math.sqrt((10.0*game.dist)/ttime)*10.0)+1.0)/10.0 if ttime <= 1e-10 or twarp > 10: prout(_("We'll never make it, sir.")) scanner.chew() return if twarp < 1.0: twarp = 1.0 break scanner.chew() proutn(_("Warp factor? ")) if scanner.next()== IHREAL: wfl = True twarp = scanner.real if twarp<1.0 or twarp > 10.0: huh() return break prout(_("Captain, certainly you can give me one of these.")) while True: scanner.chew() ttime = (10.0*game.dist)/twarp**2 tpower = game.dist*twarp*twarp*twarp*(game.shldup+1) if tpower >= game.energy: prout(_("Insufficient energy, sir.")) if not game.shldup or tpower > game.energy*2.0: if not wfl: return proutn(_("New warp factor to try? ")) if scanner.next() == IHREAL: wfl = True twarp = scanner.real if twarp<1.0 or twarp > 10.0: huh() return continue else: scanner.chew() skip(1) return prout(_("But if you lower your shields,")) proutn(_("remaining")) tpower /= 2 else: proutn(_("Remaining")) prout(_(" energy will be %.2f.") % (game.energy-tpower)) if wfl: prout(_("And we will arrive at stardate %.2f.") % (game.state.date+ttime)) elif twarp==1.0: prout(_("Any warp speed is adequate.")) else: prout(_("Minimum warp needed is %.2f,") % (twarp)) prout(_("and we will arrive at stardate %.2f.") % (game.state.date+ttime)) if game.state.remtime < ttime: prout(_("Unfortunately, the Federation will be destroyed by then.")) if twarp > 6.0: prout(_("You'll be taking risks at that speed, Captain")) if (game.isatb==1 and game.state.kscmdr == w1 and \ scheduled(FSCDBAS)< ttime+game.state.date) or \ (scheduled(FCDBAS)<ttime+game.state.date and game.battle == w1): prout(_("The starbase there will be destroyed by then.")) proutn(_("New warp factor to try? ")) if scanner.next() == IHREAL: wfl = True twarp = scanner.real if twarp<1.0 or twarp > 10.0: huh() return else: scanner.chew() skip(1) return
af15867a294e48006eba4fd9997cae401ccbfb05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/af15867a294e48006eba4fd9997cae401ccbfb05/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14251, 13332, 315, 3727, 26579, 358, 336, 13137, 813, 434, 2454, 5162, 364, 279, 341, 11441, 11833, 1199, 341, 21, 273, 2745, 5621, 341, 22, 273, 2745, 1435, 6866, 273, 1083, 309, 302, 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, 14251, 13332, 315, 3727, 26579, 358, 336, 13137, 813, 434, 2454, 5162, 364, 279, 341, 11441, 11833, 1199, 341, 21, 273, 2745, 5621, 341, 22, 273, 2745, 1435, 6866, 273, 1083, 309, 302, 3...
value[0].__delslice__(0,index) value[1].__delslice__(0,index) map_so.y.__delslice__(0,index) map_so.var_y.__delslice__(0,index) hlr_utils.result_insert(result,res_descr,value,map_so,"x",axis)
value[0].__delslice__(0, index) value[1].__delslice__(0, index) map_so.y.__delslice__(0, index) map_so.var_y.__delslice__(0, index) else: pass hlr_utils.result_insert(result, res_descr, value, map_so, "x", axis)
def tof_to_initial_wavelength_igs(obj,**kwargs): """ This function converts a primary axis of a SOM or SO from time-of-flight to initial_wavelength_igs. The time-of-flight axis for a SOM must be in units of microseconds. The primary axis of a SO is assumed to be in units of microseconds. A tuple of [tof, tof_err2] (assumed to be in units of microseconds) can be converted to [initial_wavelength_igs, initial_wavelength_igs_err2]. Parameters: ---------- -> obj is the SOM, SO or tuple to be converted -> kwargs is a list of key word arguments that the function accepts: lambda_f= a tuple containing the final wavelength and its associated error^2 time_zero= a tuple containing the time zero offset and its associated error^2 dist_source_sample= a tuple or list of tuples containing the source to sample distance information and its associated error^2 dist_sample_detector= a tuple or list of tuples containing the sample to detector distance information and its associated error^2 run_filter=<True or False> This determines if the filter on the negative wavelengths is run units= a string containing the expected units for this function. The default for this function is microseconds Return: ------ <- A SOM or SO with a primary axis in time-of-flight or a tuple converted to initial_wavelength_igs Exceptions: ---------- <- TypeError is raised if the incoming object is not a type the function recognizes <- RuntimeError is raised if the SOM x-axis units are not microseconds """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) # Setup keyword arguments try: lambda_f = kwargs["lambda_f"] except KeyError: lambda_f = None try: time_zero = kwargs["time_zero"] except KeyError: time_zero = None try: dist_source_sample = kwargs["dist_source_sample"] except KeyError: dist_source_sample = None try: dist_sample_detector = kwargs["dist_sample_detector"] except KeyError: dist_sample_detector = None try: units = kwargs["units"] except KeyError: units = "microseconds" try: run_filter = kwargs["run_filter"] except KeyError: run_filter = True # Primary axis for transformation. If a SO is passed, the function, will # assume the axis for transformation is at the 0 position if o_descr == "SOM": axis = hlr_utils.hlr_1D_units(obj, units) else: axis = 0 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "Angstroms", axis) result.setAxisLabel(axis, "wavelength") result.setYUnits("Counts/A") result.setYLabel("Intensity") else: pass # Where to get instrument information if dist_source_sample == None or dist_sample_detector == None: if o_descr == "SOM": try: obj.attr_list.instrument.get_primary() inst = obj.attr_list.instrument except RuntimeError: raise RuntimeError, "A detector was not provided!" else: if dist_source_sample == None and dist_sample_detector == None: raise RuntimeError, "If a SOM is not passed, the "\ +"source-sample and sample-detector distances must be "\ +"provided." elif dist_source_sample == None: raise RuntimeError, "If a SOM is not passed, the "\ +"source-sample distance must be provided." elif dist_sample_detector == None: raise RuntimeError, "If a SOM is not passed, the "\ +"sample-detector distance must be provided." else: raise RuntimeError, "If you get here, see Steve Miller for "\ +"your mug." else: pass if lambda_f != None: (l_descr,e_descr) = hlr_utils.get_descr(lambda_f) else: if o_descr == "SOM": try: som_l_f = obj.attr_list["Wavelength_final"] except KeyError: raise RuntimeError, "Please provide a final wavelength "\ +"parameter either via the function call or the SOM" else: raise RuntimeError, "You need to provide a final wavelength" if time_zero != None: (t_descr,e_descr) = hlr_utils.get_descr(time_zero) else: if o_descr == "SOM": try: obj.attr_list["Time_zero"] t_0 = obj.attr_list["Time_zero"][0] t_0_err2 = obj.attr_list["Time_zero"][1] except KeyError: raise RuntimeError, "Please provide a time-zero "\ +"parameter either via the function call or the SOM" else: t_0 = 0.0 t_0_err2 = 0.0 if dist_source_sample != None: (ls_descr,e_descr) = hlr_utils.get_descr(dist_source_sample) # Do nothing, go on else: pass if dist_sample_detector != None: (ld_descr,e_descr) = hlr_utils.get_descr(dist_sample_detector) # Do nothing, go on else: pass if o_descr == "SOM" and run_filter: length = len(obj[0]) filter = True elif o_descr == "SO" and run_filter: length = len(obj) filter = True else: filter = False # iterate through the values import axis_manip for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis) map_so = hlr_utils.get_map_so(obj,None,i) if dist_source_sample == None: (L_s,L_s_err2) = hlr_utils.get_parameter("primary",map_so,inst) else: L_s = hlr_utils.get_value(dist_source_sample,i,ls_descr) L_s_err2 = hlr_utils.get_err2(dist_source_sample,i,ls_descr) if dist_sample_detector == None: (L_d,L_d_err2) = hlr_utils.get_parameter("secondary",map_so,inst) else: L_d = hlr_utils.get_value(dist_sample_detector,i,ld_descr) L_d_err2 = hlr_utils.get_err2(dist_sample_detector,i,ld_descr) if lambda_f != None: l_f = hlr_utils.get_value(lambda_f,i,t_descr) l_f_err2 = hlr_utils.get_err2(lambda_f,i,t_descr) else: l_f_tuple = hlr_utils.get_special(som_l_f, map_so) l_f = l_f_tuple[0] l_f_err2 = l_f_tuple[1] if time_zero != None: t_0 = hlr_utils.get_value(time_zero,i,t_descr) t_0_err2 = hlr_utils.get_err2(time_zero,i,t_descr) else: pass value=axis_manip.tof_to_initial_wavelength_igs(val, err2, l_f, l_f_err2, t_0, t_0_err2, L_s, L_s_err2, L_d, L_d_err2) # Remove all wavelengths < 0 if filter: index = 0 for val in value[0]: if val > 0: break index += 1 value[0].__delslice__(0,index) value[1].__delslice__(0,index) map_so.y.__delslice__(0,index) map_so.var_y.__delslice__(0,index) hlr_utils.result_insert(result,res_descr,value,map_so,"x",axis) return result
f2732e272bffc96d577287672dd8a0fe10605815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/f2732e272bffc96d577287672dd8a0fe10605815/hlr_tof_to_initial_wavelength_igs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 74, 67, 869, 67, 6769, 67, 91, 16775, 67, 360, 87, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 813, 17, 792, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 358, 74, 67, 869, 67, 6769, 67, 91, 16775, 67, 360, 87, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 813, 17, 792, 17, ...
USING (taskrow,linenum) WHERE taskrow=%d LIMIT 1;""" cur = self.cursor() cur.execute(cmd % taskrow) rows = cur.fetchall() if len(rows) < 1: return None mycommand = rows[0] cmd = """delete from readyList where rowid=%d;""" cur.execute(cmd % mycommand[0]) cmd = "update fileState set state=2 where concretename='%s';" cur.execute(cmd % mycommand[1]) return (mycommand[2],mycommand[1])
USING (taskrow,linenum) WHERE taskrow=%d;""" rows = None for i in range(3): try: self.close() con = self.connection() oldLevel = con.isolation_level con.isolation_level = "EXCLUSIVE" cur = con.cursor() cur.execute(cmd % taskrow) rows = cur.fetchall() result = None break except: import time time.sleep(0.2) continue if not rows: return None if len(rows) > 0: mycommand = rows[0] result = (mycommand[3],mycommand[2]) cmd = """delete from readyList where taskrow=%d AND linenum=%d;""" cur.execute(cmd % (mycommand[0],mycommand[1])) cmd = "update fileState set state=2 where concretename='%s';" cur.execute(cmd % mycommand[2]) cur.close() cur = None con.commit() con.isolation_level = oldLevel self.close() return result
def fetchAndLockNextCmd(self,taskrow): # fetch a cmd from ready list cmd = """SELECT readyList.rowid,concretename,cmdLine FROM readyList JOIN cmds USING (taskrow,linenum) WHERE taskrow=%d LIMIT 1;""" cur = self.cursor() cur.execute(cmd % taskrow) rows = cur.fetchall() if len(rows) < 1: return None mycommand = rows[0] # drop the cmd from the list cmd = """delete from readyList where rowid=%d;""" cur.execute(cmd % mycommand[0]) # update the filestate to running # hope filename doesn't have any quotes! cmd = "update fileState set state=2 where concretename='%s';" cur.execute(cmd % mycommand[1]) # return cmdline and output concretename return (mycommand[2],mycommand[1])
b677b64eec7484b77e6f6ecf3811f34cf5581e8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5203/b677b64eec7484b77e6f6ecf3811f34cf5581e8c/ssdap_dbutil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 1876, 2531, 2134, 5931, 12, 2890, 16, 4146, 492, 4672, 468, 2158, 279, 1797, 628, 5695, 666, 1797, 273, 3536, 4803, 5695, 682, 18, 492, 350, 16, 11504, 1349, 1069, 16, 4172, 1670, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2158, 1876, 2531, 2134, 5931, 12, 2890, 16, 4146, 492, 4672, 468, 2158, 279, 1797, 628, 5695, 666, 1797, 273, 3536, 4803, 5695, 682, 18, 492, 350, 16, 11504, 1349, 1069, 16, 4172, 1670, ...
message = wiki_to_oneliner(message, self.env, db, shorten=True)
if self.timeline_long_messages: message = wiki_to_html(message, self.env, req, db, absurls=True) else: message = wiki_to_oneliner(message, self.env, db, shorten=True)
def get_timeline_events(self, req, start, stop, filters): if 'changeset' in filters: format = req.args.get('format') wiki_format = self.wiki_format_messages show_files = self.timeline_show_files db = self.env.get_db_cnx() repos = self.env.get_repository(req.authname) for chgset in repos.get_changesets(start, stop): message = chgset.message or '--' if wiki_format: shortlog = wiki_to_oneliner(message, self.env, db, shorten=True) else: shortlog = util.shorten_line(message)
8a8334eaf89b3d633caa97b1b71554e15aa6a9eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8a8334eaf89b3d633caa97b1b71554e15aa6a9eb/changeset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 26237, 67, 5989, 12, 2890, 16, 1111, 16, 787, 16, 2132, 16, 3415, 4672, 309, 296, 6329, 278, 11, 316, 3415, 30, 740, 273, 1111, 18, 1968, 18, 588, 2668, 2139, 6134, 9050, 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, 336, 67, 26237, 67, 5989, 12, 2890, 16, 1111, 16, 787, 16, 2132, 16, 3415, 4672, 309, 296, 6329, 278, 11, 316, 3415, 30, 740, 273, 1111, 18, 1968, 18, 588, 2668, 2139, 6134, 9050, 67...
elif action == 'updateRepos':
elif action == 'updateRepos' or action == 'Find and Update Backup Locations':
def index(self, **parms): if parms: action = parms['form'] if action == 'setPassword': return self._changePassword(parms['current'], parms['new'], parms['confirm']) elif action == 'updateRepos': return self._updateRepos() elif action == 'setNotifications': return self._setNotifications(parms) elif action == 'setRestoreType': return self._setRestoreType(parms['restoreType']) elif action == 'setAllowRepoDeletion': return self._setAllowRepoDeletion('allowDeletion' in parms) else: return self._getPrefsPage(errorMessage='Invalid setting.') return self._getPrefsPage('', '')
d664afbdac4f69b6153419dd18e72be2347516db /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2223/d664afbdac4f69b6153419dd18e72be2347516db/page_prefs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 12, 2890, 16, 2826, 29927, 4672, 309, 17902, 30, 1301, 273, 17902, 3292, 687, 3546, 309, 1301, 422, 296, 542, 3913, 4278, 327, 365, 6315, 3427, 3913, 12, 29927, 3292, 2972, 17337, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 770, 12, 2890, 16, 2826, 29927, 4672, 309, 17902, 30, 1301, 273, 17902, 3292, 687, 3546, 309, 1301, 422, 296, 542, 3913, 4278, 327, 365, 6315, 3427, 3913, 12, 29927, 3292, 2972, 17337, 1...
num_lines = len(str.splitlines())
lines = str.splitlines() num_lines = len(lines) str = "\n".join(lines)
def format_str_for_message(str): """ Format str so that it can be appended to a message. If str consists of one line, prefix it with a space. If str consists of multiple lines, prefix it with a newline. @param str: string that will be formatted. """ num_lines = len(str.splitlines()) if num_lines == 0: return "" elif num_lines == 1: return " " + str else: return "\n" + str
d2c25b6b2a1031ee0341bf6c45405b98405a7e20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/d2c25b6b2a1031ee0341bf6c45405b98405a7e20/kvm_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 701, 67, 1884, 67, 2150, 12, 701, 4672, 3536, 4077, 609, 1427, 716, 518, 848, 506, 12317, 358, 279, 883, 18, 971, 609, 20915, 434, 1245, 980, 16, 1633, 518, 598, 279, 3476, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 701, 67, 1884, 67, 2150, 12, 701, 4672, 3536, 4077, 609, 1427, 716, 518, 848, 506, 12317, 358, 279, 883, 18, 971, 609, 20915, 434, 1245, 980, 16, 1633, 518, 598, 279, 3476, ...
tag = Tag.objects.get( name__exact = tag_name )
tag = Tag.objects.get( group = group, name__exact = tag_name )
def show_tag_posts(request, group, tag_name): categories = get_board_categories(group) if not categories: return render_to_response( 'sphene/sphblog/nocategory.html',{}, context_instance = RequestContext(request) ) tag = Tag.objects.get( name__exact = tag_name ) threads = get_posts_queryset(group, categories) threads = tag_get_models_by_tag( threads, tag ) select, sql, params = threads._get_sql_clause() return render_to_response( 'sphene/sphblog/blogindex.html', { 'threads': threads, 'tag': tag, }, context_instance = RequestContext(request) )
492263bb2f2143bbf5498fc87a4b1a6fe1ac68d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11563/492263bb2f2143bbf5498fc87a4b1a6fe1ac68d4/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 67, 2692, 67, 11660, 12, 2293, 16, 1041, 16, 1047, 67, 529, 4672, 6477, 273, 336, 67, 3752, 67, 8995, 12, 1655, 13, 225, 309, 486, 6477, 30, 327, 1743, 67, 869, 67, 2740, 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, 2405, 67, 2692, 67, 11660, 12, 2293, 16, 1041, 16, 1047, 67, 529, 4672, 6477, 273, 336, 67, 3752, 67, 8995, 12, 1655, 13, 225, 309, 486, 6477, 30, 327, 1743, 67, 869, 67, 2740, 12, ...
except: self._debug('Unable to save synclog: %s' % traceback.format_exc())
except Exception, e: self._debug('Unable to save synclog -- caught an exception.') tsumufs.syslogCurrentException()
def run(self): try: while not tsumufs.unmounted.isSet(): self._debug('TsumuFS not unmounted yet.')
f99cbb1ccc72fd3d09fee4ad8a399f224b3c5739 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5149/f99cbb1ccc72fd3d09fee4ad8a399f224b3c5739/syncthread.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 775, 30, 1323, 486, 268, 1364, 696, 87, 18, 318, 4778, 329, 18, 291, 694, 13332, 365, 6315, 4148, 2668, 56, 1364, 89, 4931, 486, 25670, 329, 4671, 1093, 13, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 775, 30, 1323, 486, 268, 1364, 696, 87, 18, 318, 4778, 329, 18, 291, 694, 13332, 365, 6315, 4148, 2668, 56, 1364, 89, 4931, 486, 25670, 329, 4671, 1093, 13, 2, ...
if (i.getURL() == url):
if i.getURL() == url:
def checkURLExists(url): manualFeed = getManualFeed() for i in manualFeed.items: if (i.getURL() == url): title = _("Download already exists") text1 = _("That URL is already an external download.") downloadState = None if i.downloader is not None: downloadState = i.downloader.getState() if downloadState in ('paused', 'stopped'): i.download() text2 = _("Miro will begin downloading it now.") elif downloadState == 'downloading': text2 = _("It is downloading now.") else: text2 = _("It has already been downloaded.") dialogs.MessageBoxDialog(title, "%s %s" % (text1, text2)).run() return True existingFeed = feed.getFeedByURL(url) if existingFeed is not None: existingFeed.blink() return True return False
bb58bbfb15bd170b111017694726c7dfd08bc774 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/bb58bbfb15bd170b111017694726c7dfd08bc774/singleclick.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1785, 4002, 12, 718, 4672, 11297, 8141, 273, 23619, 1462, 8141, 1435, 364, 277, 316, 11297, 8141, 18, 3319, 30, 309, 277, 18, 588, 1785, 1435, 422, 880, 30, 2077, 273, 389, 2932, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1785, 4002, 12, 718, 4672, 11297, 8141, 273, 23619, 1462, 8141, 1435, 364, 277, 316, 11297, 8141, 18, 3319, 30, 309, 277, 18, 588, 1785, 1435, 422, 880, 30, 2077, 273, 389, 2932, ...
self.inst = Instance(self.ex, self.inst_name, self.environ)
self.inst = Instance(self.ex, self.inst_name, environ=self.environ)
def setUp(self): self.environ = {'env0':'abc', 'env1':'123'} self.ex = Executable("testinstanceEnviron", mediatype="text/x-python") self.ex.writeimage(io.StringIO(self.source)) self.inst_name = Instance.createname() self.inst_dir = os.path.join(self.ex.dirpath, self.inst_name) self.inst = Instance(self.ex, self.inst_name, self.environ)
4bc3190c1b39445e378c9199e5a731d336d6fa74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4814/4bc3190c1b39445e378c9199e5a731d336d6fa74/InstanceTestCase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 28684, 273, 13666, 3074, 20, 11, 2497, 18947, 2187, 296, 3074, 21, 11, 2497, 12936, 11, 97, 365, 18, 338, 273, 18342, 2932, 3813, 1336, 28248, 3113, 25381...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 18, 28684, 273, 13666, 3074, 20, 11, 2497, 18947, 2187, 296, 3074, 21, 11, 2497, 12936, 11, 97, 365, 18, 338, 273, 18342, 2932, 3813, 1336, 28248, 3113, 25381...
if L2>LSMALL:
if L2 > LSMALL:
def calc_TLS_center_of_reaction(T0, L0, S0, origin): """Calculate new tensors based on the center for reaction. This method returns a dictionary of the calculations: T^: T tensor in the coordinate system of L L^: L tensor in the coordinate system of L S^: S tensor in the coordinate system of L COR: Center of Reaction T',S',L': T,L,S tensors in original coordinate system with the origin shifted to the center of reaction. """ ## LSMALL is the smallest magnitude of L before it is considered 0.0 LSMALL = 0.5 * Constants.DEG2RAD2 rdict = {} rdict["T'"] = T0.copy() rdict["L'"] = L0.copy() rdict["S'"] = S0.copy() rdict["rT'"] = T0.copy() rdict["L1_eigen_val"] = 0.0 rdict["L2_eigen_val"] = 0.0 rdict["L3_eigen_val"] = 0.0 rdict["L1_rmsd"] = 0.0 rdict["L2_rmsd"] = 0.0 rdict["L3_rmsd"] = 0.0 rdict["L1_eigen_vec"] = numpy.zeros(3, float) rdict["L2_eigen_vec"] = numpy.zeros(3, float) rdict["L3_eigen_vec"] = numpy.zeros(3, float) rdict["RHO"] = numpy.zeros(3, float) rdict["COR"] = origin rdict["L1_rho"] = numpy.zeros(3, float) rdict["L2_rho"] = numpy.zeros(3, float) rdict["L3_rho"] = numpy.zeros(3, float) rdict["L1_pitch"] = 0.0 rdict["L2_pitch"] = 0.0 rdict["L3_pitch"] = 0.0 rdict["Tr1_eigen_val"] = 0.0 rdict["Tr2_eigen_val"] = 0.0 rdict["Tr3_eigen_val"] = 0.0 rdict["Tr1_rmsd"] = 0.0 rdict["Tr2_rmsd"] = 0.0 rdict["Tr3_rmsd"] = 0.0 ## set the L tensor eigenvalues and eigenvectors (L_evals, RL) = linalg.eigenvectors(L0) L1, L2, L3 = L_evals good_L_eigens = [] if numpy.allclose(L1, 0.0) or isinstance(L1, complex): L1 = 0.0 else: good_L_eigens.append(0) if numpy.allclose(L2, 0.0) or isinstance(L2, complex): L2 = 0.0 else: good_L_eigens.append(1) if numpy.allclose(L3, 0.0) or isinstance(L3, complex): L3 = 0.0 else: good_L_eigens.append(2) ## no good L eigen values if len(good_L_eigens)==0: return rdict ## one good eigen value -- reconstruct RL about it elif len(good_L_eigens)==1: i = good_L_eigens[0] evec = RL[i] RZt = numpy.transpose(AtomMath.rmatrixz(evec)) xevec = numpy.dot(RZt, numpy.array([1.0, 0.0, 0.0], float)) yevec = numpy.dot(RZt, numpy.array([0.0, 1.0, 0.0], float)) if i==0: RL[1] = xevec RL[2] = yevec elif i==1: RL[0] = xevec RL[2] = yevec elif i==2: RL[0] = xevec RL[1] = yevec ## two good eigen values -- reconstruct RL about them elif len(good_L_eigens)==2: i = good_L_eigens[0] j = good_L_eigens[1] xevec = AtomMath.normalize(numpy.cross(RL[i], RL[j])) for k in range(3): if k==i: continue if k==j: continue RL[k] = xevec break rdict["L1_eigen_val"] = L1 rdict["L2_eigen_val"] = L2 rdict["L3_eigen_val"] = L3 rdict["L1_rmsd"] = calc_rmsd(L1) rdict["L2_rmsd"] = calc_rmsd(L2) rdict["L3_rmsd"] = calc_rmsd(L3) rdict["L1_eigen_vec"] = RL[0].copy() rdict["L2_eigen_vec"] = RL[1].copy() rdict["L3_eigen_vec"] = RL[2].copy() ## begin tensor transformations which depend upon ## the eigenvectors of L0 being well-determined ## make sure RLt is right-handed if numpy.allclose(linalg.determinant(RL), -1.0): I = numpy.identity(3, float) I[0,0] = -1.0 RL = numpy.dot(I, RL) if not numpy.allclose(linalg.determinant(RL), 1.0): return rdict RLt = numpy.transpose(RL) ## carrot-L tensor (tensor WRT principal axes of L) cL = numpy.dot(numpy.dot(RL, L0), RLt) rdict["L^"] = cL.copy() ## carrot-T tensor (T tensor WRT principal axes of L) cT = numpy.dot(numpy.dot(RL, T0), RLt) rdict["T^"] = cT.copy() ## carrot-S tensor (S tensor WRT principal axes of L) cS = numpy.dot(numpy.dot(RL, S0), RLt) rdict["S^"] = cS.copy() ## ^rho: the origin-shift vector in the coordinate system of L L23 = L2 + L3 L13 = L1 + L3 L12 = L1 + L2 ## shift for L1 if not numpy.allclose(L1, 0.0) and abs(L23)>LSMALL: crho1 = (cS[1,2] - cS[2,1]) / L23 else: crho1 = 0.0 if not numpy.allclose(L2, 0.0) and abs(L13)>LSMALL: crho2 = (cS[2,0] - cS[0,2]) / L13 else: crho2 = 0.0 if not numpy.allclose(L3, 0.0) and abs(L12)>LSMALL: crho3 = (cS[0,1] - cS[1,0]) / L12 else: crho3 = 0.0 crho = numpy.array([crho1, crho2, crho3], float) rdict["RHO^"] = crho.copy() ## rho: the origin-shift vector in orthogonal coordinates rho = numpy.dot(RLt, crho) rdict["RHO"] = rho rdict["COR"] = origin + rho ## set up the origin shift matrix PRHO WRT orthogonal axes PRHO = numpy.array([ [ 0.0, rho[2], -rho[1]], [-rho[2], 0.0, rho[0]], [ rho[1], -rho[0], 0.0] ], float) ## set up the origin shift matrix cPRHO WRT libration axes cPRHO = numpy.array([ [ 0.0, crho[2], -crho[1]], [-crho[2], 0.0, crho[0]], [ crho[1], -crho[0], 0.0] ], float) ## calculate tranpose of cPRHO, ans cS cSt = numpy.transpose(cS) cPRHOt = numpy.transpose(cPRHO) rdict["L'^"] = cL.copy() ## calculate S'^ = S^ + L^*pRHOt cSp = cS + numpy.dot(cL, cPRHOt) rdict["S'^"] = cSp.copy() ## calculate T'^ = cT + cPRHO*S^ + cSt*cPRHOt + cPRHO*cL*cPRHOt * cTp = cT + numpy.dot(cPRHO, cS) + numpy.dot(cSt, cPRHOt) +\ numpy.dot(numpy.dot(cPRHO, cL), cPRHOt) rdict["T'^"] = cTp.copy() ## transpose of PRHO and S PRHOt = numpy.transpose(PRHO) St = numpy.transpose(S0) ## calculate S' = S + L*PRHOt Sp = S0 + numpy.dot(L0, PRHOt) rdict["S'"] = Sp ## calculate T' = T + PRHO*S + St*PRHOT + PRHO*L*PRHOt Tp = T0 + numpy.dot(PRHO, S0) + numpy.dot(St, PRHOt) +\ numpy.dot(numpy.dot(PRHO, L0), PRHOt) rdict["T'"] = Tp ## now calculate the TLS motion description using 3 non ## intersecting screw axes, with one ## libration axis 1 shift in the L coordinate system if abs(L1)>LSMALL: cL1rho = numpy.array([0.0, -cSp[0,2]/L1, cSp[0,1]/L1], float) else: cL1rho = numpy.zeros(3, float) ## libration axis 2 shift in the L coordinate system if abs(L2)>LSMALL: cL2rho = numpy.array([cSp[1,2]/L2, 0.0, -cSp[1,0]/L2], float) else: cL2rho = numpy.zeros(3, float) ## libration axis 2 shift in the L coordinate system if abs(L3)>LSMALL: cL3rho = numpy.array([-cSp[2,1]/L3, cSp[2,0]/L3, 0.0], float) else: cL3rho = numpy.zeros(3, float) ## libration axes shifts in the origional orthogonal ## coordinate system rdict["L1_rho"] = numpy.dot(RLt, cL1rho) rdict["L2_rho"] = numpy.dot(RLt, cL2rho) rdict["L3_rho"] = numpy.dot(RLt, cL3rho) ## calculate screw pitches (A*R / R*R) = (A/R) if abs(L1)>LSMALL: rdict["L1_pitch"] = cS[0,0]/L1 else: rdict["L1_pitch"] = 0.0 if L2>LSMALL: rdict["L2_pitch"] = cS[1,1]/L2 else: rdict["L2_pitch"] = 0.0 if L3>LSMALL: rdict["L3_pitch"] = cS[2,2]/L3 else: rdict["L3_pitch"] = 0.0 ## now calculate the reduction in T for the screw rotation axes cTred = cT.copy() for i in (0, 1, 2): for k in (0, 1, 2): if i==k: continue if abs(cL[k,k])>LSMALL: cTred[i,i] -= (cS[k,i]**2) / cL[k,k] for i in (0, 1, 2): for j in (0, 1, 2): for k in (0, 1, 2): if j==i: continue if abs(cL[k,k])>LSMALL: cTred[i,j] -= (cS[k,i]*cS[k,j]) / cL[k,k] ## rotate the newly calculated reduced-T tensor from the carrot ## coordinate system (coordinate system of L) back to the structure ## coordinate system Tr = numpy.dot(numpy.dot(RLt, cTred), RL) rdict["rT'"] = Tr Tr1, Tr2, Tr3 = linalg.eigenvalues(Tr) if numpy.allclose(Tr1, 0.0) or isinstance(Tr1, complex): Tr1 = 0.0 if numpy.allclose(Tr2, 0.0) or isinstance(Tr2, complex): Tr2 = 0.0 if numpy.allclose(Tr3, 0.0) or isinstance(Tr3, complex): Tr3 = 0.0 rdict["Tr1_eigen_val"] = Tr1 rdict["Tr2_eigen_val"] = Tr2 rdict["Tr3_eigen_val"] = Tr3 rdict["Tr1_rmsd"] = calc_rmsd(Tr1) rdict["Tr2_rmsd"] = calc_rmsd(Tr2) rdict["Tr3_rmsd"] = calc_rmsd(Tr3) return rdict
4293dee160eba41d42fb83ab7a7352ba89fb81ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10674/4293dee160eba41d42fb83ab7a7352ba89fb81ad/TLS.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 9905, 67, 5693, 67, 792, 67, 266, 1128, 12, 56, 20, 16, 511, 20, 16, 348, 20, 16, 4026, 4672, 3536, 8695, 394, 25122, 2511, 603, 326, 4617, 364, 12836, 18, 1220, 707, 1135,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 9905, 67, 5693, 67, 792, 67, 266, 1128, 12, 56, 20, 16, 511, 20, 16, 348, 20, 16, 4026, 4672, 3536, 8695, 394, 25122, 2511, 603, 326, 4617, 364, 12836, 18, 1220, 707, 1135,...
library_dirs=dblib_dir,
library_dirs=[dblib_dir],
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
efe1af981d1467c0c0fc2401e44c0aaca3af93a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/efe1af981d1467c0c0fc2401e44c0aaca3af93a0/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 19, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 19, ...
m = pcs.Field("m", 4)
m = pcs.Field("m", 1)
def __init__(self, bytes = None, timestamp = None, **kv): v = pcs.Field("v", 2) # version p = pcs.Field("p", 1) # padded x = pcs.Field("x", 1) # extended cc = pcs.Field("cc", 4) # csrc count m = pcs.Field("m", 4) # m-bit pt = pcs.Field("pt", 7, discriminator=True) # payload type seq = pcs.Field("seq", 16) # sequence ssrc = pcs.Field("ssrc", 32) # source opt = pcs.OptionListField("opt") # optional fields
1d821daa6c6d98948f586c7fd16cbd406fc8e354 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5910/1d821daa6c6d98948f586c7fd16cbd406fc8e354/rtp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1731, 273, 599, 16, 2858, 273, 599, 16, 2826, 18152, 4672, 331, 273, 31353, 18, 974, 2932, 90, 3113, 576, 13, 202, 202, 7, 1177, 293, 273, 31353, 18, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1731, 273, 599, 16, 2858, 273, 599, 16, 2826, 18152, 4672, 331, 273, 31353, 18, 974, 2932, 90, 3113, 576, 13, 202, 202, 7, 1177, 293, 273, 31353, 18, 9...
if os.path.exists('sync_password'): fs = open('sync_password', 'r')
password_file_path = os.path.join( os.path.dirname(__file__),'sync_password') if os.path.exists(password_file_path): fs = open(password_file_path, 'r')
def main_win(options, args): """Main Function for win32 platform which drives the test here. Using the target build configuration, run the executable given in the first non-option argument, passing any following arguments to that executable. Args: options: Option parameters. args: Test arguments. Returns: Result: Zero for success/ Non-zero for failure. """ final_result = 0 test_exe = 'sync_integration_tests.exe' build_dir = os.path.abspath(options.build_dir) test_exe_path = os.path.join(build_dir, options.target, test_exe) if not os.path.exists(test_exe_path): raise PathNotFound('Unable to find %s' % test_exe_path) test_list = ListSyncTests(test_exe_path) for test_name in test_list: result = RunOneTest( test_exe_path, test_name, options.sync_test_username, options.sync_test_password) # If any single test fails then final result should be failure if result != 0: final_result = result return final_result
ecff7ec3bc3a8297030e9cd865d4413d72c0eb83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/ecff7ec3bc3a8297030e9cd865d4413d72c0eb83/sync_integration_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 67, 8082, 12, 2116, 16, 833, 4672, 3536, 6376, 4284, 364, 5657, 1578, 4072, 1492, 5081, 3606, 326, 1842, 2674, 18, 225, 11637, 326, 1018, 1361, 1664, 16, 1086, 326, 9070, 864, 316,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 67, 8082, 12, 2116, 16, 833, 4672, 3536, 6376, 4284, 364, 5657, 1578, 4072, 1492, 5081, 3606, 326, 1842, 2674, 18, 225, 11637, 326, 1018, 1361, 1664, 16, 1086, 326, 9070, 864, 316,...
ansi.stdout( "{cursor.col.0}{clear.line.all}Current time:" " {style.bold}{file.elapsedTime: >7.2f}{style.none} / {file.duration: <7.2f}", file=self.sampleGen, suppressNewline=True )
if self.debug: ansi.stdout( "{cursor.col.0}{clear.line.all}Current time:" " {style.bold}{file.elapsedTime: >7.2f}{style.none} / {file.duration: <7.2f}", file=self.sampleGen, suppressNewline=True )
def queueNextSound(self, event=None): ansi.stdout( "{cursor.col.0}{clear.line.all}Current time:" " {style.bold}{file.elapsedTime: >7.2f}{style.none} / {file.duration: <7.2f}", file=self.sampleGen, suppressNewline=True )
b70986e594fffb8b6e1c534a0cd5403d3eb2e48b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10082/b70986e594fffb8b6e1c534a0cd5403d3eb2e48b/alsa_output.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2389, 2134, 24331, 12, 2890, 16, 871, 33, 7036, 4672, 21809, 18, 10283, 12, 4144, 9216, 18, 1293, 18, 20, 8637, 8507, 18, 1369, 18, 454, 97, 3935, 813, 2773, 315, 288, 4060, 18, 16390,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2389, 2134, 24331, 12, 2890, 16, 871, 33, 7036, 4672, 21809, 18, 10283, 12, 4144, 9216, 18, 1293, 18, 20, 8637, 8507, 18, 1369, 18, 454, 97, 3935, 813, 2773, 315, 288, 4060, 18, 16390,...
submsgobj = self.parsestr(part) msgobj.attach(submsgobj)
def _parsebody(self, container, fp): # Parse the body, but first split the payload on the content-type # boundary if present. boundary = container.get_boundary() isdigest = (container.get_content_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately. Otherwise, just parse the rest of # the body as a single message. Note: any exceptions raised in the # recursive parse need to have their line numbers coerced. if boundary: preamble = epilogue = None # Split into subparts. The first boundary we're looking for won't # always have a leading newline since we're at the start of the # body text, and there's not always a preamble before the first # boundary. separator = '--' + boundary payload = fp.read() # We use an RE here because boundaries can have trailing # whitespace. mo = re.search( r'(?P<sep>' + re.escape(separator) + r')(?P<ws>[ \t]*)', payload) if not mo: if self._strict: raise Errors.BoundaryError( "Couldn't find starting boundary: %s" % boundary) container.set_payload(payload) return start = mo.start() if start > 0: # there's some pre-MIME boundary preamble preamble = payload[0:start] # Find out what kind of line endings we're using start += len(mo.group('sep')) + len(mo.group('ws')) mo = nlcre.search(payload, start) if mo: start += len(mo.group(0)) # We create a compiled regexp first because we need to be able to # specify the start position, and the module function doesn't # support this signature. :( cre = re.compile('(?P<sep>\r\n|\r|\n)' + re.escape(separator) + '--') mo = cre.search(payload, start) if mo: terminator = mo.start() linesep = mo.group('sep') if mo.end() < len(payload): # There's some post-MIME boundary epilogue epilogue = payload[mo.end():] elif self._strict: raise Errors.BoundaryError( "Couldn't find terminating boundary: %s" % boundary) else: # Handle the case of no trailing boundary. Check that it ends # in a blank line. Some cases (spamspamspam) don't even have # that! mo = re.search('(?P<sep>\r\n|\r|\n){2}$', payload) if not mo: mo = re.search('(?P<sep>\r\n|\r|\n)$', payload) if not mo: raise Errors.BoundaryError( 'No terminating boundary and no trailing empty line') linesep = mo.group('sep') terminator = len(payload) # We split the textual payload on the boundary separator, which # includes the trailing newline. If the container is a # multipart/digest then the subparts are by default message/rfc822 # instead of text/plain. In that case, they'll have a optional # block of MIME headers, then an empty line followed by the # message headers. parts = re.split( linesep + re.escape(separator) + r'[ \t]*' + linesep, payload[start:terminator]) for part in parts: if isdigest: if part.startswith(linesep): # There's no header block so create an empty message # object as the container, and lop off the newline so # we can parse the sub-subobject msgobj = self._class() part = part[len(linesep):] else: parthdrs, part = part.split(linesep+linesep, 1) # msgobj in this case is the "message/rfc822" container msgobj = self.parsestr(parthdrs, headersonly=1) # while submsgobj is the message itself submsgobj = self.parsestr(part) msgobj.attach(submsgobj) msgobj.set_default_type('message/rfc822') else: msgobj = self.parsestr(part) container.preamble = preamble container.epilogue = epilogue container.attach(msgobj) elif container.get_main_type() == 'multipart': # Very bad. A message is a multipart with no boundary! raise Errors.BoundaryError( 'multipart message with no defined boundary') elif container.get_type() == 'message/delivery-status': # This special kind of type contains blocks of headers separated # by a blank line. We'll represent each header block as a # separate Message object blocks = [] while True: blockmsg = self._class() self._parseheaders(blockmsg, fp) if not len(blockmsg): # No more header blocks left break blocks.append(blockmsg) container.set_payload(blocks) elif container.get_main_type() == 'message': # Create a container for the payload, but watch out for there not # being any headers left try: msg = self.parse(fp) except Errors.HeaderParseError: msg = self._class() self._parsebody(msg, fp) container.attach(msg) else: container.set_payload(fp.read())
83bbd5c0ebc9f0bce67700e6ecf1f3a3ff4b2efc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/83bbd5c0ebc9f0bce67700e6ecf1f3a3ff4b2efc/Parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 3432, 12, 2890, 16, 1478, 16, 4253, 4672, 468, 2884, 326, 1417, 16, 1496, 1122, 1416, 326, 2385, 603, 326, 913, 17, 723, 468, 7679, 309, 3430, 18, 7679, 273, 1478, 18, 588, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3432, 12, 2890, 16, 1478, 16, 4253, 4672, 468, 2884, 326, 1417, 16, 1496, 1122, 1416, 326, 2385, 603, 326, 913, 17, 723, 468, 7679, 309, 3430, 18, 7679, 273, 1478, 18, 588, ...
lock(get_lock.lock_dir, timeout = 60, verbosity = 10)
lock(get_lock.lock_dir, timeout = 60, verbosity = 1)
def get_lock(): """ Obtain lock on compilation directory. """ if not hasattr(get_lock, 'n_lock'): # Initialization. get_lock.n_lock = 0 get_lock.lock_dir = os.path.join(compiledir.get_compiledir(), 'lock_dir') if not hasattr(get_lock, 'lock_is_enabled'): # Currently lock is disabled by default, due to the annoying # persistence of lock files when compilation is being interrupted. get_lock.lock_is_enabled = False # Only really try to acquire the lock if we do not have it already. if get_lock.lock_is_enabled and get_lock.n_lock == 0: lock(get_lock.lock_dir, timeout = 60, verbosity = 10) get_lock.n_lock += 1
2be4d824287329a2fa216c5b1c5463b33950738c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/2be4d824287329a2fa216c5b1c5463b33950738c/compilelock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 739, 13332, 3536, 24850, 2176, 603, 8916, 1867, 18, 3536, 309, 486, 3859, 12, 588, 67, 739, 16, 296, 82, 67, 739, 11, 4672, 468, 26586, 18, 336, 67, 739, 18, 82, 67, 739, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 739, 13332, 3536, 24850, 2176, 603, 8916, 1867, 18, 3536, 309, 486, 3859, 12, 588, 67, 739, 16, 296, 82, 67, 739, 11, 4672, 468, 26586, 18, 336, 67, 739, 18, 82, 67, 739, ...
if (self.c.control_type == OpenIPMI.CONTROL_IDENTIFIER): control.identifier_set_val(self.ival) else: control.set_val(self.ival)
rv = control.set_light(self.ival) if (rv != 0): raise ValueError("set_light failed: " + str(rv))
def control_cb(self, control): if (self.c.control_type == OpenIPMI.CONTROL_IDENTIFIER): control.identifier_set_val(self.ival) else: control.set_val(self.ival)
e4a495f473299f3234d1d57514918996b249814d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3867/e4a495f473299f3234d1d57514918996b249814d/_control.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3325, 67, 7358, 12, 2890, 16, 3325, 4672, 5633, 273, 3325, 18, 542, 67, 5099, 12, 2890, 18, 5162, 13, 309, 261, 4962, 480, 374, 4672, 1002, 2068, 2932, 542, 67, 5099, 2535, 30, 315, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3325, 67, 7358, 12, 2890, 16, 3325, 4672, 5633, 273, 3325, 18, 542, 67, 5099, 12, 2890, 18, 5162, 13, 309, 261, 4962, 480, 374, 4672, 1002, 2068, 2932, 542, 67, 5099, 2535, 30, 315, ...
self.init_html(source)
self.initHtml(source) def __repr__ (self): return "<Tiddler '" + self.title + "'>"
def __init__ (self, source, type = 'twee'): "constructor; pass source code, and optionally 'twee' or 'html'" if type == 'twee': self.init_twee(source) else: self.init_html(source)
6c1969959d8e0961fa5075dac2f76e60b7f2c5fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11433/6c1969959d8e0961fa5075dac2f76e60b7f2c5fe/tiddlywiki.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 1084, 16, 618, 273, 296, 11246, 1340, 11, 4672, 315, 12316, 31, 1342, 1084, 981, 16, 471, 8771, 296, 11246, 1340, 11, 578, 296, 2620, 4970, 309, 618, 42...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 261, 2890, 16, 1084, 16, 618, 273, 296, 11246, 1340, 11, 4672, 315, 12316, 31, 1342, 1084, 981, 16, 471, 8771, 296, 11246, 1340, 11, 578, 296, 2620, 4970, 309, 618, 42...
raise NotImplementedError, "gcd is not implemented for non-commutative factorizations"
raise NotImplementedError, "lcm is not implemented for non-commutative factorizations"
def lcm(self, other): r""" Return the lcm of two factorizations.
37fd1555e7cb453ca4ff1e80b1e085a829159f45 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/37fd1555e7cb453ca4ff1e80b1e085a829159f45/factorization.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 7670, 12, 2890, 16, 1308, 4672, 436, 8395, 2000, 326, 328, 7670, 434, 2795, 5578, 7089, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 7670, 12, 2890, 16, 1308, 4672, 436, 8395, 2000, 326, 328, 7670, 434, 2795, 5578, 7089, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if crypt(password, user.password) == user.password:
if crypt(password, user.password) == user.password and user.is_active:
def authenticate(self, username = None, password = None): """ Authenticate against the database using OpenBSD's blowfish crypt function. """ try: user = User.objects.get(username = username) if crypt(password, user.password) == user.password: return user else: return None except User.DoesNotExist: return None except ValueError: return None
744cf67be0ddd37a119af27be500bb67abe8f9c2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11345/744cf67be0ddd37a119af27be500bb67abe8f9c2/auth.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8929, 12, 2890, 16, 2718, 273, 599, 16, 2201, 273, 599, 4672, 3536, 26644, 5314, 326, 2063, 1450, 3502, 30780, 1807, 324, 821, 22905, 13231, 445, 18, 3536, 775, 30, 729, 273, 2177, 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, 8929, 12, 2890, 16, 2718, 273, 599, 16, 2201, 273, 599, 4672, 3536, 26644, 5314, 326, 2063, 1450, 3502, 30780, 1807, 324, 821, 22905, 13231, 445, 18, 3536, 775, 30, 729, 273, 2177, 18, ...
response = xmlrpclib.dumps(response, methodresponse=1)
response = xmlrpclib.dumps(response, methodresponse=1, allow_none = self.allow_none)
def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data.
abc39365bd1065be5983597fe24f8dddbe98dbc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/abc39365bd1065be5983597fe24f8dddbe98dbc6/SimpleXMLRPCServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3108, 329, 67, 10739, 12, 2890, 16, 501, 16, 3435, 67, 2039, 273, 599, 4672, 3536, 5325, 281, 392, 3167, 17, 8087, 707, 628, 10893, 1259, 261, 4201, 13, 501, 18, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3108, 329, 67, 10739, 12, 2890, 16, 501, 16, 3435, 67, 2039, 273, 599, 4672, 3536, 5325, 281, 392, 3167, 17, 8087, 707, 628, 10893, 1259, 261, 4201, 13, 501, 18, 2, -100, -100, ...
InspectableObjectCollectionView.deleteCtrl(self, name)
InspectableObjectView.deleteCtrl(self, name)
def deleteCtrl(self, name, parentRef = None): """ Delete a control, update selection and parent tree """ ctrlInfo = self.objects[name] if ctrlInfo[1] == self: wxMessageBox("Can't delete frame") return parRel = None # build relationship, this will only happen for the first call if not parentRef: # select parent so long, pretty soon won't be able to ask who # the parent is parentName = ctrlInfo[1].GetParent().GetName() if parentName == self.GetName(): parentName = ''
3095cf591b9bab682ecbcda45a59ab4acee24fb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/3095cf591b9bab682ecbcda45a59ab4acee24fb6/Designer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 12418, 12, 2890, 16, 508, 16, 982, 1957, 273, 599, 4672, 3536, 2504, 279, 3325, 16, 1089, 4421, 471, 982, 2151, 3536, 6414, 966, 273, 365, 18, 6911, 63, 529, 65, 309, 6414, 966, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1430, 12418, 12, 2890, 16, 508, 16, 982, 1957, 273, 599, 4672, 3536, 2504, 279, 3325, 16, 1089, 4421, 471, 982, 2151, 3536, 6414, 966, 273, 365, 18, 6911, 63, 529, 65, 309, 6414, 966, ...
def connect(self, callee_uri, credentials, route, audio=False, chat=False):
def connect(self, *args, **kwargs):
def connect(self, callee_uri, credentials, route, audio=False, chat=False): event_names = ['SCSessionDidStart', 'SCSessionDidFail', 'SCSessionDidEnd'] with self.linked_notifications(event_names) as q: self._obj.connect(callee_uri, credentials, route, audio=audio, chat=chat) while True: notification = q.wait() if notification.name == 'SCSessionDidStart': break else: self._raise_if_error(notification) # XXX I would expect Session instance not to fire SCSessionDidStart until all the transports started # XXX otherwise I have to go into session and manually wait for different types of events # XXX the same goes for terminating - wait for MSRPChatDidEnd before firing SCSessionDidEnd self._wait_for_chat_to_start()
3be9bca2e7907752122a6322a0799ced0170bf3b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/3be9bca2e7907752122a6322a0799ced0170bf3b/session.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 871, 67, 1973, 273, 10228, 2312, 2157, 18250, 1685, 2187, 296, 2312, 2157, 18250, 3754, 2187, 296, 2312, 2157, 18250, 1638, 3546, 598, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 871, 67, 1973, 273, 10228, 2312, 2157, 18250, 1685, 2187, 296, 2312, 2157, 18250, 3754, 2187, 296, 2312, 2157, 18250, 1638, 3546, 598, ...
def close (self):
def close(self):
def close (self): self.del_channel() self.socket.close()
f7eb0d3f501f2e379b8719bda476d318d1e79160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f7eb0d3f501f2e379b8719bda476d318d1e79160/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 365, 18, 3771, 67, 4327, 1435, 365, 18, 7814, 18, 4412, 1435, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 365, 18, 3771, 67, 4327, 1435, 365, 18, 7814, 18, 4412, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
self.cls.addstmts([ onentered, onexited, onstack, Whitespace.NL ])
self.cls.addstmts([ onentered, onexited, onenteredcall, onexitedcall, onstack, Whitespace.NL ])
def makeHandlerMethod(name, switch, hasReply, dispatches=0): params = [ Decl(Type('Message', const=1, ref=1), msgvar.name) ] if hasReply: params.append(Decl(Type('Message', ref=1, ptr=1), replyvar.name)) method = MethodDefn(MethodDecl(name, virtual=True, params=params, ret=_Result.Type())) if dispatches: routevar = ExprVar('__route') routedecl = StmtDecl( Decl(_actorIdType(), routevar.name), init=ExprCall(ExprSelect(msgvar, '.', 'routing_id')))
0631ae25faf40038af212ec1baea5f0bb2812679 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/0631ae25faf40038af212ec1baea5f0bb2812679/lower.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 1503, 1305, 12, 529, 16, 1620, 16, 711, 7817, 16, 3435, 281, 33, 20, 4672, 859, 273, 306, 16110, 12, 559, 2668, 1079, 2187, 1866, 33, 21, 16, 1278, 33, 21, 3631, 1234, 1401, 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, 1221, 1503, 1305, 12, 529, 16, 1620, 16, 711, 7817, 16, 3435, 281, 33, 20, 4672, 859, 273, 306, 16110, 12, 559, 2668, 1079, 2187, 1866, 33, 21, 16, 1278, 33, 21, 3631, 1234, 1401, 18...
eventString = IrDecoder.Decode(data, len(data))
eventString = self.irDecode(data, len(data))
def OnReceive(self, serialThread): self.buffer += serialThread.Read(1024) while True: terminatorPos = self.buffer.find("\xff") if terminatorPos < 0: break data = [ord(char) for char in self.buffer[2:terminatorPos]] self.buffer = self.buffer[terminatorPos+1:] if len(data) < 2: continue eventString = IrDecoder.Decode(data, len(data)) if eventString: self.TriggerEvent(eventString)
8803520caf159e34ba511c3f34442010efcf03b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/8803520caf159e34ba511c3f34442010efcf03b9/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 11323, 12, 2890, 16, 2734, 3830, 4672, 365, 18, 4106, 1011, 2734, 3830, 18, 1994, 12, 2163, 3247, 13, 1323, 1053, 30, 24965, 1616, 273, 365, 18, 4106, 18, 4720, 31458, 5297, 7923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2755, 11323, 12, 2890, 16, 2734, 3830, 4672, 365, 18, 4106, 1011, 2734, 3830, 18, 1994, 12, 2163, 3247, 13, 1323, 1053, 30, 24965, 1616, 273, 365, 18, 4106, 18, 4720, 31458, 5297, 7923, ...
if size > 1024*1024: print_debug("%s: the file is too big: %d bytes" % (fullpath, size)) return None try: return open(fullpath, 'rU') except IOError, err: print_debug("%s: access denied: %s" % (fullpath, err)) return None def has_python_ext(fullpath): return fullpath.endswith(".py") or fullpath.endswith(".pyw") def looks_like_python(fullpath): infile = _open(fullpath) if infile is None:
line1 = infile.readline() line2 = infile.readline() if get_declaration(line1) or get_declaration(line2): infile.close()
def _open(fullpath): try: size = os.stat(fullpath).st_size except OSError, err: # Permission denied - ignore the file print_debug("%s: permission denied: %s" % (fullpath, err)) return None if size > 1024*1024: # too big print_debug("%s: the file is too big: %d bytes" % (fullpath, size)) return None try: return open(fullpath, 'rU') except IOError, err: # Access denied, or a special file - ignore it print_debug("%s: access denied: %s" % (fullpath, err)) return None
568973181aa523bbcf7f827b3a2eb2affd96ea67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/568973181aa523bbcf7f827b3a2eb2affd96ea67/findnocoding.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3190, 12, 2854, 803, 4672, 775, 30, 963, 273, 1140, 18, 5642, 12, 2854, 803, 2934, 334, 67, 1467, 1335, 10002, 16, 393, 30, 468, 8509, 15338, 300, 2305, 326, 585, 1172, 67, 4148, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3190, 12, 2854, 803, 4672, 775, 30, 963, 273, 1140, 18, 5642, 12, 2854, 803, 2934, 334, 67, 1467, 1335, 10002, 16, 393, 30, 468, 8509, 15338, 300, 2305, 326, 585, 1172, 67, 4148, ...
wikipedia.output(u'%s may have an unwanted username, what shall i do?' % username.titleWithoutNamespace())
wikipedia.output(u'%s may have an unwanted username, what shall I do?' % usertalkpage.titleWithoutNamespace())
def main(settingsBot): # Taking the messages inside the function namespace. global netext, summary, logbook, summary2, report_page, project_inserted global comment, bad_pag, report_text, random_sign, whitelist_pg, final_new_text_additions """ 0 1 2 3 4 5 6 7 8 9 10 11 Returned tuple: (None, ask, filename, fileOption, fileSignName, filter_wp, limit, log_variable, number, numberlog, offset_variable, random, (mainSettings()) 12 13 14 15 recursive, savedata, sign, time_variable) """ # Loading the option of the mainSettings() ask = settingsBot[1] filename = settingsBot[2] fileOption = settingsBot[3] fileSignName = settingsBot[4] filter_wp = settingsBot[5] limit = settingsBot[6] log_variable = settingsBot[7] number = settingsBot[8] numberlog = settingsBot[9] offset_variable = settingsBot[10] random = settingsBot[11] recursive = settingsBot[12] savedata = settingsBot[13] sign = settingsBot[14] time_variable = settingsBot[15] # The site wsite = wikipedia.getSite() # The follow lines translate the language's parameters. welcomer = wikipedia.translate(wsite, netext) summ = wikipedia.translate(wsite, summary) logg = wikipedia.translate(wsite, logbook) summ2 = wikipedia.translate(wsite, summary2) rep_page = wikipedia.translate(wsite, report_page) com = wikipedia.translate(wsite, comment) bad_page = wikipedia.translate(wsite, bad_pag) rep_text = wikipedia.translate(wsite, report_text) signPageTitle = wikipedia.translate(wsite, random_sign) wtlpg = wikipedia.translate(wsite, whitelist_pg) final_additions = wikipedia.translate(wsite, final_new_text_additions) usernam = wsite.namespace(2) contrib = string.capitalize(wsite.mediawiki_message('contribslink')) # The talk_page's variable gives "Talk page". talk_page = wsite.namespace(3) talk = '%s:' % urlname(talk_page, wsite) # Some project of the same language, have different settings. (this is the place to add them). if wsite.family.name == "wikinews" and wsite.lang == "it": welcomer = u'{{subst:benvenuto|%s}}' sign = 'Tooby' elif wsite.family.name == "wiktionary" and wsite.lang == "it": welcomer = u'{{subst:Utente:Filnik/Benve|nome={{subst:PAGENAME}}}} %s' elif wsite.family.name == "wikiversity" and wsite.lang == "it": welcomer = u'{{subst:Benvenuto}} %s' welcomed_users = list() if savedata == True and os.path.exists( wikipedia.config.datafilepath(filename)): f = file(filename) number_user = cPickle.load(f) yield number_user else: number_user = 0 yield number_user # Here there is the main loop. while True: if filter_wp == True: # A standard list of bad username components (you can change/delate it in your project...). # [ I divided the list into three to make it smaller...] elencoaf = [' ano', ' anus', 'anal ', 'babies', 'baldracca', 'balle', 'bastardo', 'bestiali', 'bestiale', 'bastarda', 'b.i.t.c.h.', 'bitch', 'boobie', 'bordello', 'breast', 'cacata', 'cacca', 'cachapera', 'cagata', 'cane', 'cazz', 'cazzo', 'cazzata', 'chiavare', 'chiavata', 'chick', 'christ ', 'cristo', 'clitoride', 'coione', 'cojdioonear', 'cojones', 'cojo', 'coglione', 'coglioni', 'cornuto', 'cula', 'culatone', 'culattone', 'culo', 'deficiente', 'deficente', 'dio', 'die ', 'died ', 'ditalino', 'ejackulate', 'enculer', 'eroticunt', 'fanculo', 'fellatio', 'fica ', 'ficken', 'figa', 'sfiga', 'fottere', 'fotter', 'fottuto', 'fuck', 'f.u.c.k.', "funkyass"] elencogz = ['gay', 'hentai.com', 'horne', 'horney', 'virgin', 'hotties', 'idiot', '@alice.it', 'incest', 'jesus', 'gesu', 'gesù', 'kazzo', 'kill', 'leccaculo', 'lesbian', 'lesbica', 'lesbo', 'masturbazione', 'masturbare', 'masturbo', 'merda', 'merdata', 'merdoso', 'mignotta', 'minchia', 'minkia', 'minchione', 'mona', 'nudo', 'nuda', 'nudi', 'oral', 'sex', 'orgasmso', 'porc', 'pompa', 'pompino', 'porno', 'puttana', 'puzza', 'puzzone', "racchia", 'sborone', 'sborrone', 'sborata', 'sborolata', 'sboro', 'scopata', 'scopare', 'scroto', 'scrotum', 'sega', 'sesso', 'shit', 'shiz', 's.h.i.t.', 'sadomaso', 'sodomist', 'stronzata', 'stronzo', 'succhiamelo', 'succhiacazzi', 'testicol', 'troia', 'universetoday.net', 'vaffanculo', 'vagina', 'vibrator', "vacca", 'yiddiot', "zoccola"] elenco_others = ['@', ".com", ".sex", ".org", ".uk", ".en", ".it", "admin", "administrator", "amministratore", '@yahoo.com', '@alice.com', "amministratrice", "burocrate", "checkuser", "developer", "http://", "jimbo", "mediawiki", "on wheals", "on wheal", "on wheel", "planante", "razinger", "sysop", "troll", "vandal", " v.f. ", "v. fighter", "vandal f.", "vandal fighter", 'wales jimmy', "wheels", "wales", "www."] badword_page = wikipedia.Page(wsite, bad_page) if badword_page.exists(): wikipedia.output(u'\nLoading the bad words list from %s...' % wsite.hostname() ) text_bad = badword_page.get() list_loaded = load_word_function(wsite,text_bad) else: wikipedia.output(u'\t\t>>>WARNING: The bad word page doesn\'t exist!<<<') list_loaded = list() # Joining the "other things" with the loaded... elencovarie = elenco_others + list_loaded else: elencoaf = list() elencogz = list() elencovarie = list() # Joining the three lists.. elenco = elencoaf + elencogz + elencovarie if filter_wp == True: # That is the default whitelist (it contains few name because it has been improved in the latest days..). whitelist_default = ['emiliano'] if wtlpg != None: whitelist_page = wikipedia.Page(wsite, wtlpg) if whitelist_page.exists(): wikipedia.output(u'\nLoading the whitelist from %s...' % wsite.hostname() ) text_white = whitelist_page.get() list_white = load_word_function(wsite, text_white) else: wikipedia.output(u"\t\t>>>WARNING: The whitelist's page doesn't exist!<<<") list_white = list() else: wikipedia.output(u"\t\t>>>WARNING: The whitelist hasn't been setted!<<<") list_white = list() else: list_white = list() whitelist_default = list() # Join the whitelist words. whitelist = list_white + whitelist_default # List of words that the bot understands when it asks the operator for input. block = ("B", "b", "Blocco", "blocco", "block", "bloc", "Block", "Bloc", 'Report', 'report') say_hi = ("S", "s", "Saluto", "saluto", "Welcome", "welcome", 'w', 'W', 'say hi', 'Say hi', 'Hi', 'hi', 'h', 'hello', 'Hello') # The URL for new users is the same in every project. It should not be changed. URL = "/w/index.php?title=Special:Log&type=newusers&limit=%d&offset=%d" % (limit, offset_variable) log = wsite.getUrl(URL) wikipedia.output(u'Loading latest %s new users from %s...\n' % (limit, wsite.hostname())) # Determine which signature to use if random == True: try: wikipedia.output(u'Loading random signatures...') signList = defineSign(wsite, signPageTitle, fileSignName, fileOption) except wikipedia.NoPage: wikipedia.output(u'The list with signatures is not available... Using default signature...') random = False for found_result in parselog(wsite, log, talk, number): if found_result == None: continue # Compiling the signature to be used. if random == True: if number_user + 1 > len(signList): number_user = 0 yield number_user welcom = welcomer % signList[number_user] + timeselected # If there's something extra to add at the end of the template, add it! if final_additions != '': welcom += final_additions else: welcom = welcomer % sign username = str(found_result[0]) usertalkpage = wikipedia.Page(wsite, talk + username) baduser = False # Check if the username is composed by only numbers. try: int(username) baduser = True except ValueError: # OK, no problem pass # Check if the user has been already blocked. ki = blocked(wsite,username) if ki == True: wikipedia.output(u'%s has been blocked! Skipping...' % username.titleWithoutNamespace()) continue # Understand if the user has a bad-username. for word in elenco: username = str(username).encode(config.console_encoding) if word.lower() in username.lower(): baduser = True if wsite.lang == 'it': final_rep = "%s%s}}" % (rep_text, word) break else: final_rep = rep_text break # Checking in the whitelist... for xy in whitelist: if xy.lower() in username.lower(): username.replace(xy, '') for word in elenco: if word.lower() in username.lower(): baduser = True break else: baduser = False break # He has a badusername, trying to report him... if baduser: while 1: if ask == True: wikipedia.output(u'%s may have an unwanted username, what shall i do?' % username.titleWithoutNamespace()) answer = wikipedia.input(u'[B]lock or [W]elcome?') for w in block: if w in answer: if not usertalkpage.exists(): # Check if the user has been already blocked (second check). ki = blocked(wsite, username) if ki == True: wikipedia.output(u'%s has been blocked! Skipping him...' % username.titleWithoutNamespace()) continue report(wsite, rep_page, username, com, final_rep) break else: wikipedia.output(u'The discussion page of the bad-user already exists...') running = False for w in say_hi: if w in answer: baduser = False break elif ask == False: wikipedia.output(u'%s is possibly an unwanted username. He will be reported.' % username.titleWithoutNamespace()) if not usertalkpage.exists(): report(wsite, rep_page, username, com, final_rep) break else: wikipedia.output(u'The discussion page of the bad-user already exists...') break # He has a good username, welcome! else: if not usertalkpage.exists(): # Tring to put the welcome... try: # make non-minor edit to trigger new talk page message. usertalkpage.put(welcom, summ, minorEdit = False) welcomed_users.append(found_result) if random == True: number_user += 1 yield number_user except wikipedia.EditConflict: wikipedia.output(u'An edit conflict has occured, skipping this user.') continue else: wikipedia.output(u'%s has been already welcomed when i was loading all the users... skipping' % username.titleWithoutNamespace()) continue # That's the log if log_variable == True and logg: if len(welcomed_users) == 1: wikipedia.output(u'One user has been welcomed.') elif len(welcomed_users) == 0: wikipedia.output(u'No users have been welcomed.') else: wikipedia.output(u'%s users have been welcomed.' % str(len(welcomed_users)) ) if len(welcomed_users) < numberlog: continue # Update the welcome log each fifth welcome message. elif len(welcomed_users) >= numberlog: logresult = logmaker(wsite, welcomed_users, logg, summ2, usernam, contrib) welcomed_users = list() if logresult == False: continue # If we haven't to report, do nothing. elif log_variable == False: pass if log_variable == True and logg and len(welcomed_users) != 0: if len(welcomed_users) == 1: wikipedia.output(u'Putting the log of the latest user...') else: wikipedia.output(u'Putting the log of the latest %d users...' % len(welcomed_users)) logresult2 = logmaker(wsite, welcomed_users, logg, summ2, usernam, contrib) welcomed_users = list() if logresult2 == False: continue # If recursive, don't exit, repeat after one hour. if recursive == True: waitstr = unicode(time_variable) if locale.getlocale()[1]: strfstr = unicode(time.strftime(u"%d %b %Y %H:%M:%S (UTC)", time.gmtime()), locale.getlocale()[1]) else: strfstr = unicode(time.strftime(u"%d %b %Y %H:%M:%S (UTC)", time.gmtime())) wikipedia.output(u'Sleeping %s seconds before rerun. %s' % (waitstr, strfstr)) time.sleep(time_variable) # If not recursive, break. elif recursive == False: yield [number_user, 'STOP']
b1ce5ed7cbe7058c76d83a57e2becfaf0286158d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/b1ce5ed7cbe7058c76d83a57e2becfaf0286158d/welcome.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 4272, 6522, 4672, 468, 399, 6159, 326, 2743, 4832, 326, 445, 1981, 18, 2552, 2901, 408, 16, 4916, 16, 613, 3618, 16, 4916, 22, 16, 2605, 67, 2433, 16, 1984, 67, 6387, 329, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 4272, 6522, 4672, 468, 399, 6159, 326, 2743, 4832, 326, 445, 1981, 18, 2552, 2901, 408, 16, 4916, 16, 613, 3618, 16, 4916, 22, 16, 2605, 67, 2433, 16, 1984, 67, 6387, 329, ...
VS.IOmessage (2,"bounty mission",self.mplay,"Once there, you must destroy a %s unit." % (faction))
VS.IOmessage (2,"bounty mission",self.mplay,"Once there, you must destroy a %s unit." % (self.faction))
def __init__ (self,minnumsystemsaway, maxnumsystemsaway, creds, run_away, shipdifficulty, tempfaction): Director.Mission.__init__ () self.newship="" self.mplay="all" self.istarget=0 self.obj=0 self.curiter=0 self.arrived=0 self.faction = tempfaction self.difficulty = shipdifficulty self.runaway=run_away self.cred=creds mysys=VS.getSystemFile() sysfile = VS.getSystemFile() self.you=VS.getPlayer() self.enemy=VS.Unit() self.significant=VS.Unit() self.adjsys=go_to_adjacent_systems (self.you,random.randrange(minnumsystemsaway,maxnumsystemsaway+1)) self.mplay=universe.getMessagePlayer(self.you) if (you): VS.IOmessage (0,"bounty mission",self.mplay,"Good Day, %s. Your mission is as follows:" % (you.getName())) self.adjsys.Print("You should start in the system named %s","Then jump to %s","Finally, jump to %s, your final destination","bounty mission",1) VS.IOmessage (2,"bounty mission",self.mplay,"Once there, you must destroy a %s unit." % (faction)) VS.IOmessage (3,"bounty mission",self.mplay,"You will then %.2f credits as your reward (if you survive)." % (self.cred)) VS.IOmessage (4,"bounty mission",self.mplay,"#00ff00Good luck!") else: print "aboritng bounty constructor..." VS.terminateMission (0)
a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 1154, 2107, 4299, 13098, 1888, 16, 943, 2107, 4299, 13098, 1888, 16, 12534, 16, 1086, 67, 26718, 16, 24316, 5413, 21934, 16, 1906, 507, 349, 4672, 29701, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 261, 2890, 16, 1154, 2107, 4299, 13098, 1888, 16, 943, 2107, 4299, 13098, 1888, 16, 12534, 16, 1086, 67, 26718, 16, 24316, 5413, 21934, 16, 1906, 507, 349, 4672, 29701, ...
engine.set_target_variable(matches, "SEARCH", [target_path] + self.includes_)
get_manager().engine().set_target_variable(matches, "SEARCH", [target_path] + self.includes)
def process(self, target, matches, binding):
537076bf10ed506bccf16486e3ca577242bc2927 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9981/537076bf10ed506bccf16486e3ca577242bc2927/scanner.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 16, 1018, 16, 1885, 16, 5085, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 16, 1018, 16, 1885, 16, 5085, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.regex="^d?whois .+"
self.regex="^(whois\s+.+|\d{1,3}(\.\d{1,3}){1,3})$" self.priority = 4
def __init__(self): self.regex="^d?whois .+"
701d354855127a196fc517b7da922d08e5b77e23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10749/701d354855127a196fc517b7da922d08e5b77e23/whois.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 7584, 1546, 66, 72, 35, 3350, 19606, 263, 9078, 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, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 7584, 1546, 66, 72, 35, 3350, 19606, 263, 9078, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
strangeIds = ['home', 'version', 'icon']
strangeIds = ['home', 'version']
def test_strangeUnallowedIds(self): """ Certain IDs give an error and are unusable
28fee4d083f704b013ef2b2eff6b50737c72cab2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/28fee4d083f704b013ef2b2eff6b50737c72cab2/test_filename.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 701, 726, 984, 8151, 2673, 12, 2890, 4672, 3536, 11921, 530, 7115, 8492, 392, 555, 471, 854, 640, 16665, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 701, 726, 984, 8151, 2673, 12, 2890, 4672, 3536, 11921, 530, 7115, 8492, 392, 555, 471, 854, 640, 16665, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
eq(int(time.mktime(timetup[:9])), 1044470846)
t = int(time.mktime(timetup[:9])) eq(time.localtime(t)[:6], timetup[:6])
def test_parsedate_acceptable_to_time_functions(self): eq = self.assertEqual timetup = Utils.parsedate('5 Feb 2003 13:47:26 -0800') eq(int(time.mktime(timetup)), 1044470846) eq(int(time.strftime('%Y', timetup)), 2003) timetup = Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800') eq(int(time.mktime(timetup[:9])), 1044470846) eq(int(time.strftime('%Y', timetup[:9])), 2003)
15582637857b81aeef3d697719a41917f59a73ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/15582637857b81aeef3d697719a41917f59a73ab/test_email.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2670, 712, 67, 9436, 429, 67, 869, 67, 957, 67, 10722, 12, 2890, 4672, 7555, 273, 365, 18, 11231, 5812, 26668, 416, 273, 6091, 18, 2670, 712, 2668, 25, 5782, 70, 4044, 23, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2670, 712, 67, 9436, 429, 67, 869, 67, 957, 67, 10722, 12, 2890, 4672, 7555, 273, 365, 18, 11231, 5812, 26668, 416, 273, 6091, 18, 2670, 712, 2668, 25, 5782, 70, 4044, 23, ...
self.assert_(self._box.get_string(key2) ==
self.assertEqual(self._box.get_string(key2),
def test_update(self): # Modify multiple messages using update() key0 = self._box.add(self._template % 'original 0') key1 = self._box.add(self._template % 'original 1') key2 = self._box.add(self._template % 'original 2') self._box.update({key0: self._template % 'changed 0', key2: _sample_message}) self.assertEqual(len(self._box), 3) self.assert_(self._box.get_string(key0) == self._template % 'changed 0') self.assert_(self._box.get_string(key1) == self._template % 'original 1') self._check_sample(self._box[key2]) self._box.update([(key2, self._template % 'changed 2'), (key1, self._template % 'changed 1'), (key0, self._template % 'original 0')]) self.assertEqual(len(self._box), 3) self.assert_(self._box.get_string(key0) == self._template % 'original 0') self.assert_(self._box.get_string(key1) == self._template % 'changed 1') self.assert_(self._box.get_string(key2) == self._template % 'changed 2') self.assertRaises(KeyError, lambda: self._box.update({'foo': 'bar', key0: self._template % "changed 0"})) self.assertEqual(len(self._box), 3) self.assert_(self._box.get_string(key0) == self._template % "changed 0") self.assert_(self._box.get_string(key1) == self._template % "changed 1") self.assert_(self._box.get_string(key2) == self._template % "changed 2")
fc9997a71def3361507ae020d7f678e347d8646b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/fc9997a71def3361507ae020d7f678e347d8646b/test_mailbox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2725, 12, 2890, 4672, 468, 9518, 3229, 2743, 1450, 1089, 1435, 498, 20, 273, 365, 6315, 2147, 18, 1289, 12, 2890, 6315, 3202, 738, 296, 8830, 374, 6134, 498, 21, 273, 365, 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, 1842, 67, 2725, 12, 2890, 4672, 468, 9518, 3229, 2743, 1450, 1089, 1435, 498, 20, 273, 365, 6315, 2147, 18, 1289, 12, 2890, 6315, 3202, 738, 296, 8830, 374, 6134, 498, 21, 273, 365, 63...
catalogSize = lfnSizeDict[lfn] storageSize = pfnDict['Size']
catalogSize = int(lfnSizeDict[lfn]) storageSize = int(pfnDict['Size'])
def execute(self):
5108c384c9d094d4c69604626d738f7d2f84943e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/5108c384c9d094d4c69604626d738f7d2f84943e/LFCvsSEAgent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 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, 1836, 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, -...
interface, and if this fails, try one more time to load it. EXAMPLES:
interface. If this fails, try one more time to load it. EXAMPLES::
def load_hap(): """ Load the GAP hap package into the default GAP interpreter interface, and if this fails, try one more time to load it. EXAMPLES: sage: sage.groups.perm_gps.permgroup.load_hap() """ try: gap.eval('LoadPackage("hap")') except: gap.eval('LoadPackage("hap")')
f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a/permgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 76, 438, 13332, 3536, 4444, 326, 611, 2203, 5622, 2181, 1368, 326, 805, 611, 2203, 16048, 1560, 18, 971, 333, 6684, 16, 775, 1245, 1898, 813, 358, 1262, 518, 18, 225, 5675, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 76, 438, 13332, 3536, 4444, 326, 611, 2203, 5622, 2181, 1368, 326, 805, 611, 2203, 16048, 1560, 18, 971, 333, 6684, 16, 775, 1245, 1898, 813, 358, 1262, 518, 18, 225, 5675, 8...
checkDesc(parser, "seq[0]/seq[0]/seq[0]/obj_id[0]", "Object identifier: 1.2.840.113549.1.1.4"), checkValue(parser, "seq[0]/seq[0]/seq[1]/set[0]/seq[0]/print_str[0]/value", u"Root CA"), checkValue(parser, "seq[0]/seq[0]/seq[1]/set[3]/seq[0]/ia5_str[0]/value", u"support@cacert.org"),
checkDesc(parser, "seq[0]/seq[0]/seq[1]/obj_id[0]", "Object identifier: 1.2.840.113549.1.1.4"), checkValue(parser, "seq[0]/seq[0]/seq[2]/set[0]/seq[0]/print_str[0]/value", u"Root CA"), checkValue(parser, "seq[0]/seq[0]/seq[2]/set[3]/seq[0]/ia5_str[0]/value", u"support@cacert.org"),
def checkCACertClass3(parser): return ( checkDisplay(parser, "seq[0]/class", u'universal'), checkDesc(parser, "seq[0]/seq[0]/seq[0]/obj_id[0]", "Object identifier: 1.2.840.113549.1.1.4"), checkValue(parser, "seq[0]/seq[0]/seq[1]/set[0]/seq[0]/print_str[0]/value", u"Root CA"), checkValue(parser, "seq[0]/seq[0]/seq[1]/set[3]/seq[0]/ia5_str[0]/value", u"support@cacert.org"), checkValue(parser, "seq[0]/bit_str[0]/size", 513),
9bd62cfaf5811ee7f88fa231268ad1d0e4f040f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9327/9bd62cfaf5811ee7f88fa231268ad1d0e4f040f5/run_testcase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 26022, 1051, 797, 23, 12, 4288, 4672, 327, 261, 866, 4236, 12, 4288, 16, 315, 5436, 63, 20, 18537, 1106, 3113, 582, 11, 318, 14651, 19899, 866, 4217, 12, 4288, 16, 315, 5436, 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, 866, 26022, 1051, 797, 23, 12, 4288, 4672, 327, 261, 866, 4236, 12, 4288, 16, 315, 5436, 63, 20, 18537, 1106, 3113, 582, 11, 318, 14651, 19899, 866, 4217, 12, 4288, 16, 315, 5436, 63, ...
source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + package.split("=", 1)[1] path = p.getpath_build_log(source_package) if not path: fatal("no build log for `%s' (%s)" % (package, source_package))
def main(): args = sys.argv[1:] if not args: usage() package = args[0] try: p = pool.Pool() except pool.Error, e: fatal(e) source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + package.split("=", 1)[1] path = p.getpath_build_log(source_package) if not path: fatal("no build log for `%s' (%s)" % (package, source_package)) for line in file(path).readlines(): print line,
919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 833, 273, 2589, 18, 19485, 63, 21, 26894, 309, 486, 833, 30, 4084, 1435, 225, 2181, 273, 833, 63, 20, 65, 225, 775, 30, 293, 273, 2845, 18, 2864, 1435, 1335, 2845, 18, 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, 2774, 13332, 833, 273, 2589, 18, 19485, 63, 21, 26894, 309, 486, 833, 30, 4084, 1435, 225, 2181, 273, 833, 63, 20, 65, 225, 775, 30, 293, 273, 2845, 18, 2864, 1435, 1335, 2845, 18, 6...
assert_equals(splitter.messages[index].message, msg) assert_equals(splitter.messages[index].level, level) assert_equals(splitter.messages[index].html, html)
message = list(splitter)[index] assert_equals(message.message, msg) assert_equals(message.level, level) assert_equals(message.html, html)
def _verify_message(self, splitter, msg, level='INFO', html=False, index=0): assert_equals(splitter.messages[index].message, msg) assert_equals(splitter.messages[index].level, level) assert_equals(splitter.messages[index].html, html)
8503ab234b27808e95447011fba0cac88e86f61b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/8503ab234b27808e95447011fba0cac88e86f61b/test_output_splitter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8705, 67, 2150, 12, 2890, 16, 21553, 16, 1234, 16, 1801, 2218, 5923, 2187, 1729, 33, 8381, 16, 770, 33, 20, 4672, 1815, 67, 14963, 12, 4939, 387, 18, 6833, 63, 1615, 8009, 2150, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8705, 67, 2150, 12, 2890, 16, 21553, 16, 1234, 16, 1801, 2218, 5923, 2187, 1729, 33, 8381, 16, 770, 33, 20, 4672, 1815, 67, 14963, 12, 4939, 387, 18, 6833, 63, 1615, 8009, 2150, ...
return _checkStore().newLiteral(str)
return _checkStore().newLiteral(str, dt, lang)
def literal(str): """Create or reuse, in the default store, an interned version of the given literal string and return it for future use""" return _checkStore().newLiteral(str)
509514484dfa5428cf5b82e241a829ceca79b1fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/509514484dfa5428cf5b82e241a829ceca79b1fe/thing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7158, 12, 701, 4672, 3536, 1684, 578, 11827, 16, 316, 326, 805, 1707, 16, 392, 8216, 329, 1177, 434, 326, 864, 7158, 533, 471, 327, 518, 364, 3563, 999, 8395, 327, 389, 1893, 2257, 767...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7158, 12, 701, 4672, 3536, 1684, 578, 11827, 16, 316, 326, 805, 1707, 16, 392, 8216, 329, 1177, 434, 326, 864, 7158, 533, 471, 327, 518, 364, 3563, 999, 8395, 327, 389, 1893, 2257, 767...
print "%s" % render_tabs()
return "%s" % render_tabs()
def GET(self): print "%s" % render_tabs()
c93704d739b2b268f2a8b5208fd0622f65fa7997 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4845/c93704d739b2b268f2a8b5208fd0622f65fa7997/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4978, 12, 2890, 4672, 1172, 2213, 87, 6, 738, 1743, 67, 16056, 1435, 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, 4978, 12, 2890, 4672, 1172, 2213, 87, 6, 738, 1743, 67, 16056, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
HDF5_file.close()
def writeDomainsByHDF5(self):
b5ab00002c7fede604a02d48b2c2f43134f4529f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12742/b5ab00002c7fede604a02d48b2c2f43134f4529f/logger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 15531, 858, 44, 4577, 25, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 15531, 858, 44, 4577, 25, 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,...
_("Named entity did not end in ';'.")})
_("Named entity did not ';'.")})
def entitiesStartingWith(name): return [e for e in filteredEntityList if e.startswith(name)]
24a4502eaa02c9e59efadc78bbab79c4220e0d2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/24a4502eaa02c9e59efadc78bbab79c4220e0d2f/tokenizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5140, 11715, 1190, 12, 529, 4672, 327, 306, 73, 364, 425, 316, 5105, 1943, 682, 309, 425, 18, 17514, 1918, 12, 529, 25887, 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, 5140, 11715, 1190, 12, 529, 4672, 327, 306, 73, 364, 425, 316, 5105, 1943, 682, 309, 425, 18, 17514, 1918, 12, 529, 25887, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.assertTrue(hasattr(review, "generatedPdf")
self.assertTrue(hasattr(review, "generatedPdf"),
def test_review_with_custom_pdf_files(self): """Reviews / Presentations which have a custom pdf file will use that version for downloading and conversion to swf """ portal = self.layer["portal"] sample_reviews = portal["sample-reviews"] review = sample_reviews[sample_reviews.objectIds()[0]] # The sample reviews have both a pdf and a word doc attached self.assertTrue(review.pdf.get_size() > 0, msg=("Review: %s " "doesn't have a pdf file attached." %review.absolute_url())) self.assertTrue(review.doc.get_size() > 0, msg=("Review: %s " "doesn't have a doc file attached." %review.absolute_url())) self.assertFalse(hasattr(review, "generatedPdf"), msg=("Review: %s " "A pdf has been generated, even though this " "review has a custom pdf (this is wrong)." %review.absolute_url())) # An swf file has been created settings = Settings(review) swf_blob = openBlob(settings.data) swf_size = fstat(swf_blob.fileno()).st_size swf_blob.close() self.assertTrue(swf_size > 0, msg=("Review: %s " "doesn't have an swf version." %review.absolute_url())) self.assertTrue(review.pdf.blob == review.get_review_pdf() msg=("Review: %s " "get_review_pdf doesn't return the custom pdf." %review.absolute_url())) # Remove the custom pdf and trigger the ObjectEditedEvent # This should cause the pdf to be generated from the Word doc # and the swf to be generated from that review.setPdf(None) self.assertTrue(review.getPdf().get_size() == 0, msg=("Review: %s " "still has an attached custom pdf file, " "this should have been removed." %review.absolute_url())) request = makerequest.makerequest(review) event = ObjectEditedEvent(review, request) zope.event.notify(event) self.assertTrue(hasattr(review, "generatedPdf") msg=("Review: %s " "A pdf has not successfully been generated." %review.absolute_url())) self.assertTrue(review.generatedPdf == review.get_review_pdf(), msg=("Review: %s " "get_review_pdf is not returning the correct pdf." %review.absolute_url())) settings = Settings(review) doc_swf_blob = openBlob(settings.data) doc_swf_size = fstat(doc_swf_blob.fileno()).st_size doc_swf_blob.close() self.assertTrue(doc_swf_size != swf_size, msg=("Review: %s " "The size of the swf generated from the doc " "version is the same as the swf generated from " "custom pdf. This should not be the case." %review.absolute_url()))
4b30cf4d9fd6ebcf4664825daa66b9accdd612ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10560/4b30cf4d9fd6ebcf4664825daa66b9accdd612ea/test_review_file_conversions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 16041, 67, 1918, 67, 3662, 67, 7699, 67, 2354, 12, 2890, 4672, 3536, 426, 7061, 342, 25130, 1012, 1492, 1240, 279, 1679, 8169, 585, 903, 999, 716, 1177, 364, 23742, 471, 4105, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16041, 67, 1918, 67, 3662, 67, 7699, 67, 2354, 12, 2890, 4672, 3536, 426, 7061, 342, 25130, 1012, 1492, 1240, 279, 1679, 8169, 585, 903, 999, 716, 1177, 364, 23742, 471, 4105, ...
if value is None and emptyReturnsMarker:
if value is None and empty_marker:
def process_form(self, instance, field, form, empty_marker=None, emptyReturnsMarker=False): fieldname = field.getName() value = self._readDateTimeFromForm(instance, form, fieldname) if value is None and emptyReturnsMarker: value = empty_marker return value, {}
105c4b77f88ead048849ef5300cc713a22215a3d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5657/105c4b77f88ead048849ef5300cc713a22215a3d/widget.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 687, 12, 2890, 16, 791, 16, 652, 16, 646, 16, 1008, 67, 11145, 33, 7036, 16, 1008, 1356, 7078, 33, 8381, 4672, 225, 14680, 273, 652, 18, 17994, 1435, 460, 273, 365, 6315, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 687, 12, 2890, 16, 791, 16, 652, 16, 646, 16, 1008, 67, 11145, 33, 7036, 16, 1008, 1356, 7078, 33, 8381, 4672, 225, 14680, 273, 652, 18, 17994, 1435, 460, 273, 365, 6315, 8...
fields = {'id': Integer(is_key_field=True, is_stored=True, is_indexed=True), 'data': Integer(is_stored=True, multiple=True)}
fields = {'id': Integer(key_field=True, stored=True, indexed=True), 'data': Integer(stored=True, multiple=True)}
def get_catalog_values(self): return {'id': self.id, 'data': self.data}
464db3e104a1d7f3b6d148abb331fd993d33bdaf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12681/464db3e104a1d7f3b6d148abb331fd993d33bdaf/test_xapian.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7199, 67, 2372, 12, 2890, 4672, 327, 13666, 350, 4278, 365, 18, 350, 16, 296, 892, 4278, 365, 18, 892, 97, 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, 336, 67, 7199, 67, 2372, 12, 2890, 4672, 327, 13666, 350, 4278, 365, 18, 350, 16, 296, 892, 4278, 365, 18, 892, 97, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
for loop1 in range(ncrit):
while ncrit > 0: ncrit -= 1
def fry(hit): "Critical-hit resolution." if hit < (275.0-25.0*game.skill)*randreal(1.0, 1.5): return ncrit = int(1.0 + hit/(500.0+randreal(100))) proutn(_("***CRITICAL HIT--")) # Select devices and cause damage cdam = [] for loop1 in range(ncrit): while True: j = randdevice() # Cheat to prevent shuttle damage unless on ship if not (game.damage[j]<0.0 or (j==DSHUTTL and game.iscraft != "onship")): break cdam.append(j) extradm = (hit*game.damfac)/(ncrit*randreal(75, 100)) game.damage[j] += extradm skipcount = 0 for (i, j) in enumerate(cdam): proutn(device[j]) if skipcount % 3 == 2 and i < len(cdam)-1: skip(1) skipcount += 1 if i < len(cdam)-1: proutn(_(" and ")) prout(_(" damaged.")) if damaged(DSHIELD) and game.shldup: prout(_("***Shields knocked down.")) game.shldup=False
eafdd35f1af1e4e93d3609a0adbe768b562907e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/eafdd35f1af1e4e93d3609a0adbe768b562907e0/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1176, 12, 15989, 4672, 315, 30286, 17, 15989, 7861, 1199, 309, 6800, 411, 261, 5324, 25, 18, 20, 17, 2947, 18, 20, 14, 13957, 18, 7771, 737, 17653, 7884, 7688, 12, 21, 18, 20, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1176, 12, 15989, 4672, 315, 30286, 17, 15989, 7861, 1199, 309, 6800, 411, 261, 5324, 25, 18, 20, 17, 2947, 18, 20, 14, 13957, 18, 7771, 737, 17653, 7884, 7688, 12, 21, 18, 20, 1...
subprocess.call([ 'inkscape', 'out.svg', '--export-png=%s' % filename, ])
subprocess.call(['convert', '-background', 'none', 'out.svg', filename])
def handle_noargs(self, **options): template = open(os.path.join(os.path.dirname(__file__), 'markers', 'base.svg')).read() marker_dir = get_marker_dir() if not os.path.exists(marker_dir): os.makedirs(marker_dir)
ae4a41849dfcb4f4f257cb6b951e1b3a67cdfbbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/ae4a41849dfcb4f4f257cb6b951e1b3a67cdfbbd/generate_markers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 2135, 1968, 12, 2890, 16, 2826, 2116, 4672, 1542, 273, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 296, 22807, 2187, 296, 1969, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1640, 67, 2135, 1968, 12, 2890, 16, 2826, 2116, 4672, 1542, 273, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 296, 22807, 2187, 296, 1969, ...
return ' %d bytes ' % size
otrans = i18n.get_translation() try: i18n.set_language(lang) out = _(' %(size)i bytes ') finally: i18n.set_translation(otrans) return out
def sizeof(filename): size = os.path.getsize(filename) if size < 1000: return ' %d bytes ' % size elif size < 1000000: return ' %d KB ' % (size / 1000) # GB?? :-) return ' %d MB ' % (size / 1000000)
3af39c5f05e82fd415c7f13441692ce1fa61bab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/3af39c5f05e82fd415c7f13441692ce1fa61bab9/HyperArch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13726, 12, 3459, 4672, 963, 273, 1140, 18, 803, 18, 588, 1467, 12, 3459, 13, 309, 963, 411, 4336, 30, 225, 320, 2338, 273, 277, 2643, 82, 18, 588, 67, 10173, 1435, 775, 30, 277, 2643...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13726, 12, 3459, 4672, 963, 273, 1140, 18, 803, 18, 588, 1467, 12, 3459, 13, 309, 963, 411, 4336, 30, 225, 320, 2338, 273, 277, 2643, 82, 18, 588, 67, 10173, 1435, 775, 30, 277, 2643...
"""
def run(self): raise TypeError('this is only a test')
88b3e953a48c772ac6aa9bb47f8e5149fa4d5445 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/88b3e953a48c772ac6aa9bb47f8e5149fa4d5445/test_traceback_jy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 1002, 3580, 2668, 2211, 353, 1338, 279, 1842, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1086, 12, 2890, 4672, 1002, 3580, 2668, 2211, 353, 1338, 279, 1842, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
self.flush_move_actions()
self.flush_delayed_actions()
def copy_modules_and_connections(self, module_ids, connection_ids): """copy_modules_and_connections(module_ids: [long], connection_ids: [long]) -> str Serializes a list of modules and connections """ self.flush_move_actions()
79dd982e6cefb84d959fc7a4fd17507a2c038301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/79dd982e6cefb84d959fc7a4fd17507a2c038301/vistrail_controller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 67, 6400, 67, 464, 67, 13313, 12, 2890, 16, 1605, 67, 2232, 16, 1459, 67, 2232, 4672, 3536, 3530, 67, 6400, 67, 464, 67, 13313, 12, 2978, 67, 2232, 30, 306, 5748, 6487, 1459, 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, 1610, 67, 6400, 67, 464, 67, 13313, 12, 2890, 16, 1605, 67, 2232, 16, 1459, 67, 2232, 4672, 3536, 3530, 67, 6400, 67, 464, 67, 13313, 12, 2978, 67, 2232, 30, 306, 5748, 6487, 1459, 6...
return self.longcmd('HELP')
return self.longcmd('HELP',file)
def help(self): """Process a HELP command. Returns: - resp: server response if successful - list: list of strings"""
7310cde011c0d39df04e490d7cee58bff65f0013 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7310cde011c0d39df04e490d7cee58bff65f0013/nntplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2809, 12, 2890, 4672, 3536, 2227, 279, 22557, 52, 1296, 18, 225, 2860, 30, 300, 1718, 30, 1438, 766, 309, 6873, 300, 666, 30, 666, 434, 2064, 8395, 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, 2809, 12, 2890, 4672, 3536, 2227, 279, 22557, 52, 1296, 18, 225, 2860, 30, 300, 1718, 30, 1438, 766, 309, 6873, 300, 666, 30, 666, 434, 2064, 8395, 2, -100, -100, -100, -100, -100, -10...
if not os.path.exists(firstSpec):
firstSpecName = firstSpec.replace("file:///", "/") if not os.path.exists(firstSpecName):
def makeJobs(self, payload): """ _makeJobs_
29095522f508356f722590a2e7ec47d28e8ea2d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/29095522f508356f722590a2e7ec47d28e8ea2d0/ReqInjComponent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 7276, 12, 2890, 16, 2385, 4672, 3536, 389, 6540, 7276, 67, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 7276, 12, 2890, 16, 2385, 4672, 3536, 389, 6540, 7276, 67, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
elif k!=-1 and (j>k or j==-1): text=URL=kr.group(1) ; pos=k else: raise ValueError, "j==k: This can't happen!" length=len(text)
elif k!=-1 and (j>k or j==-1): text=URL=kr.group(1) ; pos=k else: raise ValueError, "j==k: This can't happen!" length=len(text)
def __processbody_URLquote(self, lines): # XXX a lot to do here: # 1. use lines directly, rather than source and dest # 2. make it clearer # 3. make it faster source = lines[:] dest = lines
3af39c5f05e82fd415c7f13441692ce1fa61bab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/3af39c5f05e82fd415c7f13441692ce1fa61bab9/HyperArch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2567, 3432, 67, 1785, 6889, 12, 2890, 16, 2362, 4672, 468, 11329, 279, 17417, 358, 741, 2674, 30, 468, 404, 18, 999, 2362, 5122, 16, 9178, 2353, 1084, 471, 1570, 468, 576, 18, 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2567, 3432, 67, 1785, 6889, 12, 2890, 16, 2362, 4672, 468, 11329, 279, 17417, 358, 741, 2674, 30, 468, 404, 18, 999, 2362, 5122, 16, 9178, 2353, 1084, 471, 1570, 468, 576, 18, 12...
self.extra_modules = params.get("extra_modules", None)
self.extra_modules = eval(params.get("extra_modules", "None"))
def __init__(self, test, params): """ Initialize class parameters and retrieves code from git repositories.
e1097dda48cfc6ecd903f931ff8c7b9ea75a29ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/e1097dda48cfc6ecd903f931ff8c7b9ea75a29ec/build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1842, 16, 859, 4672, 3536, 9190, 667, 1472, 471, 9023, 981, 628, 5071, 14531, 18, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1842, 16, 859, 4672, 3536, 9190, 667, 1472, 471, 9023, 981, 628, 5071, 14531, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
text = [const.SM_PAUSE, const.SM_PLAY][paused]
text = [const.SM_PAUSE, const.SM_PLAY][player.paused]
def __set_paused(self, watcher, player): self.__menu.get_children()[0].destroy() stock = [gtk.STOCK_MEDIA_PAUSE, gtk.STOCK_MEDIA_PLAY][player.paused] text = [const.SM_PAUSE, const.SM_PLAY][paused] playpause = qltk.MenuItem(text, stock) playpause.connect('activate', self.__play_pause, player) playpause.show() self.__menu.prepend(playpause)
1518cc810432a6e15b3d9f134759190405b665ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/1518cc810432a6e15b3d9f134759190405b665ce/trayicon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 67, 8774, 3668, 12, 2890, 16, 9527, 16, 7291, 4672, 365, 16186, 5414, 18, 588, 67, 5906, 1435, 63, 20, 8009, 11662, 1435, 12480, 273, 306, 4521, 79, 18, 31487, 3507, 67, 263...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 67, 8774, 3668, 12, 2890, 16, 9527, 16, 7291, 4672, 365, 16186, 5414, 18, 588, 67, 5906, 1435, 63, 20, 8009, 11662, 1435, 12480, 273, 306, 4521, 79, 18, 31487, 3507, 67, 263...
ship.combatAtt += ship.combatAttBase ship.combatDef = int((ship.combatDef + ship.combatDefBase) * ship.combatDefMultiplier) ship.missileDef = int((ship.missileDef + ship.missileDefBase) * ship.missileDefMultiplier) ship.hardShield = min(1.0,ship.hardShield) combatExtra += ship.damageAbsorb * 1500 ship.signature *= ship.signatureCloak * ship.signatureDecloak if ship.autoRepairMaxHP==0.0: ship.autoRepairMaxHP = 1.0
ship.combatAtt += ship.combatAttBase ship.combatDef = int((ship.combatDef + ship.combatDefBase) * ship.combatDefMultiplier) ship.missileDef = int((ship.missileDef + ship.missileDefBase) * ship.missileDefMultiplier) ship.hardShield = min(1.0,ship.hardShield) combatExtra += ship.damageAbsorb * 1500 ship.signature *= ship.signatureCloak * ship.signatureDecloak if ship.autoRepairMaxHP==0.0: ship.autoRepairMaxHP = 1.0
def makeShipFullSpec(player, name, hullID, eqIDs, improvements, raiseExs = True): if not hullID: raise GameException("Ship's hull must be specified.") hull = Rules.techs[hullID] if not hull.isShipHull: raise GameException("Ship's hull must be specified.") ship = IDataHolder() ship.type = T_SHIP # initial values techEff = Rules.techImprEff[player.techs.get(hullID, Rules.techBaseImprovement)] ship.name = name ship.hullID = hullID ship.eqIDs = eqIDs ship.level = hull.level ship.combatClass = hull.combatClass ship.improvements = improvements ship.buildProd = hull.buildProd ship.buildSRes = hull.buildSRes[:] # we need copy ship.operEn = hull.operEn ship.storEn = hull.storEn * techEff ship.weight = hull.weight ship.slots = 0 ship.signature = hull.signature ship.minSignature = hull.minSignature ship.signatureCloak = 1.0 #NEW; 100% - this is the default rule ship.signatureDecloak = 1.0 #NEW; 100% - this is the default rule ship.combatAttBase = hull.combatAtt * techEff ship.combatAtt = 0 ship.combatAttMultiplier = 1.0 #NEW; 100% - this is the default rule ship.combatDefBase = hull.combatDef * techEff ship.combatDef = 0 ship.combatDefMultiplier = 1.0 #NEW; 100% - this is the default rule ship.missileDefBase = hull.missileDef * techEff ship.missileDef = 0 ship.missileDefMultiplier = 1.0 #NEW; 100% - this is the default rule ship.scannerPwr = max(hull.scannerPwr * techEff, Rules.scannerMinPwr) ship.autoRepairMaxHP = hull.autoRepairMaxHP #New...this had been forgotten ship.autoRepairFix = hull.autoRepairFix ship.autoRepairPerc = hull.autoRepairPerc ship.shieldRechargeFix = hull.shieldRechargeFix ship.shieldRechargePerc = hull.shieldRechargePerc ship.hardShield = 0.0 ship.engPwr = 0 ship.upgradeTo = 0 ship.shieldHP = 0 ship.maxHP = int(hull.maxHP * techEff) ship.weaponIDs = [] ship.deployStructs = [] ship.deployHandlers = [] ship.isMilitary = 0 ship.baseExp = 0 ship.damageAbsorb = 0 combatExtra = 0 shieldPerc = 0.0 unpactStruct = 0 deployHandler = 0 # add equipment negslots = {} negweight = {} counter = {} installations = {} for techID in eqIDs: tech = Rules.techs[techID] techEff = Rules.techImprEff[player.techs.get(techID, Rules.techBaseImprovement)] for i in xrange(0, eqIDs[techID]): counter[tech.subtype] = 1 + counter.get(tech.subtype, 0) installations[techID] = 1 + installations.get(techID, 0) # check min hull req if tech.minHull > ship.combatClass and raiseExs: log.warning("Cannot add tech", techID, tech.name) raise GameException("Minimum hull requirement not satisfied.") # check max hull req #NEW if tech.maxHull < ship.combatClass and raiseExs: log.warning("Cannot add tech", techID, tech.name) raise GameException("Maximum hull requirement not satisfied.") # check maximum installations if tech.maxInstallations and installations[tech.id] > tech.maxInstallations \ and raiseExs: raise GameException("Maximum number of equipment installations exceeded.") # add values ship.level = max(ship.level, tech.level) ship.buildProd += tech.buildProd ship.buildSRes.extend(tech.buildSRes) ship.storEn += tech.storEn * techEff if (tech.weight > 0): ship.weight += tech.weight else: negweight[techID] = tech.weight + negweight.get(techID, 0) #this is complex for items with max installs... if (tech.slots > 0): ship.slots += tech.slots else: negslots[techID] = tech.slots + negslots.get(techID, 0) #this is complex for items with max installs... ship.signature += tech.signature ship.minSignature = max(ship.minSignature, tech.minSignature) ship.signatureCloak = min(ship.signatureCloak, tech.signatureCloak) ship.signatureDecloak = min(ship.signatureDecloak, tech.signatureDecloak) if tech.subtype == "seq_mod": #not cumulative for equipment; pick best ship.combatAtt = max(ship.combatAtt, tech.combatAtt * techEff) ship.combatDef = max(ship.combatDef, tech.combatDef * techEff) ship.missileDef = max(ship.missileDef, tech.missileDef * techEff) else : ship.combatDefBase += tech.combatDef * techEff ship.missileDefBase += tech.missileDef * techEff ship.combatAttBase += tech.combatAtt * techEff #not cumulative; pick best ship.combatAttMultiplier = max(ship.combatAttMultiplier, tech.combatAttPerc * techEff) #NEW ship.combatDefMultiplier = max(ship.combatDefMultiplier, tech.combatDefPerc * techEff) #NEW ship.missileDefMultiplier = max(ship.missileDefMultiplier, tech.missileDefPerc * techEff) #NEW ship.engPwr += tech.engPwr * techEff ship.maxHP += tech.maxHP * techEff shieldPerc = max(shieldPerc, tech.shieldPerc * techEff) ship.scannerPwr = max(ship.scannerPwr, tech.scannerPwr * techEff) ship.operEn += tech.operEn ship.autoRepairFix = max(ship.autoRepairFix, tech.autoRepairFix * techEff) ship.autoRepairPerc = max(ship.autoRepairPerc, tech.autoRepairPerc * techEff) if ((ship.autoRepairFix < tech.autoRepairFix) or (ship.autoRepairPerc < tech.autoRepairPerc) and (ship.autoRepairMaxHP < tech.autoRepairMaxHP)): ship.autoRepairMaxHP = tech.autoRepairMaxHP #grab this ONLY if the tech repairs faster than another tech (prevent abuse through multiple repair systems) ship.shieldRechargeFix = max(ship.shieldRechargeFix, tech.shieldRechargeFix * techEff) ship.shieldRechargePerc = max(ship.shieldRechargePerc, tech.shieldRechargePerc * techEff) ship.hardShield = max(ship.hardShield,tech.hardShield * techEff) ship.damageAbsorb = min(ship.damageAbsorb + tech.damageAbsorb,Rules.maxDamageAbsorb) #limit this by rule combatExtra += tech.addMP # if weapon - register only if tech.subtype == "seq_wpn": ship.weaponIDs.append(techID) ship.isMilitary = 1 weapon = Rules.techs[techID] ship.baseExp += (weapon.weaponDmgMin + weapon.weaponDmgMax) / 2 * weapon.weaponROF # deployables if tech.unpackStruct != OID_NONE: ship.deployStructs.append(tech.unpackStruct) unpactStruct = 1 if tech.deployHandlerID != OID_NONE: #this calls another tech at execute time, so only need the ID ship.deployHandlers.append(tech.deployHandlerID) deployHandler = 1 #fix limiter based attibs; round when needed currentNegWeight = 0 for negtech in negweight: currentNegWeight = min(currentNegWeight,negweight[negtech]) currentNegSlots = 0 for negtech in negslots: currentNegSlots = min(currentNegSlots,negslots[negtech]) ship.weight = max(ship.weight+currentNegWeight,int(hull.weight/2)) ship.slots = max(ship.slots+currentNegSlots,1) ship.combatAtt += ship.combatAttBase ship.combatDef = int((ship.combatDef + ship.combatDefBase) * ship.combatDefMultiplier) ship.missileDef = int((ship.missileDef + ship.missileDefBase) * ship.missileDefMultiplier) ship.hardShield = min(1.0,ship.hardShield) #don't allow this to be more than 100% blocking!! #add some MP for damage absorb: combatExtra += ship.damageAbsorb * 1500 #calculate final signature ship.signature *= ship.signatureCloak * ship.signatureDecloak #fix autorepair MaxHP / if nothing set autoRepairMaxHP, assume 100%; this is for legacy technologies if ship.autoRepairMaxHP==0.0: ship.autoRepairMaxHP = 1.0 # check various conditions
e36f6837ef1b365a4e49a58cc4e5c3712ecafe5e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/503/e36f6837ef1b365a4e49a58cc4e5c3712ecafe5e/ShipUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 26358, 5080, 1990, 12, 14872, 16, 508, 16, 22474, 734, 16, 7555, 5103, 16, 13069, 90, 17110, 16, 1002, 424, 87, 273, 1053, 4672, 309, 486, 22474, 734, 30, 1002, 14121, 503, 2932, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 26358, 5080, 1990, 12, 14872, 16, 508, 16, 22474, 734, 16, 7555, 5103, 16, 13069, 90, 17110, 16, 1002, 424, 87, 273, 1053, 4672, 309, 486, 22474, 734, 30, 1002, 14121, 503, 2932, ...
correction_factor = x[-1] - x[0]
correction_factor = x[-1] - x[0]
def quantize(x, bits, scale=False): x = list(x) fact = 2 ** bits # this adjusts range precisely between -65536 and 0 so that our bleps look right. # we should only do this if the table is integrated; in fact this code probably # belonged to the integration function. correction_factor = 1.0 if scale: correction_factor = x[-1] - x[0] for _ in range(len(x)): val = x[_] * fact / correction_factor; # correct rounding if val < 0: val = int(val - 0.5) else: val = int(val + 0.5) # leave scaled? if not scale: val /= float(fact) x[_] = val * -1 return x
7ffb907931bc8baea614d0990c951dce350f0b76 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6245/7ffb907931bc8baea614d0990c951dce350f0b76/sinc-integral.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10251, 554, 12, 92, 16, 4125, 16, 3159, 33, 8381, 4672, 619, 273, 666, 12, 92, 13, 5410, 273, 576, 2826, 4125, 225, 468, 333, 5765, 87, 1048, 13382, 291, 2357, 3086, 300, 26, 2539, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10251, 554, 12, 92, 16, 4125, 16, 3159, 33, 8381, 4672, 619, 273, 666, 12, 92, 13, 5410, 273, 576, 2826, 4125, 225, 468, 333, 5765, 87, 1048, 13382, 291, 2357, 3086, 300, 26, 2539, 5...