rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
segments = message.get_segments()
segments = [] for seg, offset in get_segments(message): segments.append(seg)
def test_HTML3(self): text = u"""-- toto is here-- *I am*""" result = [u'-- toto is here-- *I am*']
f60259a351ba0ec0893ebab283ae29d948ec283a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/f60259a351ba0ec0893ebab283ae29d948ec283a/test_i18n.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4870, 23, 12, 2890, 4672, 977, 273, 582, 8395, 413, 268, 6302, 353, 2674, 413, 380, 45, 2125, 14, 8395, 563, 273, 306, 89, 11, 413, 268, 6302, 353, 2674, 413, 380, 45, 2125...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4870, 23, 12, 2890, 4672, 977, 273, 582, 8395, 413, 268, 6302, 353, 2674, 413, 380, 45, 2125, 14, 8395, 563, 273, 306, 89, 11, 413, 268, 6302, 353, 2674, 413, 380, 45, 2125...
lib = self.iTunes.sources.ItemByName('Library') lib_playlists = [pl.Name for pl in lib.Playlists] if not 'Books' in lib_playlists: self.log.error(" no 'Books' playlist in Library") library_books = lib.Playlists.ItemByName('Books')
for source in self.iTunes.sources: if source.Kind == self.Sources.index('Library'): lib = source if DEBUG: self.log.info(" Library source: '%s' kind: %s" % (lib.Name, self.Sources[lib.Kind])) break else: if DEBUG: self.log.info(" Library source not found") if lib is not None: lib_books = None for pl in lib.Playlists: if self.PlaylistKind[pl.Kind] == 'User' and self.PlaylistSpecialKind[pl.SpecialKind] == 'Books': if DEBUG: self.log.info(" Books playlist: '%s' special_kind: '%s'" % (pl.Name, self.PlaylistSpecialKind[pl.SpecialKind])) lib_books = pl break else: if DEBUG: self.log.error(" no Books playlist found")
def upload_books(self, files, names, on_card=None, end_session=True, metadata=None): ''' Upload a list of books to the device. If a file already exists on the device, it should be replaced. This method should raise a L{FreeSpaceError} if there is not enough free space on the device. The text of the FreeSpaceError must contain the word "card" if C{on_card} is not None otherwise it must contain the word "memory". :files: A list of paths and/or file-like objects. :names: A list of file names that the books should have once uploaded to the device. len(names) == len(files) :return: A list of 3-element tuples. The list is meant to be passed to L{add_books_to_metadata}. :metadata: If not None, it is a list of :class:`MetaInformation` objects. The idea is to use the metadata to determine where on the device to put the book. len(metadata) == len(files). Apart from the regular cover (path to cover), there may also be a thumbnail attribute, which should be used in preference. The thumbnail attribute is of the form (width, height, cover_data as jpeg). '''
462b2e6c44751baac6b573b9a8450f4512d05312 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/462b2e6c44751baac6b573b9a8450f4512d05312/driver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3617, 67, 12567, 12, 2890, 16, 1390, 16, 1257, 16, 603, 67, 3327, 33, 7036, 16, 679, 67, 3184, 33, 5510, 16, 1982, 33, 7036, 4672, 9163, 9414, 279, 666, 434, 6978, 87, 358, 326, 2346...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3617, 67, 12567, 12, 2890, 16, 1390, 16, 1257, 16, 603, 67, 3327, 33, 7036, 16, 679, 67, 3184, 33, 5510, 16, 1982, 33, 7036, 4672, 9163, 9414, 279, 666, 434, 6978, 87, 358, 326, 2346...
flex.set_random_seed(0) fo2_incomplete = fo2.select(flex.random_bool(fo2.size(), 0.95))
mt = flex.mersenne_twister(seed=0) fo2_incomplete = fo2.select(mt.random_bool(fo2.size(), 0.95))
def exercise_masks(): xs_ref = structure.from_shelx( file=cStringIO.StringIO(YAKRUY_ins)) mi = xs_ref.crystal_symmetry().build_miller_set( d_min=0.5, anomalous_flag=False) fo = mi.structure_factors_from_scatterers( xs_ref, algorithm="direct").f_calc().as_amplitude_array() k = 0.05 + 10 * flex.random_double() fo = fo.customized_copy(data=fo.data()*k) fo2 = fo.f_as_f_sq() acetonitrile_sel = xs_ref.label_selection( 'N4', 'C20', 'C21', 'H211', 'H212', 'H213') xs_no_sol = xs_ref.deep_copy_scatterers().select( acetonitrile_sel, negate=True) # check what happens when no voids are found mask = masks.mask(xs_ref, fo2) mask.compute(solvent_radius=1.2, shrink_truncation_radius=1.2, resolution_factor=1/2, atom_radii_table={'C':1.70, 'B':1.63, 'N':1.55, 'O':1.52}) assert mask.structure_factors() is None assert mask.n_voids() == 0 assert mask.n_solvent_grid_points() == 0 assert mask.f_mask() is None assert mask.f_model() is None assert mask.modified_intensities() is None assert mask.f_000 is None s = cStringIO.StringIO() mask.show_summary(log=s) assert not show_diff(s.getvalue(), """\
6339f4025b1d72c5e2d60ba010cf60c9d718b2ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/6339f4025b1d72c5e2d60ba010cf60c9d718b2ce/tst_masks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24165, 67, 29102, 13332, 9280, 67, 1734, 273, 3695, 18, 2080, 67, 674, 292, 92, 12, 585, 33, 71, 780, 4294, 18, 780, 4294, 12, 61, 14607, 19866, 61, 67, 2679, 3719, 12837, 273, 9280, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24165, 67, 29102, 13332, 9280, 67, 1734, 273, 3695, 18, 2080, 67, 674, 292, 92, 12, 585, 33, 71, 780, 4294, 18, 780, 4294, 12, 61, 14607, 19866, 61, 67, 2679, 3719, 12837, 273, 9280, ...
try: assert os.path.exists(filename) finally: os.unlink(filename) assert not os.path.exists(filename)
assert not os.path.exists(filename)
def checkCloseNoUnlink(self): log = CommitLog.CommitLog() filename = log.get_filename() log.close() try: assert os.path.exists(filename) finally: os.unlink(filename) assert not os.path.exists(filename)
aa3de9c148eda3d9e95edbdc591bdfb27b69db11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/aa3de9c148eda3d9e95edbdc591bdfb27b69db11/test_commitlog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 4605, 2279, 984, 1232, 12, 2890, 4672, 613, 273, 10269, 1343, 18, 5580, 1343, 1435, 1544, 273, 613, 18, 588, 67, 3459, 1435, 613, 18, 4412, 1435, 775, 30, 1815, 1140, 18, 803, 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, 866, 4605, 2279, 984, 1232, 12, 2890, 4672, 613, 273, 10269, 1343, 18, 5580, 1343, 1435, 1544, 273, 613, 18, 588, 67, 3459, 1435, 613, 18, 4412, 1435, 775, 30, 1815, 1140, 18, 803, 18,...
keys = self.aliases.keys() keys.sort()
keys = sorted(self.aliases.keys())
def do_alias(self, arg): args = arg.split() if len(args) == 0: keys = self.aliases.keys() keys.sort() for alias in keys: print("%s = %s" % (alias, self.aliases[alias]), file=self.stdout) return if args[0] in self.aliases and len(args) == 1: print("%s = %s" % (args[0], self.aliases[args[0]]), file=self.stdout) else: self.aliases[args[0]] = ' '.join(args[1:])
be74a378eb1676bdef826034aff96feb74141e23 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/be74a378eb1676bdef826034aff96feb74141e23/pdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 4930, 12, 2890, 16, 1501, 4672, 833, 273, 1501, 18, 4939, 1435, 309, 562, 12, 1968, 13, 422, 374, 30, 1311, 273, 3115, 12, 2890, 18, 13831, 18, 2452, 10756, 364, 2308, 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, 741, 67, 4930, 12, 2890, 16, 1501, 4672, 833, 273, 1501, 18, 4939, 1435, 309, 562, 12, 1968, 13, 422, 374, 30, 1311, 273, 3115, 12, 2890, 18, 13831, 18, 2452, 10756, 364, 2308, 316, ...
return render_to_response(template, RequestContext(request, ctx))
return render_to_response(template, context_instance=RequestContext(request, ctx))
def category_view(request, slug, parent_slugs='', template='product/category.html'): """Display the category, its child categories, and its products. Parameters: - slug: slug of category - parent_slugs: ignored """ try: category = Category.objects.get_by_site(slug=slug) products = list(category.active_products()) sale = find_best_auto_discount(products) except Category.DoesNotExist: return bad_or_missing(request, _('The category you have requested does not exist.')) child_categories = category.get_all_children() ctx = { 'category': category, 'child_categories': child_categories, 'sale' : sale, 'products' : products, } index_prerender.send(Product, request=request, context=ctx, category=category, object_list=products) return render_to_response(template, RequestContext(request, ctx))
d901911c330685f33a315d8b4786941f3d990d04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/171/d901911c330685f33a315d8b4786941f3d990d04/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3150, 67, 1945, 12, 2293, 16, 4959, 16, 982, 67, 2069, 9024, 2218, 2187, 1542, 2218, 5896, 19, 4743, 18, 2620, 11, 4672, 3536, 4236, 326, 3150, 16, 2097, 1151, 6477, 16, 471, 2097, 104...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3150, 67, 1945, 12, 2293, 16, 4959, 16, 982, 67, 2069, 9024, 2218, 2187, 1542, 2218, 5896, 19, 4743, 18, 2620, 11, 4672, 3536, 4236, 326, 3150, 16, 2097, 1151, 6477, 16, 471, 2097, 104...
msg = _('The jamendo server returned code %s') % exc.code
msg = _('The Jamendo server returned code %s.') % exc.code
def on_fetch_albums_error(self, treeview, exc): """ Called when an error occured in the thread. """ self.reset() pindex = self.treeviews.index(treeview) self.progressbars[pindex].set_fraction(0.0) self.progressbars[pindex].hide() self.running_threads[pindex] = False dlg = gtk.MessageDialog( type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK ) dlg.set_markup( '<b>%s</b>' % _('An error occured while fetching albums.') ) # managing exceptions with urllib is a real PITA... :( if hasattr(exc, 'reason'): try: reason = exc.reason[1] except: try: reason = exc.reason[0] except: reason = str(exc) reason = reason.capitalize() msg = _('Failed to connect to jamendo server.\n%s.') % reason elif hasattr(exc, 'code'): msg = _('The jamendo server returned code %s') % exc.code else: msg = str(exc) dlg.format_secondary_text(msg) dlg.run() dlg.destroy()
204fc110d39767d8f9d5956b72f45fef1e692e10 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11070/204fc110d39767d8f9d5956b72f45fef1e692e10/jamendo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 5754, 67, 25090, 87, 67, 1636, 12, 2890, 16, 2151, 1945, 16, 3533, 4672, 3536, 11782, 1347, 392, 555, 16206, 316, 326, 2650, 18, 3536, 365, 18, 6208, 1435, 293, 1615, 273, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 5754, 67, 25090, 87, 67, 1636, 12, 2890, 16, 2151, 1945, 16, 3533, 4672, 3536, 11782, 1347, 392, 555, 16206, 316, 326, 2650, 18, 3536, 365, 18, 6208, 1435, 293, 1615, 273, 365...
>>> Fraction(1234, 5678).limit_denominator(10000) Fraction(1234, 5678)
>>> Fraction(4321, 8765).limit_denominator(10000) Fraction(4321, 8765)
def limit_denominator(self, max_denominator=1000000): """Closest Fraction to self with denominator at most max_denominator.
e13dc3e6d5448668bbe9adae3ea141964f829e0b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/e13dc3e6d5448668bbe9adae3ea141964f829e0b/fractions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1800, 67, 13002, 26721, 12, 2890, 16, 943, 67, 13002, 26721, 33, 21, 9449, 4672, 3536, 4082, 7781, 478, 5738, 358, 365, 598, 15030, 622, 4486, 943, 67, 13002, 26721, 18, 2, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1800, 67, 13002, 26721, 12, 2890, 16, 943, 67, 13002, 26721, 33, 21, 9449, 4672, 3536, 4082, 7781, 478, 5738, 358, 365, 598, 15030, 622, 4486, 943, 67, 13002, 26721, 18, 2, -100, -100, ...
process = _pop_by_pid(job._accept_pid)
process = _pop_by_pid(job._worker_pid)
def _on_hard_timeout(job, i): debug('hard time limit exceeded for %i', i) # Remove from _pool process = _pop_by_pid(job._accept_pid) # Remove from cache and set return value to an exception job._set(i, (False, TimeLimitExceeded())) # Run timeout callback if job._timeout_callback is not None: job._timeout_callback(soft=False) if not process: return # Terminate the process process.terminate()
a38672638aa95f9a7a01dedfc1e9528707311195 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/a38672638aa95f9a7a01dedfc1e9528707311195/pool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 265, 67, 20379, 67, 4538, 12, 4688, 16, 277, 4672, 1198, 2668, 20379, 813, 1800, 12428, 364, 738, 77, 2187, 277, 13, 468, 3581, 628, 389, 6011, 1207, 273, 389, 5120, 67, 1637, 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, 389, 265, 67, 20379, 67, 4538, 12, 4688, 16, 277, 4672, 1198, 2668, 20379, 813, 1800, 12428, 364, 738, 77, 2187, 277, 13, 468, 3581, 628, 389, 6011, 1207, 273, 389, 5120, 67, 1637, 67,...
h2_im[-pl2:, -pl2:], s1_im[-pl2:, -pl2:] = hs2_dij
h2_im[-pl2:, -pl2:], s2_im[-pl2:, -pl2:] = hs2_dij
def initialize(self, energies, bias=0): """ energies: list of energies for which the transmission function should be evaluated. bias. Will precalculate the surface greenfunctions of the tip and surface. """ self.bias = bias self.energies = energies nenergies = len(energies) pl1, pl2 = self.pl1, self.pl2 nbf1, nbf2 = len(self.h1), len(self.h2)
e67dc6edcdef0669019d51fcadac2694d16938b5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/e67dc6edcdef0669019d51fcadac2694d16938b5/stm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 12, 2890, 16, 27993, 16, 12005, 33, 20, 4672, 3536, 27993, 30, 666, 434, 27993, 364, 1492, 326, 27940, 445, 1410, 506, 12697, 18, 12005, 18, 9980, 675, 11162, 326, 9034, 10004, 107...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 12, 2890, 16, 27993, 16, 12005, 33, 20, 4672, 3536, 27993, 30, 666, 434, 27993, 364, 1492, 326, 27940, 445, 1410, 506, 12697, 18, 12005, 18, 9980, 675, 11162, 326, 9034, 10004, 107...
prefixes.append(reverse('tracking-refresh-active-users'))
try: prefixes.append(reverse('tracking-refresh-active-users')) except NoReverseMatch: pass
def process_request(self, request): # don't process AJAX requests if request.is_ajax(): return
2adc7e5285400c245e59a72f970fb910ee4d658c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7421/2adc7e5285400c245e59a72f970fb910ee4d658c/middleware.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 2293, 12, 2890, 16, 590, 4672, 468, 2727, 1404, 1207, 22355, 3285, 309, 590, 18, 291, 67, 12813, 13332, 327, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 2293, 12, 2890, 16, 590, 4672, 468, 2727, 1404, 1207, 22355, 3285, 309, 590, 18, 291, 67, 12813, 13332, 327, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
obj = self.pool.get(cal_children[child.name.lower()]) if hasattr(obj, 'check_import'): obj.check_import(cr, uid, vals, context=context) else:
objs.append(cal_children[child.name.lower()]) for obj_name in list(set(objs)): obj = self.pool.get(obj_name) if hasattr(obj, 'check_import'): obj.check_import(cr, uid, vals, context=context) checked = True if not checked:
def import_cal(self, cr, uid, content, data_id=None, context=None): """ Import Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param data_id: Get Data’s ID or False @param context: A standard dictionary for contextual values """
1263dd94aec18dc93f2c1301bed8d5db4810ef61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1263dd94aec18dc93f2c1301bed8d5db4810ef61/calendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 771, 12, 2890, 16, 4422, 16, 4555, 16, 913, 16, 501, 67, 350, 33, 7036, 16, 819, 33, 7036, 4672, 3536, 6164, 5542, 632, 891, 365, 30, 1021, 733, 4407, 632, 891, 4422, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 771, 12, 2890, 16, 4422, 16, 4555, 16, 913, 16, 501, 67, 350, 33, 7036, 16, 819, 33, 7036, 4672, 3536, 6164, 5542, 632, 891, 365, 30, 1021, 733, 4407, 632, 891, 4422, 30, ...
m[0] = 'b'
m[0] = b'b'
def test_access_parameter(self): # Test for "access" keyword parameter mapsize = 10 open(TESTFN, "wb").write("a"*mapsize) f = open(TESTFN, "rb") m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_READ) self.assertEqual(m[:], 'a'*mapsize, "Readonly memory map data incorrect.")
b358a2c4233f0e8c3cc58b86ed84007cc16ea74d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/b358a2c4233f0e8c3cc58b86ed84007cc16ea74d/test_mmap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3860, 67, 6775, 12, 2890, 4672, 468, 7766, 364, 315, 3860, 6, 4932, 1569, 852, 1467, 273, 1728, 1696, 12, 16961, 19793, 16, 315, 9464, 20387, 2626, 2932, 69, 6, 14, 1458, 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, 1842, 67, 3860, 67, 6775, 12, 2890, 4672, 468, 7766, 364, 315, 3860, 6, 4932, 1569, 852, 1467, 273, 1728, 1696, 12, 16961, 19793, 16, 315, 9464, 20387, 2626, 2932, 69, 6, 14, 1458, 146...
assert_true(summary in index_view)
assert 'Showing 250 results per page.' in index_view
def test_render_index(self): summary = 'test render index' self.new_ticket(summary=summary) index_view = self.app.get('/bugs/') assert_true(summary in index_view)
0bb6f6b64b9008196a261a7be4bd9c163afa2a08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/0bb6f6b64b9008196a261a7be4bd9c163afa2a08/test_root.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5902, 67, 1615, 12, 2890, 4672, 4916, 273, 296, 3813, 1743, 770, 11, 365, 18, 2704, 67, 16282, 12, 7687, 33, 7687, 13, 770, 67, 1945, 273, 365, 18, 2910, 18, 588, 2668, 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5902, 67, 1615, 12, 2890, 4672, 4916, 273, 296, 3813, 1743, 770, 11, 365, 18, 2704, 67, 16282, 12, 7687, 33, 7687, 13, 770, 67, 1945, 273, 365, 18, 2910, 18, 588, 2668, 19,...
def _test(N=20000):
def _test_sample(n): population = xrange(n) for k in xrange(n+1): s = sample(population, k) assert len(dict([(elem,True) for elem in s])) == len(s) == k def _sample_generator(n, k): return sample(xrange(n), k)[k//2] def _test(N=2000):
def _test(N=20000): print 'TWOPI =', TWOPI print 'LOG4 =', LOG4 print 'NV_MAGICCONST =', NV_MAGICCONST print 'SG_MAGICCONST =', SG_MAGICCONST _test_generator(N, 'random()') _test_generator(N, 'normalvariate(0.0, 1.0)') _test_generator(N, 'lognormvariate(0.0, 1.0)') _test_generator(N, 'cunifvariate(0.0, 1.0)') _test_generator(N, 'expovariate(1.0)') _test_generator(N, 'vonmisesvariate(0.0, 1.0)') _test_generator(N, 'gammavariate(0.01, 1.0)') _test_generator(N, 'gammavariate(0.1, 1.0)') _test_generator(N, 'gammavariate(0.1, 2.0)') _test_generator(N, 'gammavariate(0.5, 1.0)') _test_generator(N, 'gammavariate(0.9, 1.0)') _test_generator(N, 'gammavariate(1.0, 1.0)') _test_generator(N, 'gammavariate(2.0, 1.0)') _test_generator(N, 'gammavariate(20.0, 1.0)') _test_generator(N, 'gammavariate(200.0, 1.0)') _test_generator(N, 'gauss(0.0, 1.0)') _test_generator(N, 'betavariate(3.0, 3.0)') _test_generator(N, 'paretovariate(1.0)') _test_generator(N, 'weibullvariate(1.0, 1.0)') # Test jumpahead. s = getstate() jumpahead(N) r1 = random() # now do it the slow way setstate(s) for i in range(N): random() r2 = random() if r1 != r2: raise ValueError("jumpahead test failed " + `(N, r1, r2)`)
698ab7517f13b040ef8433d5a4175c0580f66c78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/698ab7517f13b040ef8433d5a4175c0580f66c78/random.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 67, 6358, 12, 82, 4672, 282, 11209, 273, 12314, 12, 82, 13, 364, 417, 316, 12314, 12, 82, 15, 21, 4672, 272, 273, 3296, 12, 23555, 16, 417, 13, 1815, 562, 12, 1576, 3816, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3813, 67, 6358, 12, 82, 4672, 282, 11209, 273, 12314, 12, 82, 13, 364, 417, 316, 12314, 12, 82, 15, 21, 4672, 272, 273, 3296, 12, 23555, 16, 417, 13, 1815, 562, 12, 1576, 3816, ...
print "s"+s+"::"+operation.label+"::"
def get_history(self): index = 0 for tr in self.document.getiterator('tr'): first_td = tr.getchildren()[0] if first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g': operation = Operation(index) index += 1 operation.date = first_td.text operation.label = tr.getchildren()[2].text.replace('\n',' ') if len(tr.getchildren()[3].text) > 2: s = tr.getchildren()[3].text elif len(tr.getchildren()[4].text) > 2: s = tr.getchildren()[4].text else: s = "0" print "s"+s+"::"+operation.label+"::" balance = u'' for c in s: if c.isdigit() or c == "-": balance += c if c == ',': balance += '.' operation.amount = float(balance) yield operation
1413c2bba1f1356624c7153b2a013f697cd57aa6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/1413c2bba1f1356624c7153b2a013f697cd57aa6/pages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8189, 12, 2890, 4672, 770, 273, 374, 364, 433, 316, 365, 18, 5457, 18, 588, 9838, 2668, 313, 11, 4672, 1122, 67, 4465, 273, 433, 18, 588, 5906, 1435, 63, 20, 65, 309, 1122, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8189, 12, 2890, 4672, 770, 273, 374, 364, 433, 316, 365, 18, 5457, 18, 588, 9838, 2668, 313, 11, 4672, 1122, 67, 4465, 273, 433, 18, 588, 5906, 1435, 63, 20, 65, 309, 1122, ...
return lambda a: pipepager(a, os.environ['PAGER'])
if sys.platform == 'win32': return lambda a: tempfilepager(a, os.environ['PAGER']) else: return lambda a: pipepager(a, os.environ['PAGER'])
def getpager(): """Decide what method to use for paging through text.""" if type(sys.stdout) is not types.FileType: return plainpager if not sys.stdin.isatty() or not sys.stdout.isatty(): return plainpager if os.environ.has_key('PAGER'): return lambda a: pipepager(a, os.environ['PAGER']) if sys.platform == 'win32': return lambda a: tempfilepager(a, 'more <') if hasattr(os, 'system') and os.system('less 2>/dev/null') == 0: return lambda a: pipepager(a, 'less') import tempfile filename = tempfile.mktemp() open(filename, 'w').close() try: if hasattr(os, 'system') and os.system('more %s' % filename) == 0: return lambda text: pipepager(text, 'more') else: return ttypager finally: os.unlink(filename)
a2ebd065552d2e5c9c6624a04e40faa9148962e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a2ebd065552d2e5c9c6624a04e40faa9148962e9/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 24081, 13332, 3536, 1799, 831, 4121, 707, 358, 999, 364, 17859, 3059, 977, 12123, 309, 618, 12, 9499, 18, 10283, 13, 353, 486, 1953, 18, 28941, 30, 327, 7351, 24081, 309, 486, 2589,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 24081, 13332, 3536, 1799, 831, 4121, 707, 358, 999, 364, 17859, 3059, 977, 12123, 309, 618, 12, 9499, 18, 10283, 13, 353, 486, 1953, 18, 28941, 30, 327, 7351, 24081, 309, 486, 2589,...
elif ret is None: ret = p.wait()
os.close(stdout_r)
def _bash2(command, mode='o'): """Execute a bash command. Return the output, the return value, or both. mode may be o (output), v (return value), or ov (tuple (output, value).""" stdin, stdout = PIPE, None if 'o' in mode: stdout = PIPE p = Popen('/bin/bash', stdin=stdin, stdout=stdout) (stdin, stdout) = (p.stdin, p.stdout) stdin.write(command) stdin.close() output = [] ret = p.poll() if stdout: while ret is None: o = stdout.read() if o: output.append(o) ret = p.poll() if ret is None: time.sleep(0.01) output.append(stdout.read()) output = (''.join(output)).strip() elif ret is None: ret = p.wait() if 'ov' == mode: return (output, ret) elif 'o' in mode: return output elif 'v' in mode: return ret return None
5a69ba52c1208121d9a721ab66f39c188880af1e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5186/5a69ba52c1208121d9a721ab66f39c188880af1e/PythonUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 28734, 22, 12, 3076, 16, 1965, 2218, 83, 11, 4672, 3536, 5289, 279, 24817, 1296, 18, 2000, 326, 876, 16, 326, 327, 460, 16, 578, 3937, 18, 1965, 2026, 506, 320, 261, 2844, 3631, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 28734, 22, 12, 3076, 16, 1965, 2218, 83, 11, 4672, 3536, 5289, 279, 24817, 1296, 18, 2000, 326, 876, 16, 326, 327, 460, 16, 578, 3937, 18, 1965, 2026, 506, 320, 261, 2844, 3631, ...
self.sayprivate(destination, text) self.fakepublic(self.__mergeroom__, self.joinPM(destination, self.parent.myUsername), realtext)
self.sayprivate(destination, args) self.fakepublic(self.__mergeroom__, self.joinPM(destination, self.parent.myUsername), args)
def replyMessage(self, command, room, args): if self.lastmessage: (type, destination) = self.lastmessage if type == 'Public': self.saypublic(destination, text) self.fakepublic(self.__mergeroom__, self.joinPublic(destination, self.parent.myUsername), realtext) elif type == 'PM': self.sayprivate(destination, text) self.fakepublic(self.__mergeroom__, self.joinPM(destination, self.parent.myUsername), realtext) else: self.log("EEK, programming error. (%s, %s)" % self.lastmessage) else: self.log("Nobody spoke so far, who am I supposed to send it to?")
b00ec341291cb0f45fe3e2c26f059952dbb776b8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/b00ec341291cb0f45fe3e2c26f059952dbb776b8/99-mergedview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4332, 1079, 12, 2890, 16, 1296, 16, 7725, 16, 833, 4672, 309, 365, 18, 2722, 2150, 30, 261, 723, 16, 2929, 13, 273, 365, 18, 2722, 2150, 309, 618, 422, 296, 4782, 4278, 365, 18, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4332, 1079, 12, 2890, 16, 1296, 16, 7725, 16, 833, 4672, 309, 365, 18, 2722, 2150, 30, 261, 723, 16, 2929, 13, 273, 365, 18, 2722, 2150, 309, 618, 422, 296, 4782, 4278, 365, 18, 87, ...
the local hostname is found using gethostbyname().
the local hostname is found using socket.getfqdn().
def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance.
4b186aff486400c3a7412ee552587f5a30be2381 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b186aff486400c3a7412ee552587f5a30be2381/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1479, 273, 10226, 1756, 273, 374, 16, 1191, 67, 10358, 273, 599, 4672, 3536, 7520, 279, 394, 791, 18, 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, 0, 0, 0, 0, 0, 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, 1479, 273, 10226, 1756, 273, 374, 16, 1191, 67, 10358, 273, 599, 4672, 3536, 7520, 279, 394, 791, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
res = []
def _listbloc(n, nbrepets, listint=None): """ listbloc decomposes a set of n*nbrepets integers (the list listint) in nbrepets parts. It is used in the algorithm to generate all set partitions. Not to be called by the user. EXAMPLES: sage: sage.combinat.set_partition._listbloc(2,1) [{{1, 2}}] sage: l = [Set([Set([3, 4]), Set([1, 2])]), Set([Set([2, 4]), Set([1, 3])]), Set([Set([2, 3]), Set([1, 4])])] sage: sage.combinat.set_partition._listbloc(2,2,[1,2,3,4]) == l True """ if isinstance(listint, (int, sage.rings.integer.Integer)) or listint is None: listint = Set(range(1,n+1)) if nbrepets == 1: return [Set([listint])] l = __builtin__.list(listint) l.sort() smallest = Set(l[:1]) new_listint = Set(l[1:]) f = lambda u, v: u.union(_set_union([smallest,v])) res = [] for ssens in subset.Subsets(new_listint, n-1): for z in _listbloc(n, nbrepets-1, new_listint-ssens): res.append(f(z,ssens)) return res
0c5829b64e83939f27e78ee2d1eb9d2d6d5fe63a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0c5829b64e83939f27e78ee2d1eb9d2d6d5fe63a/set_partition.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1098, 70, 1829, 12, 82, 16, 4264, 14462, 2413, 16, 666, 474, 33, 7036, 4672, 3536, 666, 70, 1829, 9862, 10522, 279, 444, 434, 290, 14, 82, 6073, 84, 2413, 12321, 261, 5787, 666, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1098, 70, 1829, 12, 82, 16, 4264, 14462, 2413, 16, 666, 474, 33, 7036, 4672, 3536, 666, 70, 1829, 9862, 10522, 279, 444, 434, 290, 14, 82, 6073, 84, 2413, 12321, 261, 5787, 666, ...
self.testDateFromBuildId = kwargs['testDate']
self.testDate = kwargs['testDate']
def __init__(self, **kwargs): if 'title' in kwargs: self.title = kwargs['title'] if 'branch' in kwargs: self.branch = kwargs['branch'] if 'executablePath' in kwargs: self.exePath = kwargs['executablePath'] if 'configFilePath' in kwargs: self.configPath = kwargs['configFilePath'] if 'outputName' in kwargs: self.outputName = kwargs['outputName'] if 'buildid' in kwargs: self.buildid = kwargs['buildid'] if 'verbose' in kwargs: self.verbose = kwargs['verbose'] if 'testDate' in kwargs: self.testDateFromBuildId = kwargs['testDate']
bac2ac4d506e26446e2b5b3732bf82fd78d255c2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12156/bac2ac4d506e26446e2b5b3732bf82fd78d255c2/PerfConfigurator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 4333, 4672, 309, 296, 2649, 11, 316, 1205, 30, 365, 18, 2649, 273, 1205, 3292, 2649, 3546, 309, 296, 7500, 11, 316, 1205, 30, 365, 18, 7500, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 4333, 4672, 309, 296, 2649, 11, 316, 1205, 30, 365, 18, 2649, 273, 1205, 3292, 2649, 3546, 309, 296, 7500, 11, 316, 1205, 30, 365, 18, 7500, 273, ...
self.image142 = QPixmap(image142_data)
def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar()
12c8fe24cb1ace55e7caf0b09c7238554087208a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/12c8fe24cb1ace55e7caf0b09c7238554087208a/MainWindowUI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2938, 273, 599, 16, 529, 273, 599, 16, 2242, 273, 374, 4672, 2238, 6376, 3829, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 2242, 13, 365, 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, 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, 2938, 273, 599, 16, 529, 273, 599, 16, 2242, 273, 374, 4672, 2238, 6376, 3829, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 2242, 13, 365, 18, 23...
logging.debug("Command(%s): %s" % (gameHost, netCommand))
logging.debug("(%s) Command: %s" % (gameHost, netCommand))
def handle(self): # client address gameHost = self.client_address[0] # Read the incoming command. netCommand = self.rfile.read(4) # Skip the trailing NULL. self.rfile.read(1) ################################# # Process the incoming command. # ################################# logging.debug("Command(%s): %s" % (gameHost, netCommand)) # Add a game. if netCommand == 'addg': # Check we can connect to the host s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: logging.debug("Checking gameserver's vitality...") s.settimeout(10.0) s.connect((gameHost, gamePort)) s.close() except: logging.debug("Gameserver did not respond!") return # The host is valid logging.debug("Adding gameserver...") try: # create a game object g = Game(self) # put it in the database gamedb.addGame(g) # and start receiving updates about the game while True: newGameData = self.rfile.read(gsSize) if not newGameData: logging.debug("End of gameserver") return #set Gamedata g.setData(newGameData) #set gamehost g.host = gameHost logging.debug("Updated games:") gamedb.listGames() except struct.error: logging.warning("Host quit unexpectedly %s" % gameHost ) except KeyError: logging.warning("Communication error with %s" % gameHost ) finally: if g: gamedb.removeGame(g) # Get a game list. elif netCommand == 'list': # Lock the gamelist to prevent new games while output. with gamedblock: gamesCount = len(gamedb.getGames()) logging.debug("Gameserver list: %i game(s)" % (gamesCount)) # Transmit the length of the following list as unsigned integer (in network byte-order: big-endian). count = struct.pack('!I', gamesCount) self.wfile.write(count) # Transmit the single games. for game in gamedb.getGames(): logging.debug(" %s" % game) self.wfile.write(game.getData()) # If something unknown apperas. else: raise Exception("Recieved a unknown command: %s" % netCommand)
c7824914e0e95188a72a6032aab60ba26a5ad845 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13981/c7824914e0e95188a72a6032aab60ba26a5ad845/wzmasterserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 4672, 468, 1004, 1758, 7920, 2594, 273, 365, 18, 2625, 67, 2867, 63, 20, 65, 225, 468, 2720, 326, 6935, 1296, 18, 2901, 2189, 273, 365, 18, 86, 768, 18, 896, 12, 24, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 468, 1004, 1758, 7920, 2594, 273, 365, 18, 2625, 67, 2867, 63, 20, 65, 225, 468, 2720, 326, 6935, 1296, 18, 2901, 2189, 273, 365, 18, 86, 768, 18, 896, 12, 24, ...
return dict(resulttype='mirrorlist', returncode=200, results=[], message='
return return_error(kwargs, message='
def do_mirrorlist(kwargs): global debug global logfile if not (kwargs.has_key('repo') and kwargs.has_key('arch')) and not kwargs.has_key('path'): return dict(resulttype='mirrorlist', returncode=200, results=[], message='# either path=, or repo= and arch= must be specified') file = None cache = None pathIsDirectory = False if kwargs.has_key('path'): path = kwargs['path'].strip('/') # Strip duplicate "//" from the path path = path.replace('//', '/') header = "# path = %s " % (path) sdir = path.split('/') try: # path was to a directory cache = mirrorlist_cache['/'.join(sdir)] pathIsDirectory=True except KeyError: # path was to a file, try its directory file = sdir[-1] sdir = sdir[:-1] try: cache = mirrorlist_cache['/'.join(sdir)] except KeyError: return dict(resulttype='mirrorlist', returncode=200, results=[], message=header + 'error: invalid path') dir = '/'.join(sdir) else: if u'source' in kwargs['repo']: kwargs['arch'] = u'source' repo = repo_redirect.get(kwargs['repo'], kwargs['repo']) arch = kwargs['arch'] header = "# repo = %s arch = %s " % (repo, arch) if repo in disabled_repositories: return dict(resulttype='mirrorlist', returncode=200, results=[], message=header + 'repo disabled') try: dir = repo_arch_to_directoryname[(repo, arch)] if 'metalink' in kwargs and kwargs['metalink']: dir += '/repodata' file = 'repomd.xml' else: pathIsDirectory=True cache = mirrorlist_cache[dir] except KeyError: repos = repo_arch_to_directoryname.keys() repos.sort() repo_information = header + "error: invalid repo or arch\n" repo_information += "# following repositories are available:\n" for i in repos: if i[0] is not None and i[1] is not None: repo_information += "# repo=%s, arch=%s\n" % i return dict(resulttype='mirrorlist', returncode=200, results=[], message=repo_information) ordered_mirrorlist = cache.get('ordered_mirrorlist', default_ordered_mirrorlist) done = 0 netblock_results = set() internet2_results = set() country_results = set() geoip_results = set() continent_results = set() global_results = set() requested_countries = [] if kwargs.has_key('country'): requested_countries = uniqueify([c.upper() for c in kwargs['country'].split(',') ]) # if they specify a country, don't use netblocks if not 'country' in kwargs: header, netblock_results = do_netblocks(kwargs, cache, header) if len(netblock_results) > 0: if not ordered_mirrorlist: done=1 client_ip = kwargs['client_ip'] clientCountry = gi.country_code_by_addr(client_ip) if clientCountry is None: print_client_country = "N/A" else: print_client_country = clientCountry if debug: if kwargs.has_key('repo') and kwargs.has_key('arch'): print ("IP: " + client_ip + "; DATE: " + time.strftime("%Y-%m-%d") + "; COUNTRY: " + print_client_country + "; REPO: " + kwargs['repo'] + "; ARCH: " + kwargs['arch']) if logfile is not None: if kwargs.has_key('repo') and kwargs.has_key('arch'): logfile.write("IP: " + client_ip + "; DATE: " + time.strftime("%Y-%m-%d") + "; COUNTRY: " + print_client_country + "; REPO: " + kwargs['repo'] + "; ARCH: " + kwargs['arch'] + "\n") logfile.flush() if not done: header, internet2_results = do_internet2(kwargs, cache, clientCountry, header) if len(internet2_results) + len(netblock_results) >= 3: if not ordered_mirrorlist: done = 1 if not done and 'country' in kwargs: header, country_results = do_country(kwargs, cache, clientCountry, requested_countries, header) if len(country_results) == 0: header, continent_results = do_continent(kwargs, cache, clientCountry, requested_countries, header) done = 1 if not done: header, geoip_results = do_geoip(kwargs, cache, clientCountry, header) if len(geoip_results) >= 3: if not ordered_mirrorlist: done = 1 if not done: header, continent_results = do_continent(kwargs, cache, clientCountry, [], header) if len(geoip_results) + len(continent_results) >= 3: done = 1 if not done: header, global_results = do_global(kwargs, cache, clientCountry, header) def _random_shuffle(s): l = list(s) random.shuffle(l) return l netblock_hosts = _random_shuffle(netblock_results) internet2_hosts = _random_shuffle(internet2_results) country_hosts = shuffle(country_results) geoip_hosts = shuffle(geoip_results) continent_hosts = shuffle(continent_results) global_hosts = shuffle(global_results) allhosts = uniqueify(netblock_hosts + internet2_hosts + country_hosts + geoip_hosts + continent_hosts + global_hosts) hosts_and_urls = append_path(allhosts, cache, file, pathIsDirectory=pathIsDirectory) if 'metalink' in kwargs and kwargs['metalink']: (resulttype, returncode, results)=metalink(dir, file, hosts_and_urls) d = dict(message=None, resulttype=resulttype, returncode=returncode, results=results) return d else: host_url_list = trim_to_preferred_protocols(hosts_and_urls) d = dict(message=header, resulttype='mirrorlist', returncode=200, results=host_url_list) return d
2f698c8027b88597bbdef9712dee43e6e9d48e18 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13031/2f698c8027b88597bbdef9712dee43e6e9d48e18/mirrorlist_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 27197, 1098, 12, 4333, 4672, 2552, 1198, 2552, 15204, 225, 309, 486, 261, 4333, 18, 5332, 67, 856, 2668, 7422, 6134, 471, 1205, 18, 5332, 67, 856, 2668, 991, 26112, 471, 486, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 27197, 1098, 12, 4333, 4672, 2552, 1198, 2552, 15204, 225, 309, 486, 261, 4333, 18, 5332, 67, 856, 2668, 7422, 6134, 471, 1205, 18, 5332, 67, 856, 2668, 991, 26112, 471, 486, ...
if not remaining or remaining[0] != 'Got:':
if not remaining or remaining[0] not in ('Got:', 'Got nothing'):
def colorize_zope_doctest_output(lines): """Colorize output formatted by the doctest engine included with Zope 3. Returns a new sequence of colored strings. `lines` is a sequence of strings. The typical structure of the doctest output looks either like this: File "...", line 123, in foo.bar.baz.doctest_quux Failed example: f(2, 3) Expected: 6 Got: 5 Or, if an exception has occured, like this: File "...", line 123, in foo.bar.baz.doctest_quux Failed example: f(2, 3) Exception raised: Traceback (most recent call last): File "...", line 123, in __init__ self.do_something(a, b, c) File "...", line ... ... FooError: something bad happened If some assumption made by this function is not met, the original sequence is returned without any modifications. """ header = lines[0] if not header.startswith('File "'): return lines # not a doctest failure report? # Dissect the header in a rather nasty way. header = header[len('File "'):] fn_end = header.find('"') if fn_end == -1: return lines filename = header[:fn_end] header = header[fn_end+len('", line '):] parts = header.split(', in ') if len(parts) != 2: return lines lineno, testname = parts filename = colorize('filename', filename) lineno = colorize('lineno', lineno) testname = colorize('testname', testname) result = ['File "%s", line %s, in %s' % (filename, lineno, testname)] # Colorize the 'Failed example:' section. if lines[1] != 'Failed example:': return lines result.append(colorize('doctest_title', lines[1])) remaining = lines[2:] # XXX It can say 'Expected nothing' too. while remaining and remaining[0] not in ('Expected:', 'Exception raised:'): line = remaining.pop(0) result.append(colorize('doctest_code', line)) if not remaining: return lines if remaining[0] == 'Expected:': result.append(colorize('doctest_title', remaining.pop(0))) # Expected: while remaining and remaining[0] != 'Got:': line = remaining.pop(0) result.append(colorize('doctest_expected', line)) if not remaining or remaining[0] != 'Got:': return lines result.append(colorize('doctest_title', remaining.pop(0))) # Got: while remaining: line = remaining.pop(0) result.append(colorize('doctest_got', line)) elif remaining[0] == 'Exception raised:': result.append(colorize('doctest_title', remaining.pop(0))) # E. raised: while remaining: line = remaining.pop(0) # TODO: Scrape and colorize the traceback. result.append(colorize('doctest_got', line)) else: return lines return result
bac1bef133ecddf6647cd477c316f13d402f89b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/bac1bef133ecddf6647cd477c316f13d402f89b4/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21077, 67, 94, 1306, 67, 2896, 299, 395, 67, 2844, 12, 3548, 4672, 3536, 2957, 554, 876, 4955, 635, 326, 31263, 395, 4073, 5849, 598, 2285, 1306, 890, 18, 225, 2860, 279, 394, 3102, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21077, 67, 94, 1306, 67, 2896, 299, 395, 67, 2844, 12, 3548, 4672, 3536, 2957, 554, 876, 4955, 635, 326, 31263, 395, 4073, 5849, 598, 2285, 1306, 890, 18, 225, 2860, 279, 394, 3102, 43...
try: import win32api import win32con except ImportError:
if not _can_read_reg:
def get_devstudio_versions (): """Get list of devstudio versions from the Windows registry. Return a list of strings containing version numbers; the list will be empty if we were unable to access the registry (eg. couldn't import a registry-access module) or the appropriate registry keys weren't found.""" try: import win32api import win32con except ImportError: return [] K = 'Software\\Microsoft\\Devstudio' L = [] for base in (win32con.HKEY_CLASSES_ROOT, win32con.HKEY_LOCAL_MACHINE, win32con.HKEY_CURRENT_USER, win32con.HKEY_USERS): try: k = win32api.RegOpenKeyEx(base,K) i = 0 while 1: try: p = win32api.RegEnumKey(k,i) if p[0] in '123456789' and p not in L: L.append(p) except win32api.error: break i = i + 1 except win32api.error: pass L.sort() L.reverse() return L
a0766842dc884fd9bbc88b65569925b6f87abaa3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a0766842dc884fd9bbc88b65569925b6f87abaa3/msvccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 5206, 334, 4484, 67, 10169, 1832, 30, 3536, 967, 666, 434, 4461, 334, 4484, 5244, 628, 326, 8202, 4023, 18, 225, 2000, 279, 666, 434, 2064, 4191, 1177, 5600, 31, 326, 666, 903...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 5206, 334, 4484, 67, 10169, 1832, 30, 3536, 967, 666, 434, 4461, 334, 4484, 5244, 628, 326, 8202, 4023, 18, 225, 2000, 279, 666, 434, 2064, 4191, 1177, 5600, 31, 326, 666, 903...
procCP = se_utils.se_copy(os.path.join(pathSE, name_dest), outFilePath) if procCP.wait() != 0:
myGetSize = lambda x: "(%7s)" % gcSupport.prettySize(os.path.getsize(x.replace('file://', ''))) def monitorFile(path, lock): while not lock.acquire(False): try: print "\r\t", name_dest, myGetSize(path), sys.stdout.flush() except: pass time.sleep(1) lock.release() monitorLock = threading.Lock() monitorLock.acquire() monitor = threading.Thread(target = monitorFile, args = (checkPath, monitorLock)) monitor.start() try: procCP = se_utils.se_copy(os.path.join(pathSE, name_dest), outFilePath, tmp = checkPath) result = procCP.wait() finally: monitorLock.release() monitor.join() if result != 0:
def processSingleJob(jobNum): print "Job %d:" % jobNum,
45e0a8366ef09ad2b9900eb80d335aaa03af6bdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/45e0a8366ef09ad2b9900eb80d335aaa03af6bdc/downloadFromSE.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 5281, 2278, 12, 4688, 2578, 4672, 1172, 315, 2278, 738, 72, 2773, 738, 1719, 2578, 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 5281, 2278, 12, 4688, 2578, 4672, 1172, 315, 2278, 738, 72, 2773, 738, 1719, 2578, 16, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if polar != None: (a_descr,e_descr) = hlr_utils.get_descr(polar)
if polar is not None: a_descr = hlr_utils.get_descr(polar)
def tof_to_d_spacing(obj,**kwargs): # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) if o_descr == "number" or o_descr == "list": raise RuntimeError, "Must provide a SOM of a SO to the function." # Go on else: pass # Setup keyword arguments try: polar = kwargs["polar"] except KeyError: polar = None try: pathlength = kwargs["pathlength"] except KeyError: pathlength = None try: units = kwargs["units"] except KeyError: units = "microseconds" # 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, "d-spacing") result.setYUnits("Counts/A") result.setYLabel("Intensity") else: pass if pathlength == None or polar == 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 pathlength == None and polar == None: raise RuntimeError, "If no SOM is provided, then pathlength "\ +"and polar angle information must be provided" elif pathlength == None: raise RuntimeError, "If no SOM is provided, then pathlength "\ +"information must be provided" elif polar == None: raise RuntimeError, "If no SOM is provided, then polar angle "\ +"information must be provided" else: pass if pathlength != None: (p_descr,e_descr) = hlr_utils.get_descr(pathlength) if polar != None: (a_descr,e_descr) = hlr_utils.get_descr(polar) # iterate through the values import axis_manip import math 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 pathlength == None: (pl,pl_err2) = hlr_utils.get_parameter("total",map_so,inst) else: pl = hlr_utils.get_value(pathlength,i,p_descr) pl_err2 = hlr_utils.get_err2(pathlength,i,p_descr) value=axis_manip.tof_to_wavelength(val, err2, pl, pl_err2) if polar == None: (angle,angle_err2) = hlr_utils.get_parameter("polar",map_so,inst) else: angle = hlr_utils.get_value(polar,i,p_descr) angle_err2 = hlr_utils.get_err2(polar,i,p_descr) count = 0 for v,e2 in map(None, value[0], value[1]): term1 = 1.0 / (2.0 * math.sin(angle/2.0)) term2 = 1.0 / (2.0 * math.tan(angle/2.0)) value[0][count] = v * term1 v2 = value[0][count] * value[0][count] value[1][count] = term1*term1*e2 + v2*term2*term2*angle_err2 count += 1 hlr_utils.result_insert(result,res_descr,value,map_so,"x",axis) return result
8dcf8af8c74e3673ec736b87e019766d76714d13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/8dcf8af8c74e3673ec736b87e019766d76714d13/hlr_tof_to_d_spacing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 74, 67, 869, 67, 72, 67, 14080, 12, 2603, 16, 636, 4333, 4672, 225, 468, 1930, 326, 4222, 4186, 1930, 366, 10826, 67, 5471, 225, 468, 444, 731, 364, 5960, 3059, 501, 261, 2088, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 72, 67, 14080, 12, 2603, 16, 636, 4333, 4672, 225, 468, 1930, 326, 4222, 4186, 1930, 366, 10826, 67, 5471, 225, 468, 444, 731, 364, 5960, 3059, 501, 261, 2088, ...
class TestStart(EnumerateTestCase): enum = lambda i: enumerate(i, start=11) seq, res = 'abc', [(1, 'a'), (2, 'b'), (3, 'c')] class TestLongStart(EnumerateTestCase): enum = lambda i: enumerate(i, start=sys.maxint+1)
class EnumerateStartTestCase(EnumerateTestCase): def test_basicfunction(self): e = self.enum(self.seq) self.assertEqual(iter(e), e) self.assertEqual(list(self.enum(self.seq)), self.res) class TestStart(EnumerateStartTestCase): enum = lambda self, i: enumerate(i, start=11) seq, res = 'abc', [(11, 'a'), (12, 'b'), (13, 'c')] class TestLongStart(EnumerateStartTestCase): enum = lambda self, i: enumerate(i, start=sys.maxint+1)
def f(): pass
4cbee82e5add66358d6ea20802ef2796a602187c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/4cbee82e5add66358d6ea20802ef2796a602187c/test_enumerate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 13332, 1342, 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, 0, ...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 13332, 1342, 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, -100, ...
for term,item in self.by_twos(node):
for entry in node: terms = [] description = '' for item in entry: if item.tag.endswith( 'term' ): value = "".join( [x.text.strip() for x in item.iterdescendants() if x.text] ) terms.append(value) else: description = item set.append( VariableRef(terms,description)) self.varrefs.extend( set )
def process_variablelist( self, node ): """Process a variable list into annotations""" set = [] for term,item in self.by_twos(node):
9416b3067be8e9ced457297dd4a3aef6d1612b0f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1545/9416b3067be8e9ced457297dd4a3aef6d1612b0f/spike.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 4093, 9237, 5449, 12, 365, 16, 756, 262, 30, 3536, 2227, 279, 2190, 666, 1368, 5617, 8395, 444, 273, 5378, 364, 2481, 16, 1726, 316, 365, 18, 1637, 67, 11246, 538, 12, 2159, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 4093, 9237, 5449, 12, 365, 16, 756, 262, 30, 3536, 2227, 279, 2190, 666, 1368, 5617, 8395, 444, 273, 5378, 364, 2481, 16, 1726, 316, 365, 18, 1637, 67, 11246, 538, 12, 2159, ...
else: self.respond("550 No such directory.")
os.chdir(old_dir)
def ftp_CWD(self, line): if not line: line = '/' if self.fs.chdir(line): self.log('OK CWD "%s"' %self.fs.cwd) self.respond('250 "%s" is the current directory.' %self.fs.cwd) else: self.respond("550 No such directory.")
c9b8903e72d3357d1308af9cb7394f14ea28a0cc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/c9b8903e72d3357d1308af9cb7394f14ea28a0cc/FTPServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 12844, 40, 12, 2890, 16, 980, 4672, 309, 486, 980, 30, 980, 273, 2023, 309, 365, 18, 2556, 18, 343, 1214, 12, 1369, 4672, 365, 18, 1330, 2668, 3141, 385, 16006, 2213, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 12844, 40, 12, 2890, 16, 980, 4672, 309, 486, 980, 30, 980, 273, 2023, 309, 365, 18, 2556, 18, 343, 1214, 12, 1369, 4672, 365, 18, 1330, 2668, 3141, 385, 16006, 2213, 87, ...
def _get_caldav_schedule_outbox_URL(self, cr): return self._get_caldav_schedule_inbox_URL(cr)
def _get_caldav_schedule_outbox_URL(self, cr): return self._get_caldav_schedule_inbox_URL(cr)
e067fa17a8ef9c2c74072f59edea4f78e688ae35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e067fa17a8ef9c2c74072f59edea4f78e688ae35/caldav_node.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 771, 20752, 67, 10676, 67, 659, 2147, 67, 1785, 12, 2890, 16, 4422, 4672, 327, 365, 6315, 588, 67, 771, 20752, 67, 10676, 67, 267, 2147, 67, 1785, 12, 3353, 13, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 771, 20752, 67, 10676, 67, 659, 2147, 67, 1785, 12, 2890, 16, 4422, 4672, 327, 365, 6315, 588, 67, 771, 20752, 67, 10676, 67, 267, 2147, 67, 1785, 12, 3353, 13, 2, -100...
if defineMacro: self.pushProgram() self.emit("version", TAL_VERSION) self.emit("mode", self.xml and "xml" or "html") todo["defineMacro"] = defineMacro if useMacro: self.pushSlots() self.pushProgram() todo["useMacro"] = useMacro if fillSlot: self.pushProgram() todo["fillSlot"] = fillSlot if defineSlot: self.pushProgram() todo["defineSlot"] = defineSlot
if self.inMacroUse: if fillSlot: self.pushProgram() todo["fillSlot"] = fillSlot self.inMacroUse = 0 else: if fillSlot: raise METALError, ("fill-slot must be within a use-macro", position) if not self.inMacroUse: if defineMacro: self.pushProgram() self.emit("version", TAL_VERSION) self.emit("mode", self.xml and "xml" or "html") todo["defineMacro"] = defineMacro self.inMacroDef = self.inMacroDef + 1 if useMacro: self.pushSlots() self.pushProgram() todo["useMacro"] = useMacro self.inMacroUse = 1 if defineSlot: if not self.inMacroDef: raise METALError, ( "define-slot must be within a define-macro", position) self.pushProgram() todo["defineSlot"] = defineSlot
def emitStartElement(self, name, attrlist, taldict, metaldict, position=(None, None), isend=0): if not taldict and not metaldict: # Handle the simple, common case self.emitStartTag(name, attrlist, isend) self.todoPush({}) if isend: self.emitEndElement(name, isend) return
113b82e2a8d18d92cff675a824f8651f6cef4dba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/113b82e2a8d18d92cff675a824f8651f6cef4dba/TALGenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3626, 1685, 1046, 12, 2890, 16, 508, 16, 1604, 1098, 16, 268, 287, 1576, 16, 5100, 287, 1576, 16, 1754, 28657, 7036, 16, 599, 3631, 353, 409, 33, 20, 4672, 309, 486, 268, 287, 1576, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3626, 1685, 1046, 12, 2890, 16, 508, 16, 1604, 1098, 16, 268, 287, 1576, 16, 5100, 287, 1576, 16, 1754, 28657, 7036, 16, 599, 3631, 353, 409, 33, 20, 4672, 309, 486, 268, 287, 1576, ...
x = np.array([np.nan + 1j * np.inf], dtype=np.complex)
x = np.array([complex(np.nan, np.inf)], dtype=np.complex)
def test_special_values(self): xl = [] yl = []
c60575349b5810b393eb3092a591ac429325074c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/c60575349b5810b393eb3092a591ac429325074c/test_umath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9371, 67, 2372, 12, 2890, 4672, 15643, 273, 5378, 677, 80, 273, 5378, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9371, 67, 2372, 12, 2890, 4672, 15643, 273, 5378, 677, 80, 273, 5378, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
return self._MPolynomial__element.dict()!={}
return self._MPolynomial_element__element.dict()!={}
def __nonzero__(self): """ Returns True if self != 0
9563aa05d4b48c3206bf432cbd4fd11de9e678fd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9563aa05d4b48c3206bf432cbd4fd11de9e678fd/multi_polynomial_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 26449, 972, 12, 2890, 4672, 3536, 2860, 1053, 309, 365, 480, 374, 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, 1001, 26449, 972, 12, 2890, 4672, 3536, 2860, 1053, 309, 365, 480, 374, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
return ((self.x + 1) * self.width, self.y * self.height + self.height // 2)
return ((self.i + 1) * self.width, self.j * self.height + self.height // 2)
def get_midright(self): return ((self.x + 1) * self.width, self.y * self.height + self.height // 2)
ae46287e32a1e7a487f4f47ee34d687ee3d6604c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7473/ae46287e32a1e7a487f4f47ee34d687ee3d6604c/tiles.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 13138, 4083, 12, 2890, 4672, 327, 14015, 2890, 18, 92, 397, 404, 13, 380, 365, 18, 2819, 16, 365, 18, 93, 380, 365, 18, 4210, 397, 365, 18, 4210, 368, 576, 13, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 336, 67, 13138, 4083, 12, 2890, 4672, 327, 14015, 2890, 18, 92, 397, 404, 13, 380, 365, 18, 2819, 16, 365, 18, 93, 380, 365, 18, 4210, 397, 365, 18, 4210, 368, 576, 13, 2, -100, -1...
verify((a - 0).__class__ is complex)
veris((a - 0).__class__, complex)
def __repr__(self): return "%.17gj%+.17g" % (self.imag, self.real)
b1b7e702cae6f65e6d146f8881c14f933fe52efd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b1b7e702cae6f65e6d146f8881c14f933fe52efd/test_descr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 26209, 4033, 75, 78, 9, 15, 18, 4033, 75, 6, 738, 261, 2890, 18, 15374, 16, 365, 18, 7688, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12715, 972, 12, 2890, 4672, 327, 26209, 4033, 75, 78, 9, 15, 18, 4033, 75, 6, 738, 261, 2890, 18, 15374, 16, 365, 18, 7688, 13, 2, -100, -100, -100, -100, -100, -100, -100, -10...
return cmd in ('diff1', 'qimport', 'qnew', 'qpush', 'qrefresh', 'record', 'qrecord')
return cmd in ('diff1', 'record', 'qfold', 'qimport', 'qnew', 'qpush', 'qrefresh', 'qrecord')
def _kwrestrict(cmd): '''Returns True if cmd should trigger restricted expansion. Keywords will only expanded when writing to working dir. Crucial for mq as expanded keywords should not make it into patches.''' return cmd in ('diff1', 'qimport', 'qnew', 'qpush', 'qrefresh', 'record', 'qrecord')
3df9c59ccf20d02b0c3cc8bd6b110e4be0fced8b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/3df9c59ccf20d02b0c3cc8bd6b110e4be0fced8b/keyword.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9987, 30604, 12, 4172, 4672, 9163, 1356, 1053, 309, 1797, 1410, 3080, 15693, 17965, 18, 1929, 3753, 903, 1338, 8406, 1347, 7410, 358, 5960, 1577, 18, 14998, 5286, 649, 364, 18327, 487...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9987, 30604, 12, 4172, 4672, 9163, 1356, 1053, 309, 1797, 1410, 3080, 15693, 17965, 18, 1929, 3753, 903, 1338, 8406, 1347, 7410, 358, 5960, 1577, 18, 14998, 5286, 649, 364, 18327, 487...
"""todo"""
"""Set the x array of values"""
def set_x(self, value): """todo""" self.abs = value
bf0b96db5a2c0572c20b1a46244a6b61f65ce204 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4914/bf0b96db5a2c0572c20b1a46244a6b61f65ce204/plotable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 92, 12, 2890, 16, 460, 4672, 3536, 694, 326, 619, 526, 434, 924, 8395, 365, 18, 5113, 273, 460, 225, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 92, 12, 2890, 16, 460, 4672, 3536, 694, 326, 619, 526, 434, 924, 8395, 365, 18, 5113, 273, 460, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if attr in self.__dict__: return self.__dict__[attr] return getattr(self.wsgi_response, attr)
if not attr.startswith('_'): return getattr(self.wsgi_response, attr) else: raise AttributeError(attr)
def __getattr__(self, attr): if attr in self.__dict__: return self.__dict__[attr] return getattr(self.wsgi_response, attr)
8deae17a7d2532c49190e5fe4f10998026c16c2b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12287/8deae17a7d2532c49190e5fe4f10998026c16c2b/exc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 12, 2890, 16, 1604, 4672, 309, 1604, 316, 365, 16186, 1576, 972, 30, 327, 365, 16186, 1576, 972, 63, 1747, 65, 327, 3869, 12, 2890, 18, 28539, 67, 2740, 16, 1604,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 12, 2890, 16, 1604, 4672, 309, 1604, 316, 365, 16186, 1576, 972, 30, 327, 365, 16186, 1576, 972, 63, 1747, 65, 327, 3869, 12, 2890, 18, 28539, 67, 2740, 16, 1604,...
self.generateImpliedEndTags()
self.generateImpliedEndTags(exclude)
def generateImpliedEndTags(self, exclude=None): name = self.openElements[-1].name if (name in frozenset(("dd", "dt", "li", "p", "td", "th", "tr")) and name != exclude): self.phase.processEndTag(name) self.generateImpliedEndTags()
3b3fb2ac5b0657a14c838c0f63502cfd168f2021 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/3b3fb2ac5b0657a14c838c0f63502cfd168f2021/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 2828, 2092, 1638, 3453, 12, 2890, 16, 4433, 33, 7036, 4672, 508, 273, 365, 18, 3190, 3471, 18919, 21, 8009, 529, 309, 261, 529, 316, 23462, 12, 2932, 449, 3113, 315, 7510, 3113, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 2828, 2092, 1638, 3453, 12, 2890, 16, 4433, 33, 7036, 4672, 508, 273, 365, 18, 3190, 3471, 18919, 21, 8009, 529, 309, 261, 529, 316, 23462, 12, 2932, 449, 3113, 315, 7510, 3113, ...
build_frame_kebab(z)
build_z_kebab(z)
def main(argv): global x, y, z, feedrate, nutHeight, washerHeight, rodSize, blockSize, useThreadLocker, useNutStarter, useWashers try: opts, args = getopt.getopt(argv, "h", ["help", "x=", "y=", "z=", "feedrate=", "nut-height=", "washer-height=", "rod-size=", "block-size=", "use-thread-locker", "use-nut-starter", "no-washers"]) except getopt.GetoptError: usage() sys.exit(2) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() elif opt == "--x": x = float(arg) elif opt == "--y": y = float(arg) elif opt == "--z": z = float(arg) elif opt == "--feedrate": feedrate = float(arg) elif opt == "--nut-height": nutHeight = float(arg) elif opt == "--washer-height": washerHeight = float(arg) elif opt == "--block-size": blockSize = float(arg) elif opt == "--rod-size": rodSize = float(arg) elif opt == "--use-thread-locker": useThreadLocker = True elif opt == "--use-nut-starter": useNutStarter = True elif opt == "--no-washers": useWashers = False else: print "(Huh? %s:%s)" % (opt,arg) bot = CartesianFrame(x, y, z) xRods = 4 yRods = 4 zRods = 4 xyRods = 2 xzRods = 4 yzRods = 4 totalRods = xRods + yRods + zRods + xyRods + xzRods + yzRods nutsPerKebab = 4 totalNuts = totalRods * nutsPerKebab if useWashers: washersPerKebab = 4 totalWashers = totalRods * washersPerKebab else: washersPerKebab = 0 totalWashers = 0 print "(Generated by make_bot.py)" print "(Required Rod Lengths:)" print "( X Rods: 4 * %6.2fmm)" % (x) print "( Y Rods: 4 * %6.2fmm)" % (y) print "( Z Rods: 4 * %6.2fmm)" % (z) print "(XZ Rods: 4 * %6.2fmm)" % (bot.getXZ()) print "(YZ Rods: 4 * %6.2fmm)" % (bot.getYZ()) print "(XY Rods: 2 * %6.2fmm)" % (bot.getXY()) print "(Total Volume: %6.2fm^3)" % (bot.getVolume()) print "(Total kebabs: %d)" % (totalRods) print "(Total nuts required: %d)" % (totalNuts) print "(Total washers required: %d)" % (totalWashers) #TODO: print the total number of whole rods required. print "(GCODE STARTS BELOW)" print "G90 (Absolute Mode)" print "G21 (Metric Units)" print "M00 (Starting X kebabs)" for i in range(0, xRods): build_frame_kebab(x) print "M00 (Starting Y kebabs)" for i in range(0, yRods): build_frame_kebab(y) print "M00 (Starting Z kebabs)" for i in range(0, zRods): build_frame_kebab(z) print "M00 (Starting XY kebabs)" for i in range(0, xyRods): build_diagonal_kebab(bot.getXY()) print "M00 (Starting XZ kebabs)" for i in range(0, xzRods): build_diagonal_kebab(bot.getXZ()) print "M00 (Starting YZ kebabs)" for i in range(0, yzRods): build_diagonal_kebab(bot.getYZ())
74fb04ff2e7d3c298179074e45420a96021f9c99 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/479/74fb04ff2e7d3c298179074e45420a96021f9c99/make_bot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 225, 2552, 619, 16, 677, 16, 998, 16, 4746, 5141, 16, 290, 322, 2686, 16, 341, 961, 264, 2686, 16, 721, 72, 1225, 16, 13766, 16, 999, 3830, 2531, 264, 16, 999,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19485, 4672, 225, 2552, 619, 16, 677, 16, 998, 16, 4746, 5141, 16, 290, 322, 2686, 16, 341, 961, 264, 2686, 16, 721, 72, 1225, 16, 13766, 16, 999, 3830, 2531, 264, 16, 999,...
positionLayout.addWidget(self.increasePositionButton)
positionLayout.addWidget(self.helixIncreasePositionButton)
def setupHelixTab(self): #These go in the Helix tab self.modifyRadioButton = QtGui.QRadioButton(self.tr('Modify')) self.newRadioButtion = QtGui.QRadioButton(self.tr('New')) NterminusLabel = QtGui.QLabel('N term') self.NtermResNameLabel = QtGui.QLabel('?') self.NtermSpinBox = QtGui.QSpinBox() self.NtermSpinBox.setRange(1, 10000) CterminusLabel = QtGui.QLabel('C term') self.CtermResNameLabel = QtGui.QLabel('?') self.CtermSpinBox = QtGui.QSpinBox() self.CtermSpinBox.setRange(1, 10000) self.decreasePositionButton = QtGui.QPushButton('-') self.decreasePositionButton.setMaximumWidth(30) positionLabel = QtGui.QLabel(self.tr('Position')) self.increasePositionButton = QtGui.QPushButton('+') self.increasePositionButton.setMaximumWidth(30) self.createCAHelixButton = QtGui.QPushButton(self.tr('Create C-alpha Helix')) self.removeButton = QtGui.QPushButton(self.tr('Remove')) self.flipButton = QtGui.QPushButton(self.tr('Flip')) radioLayout = QtGui.QHBoxLayout() radioLayout.addWidget(self.modifyRadioButton) radioLayout.addWidget(self.newRadioButtion) radioLayout.addStretch() NtermLayout = QtGui.QHBoxLayout() NtermLayout.addWidget(NterminusLabel) NtermLayout.addWidget(self.NtermResNameLabel) NtermLayout.addWidget(self.NtermSpinBox) NtermLayout.addStretch() CtermLayout = QtGui.QHBoxLayout() CtermLayout.addWidget(CterminusLabel) CtermLayout.addWidget(self.CtermResNameLabel) CtermLayout.addWidget(self.CtermSpinBox) CtermLayout.addStretch() positionLayout = QtGui.QHBoxLayout() positionLayout.addWidget(self.decreasePositionButton) positionLayout.addWidget(positionLabel) positionLayout.addWidget(self.increasePositionButton) positionLayout.addStretch() createLayout = QtGui.QHBoxLayout() createLayout.addWidget(self.createCAHelixButton) createLayout.addStretch() removeLayout = QtGui.QHBoxLayout() removeLayout.addWidget(self.removeButton) removeLayout.addStretch() flipLayout = QtGui.QHBoxLayout() flipLayout.addWidget(self.flipButton) flipLayout.addStretch() helixLayout = QtGui.QVBoxLayout() helixLayout.addLayout(radioLayout) helixLayout.addLayout(NtermLayout) helixLayout.addLayout(CtermLayout) helixLayout.addLayout(positionLayout) helixLayout.addLayout(createLayout) helixLayout.addLayout(removeLayout) helixLayout.addLayout(flipLayout) self.helixTab.setLayout(helixLayout)
e8ef4efb1ee70bddc3bc00074e7599d9adb9bfb9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4399/e8ef4efb1ee70bddc3bc00074e7599d9adb9bfb9/structure_editor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 44, 26342, 5661, 12, 2890, 4672, 468, 29690, 1960, 316, 326, 670, 26342, 3246, 365, 18, 17042, 19984, 3616, 273, 23425, 18, 53, 19984, 3616, 12, 2890, 18, 313, 2668, 11047, 26112, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 44, 26342, 5661, 12, 2890, 4672, 468, 29690, 1960, 316, 326, 670, 26342, 3246, 365, 18, 17042, 19984, 3616, 273, 23425, 18, 53, 19984, 3616, 12, 2890, 18, 313, 2668, 11047, 26112, ...
if isinstance(vval, UID): try: vval = `vval.object()` except: vval = None if vval is not None: vval += ' '*(60-len(vval)) if len(vval) > 300: vval = vval[:297]+'...' vval = re.sub('('+'.'*60+')', r'\1\n', vval) vval = re.sub('&', '&amp;', vval) vval = re.sub('<', '&lt;', vval) vval = re.sub('>', '&gt;', vval) vval = re.sub(' ', '&nbsp;', vval) vval = re.sub(r'\n', '\n', vval) str += ' <dt><b>Value:</b></dt>\n' str += ' <dd><table><tr><td>\n' str += '<pre class="variable">%s</pre>\n' % vval str += ' </td></tr></table></dd>\n' if vtyp is not None or vval is not None:
str += self._pprint_var_value(var) if vtyp is not None or hasval:
def _var_details(self, variables, container, heading='Variable Details'): """ @return: The HTML code for a variable details table. This is used by L{_module_to_html} to describe the variables in a module; and by L{_class_to_html} to describe instance variables and class variables. @rtype: C{string} """ variables = self._sort(variables) if len(variables) == 0: return '' str = self._table_header(heading, 'details')+'</table>'
7e1af2abc702612461ceeb001b4b551d49cb71d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/7e1af2abc702612461ceeb001b4b551d49cb71d3/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1401, 67, 6395, 12, 2890, 16, 3152, 16, 1478, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 632, 2463, 30, 1021, 3982, 981, 364, 279, 2190, 3189, 1014, 18, 225, 1220, 353, 1399, 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, 1401, 67, 6395, 12, 2890, 16, 3152, 16, 1478, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 632, 2463, 30, 1021, 3982, 981, 364, 279, 2190, 3189, 1014, 18, 225, 1220, 353, 1399, 6...
if timeleft < minTime: self.logging.info('Your server credential will expire in:\n\t%s hours %s minutes %s seconds\n'%(hours,minutes,seconds)) valid = False
def checkMyProxy( self , proxy=None, Time=4, checkRetrieverRenewer=False): """ """ if proxy == None: proxy=self.getUserProxy() ## check the myproxy server valid = True
7f79a39c711ac7638d40d48c8cf2f82c738e6a89 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8886/7f79a39c711ac7638d40d48c8cf2f82c738e6a89/Proxy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12062, 3886, 12, 365, 269, 2889, 33, 7036, 16, 2647, 33, 24, 16, 866, 30801, 24058, 264, 33, 8381, 4672, 3536, 3536, 309, 2889, 422, 599, 30, 2889, 33, 2890, 18, 588, 1299, 3886, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 866, 12062, 3886, 12, 365, 269, 2889, 33, 7036, 16, 2647, 33, 24, 16, 866, 30801, 24058, 264, 33, 8381, 4672, 3536, 3536, 309, 2889, 422, 599, 30, 2889, 33, 2890, 18, 588, 1299, 3886, ...
return self def __call__(self, *args): return self.impl(*args)
return self.impl.__get__(obj, owner)
def __get__(self, obj, owner): record.append(1) return self
91144c269f133033f9f578884ea2a351db6125ec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/91144c269f133033f9f578884ea2a351db6125ec/test_descr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 972, 12, 2890, 16, 1081, 16, 3410, 4672, 1409, 18, 6923, 12, 21, 13, 327, 365, 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, 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, 1001, 588, 972, 12, 2890, 16, 1081, 16, 3410, 4672, 1409, 18, 6923, 12, 21, 13, 327, 365, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
self.workingDirectory = self.am_getOption('WorkingDirectory', os.path.join( DIRAC.rootPath, 'data','SiteDirector') )
self.workingDirectory = self.am_getOption('WorkDirectory','')
def initialize( self ): """ Standard constructor """ self.am_setOption( "PollingTime", 60.0 ) self.am_setOption( "maxPilotWaitingHours", 6 ) # Get the site description dictionary siteName = self.am_getOption('Site','Unknown') if siteName == 'Unknown': siteName = gConfig.getValue('/DIRAC/Site','Unknown') if siteName == 'Unknown': return S_ERROR('Unknown site') self.siteName = siteName self.genericPilotDN = self.am_getOption('GenericPilotDN','Unknown') self.genericPilotGroup = self.am_getOption('GenericPilotGroup','Unknown') self.pilot = DIRAC_PILOT self.install = DIRAC_INSTALL self.workingDirectory = self.am_getOption('WorkingDirectory', os.path.join( DIRAC.rootPath, 'data','SiteDirector') ) # Flags self.updateStatus = self.am_getOption('UpdatePilotStatus',True) self.getOutput = self.am_getOption('GetPilotOutput',True) self.localhost = socket.getfqdn() self.proxy = '' self.queueDict = {} result = self.getQueues() if not result['OK']: return result return S_OK()
5da9405bb66c0cc3c09cb8a31c714e32f31f0ffd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/5da9405bb66c0cc3c09cb8a31c714e32f31f0ffd/SiteDirector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 12, 365, 262, 30, 3536, 8263, 3885, 3536, 365, 18, 301, 67, 542, 1895, 12, 315, 24767, 950, 3113, 4752, 18, 20, 262, 365, 18, 301, 67, 542, 1895, 12, 315, 1896, 52, 22797, 1594...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 12, 365, 262, 30, 3536, 8263, 3885, 3536, 365, 18, 301, 67, 542, 1895, 12, 315, 24767, 950, 3113, 4752, 18, 20, 262, 365, 18, 301, 67, 542, 1895, 12, 315, 1896, 52, 22797, 1594...
self._base_ring = base_ring
def __init__(self, Q): """ Constructor.
c26d6b07795f11a9104ed5b11740f789a4ab67f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/c26d6b07795f11a9104ed5b11740f789a4ab67f6/monsky_washnitzer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2238, 4672, 3536, 11417, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2238, 4672, 3536, 11417, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
xia2()
try: xia2() except exceptions.Exception, e: traceback.print_exc(file = open('xia2.error', 'w')) Chatter.write('Error: %s' % str(e))
def xia2(): '''Actually process something...''' # print the version Chatter.write(Version) start_time = time.time() if not CommandLine.get_xinfo(): raise RuntimeError, 'xinfo not defined' # this actually gets the processing started... Chatter.write(str(CommandLine.get_xinfo())) duration = time.time() - start_time # write out the time taken in a human readable way Chatter.write('Processing took %s' % \ time.strftime("%Hh %Mm %Ss", time.gmtime(duration))) # delete all of the temporary mtz files... cleanup() # tell the user which programs were used... used = '' for program in Citations.get_programs(): used += ' %s' % program Chatter.write('XIA2 used... %s' % used) Chatter.write( 'Here are the appropriate citations (BIBTeX in xia-citations.bib.)') for citation in Citations.get_citations_acta(): Chatter.write(citation) # and write the bibtex versions out = open('xia-citations.bib', 'w') for citation in Citations.get_citations(): out.write('%s\n' % citation) out.close() return
e2ec9776f4a396ea43cd926c346302651e788769 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/e2ec9776f4a396ea43cd926c346302651e788769/xia2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 619, 1155, 22, 13332, 9163, 2459, 3452, 1207, 5943, 7821, 6309, 225, 468, 1172, 326, 1177, 1680, 9293, 18, 2626, 12, 1444, 13, 225, 787, 67, 957, 273, 813, 18, 957, 1435, 225, 309, 486...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 619, 1155, 22, 13332, 9163, 2459, 3452, 1207, 5943, 7821, 6309, 225, 468, 1172, 326, 1177, 1680, 9293, 18, 2626, 12, 1444, 13, 225, 787, 67, 957, 273, 813, 18, 957, 1435, 225, 309, 486...
self.log.warn("checkReservedTasks: Failed to get task summary from WMS",res['Message'])
self.log.warn("updateTransformationReservedTasks: Failed to get task summary from WMS",res['Message'])
def checkReservedTasks(self,taskDicts): taskNames = [] for taskDict in taskDicts: transID = taskDict['TransformationID'] taskID = taskDict['JobID'] taskName = str(transID).zfill(8)+'_'+str(taskID).zfill(8) taskNames.append(taskName) res = self.wmsClient.getJobs({'JobName':taskNames}) if not ['OK']: self.log.info("checkReservedTasks: Failed to get task from WMS",res['Message']) return res taskNameIDs = {} allAccounted = True for wmsID in res['Value']: res = self.wmsClient.getJobPrimarySummary(int(wmsID)) if not res['OK']: self.log.warn("checkReservedTasks: Failed to get task summary from WMS",res['Message']) allAccounted = False continue jobName = res['Value']['JobName'] taskNameIDs[jobName] = wmsID noTask = [] if allAccounted: for taskName in taskNames: if not (taskName in taskNameIDs.keys()): noTask.append(taskName) return S_OK({'NoTasks':noTask,'TaskNameIDs':taskNameIDs})
7e361d624cd9374c5dec904aad18c8eb176604b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/7e361d624cd9374c5dec904aad18c8eb176604b6/TaskManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 10435, 6685, 12, 2890, 16, 4146, 5014, 87, 4672, 1562, 1557, 273, 5378, 364, 1562, 5014, 316, 1562, 5014, 87, 30, 906, 734, 273, 1562, 5014, 3292, 15292, 734, 3546, 29772, 273, 1562...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10435, 6685, 12, 2890, 16, 4146, 5014, 87, 4672, 1562, 1557, 273, 5378, 364, 1562, 5014, 316, 1562, 5014, 87, 30, 906, 734, 273, 1562, 5014, 3292, 15292, 734, 3546, 29772, 273, 1562...
def rational_points(self, algorithm="enum", sort=True):
def rational_points_iterator(self):
def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration.
98b600e283b76d988294a386cfe037b70de67ee1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/98b600e283b76d988294a386cfe037b70de67ee1/projective_curve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 8371, 67, 4139, 67, 9838, 12, 2890, 4672, 436, 8395, 2000, 326, 436, 8371, 3143, 603, 333, 8882, 8470, 3970, 16836, 18, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 8371, 67, 4139, 67, 9838, 12, 2890, 4672, 436, 8395, 2000, 326, 436, 8371, 3143, 603, 333, 8882, 8470, 3970, 16836, 18, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
mode = default_mode if default_mode is not 'DEBUG_MODE' else 'FAST_RUN'
mode = default_mode if default_mode != 'DEBUG_MODE' else 'FAST_RUN'
def test_pickle(): """Test that a module can be pickled""" M = Module() M.x = (T.dmatrix()) M.y = (T.dmatrix()) a = T.dmatrix() M.f = Method([a], a + M.x + M.y) M.g = Method([a], a * M.x * M.y) mode = default_mode if default_mode is not 'DEBUG_MODE' else 'FAST_RUN' m = M.make(x=numpy.zeros((4,5)), y=numpy.ones((2,3)), mode=mode) m_dup = cPickle.loads(cPickle.dumps(m)) assert numpy.all(m.x == m_dup.x) and numpy.all(m.y == m_dup.y) m_dup.x[0,0] = 3.142 assert m_dup.f.input_storage[1].data[0,0] == 3.142 assert m.x[0,0] == 0.0 #ensure that m is not aliased to m_dup #check that the unpickled version has the same argument/property aliasing assert m_dup.x is m_dup.f.input_storage[1].data assert m_dup.y is m_dup.f.input_storage[2].data assert m_dup.x is m_dup.g.input_storage[1].data assert m_dup.y is m_dup.g.input_storage[2].data
3f4c791dd5e0b4170f964c1d1e7ca3e0e540fc49 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/3f4c791dd5e0b4170f964c1d1e7ca3e0e540fc49/test_module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 20847, 13332, 3536, 4709, 716, 279, 1605, 848, 506, 6002, 1259, 8395, 490, 273, 5924, 1435, 490, 18, 92, 273, 261, 56, 18, 72, 5667, 10756, 490, 18, 93, 273, 261, 56, 18, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 20847, 13332, 3536, 4709, 716, 279, 1605, 848, 506, 6002, 1259, 8395, 490, 273, 5924, 1435, 490, 18, 92, 273, 261, 56, 18, 72, 5667, 10756, 490, 18, 93, 273, 261, 56, 18, 7...
def fibonacci_range(start, stop, algorithm='pari'):
def fibonacci_range(start, stop=None, algorithm='pari'):
def fibonacci_range(start, stop, algorithm='pari'): r""" Returns an iterator over all of the Fibonacci numbers in the given range from \code{f_n = start} to \code{f_n = stop} EXAMPLES: sage: fibs_in_some_range = [i for i in fibonacci_range(10^7, 10^8)] sage: len(fibs_in_some_range) 4 sage: fibs_in_some_range [14930352, 24157817, 39088169, 63245986] sage: fibs = [i for i in fibonacci_range(10, 100)] sage: fibs [13, 21, 34, 55, 89] AUTHOR: Bobby Moretti """ from sage.rings.integer_ring import ZZ start = ZZ(start) if stop == None: stop = start start = ZZ(0) else: stop = ZZ(stop) # iterate until we've gotten high enough fn = 0 n = 0 while fn < start: n += 1 fn = fibonacci(n) while True: fn = fibonacci(n) n += 1 if fn < stop: yield fn else: return
4a32483ad77b002e0bef656f8a6f7d584e7ea98e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/4a32483ad77b002e0bef656f8a6f7d584e7ea98e/combinat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 495, 265, 8981, 77, 67, 3676, 12, 1937, 16, 2132, 33, 7036, 16, 4886, 2218, 1065, 77, 11, 4672, 436, 8395, 2860, 392, 2775, 1879, 777, 434, 326, 478, 495, 265, 8981, 77, 5600, 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, 284, 495, 265, 8981, 77, 67, 3676, 12, 1937, 16, 2132, 33, 7036, 16, 4886, 2218, 1065, 77, 11, 4672, 436, 8395, 2860, 392, 2775, 1879, 777, 434, 326, 478, 495, 265, 8981, 77, 5600, 3...
return_error = error_template('', error_message, '')
return_error = error_template('', msg, '')
def handle_exception(exc_info, error_stream, html=True, debug_mode=False, error_email=None, error_log=None, show_exceptions_in_wsgi_errors=False, error_email_from='errors@localhost', smtp_server='localhost', error_subject_prefix='', error_message=None, simple_html_error=False, ): """ For exception handling outside of a web context Use like:: import sys import paste import paste.error_middleware try: do stuff except: paste.error_middleware.exception_handler( sys.exc_info(), paste.CONFIG, sys.stderr, html=False) If you want to report, but not fully catch the exception, call ``raise`` after ``exception_handler``, which (when given no argument) will reraise the exception. """ reported = False exc_data = collector.collect_exception(*exc_info) extra_data = '' if error_email: rep = reporter.EmailReporter( to_addresses=error_email, from_address=error_email_from, smtp_server=smtp_server, subject_prefix=error_subject_prefix) rep_err = send_report(rep, exc_data, html=html) if rep_err: extra_data += rep_err else: reported = True if error_log: rep = reporter.LogReporter( filename=error_log) rep_err = send_report(rep, exc_data, html=html) if rep_err: extra_data += rep_err else: reported = True if show_exceptions_in_wsgi_errors: rep = reporter.FileReporter( file=error_stream) rep_err = send_report(rep, exc_data, html=html) if rep_err: extra_data += rep_err else: reported = True else: error_stream.write('Error - %s: %s\n' % ( exc_data.exception_type, exc_data.exception_value)) if html: if debug_mode and simple_html_error: return_error = formatter.format_html( exc_data, include_hidden_frames=False, include_reusable=False, show_extra_data=False) reported = True elif debug_mode and not simple_html_error: error_html = formatter.format_html( exc_data, include_hidden_frames=True, include_reusable=False) head_html = formatter.error_css + formatter.hide_display_js return_error = error_template( head_html, error_html, extra_data) extra_data = '' reported = True else: msg = error_message or ''' An error occurred. See the error logs for more information. (Turn debug on to display exception reports here) ''' return_error = error_template('', error_message, '') else: return_error = None if not reported and error_stream: err_report = formatter.format_text(exc_data, show_hidden_frames=True) err_report += '\n' + '-'*60 + '\n' error_stream.write(err_report) if extra_data: error_stream.write(extra_data) return return_error
5347dc743a9e1c7d4849f0ce11f02b76cb4e3403 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/5347dc743a9e1c7d4849f0ce11f02b76cb4e3403/errormiddleware.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 4064, 12, 10075, 67, 1376, 16, 555, 67, 3256, 16, 1729, 33, 5510, 16, 1198, 67, 3188, 33, 8381, 16, 555, 67, 3652, 33, 7036, 16, 555, 67, 1330, 33, 7036, 16, 2405, 67, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 4064, 12, 10075, 67, 1376, 16, 555, 67, 3256, 16, 1729, 33, 5510, 16, 1198, 67, 3188, 33, 8381, 16, 555, 67, 3652, 33, 7036, 16, 555, 67, 1330, 33, 7036, 16, 2405, 67, 11...
def equify(f): """ Returns the equation rewritten to give negative values when True,
def equify(f, variables = None): """ Returns the equation rewritten as a symbolic function to give negative values when True,
def equify(f): """ Returns the equation rewritten to give negative values when True, positive when False. EXAMPLES: sage: from sage.plot.contour_plot import equify sage: equify(x^2 < 2) x^2 - 2 sage: equify(x^2 > 2) 2 - x^2 """ import operator op = f.operator() if op is operator.gt or op is operator.ge: return f.rhs() - f.lhs() else: return f.lhs() - f.rhs()
9d3fd85e63e6d028dd2040f1080715fe2ecace54 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/9d3fd85e63e6d028dd2040f1080715fe2ecace54/contour_plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1298, 1164, 12, 74, 16, 3152, 273, 599, 4672, 3536, 2860, 326, 15778, 26768, 487, 279, 16754, 445, 358, 8492, 6092, 924, 1347, 1053, 16, 6895, 1347, 1083, 18, 225, 5675, 8900, 11386, 30,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1298, 1164, 12, 74, 16, 3152, 273, 599, 4672, 3536, 2860, 326, 15778, 26768, 487, 279, 16754, 445, 358, 8492, 6092, 924, 1347, 1053, 16, 6895, 1347, 1083, 18, 225, 5675, 8900, 11386, 30,...
if c == "\021":
if c == b"\021":
def process_rawq(self): """Transfer from raw queue to cooked queue.
a69ff7792116218bfddc90e5e2776d431495b39b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/a69ff7792116218bfddc90e5e2776d431495b39b/telnetlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 1899, 85, 12, 2890, 4672, 3536, 5912, 628, 1831, 2389, 358, 15860, 329, 2389, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 1899, 85, 12, 2890, 4672, 3536, 5912, 628, 1831, 2389, 358, 15860, 329, 2389, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
result.append(self.key_list('OC',self.oc,sep=' $ '))
result.append(self.key_attr('OC',self.oc))
def __str__(self): result = [str(self.oid)] result.append(self.key_list('NAME',self.names,quoted=1)) result.append(self.key_attr('DESC',self.desc,quoted=1)) result.append({0:'',1:' OBSOLETE'}[self.obsolete]) result.append(self.key_list('OC',self.oc,sep=' $ ')) result.append(self.key_list('MUST',self.must,sep=' $ ')) result.append(self.key_list('MAY',self.may,sep=' $ ')) return '( %s )' % ''.join(result)
dc25df1c6399a889e0345a7f18c79873434999f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4610/dc25df1c6399a889e0345a7f18c79873434999f0/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 563, 273, 306, 701, 12, 2890, 18, 839, 25887, 563, 18, 6923, 12, 2890, 18, 856, 67, 1098, 2668, 1985, 2187, 2890, 18, 1973, 16, 15179, 33, 21, 3719, 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, 1001, 701, 972, 12, 2890, 4672, 563, 273, 306, 701, 12, 2890, 18, 839, 25887, 563, 18, 6923, 12, 2890, 18, 856, 67, 1098, 2668, 1985, 2187, 2890, 18, 1973, 16, 15179, 33, 21, 3719, 5...
node.output(self.response, subject, predicate, object)
node.output(self.response, None, subject, predicate, object)
def rdf(self, subject=None, predicate=None, object=None): node = self.getNodeInScope() node.output(self.response, subject, predicate, object)
d53229614af8817f11642e4ffeda558dccb24e9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/d53229614af8817f11642e4ffeda558dccb24e9f/viewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9160, 12, 2890, 16, 3221, 33, 7036, 16, 5641, 33, 7036, 16, 733, 33, 7036, 4672, 756, 273, 365, 18, 588, 907, 382, 3876, 1435, 756, 18, 2844, 12, 2890, 18, 2740, 16, 3221, 16, 5641, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9160, 12, 2890, 16, 3221, 33, 7036, 16, 5641, 33, 7036, 16, 733, 33, 7036, 4672, 756, 273, 365, 18, 588, 907, 382, 3876, 1435, 756, 18, 2844, 12, 2890, 18, 2740, 16, 3221, 16, 5641, ...
[p11, pv11], [p11,p12, pv11,pv13,pv12])
[pi11, pvi11], [pr11,p12, pvr11,pv12,pv13])
def testUpdateMultiRequiresVersions4(self): p11 = FakePackage('perl', '1', '1', '0', 'i386') p12 = FakePackage('perl', '1', '2', '0', 'i386')
6a23ca8e00877ebb3ae8ffc0444acb278bcf940b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/6a23ca8e00877ebb3ae8ffc0444acb278bcf940b/simpleupdatetests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1891, 5002, 21671, 5940, 24, 12, 2890, 4672, 293, 2499, 273, 11551, 2261, 2668, 457, 80, 2187, 296, 21, 2187, 296, 21, 2187, 296, 20, 2187, 296, 77, 23, 5292, 6134, 293, 2138, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1891, 5002, 21671, 5940, 24, 12, 2890, 4672, 293, 2499, 273, 11551, 2261, 2668, 457, 80, 2187, 296, 21, 2187, 296, 21, 2187, 296, 20, 2187, 296, 77, 23, 5292, 6134, 293, 2138, 27...
class Option(Input):
class Option(Widget):
def setUp(self, request, node, data): self['type'] = 'button' Input.setUp(self, request, node, data)
7c113ce0af0914f30618d1de7e6a199da36c4b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7c113ce0af0914f30618d1de7e6a199da36c4b59/widgets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 16, 590, 16, 756, 16, 501, 4672, 365, 3292, 723, 3546, 273, 296, 5391, 11, 2741, 18, 542, 1211, 12, 2890, 16, 590, 16, 756, 16, 501, 13, 2, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 16, 590, 16, 756, 16, 501, 4672, 365, 3292, 723, 3546, 273, 296, 5391, 11, 2741, 18, 542, 1211, 12, 2890, 16, 590, 16, 756, 16, 501, 13, 2, -100, -100, -100, -100, ...
yield IAC
if self.suboption is not None: self.suboption.append(byte) else: yield byte
def filter(self, data): """handle a bunch of incoming bytes. this is a generator. it will yield all characters not of interest for Telnet/RFC 2217.
1f107871b694699edca4521432f16d6a5c0b71f8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/1f107871b694699edca4521432f16d6a5c0b71f8/rfc2217.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 12, 2890, 16, 501, 4672, 3536, 4110, 279, 25606, 434, 6935, 1731, 18, 333, 353, 279, 4456, 18, 518, 903, 2824, 777, 3949, 486, 434, 16513, 364, 399, 292, 2758, 19, 17926, 11201, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 12, 2890, 16, 501, 4672, 3536, 4110, 279, 25606, 434, 6935, 1731, 18, 333, 353, 279, 4456, 18, 518, 903, 2824, 777, 3949, 486, 434, 16513, 364, 399, 292, 2758, 19, 17926, 11201, ...
self.linenos[t] = [ (self.filename, lineno) ]
self.linenos[t] = [ (self.filename, tag, lineno) ]
def outputMessage(self, text, lineno = 0, comment = None, spacepreserve = 0): """Adds a string to the list of messages.""" if (text.strip() != ''): t = escapePoString(normalizeString(text, not spacepreserve)) if self.output_msgstr: self.translations.append(t) return if self.do_translations or (not t in self.messages): self.messages.append(t) if spacepreserve: self.nowrap[t] = 1 if t in self.linenos.keys(): self.linenos[t].append((self.filename, lineno)) else: self.linenos[t] = [ (self.filename, lineno) ] if (not self.do_translations) and comment and not t in self.comments: self.comments[t] = comment else: if t in self.linenos.keys(): self.linenos[t].append((self.filename, lineno)) else: self.linenos[t] = [ (self.filename, lineno) ] if comment and not t in self.comments: self.comments[t] = comment
7df7f38ebfe0a2ba10334c996b94f4d81999bf11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11802/7df7f38ebfe0a2ba10334c996b94f4d81999bf11/xml2po.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 1079, 12, 2890, 16, 977, 16, 7586, 273, 374, 16, 2879, 273, 599, 16, 3476, 27297, 273, 374, 4672, 3536, 3655, 279, 533, 358, 326, 666, 434, 2743, 12123, 309, 261, 955, 18, 6406, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 1079, 12, 2890, 16, 977, 16, 7586, 273, 374, 16, 2879, 273, 599, 16, 3476, 27297, 273, 374, 4672, 3536, 3655, 279, 533, 358, 326, 666, 434, 2743, 12123, 309, 261, 955, 18, 6406, ...
break
def _create_parent_category_list(id, lst): if not id: return [] parent = product_category_tree.get(id) if parent: lst.append(parent) return _create_parent_category_list(parent, lst) else: return lst
1d78ae166ba2ab9323049a83a16e403e5cd4f91c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d78ae166ba2ab9323049a83a16e403e5cd4f91c/pricelist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 2938, 67, 4743, 67, 1098, 12, 350, 16, 9441, 4672, 309, 486, 612, 30, 327, 5378, 982, 273, 3017, 67, 4743, 67, 3413, 18, 588, 12, 350, 13, 309, 982, 30, 9441, 18, 69...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 2938, 67, 4743, 67, 1098, 12, 350, 16, 9441, 4672, 309, 486, 612, 30, 327, 5378, 982, 273, 3017, 67, 4743, 67, 3413, 18, 588, 12, 350, 13, 309, 982, 30, 9441, 18, 69...
print " --- " + name
def testDocumentation(self): if self.__class__ in (PluginTestCase, ChannelPluginTestCase): return for cb in self.irc.callbacks: name = cb.name() print " --- " + name if ((name in self._noTestDoc) and \ not name.lower() in self.__class__.__name__.lower()): continue self.failUnless(sys.modules[cb.__class__.__name__].__doc__, '%s has no module documentation.' % name) if hasattr(cb, 'isCommandMethod'): for attr in dir(cb): if cb.isCommandMethod(attr) and \ attr == callbacks.canonicalName(attr): self.failUnless(getattr(cb, attr, None).__doc__, '%s.%s has no help.' % (name, attr))
31d9d47751b708f04610040175390b95823eb851 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12790/31d9d47751b708f04610040175390b95823eb851/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 18905, 12, 2890, 4672, 309, 365, 16186, 1106, 972, 316, 261, 3773, 4709, 2449, 16, 5307, 3773, 4709, 2449, 4672, 327, 364, 2875, 316, 365, 18, 481, 71, 18, 13316, 30, 508, 273, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 18905, 12, 2890, 4672, 309, 365, 16186, 1106, 972, 316, 261, 3773, 4709, 2449, 16, 5307, 3773, 4709, 2449, 4672, 327, 364, 2875, 316, 365, 18, 481, 71, 18, 13316, 30, 508, 273, 2...
show(name, arch)
show(name, arch, debug, name + '.log')
def main(): global stack name = sys.argv[1] arch = getArchive(name) stack.append((name, arch)) show(name, arch) while 1: try: toks = string.split(raw_input('? '), None, 1) except EOFError: # Ctrl-D print # clear line break if not toks: usage() continue if len(toks) == 1: cmd = toks[0] arg = '' else: cmd, arg = toks cmd = string.upper(cmd) if cmd == 'U': if len(stack) > 1: arch = stack[-1][1] arch.lib.close() del stack[-1] nm, arch = stack[-1] show(nm, arch) elif cmd == 'O': if not arg: arg = raw_input('open name? ') arg = string.strip(arg) arch = getArchive(arg) if arch is None: print arg, "not found" continue stack.append((arg, arch)) show(arg, arch) elif cmd == 'X': if not arg: arg = raw_input('extract name? ') arg = string.strip(arg) data = getData(arg, arch) if data is None: print "Not found" continue fnm = raw_input('to filename? ') if not fnm: print `data` else: open(fnm, 'wb').write(data) elif cmd == 'Q': break else: usage() for (nm, arch) in stack: arch.lib.close() stack = [] for fnm in cleanup: try: os.remove(fnm) except Exception, e: print "couldn't delete", fnm, e.args
599d8336979493962763ca566024f536455367ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11925/599d8336979493962763ca566024f536455367ed/ArchiveViewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2552, 2110, 508, 273, 2589, 18, 19485, 63, 21, 65, 6637, 273, 336, 7465, 12, 529, 13, 2110, 18, 6923, 12443, 529, 16, 6637, 3719, 2405, 12, 529, 16, 6637, 16, 1198, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2552, 2110, 508, 273, 2589, 18, 19485, 63, 21, 65, 6637, 273, 336, 7465, 12, 529, 13, 2110, 18, 6923, 12443, 529, 16, 6637, 3719, 2405, 12, 529, 16, 6637, 16, 1198, 16, ...
for elem in tzsup.findall('//timezone'):
for elem in tzsup.findall('.//timezone'):
def main(): parser = OptionParser(usage='%prog path/to/cldr') options, args = parser.parse_args() if len(args) != 1: parser.error('incorrect number of arguments') srcdir = args[0] destdir = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), '..', 'babel') sup = parse(os.path.join(srcdir, 'supplemental', 'supplementalData.xml')) # Import global data from the supplemental files global_data = {} territory_zones = global_data.setdefault('territory_zones', {}) zone_aliases = global_data.setdefault('zone_aliases', {}) zone_territories = global_data.setdefault('zone_territories', {}) for elem in sup.findall('//timezoneData/zoneFormatting/zoneItem'): tzid = elem.attrib['type'] territory_zones.setdefault(elem.attrib['territory'], []).append(tzid) zone_territories[tzid] = elem.attrib['territory'] if 'aliases' in elem.attrib: for alias in elem.attrib['aliases'].split(): zone_aliases[alias] = tzid # Import Metazone mapping meta_zones = global_data.setdefault('meta_zones', {}) tzsup = parse(os.path.join(srcdir, 'supplemental', 'metazoneInfo.xml')) for elem in tzsup.findall('//timezone'): for child in elem.findall('usesMetazone'): if 'to' not in child.attrib: # FIXME: support old mappings meta_zones[elem.attrib['type']] = child.attrib['mzone'] outfile = open(os.path.join(destdir, 'global.dat'), 'wb') try: pickle.dump(global_data, outfile, 2) finally: outfile.close() # build a territory containment mapping for inheritance regions = {} for elem in sup.findall('//territoryContainment/group'): regions[elem.attrib['type']] = elem.attrib['contains'].split() # Resolve territory containment territory_containment = {} region_items = regions.items() region_items.sort() for group, territory_list in region_items: for territory in territory_list: containers = territory_containment.setdefault(territory, set([])) if group in territory_containment: containers |= territory_containment[group] containers.add(group) # prepare the per-locale plural rules definitions plural_rules = {} prsup = parse(os.path.join(srcdir, 'supplemental', 'plurals.xml')) for elem in prsup.findall('//plurals/pluralRules'): rules = [] for rule in elem.findall('pluralRule'): rules.append((rule.attrib['count'], unicode(rule.text))) pr = PluralRule(rules) for locale in elem.attrib['locales'].split(): plural_rules[locale] = pr filenames = os.listdir(os.path.join(srcdir, 'main')) filenames.remove('root.xml') filenames.sort(lambda a,b: len(a)-len(b)) filenames.insert(0, 'root.xml') for filename in filenames: stem, ext = os.path.splitext(filename) if ext != '.xml': continue print>>sys.stderr, 'Processing input file %r' % filename tree = parse(os.path.join(srcdir, 'main', filename)) data = {} language = None elem = tree.find('//identity/language') if elem is not None: language = elem.attrib['type'] print>>sys.stderr, ' Language: %r' % language territory = None elem = tree.find('//identity/territory') if elem is not None: territory = elem.attrib['type'] else: territory = '001' # world print>>sys.stderr, ' Territory: %r' % territory regions = territory_containment.get(territory, []) print>>sys.stderr, ' Regions: %r' % regions # plural rules locale_id = '_'.join(filter(None, [ language, territory != '001' and territory or None ])) if locale_id in plural_rules: data['plural_form'] = plural_rules[locale_id] # <localeDisplayNames> territories = data.setdefault('territories', {}) for elem in tree.findall('//territories/territory'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib['type'] in territories: continue territories[elem.attrib['type']] = _text(elem) languages = data.setdefault('languages', {}) for elem in tree.findall('//languages/language'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib['type'] in languages: continue languages[elem.attrib['type']] = _text(elem) variants = data.setdefault('variants', {}) for elem in tree.findall('//variants/variant'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib['type'] in variants: continue variants[elem.attrib['type']] = _text(elem) scripts = data.setdefault('scripts', {}) for elem in tree.findall('//scripts/script'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib['type'] in scripts: continue scripts[elem.attrib['type']] = _text(elem) # <dates> week_data = data.setdefault('week_data', {}) supelem = sup.find('//weekData') for elem in supelem.findall('minDays'): territories = elem.attrib['territories'].split() if territory in territories or any([r in territories for r in regions]): week_data['min_days'] = int(elem.attrib['count']) for elem in supelem.findall('firstDay'): territories = elem.attrib['territories'].split() if territory in territories or any([r in territories for r in regions]): week_data['first_day'] = weekdays[elem.attrib['day']] for elem in supelem.findall('weekendStart'): territories = elem.attrib['territories'].split() if territory in territories or any([r in territories for r in regions]): week_data['weekend_start'] = weekdays[elem.attrib['day']] for elem in supelem.findall('weekendEnd'): territories = elem.attrib['territories'].split() if territory in territories or any([r in territories for r in regions]): week_data['weekend_end'] = weekdays[elem.attrib['day']] zone_formats = data.setdefault('zone_formats', {}) for elem in tree.findall('//timeZoneNames/gmtFormat'): if 'draft' not in elem.attrib and 'alt' not in elem.attrib: zone_formats['gmt'] = unicode(elem.text).replace('{0}', '%s') break for elem in tree.findall('//timeZoneNames/regionFormat'): if 'draft' not in elem.attrib and 'alt' not in elem.attrib: zone_formats['region'] = unicode(elem.text).replace('{0}', '%s') break for elem in tree.findall('//timeZoneNames/fallbackFormat'): if 'draft' not in elem.attrib and 'alt' not in elem.attrib: zone_formats['fallback'] = unicode(elem.text) \ .replace('{0}', '%(0)s').replace('{1}', '%(1)s') break time_zones = data.setdefault('time_zones', {}) for elem in tree.findall('//timeZoneNames/zone'): info = {} city = elem.findtext('exemplarCity') if city: info['city'] = unicode(city) for child in elem.findall('long/*'): info.setdefault('long', {})[child.tag] = unicode(child.text) for child in elem.findall('short/*'): info.setdefault('short', {})[child.tag] = unicode(child.text) time_zones[elem.attrib['type']] = info meta_zones = data.setdefault('meta_zones', {}) for elem in tree.findall('//timeZoneNames/metazone'): info = {} city = elem.findtext('exemplarCity') if city: info['city'] = unicode(city) for child in elem.findall('long/*'): info.setdefault('long', {})[child.tag] = unicode(child.text) for child in elem.findall('short/*'): info.setdefault('short', {})[child.tag] = unicode(child.text) info['common'] = elem.findtext('commonlyUsed') == 'true' meta_zones[elem.attrib['type']] = info for calendar in tree.findall('//calendars/calendar'): if calendar.attrib['type'] != 'gregorian': # TODO: support other calendar types continue months = data.setdefault('months', {}) for ctxt in calendar.findall('months/monthContext'): ctxt_type = ctxt.attrib['type'] ctxts = months.setdefault(ctxt_type, {}) for width in ctxt.findall('monthWidth'): width_type = width.attrib['type'] widths = ctxts.setdefault(width_type, {}) for elem in width.getiterator(): if elem.tag == 'month': if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and int(elem.attrib['type']) in widths: continue widths[int(elem.attrib.get('type'))] = unicode(elem.text) elif elem.tag == 'alias': ctxts[width_type] = Alias( _translate_alias(['months', ctxt_type, width_type], elem.attrib['path']) ) days = data.setdefault('days', {}) for ctxt in calendar.findall('days/dayContext'): ctxt_type = ctxt.attrib['type'] ctxts = days.setdefault(ctxt_type, {}) for width in ctxt.findall('dayWidth'): width_type = width.attrib['type'] widths = ctxts.setdefault(width_type, {}) for elem in width.getiterator(): if elem.tag == 'day': dtype = weekdays[elem.attrib['type']] if ('draft' in elem.attrib or 'alt' not in elem.attrib) \ and dtype in widths: continue widths[dtype] = unicode(elem.text) elif elem.tag == 'alias': ctxts[width_type] = Alias( _translate_alias(['days', ctxt_type, width_type], elem.attrib['path']) ) quarters = data.setdefault('quarters', {}) for ctxt in calendar.findall('quarters/quarterContext'): ctxt_type = ctxt.attrib['type'] ctxts = quarters.setdefault(ctxt.attrib['type'], {}) for width in ctxt.findall('quarterWidth'): width_type = width.attrib['type'] widths = ctxts.setdefault(width_type, {}) for elem in width.getiterator(): if elem.tag == 'quarter': if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and int(elem.attrib['type']) in widths: continue widths[int(elem.attrib['type'])] = unicode(elem.text) elif elem.tag == 'alias': ctxts[width_type] = Alias( _translate_alias(['quarters', ctxt_type, width_type], elem.attrib['path']) ) eras = data.setdefault('eras', {}) for width in calendar.findall('eras/*'): width_type = NAME_MAP[width.tag] widths = eras.setdefault(width_type, {}) for elem in width.getiterator(): if elem.tag == 'era': if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and int(elem.attrib['type']) in widths: continue widths[int(elem.attrib.get('type'))] = unicode(elem.text) elif elem.tag == 'alias': eras[width_type] = Alias( _translate_alias(['eras', width_type], elem.attrib['path']) ) # AM/PM periods = data.setdefault('periods', {}) for elem in calendar.findall('am'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.tag in periods: continue periods[elem.tag] = unicode(elem.text) for elem in calendar.findall('pm'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.tag in periods: continue periods[elem.tag] = unicode(elem.text) date_formats = data.setdefault('date_formats', {}) for format in calendar.findall('dateFormats'): for elem in format.getiterator(): if elem.tag == 'dateFormatLength': if 'draft' in elem.attrib and \ elem.attrib.get('type') in date_formats: continue try: date_formats[elem.attrib.get('type')] = \ dates.parse_pattern(unicode(elem.findtext('dateFormat/pattern'))) except ValueError, e: print>>sys.stderr, 'ERROR: %s' % e elif elem.tag == 'alias': date_formats = Alias(_translate_alias( ['date_formats'], elem.attrib['path']) ) time_formats = data.setdefault('time_formats', {}) for format in calendar.findall('timeFormats'): for elem in format.getiterator(): if elem.tag == 'timeFormatLength': if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib.get('type') in time_formats: continue try: time_formats[elem.attrib.get('type')] = \ dates.parse_pattern(unicode(elem.findtext('timeFormat/pattern'))) except ValueError, e: print>>sys.stderr, 'ERROR: %s' % e elif elem.tag == 'alias': time_formats = Alias(_translate_alias( ['time_formats'], elem.attrib['path']) ) datetime_formats = data.setdefault('datetime_formats', {}) for format in calendar.findall('dateTimeFormats'): for elem in format.getiterator(): if elem.tag == 'dateTimeFormatLength': if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib.get('type') in datetime_formats: continue try: datetime_formats[elem.attrib.get('type')] = \ unicode(elem.findtext('dateTimeFormat/pattern')) except ValueError, e: print>>sys.stderr, 'ERROR: %s' % e elif elem.tag == 'alias': datetime_formats = Alias(_translate_alias( ['datetime_formats'], elem.attrib['path']) ) # <numbers> number_symbols = data.setdefault('number_symbols', {}) for elem in tree.findall('//numbers/symbols/*'): if ('draft' in elem.attrib or 'alt' in elem.attrib): continue number_symbols[elem.tag] = unicode(elem.text) decimal_formats = data.setdefault('decimal_formats', {}) for elem in tree.findall('//decimalFormats/decimalFormatLength'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib.get('type') in decimal_formats: continue pattern = unicode(elem.findtext('decimalFormat/pattern')) decimal_formats[elem.attrib.get('type')] = numbers.parse_pattern(pattern) scientific_formats = data.setdefault('scientific_formats', {}) for elem in tree.findall('//scientificFormats/scientificFormatLength'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib.get('type') in scientific_formats: continue pattern = unicode(elem.findtext('scientificFormat/pattern')) scientific_formats[elem.attrib.get('type')] = numbers.parse_pattern(pattern) currency_formats = data.setdefault('currency_formats', {}) for elem in tree.findall('//currencyFormats/currencyFormatLength'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib.get('type') in currency_formats: continue pattern = unicode(elem.findtext('currencyFormat/pattern')) currency_formats[elem.attrib.get('type')] = numbers.parse_pattern(pattern) percent_formats = data.setdefault('percent_formats', {}) for elem in tree.findall('//percentFormats/percentFormatLength'): if ('draft' in elem.attrib or 'alt' in elem.attrib) \ and elem.attrib.get('type') in percent_formats: continue pattern = unicode(elem.findtext('percentFormat/pattern')) percent_formats[elem.attrib.get('type')] = numbers.parse_pattern(pattern) currency_names = data.setdefault('currency_names', {}) currency_symbols = data.setdefault('currency_symbols', {}) for elem in tree.findall('//currencies/currency'): code = elem.attrib['type'] # TODO: support plural rules for currency name selection for name in elem.findall('displayName'): if ('draft' in name.attrib or 'count' in name.attrib) \ and code in currency_names: continue currency_names[code] = unicode(name.text) # TODO: support choice patterns for currency symbol selection symbol = elem.find('symbol') if symbol is not None and 'draft' not in symbol.attrib \ and 'choice' not in symbol.attrib: currency_symbols[code] = unicode(symbol.text) # <units> unit_patterns = data.setdefault('unit_patterns', {}) for elem in tree.findall('//units/unit'): unit_type = elem.attrib['type'] unit_pattern = unit_patterns.setdefault(unit_type, {}) for pattern in elem.findall('unitPattern'): unit_patterns[unit_type][pattern.attrib['count']] = \ unicode(pattern.text) outfile = open(os.path.join(destdir, 'localedata', stem + '.dat'), 'wb') try: pickle.dump(data, outfile, 2) finally: outfile.close()
f6a446f4ec90556809110a0a1cf043584a1e7e50 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8909/f6a446f4ec90556809110a0a1cf043584a1e7e50/import_cldr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2082, 273, 18862, 12, 9167, 28713, 14654, 589, 19, 869, 19, 830, 3069, 6134, 702, 16, 833, 273, 2082, 18, 2670, 67, 1968, 1435, 309, 562, 12, 1968, 13, 480, 404, 30, 2082,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2082, 273, 18862, 12, 9167, 28713, 14654, 589, 19, 869, 19, 830, 3069, 6134, 702, 16, 833, 273, 2082, 18, 2670, 67, 1968, 1435, 309, 562, 12, 1968, 13, 480, 404, 30, 2082,...
newname = self.xboxify_filename(xiso.xbe_name)
newname = xboxify_filename(xiso.xbe_name)
def extract_xiso(self): self.extracted_filename = None
f67e83cdf97dcd76b8b2fa4ef08fe9de49243030 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2692/f67e83cdf97dcd76b8b2fa4ef08fe9de49243030/gxiso.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 67, 5674, 83, 12, 2890, 4672, 365, 18, 8004, 329, 67, 3459, 273, 599, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 67, 5674, 83, 12, 2890, 4672, 365, 18, 8004, 329, 67, 3459, 273, 599, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
fovars = self.second_stage.yresult[tix].copy()[:,kix]
fovars = self.second_stage.yresult[fotix].copy()[:,kix]
def derivs(self, y, t, **kwargs): """Equation of motion for second order perturbations including source term""" self._log.debug("args: %s", str(kwargs)) #If k not given select all if "k" not in kwargs or kwargs["k"] is None: k = self.k kix = np.arange(len(k)) else: k = kwargs["k"] kix = kwargs["kix"] if kix is None: raise ModelError("Need to specify kix in order to calculate 2nd order perturbation!") #Need t index to use first order data if kwargs["tix"] is None: raise ModelError("Need to specify tix in order to calculate 2nd order perturbation!") else: tix = kwargs["tix"] fotix = np.around((t - self.second_stage.simtstart)/self.second_stage.tstep_wanted) #debug logging self._log.debug("tix=%f, t=%f, fo.tresult[tix]=%f, fotix=%f", tix, t, self.second_stage.tresult[tix], fotix) #Get first order results for this time step fovars = self.second_stage.yresult[tix].copy()[:,kix] phi, phidot, H = fovars[0:3] epsilon = self.second_stage.bgepsilon[tix] #Get source terms src = self.source[tix][kix] srcreal, srcimag = src.real, src.imag #get potential from function U, dU, d2U, d3U = self.potentials(fovars, self.pot_params)[0:4] #Set derivatives taking care of k type if type(k) is np.ndarray or type(k) is list: dydx = np.zeros((4,len(k))) else: dydx = np.zeros(4) #Get a a = self.ainit*np.exp(t) #Real parts #d\deltaphi_2/dn = y[1] dydx[0] = y[1] #d\deltaphi_2^prime/dn # dydx[1] = (-(3 - epsilon)*y[1] - ((k/(a*H))**2)*y[0] -(d2U/H**2 - 3*(phidot**2))*y[0] - srcreal) #Complex \deltaphi_2 dydx[2] = y[3] #Complex derivative dydx[3] = (-(3 - epsilon)*y[3] - ((k/(a*H))**2)*y[2] -(d2U/H**2 - 3*(phidot**2))*y[2] - srcimag) return dydx
92497b2747f77c97a04eeaadb1caa1b1ce25f30d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7283/92497b2747f77c97a04eeaadb1caa1b1ce25f30d/cosmomodels.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9630, 87, 12, 2890, 16, 677, 16, 268, 16, 2826, 4333, 4672, 3536, 13142, 367, 434, 21188, 364, 2205, 1353, 24445, 15850, 1012, 6508, 1084, 2481, 8395, 365, 6315, 1330, 18, 4148, 2932, 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, 9630, 87, 12, 2890, 16, 677, 16, 268, 16, 2826, 4333, 4672, 3536, 13142, 367, 434, 21188, 364, 2205, 1353, 24445, 15850, 1012, 6508, 1084, 2481, 8395, 365, 6315, 1330, 18, 4148, 2932, 19...
songs = [self.SongWrapper(self.AudioFile({"tracknumber": str(i)}))
songs = [SongWrapper(AudioFile({"tracknumber": str(i)}))
def test_cmp(self): songs = [self.SongWrapper(self.AudioFile({"tracknumber": str(i)})) for i in range(10)] songs.reverse() songs.sort() self.failUnlessEqual([s("~#track") for s in songs], range(10))
48c1a82e1b525e7e8746c861b730798d7f56ee05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/48c1a82e1b525e7e8746c861b730798d7f56ee05/test_plugins___init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9625, 12, 2890, 4672, 272, 7260, 273, 306, 55, 932, 3611, 12, 12719, 812, 12590, 6, 4101, 2696, 6877, 609, 12, 77, 16869, 3719, 364, 277, 316, 1048, 12, 2163, 25887, 272, 726...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9625, 12, 2890, 4672, 272, 7260, 273, 306, 55, 932, 3611, 12, 12719, 812, 12590, 6, 4101, 2696, 6877, 609, 12, 77, 16869, 3719, 364, 277, 316, 1048, 12, 2163, 25887, 272, 726...
if _iscommand("mozilla"): register("mozilla", None, Netscape("mozilla")) if _iscommand("netscape"): register("netscape", None, Netscape("netscape"))
for browser in ("mozilla-firefox", "mozilla-firebird", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Netscape(browser))
def open_new(self, url): self.open(url)
50cbb7e5549d1eb9ef6b2a23d663e7be5637712a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/50cbb7e5549d1eb9ef6b2a23d663e7be5637712a/webbrowser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 2704, 12, 2890, 16, 880, 4672, 365, 18, 3190, 12, 718, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 2704, 12, 2890, 16, 880, 4672, 365, 18, 3190, 12, 718, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
icon = self.absolute_url() + '/img_user'
icon = ' img_user'
def getTreeInfo(self, usr, dict = {}): "utility method" # Prevend infinite recursions name = usr.getUserName() if dict.has_key(name): return dict[name] = {}
349a95cc3d754ca8884f37d7aef37803b7793cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/349a95cc3d754ca8884f37d7aef37803b7793cb3/GroupUserFolder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15867, 966, 12, 2890, 16, 16575, 16, 2065, 273, 2618, 4672, 315, 1367, 560, 707, 6, 468, 24825, 409, 14853, 283, 2789, 1115, 508, 273, 16575, 18, 588, 15296, 1435, 309, 2065, 18, 5332, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15867, 966, 12, 2890, 16, 16575, 16, 2065, 273, 2618, 4672, 315, 1367, 560, 707, 6, 468, 24825, 409, 14853, 283, 2789, 1115, 508, 273, 16575, 18, 588, 15296, 1435, 309, 2065, 18, 5332, ...
__implements__ = IMappingTable
implements(IMappingTable)
def __init__(self, map_table_function): self.map = map_table_function
9d1183daa46577a2735a59d4b5110e777bb41a72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9d1183daa46577a2735a59d4b5110e777bb41a72/xmpp_stringprep.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 852, 67, 2121, 67, 915, 4672, 365, 18, 1458, 273, 852, 67, 2121, 67, 915, 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, 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, 852, 67, 2121, 67, 915, 4672, 365, 18, 1458, 273, 852, 67, 2121, 67, 915, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
k = self.optionxform(optname) cursect[k] = "%s\n%s" % (cursect[k], value)
cursect[optname] = "%s\n%s" % (cursect[optname], value)
def __read(self, fp, fpname): """Parse a sectioned setup file.
c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 896, 12, 2890, 16, 4253, 16, 4253, 529, 4672, 3536, 3201, 279, 2442, 329, 3875, 585, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 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, 1001, 896, 12, 2890, 16, 4253, 16, 4253, 529, 4672, 3536, 3201, 279, 2442, 329, 3875, 585, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
raise IncludeError('File "%s" already included' % address)
pass else: self.__includedfiles[bn] = bn
def includeExternalURL(self,url): proto,server,address,_,_ = urlparse.urlsplit(url) address = str(address) for p in self.__searchpaths: try: fn = os.path.join(p,address) bn = os.path.basename(fn)
9e52007128a90d12c03fd7fdf4e2dbce1f92e1c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4638/9e52007128a90d12c03fd7fdf4e2dbce1f92e1c7/e2html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2341, 6841, 1785, 12, 2890, 16, 718, 4672, 3760, 16, 3567, 16, 2867, 16, 67, 16, 67, 273, 15185, 18, 718, 4939, 12, 718, 13, 225, 1758, 273, 609, 12, 2867, 13, 364, 293, 316, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2341, 6841, 1785, 12, 2890, 16, 718, 4672, 3760, 16, 3567, 16, 2867, 16, 67, 16, 67, 273, 15185, 18, 718, 4939, 12, 718, 13, 225, 1758, 273, 609, 12, 2867, 13, 364, 293, 316, 365, ...
offset : integer, >= 0, optional
offset : int, >= 0, optional
def isdecimal(a): """ For each element in `a`, return True if there are only decimal characters in the element. Calls `unicode.isdecimal` element-wise. Decimal characters include digit characters, and all characters that that can be used to form decimal-radix numbers, e.g. ``U+0660, ARABIC-INDIC DIGIT ZERO``. Parameters ---------- a : array-like of unicode Returns ------- out : ndarray Array of booleans See also -------- unicode.isdecimal """ if _use_unicode(a) != unicode_: raise TypeError, "isnumeric is only available for Unicode strings and arrays" return _vec_string(a, bool_, 'isdecimal')
05324d0e986a1012a342e2650b3883e13a285029 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/05324d0e986a1012a342e2650b3883e13a285029/defchararray.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 12586, 12, 69, 4672, 3536, 2457, 1517, 930, 316, 1375, 69, 9191, 327, 1053, 309, 1915, 854, 1338, 6970, 3949, 316, 326, 930, 18, 225, 23665, 1375, 9124, 18, 291, 12586, 68, 930, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 12586, 12, 69, 4672, 3536, 2457, 1517, 930, 316, 1375, 69, 9191, 327, 1053, 309, 1915, 854, 1338, 6970, 3949, 316, 326, 930, 18, 225, 23665, 1375, 9124, 18, 291, 12586, 68, 930, 1...
if self.multiple_edges:
if self.multiple_edges():
def adjacency_matrix(self, sparse=True): """ Returns the adjacency matrix of the graph. Each vertex is represented by its position in the list returned by the vertices() function.
626a82169bd0d544dddaa7c64848161784242a7e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/626a82169bd0d544dddaa7c64848161784242a7e/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25220, 67, 5667, 12, 2890, 16, 9387, 33, 5510, 4672, 3536, 2860, 326, 25220, 3148, 434, 326, 2667, 18, 8315, 5253, 353, 10584, 635, 2097, 1754, 316, 326, 666, 2106, 635, 326, 6928, 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, 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, 25220, 67, 5667, 12, 2890, 16, 9387, 33, 5510, 4672, 3536, 2860, 326, 25220, 3148, 434, 326, 2667, 18, 8315, 5253, 353, 10584, 635, 2097, 1754, 316, 326, 666, 2106, 635, 326, 6928, 1435,...
installcmd = '"%s" setup.py install' % sys.executable if self._cmd(output, self._buildDirname, installcmd):
extra_args = "" for k, v in self._db.preferences.installLocations: if not v: if not unwanted_install_dir: unwanted_install_dir = tempfile.mkdtemp() v = unwanted_install_dir extra_args = extra_args + " %s \"%s\"" % (k, v) installcmd = '"%s" setup.py install %s' % (sys.executable, extra_args) if _cmd(output, self._buildDirname, installcmd):
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command']) self.beforeInstall() installcmd = self._dict.get('Install-command') if not installcmd: installcmd = '"%s" setup.py install' % sys.executable if self._cmd(output, self._buildDirname, installcmd): return "install %s: running \"%s\" failed" % \ (self.fullname(), installcmd) self.afterInstall() if self._dict.has_key('Post-install-command'): if self._cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Post-install-command']) return None
febcb863ca7d0946923a410edd2f9082b0ce60b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/febcb863ca7d0946923a410edd2f9082b0ce60b8/pimp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 2261, 3386, 12, 2890, 16, 876, 33, 7036, 4672, 3536, 6410, 279, 2202, 1084, 2181, 18, 225, 971, 876, 353, 864, 518, 1410, 506, 279, 585, 17, 5625, 733, 471, 518, 903, 6798, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 2261, 3386, 12, 2890, 16, 876, 33, 7036, 4672, 3536, 6410, 279, 2202, 1084, 2181, 18, 225, 971, 876, 353, 864, 518, 1410, 506, 279, 585, 17, 5625, 733, 471, 518, 903, 6798, 279, ...
def artcmd(self, line):
def artcmd(self, line, fileHandle=None):
def artcmd(self, line): """Internal: process a HEAD, BODY or ARTICLE command.""" resp, list = self.longcmd(line) resp, nr, id = self.statparse(resp) return resp, nr, id, list
20daa62f93117ab8f3937d4920d82cd7cd65c7e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/20daa62f93117ab8f3937d4920d82cd7cd65c7e8/nntplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3688, 4172, 12, 2890, 16, 980, 16, 26662, 33, 7036, 4672, 3536, 3061, 30, 1207, 279, 14792, 16, 30580, 578, 6052, 56, 2871, 900, 1296, 12123, 1718, 16, 666, 273, 365, 18, 5748, 4172, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3688, 4172, 12, 2890, 16, 980, 16, 26662, 33, 7036, 4672, 3536, 3061, 30, 1207, 279, 14792, 16, 30580, 578, 6052, 56, 2871, 900, 1296, 12123, 1718, 16, 666, 273, 365, 18, 5748, 4172, 1...
if not auth_code:
if (auth_code != 'false'):
def index(req, ln=cdslang): """ Menu of admin options @param ln: language """ ln = wash_language(ln) _ = gettext_set_language(ln) navtrail_previous_links = getnavtrail() navtrail_previous_links +=' &gt; <a class="navtrail" href="%s/admin/webcomment/webcommentadmin.py/">' % weburl navtrail_previous_links += _("Comment Management") + '</a>' try: uid = getUid(req) except Error, e: return error_page(req) (auth_code, auth_msg) = check_user(uid, 'cfgwebcomment') if not auth_code: return page(title=_("Comment Management"), body=perform_request_index(ln=ln), uid=uid, language=ln, navtrail = navtrail_previous_links, lastupdated=__lastupdated__, req=req) else: return page_not_authorized(req=req, text=auth_msg, navtrail=navtrail_previous_links)
0702bc430b0f8b307f914c5b86b94bfd67690604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3302/0702bc430b0f8b307f914c5b86b94bfd67690604/webcommentadmin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 12, 3658, 16, 7211, 33, 4315, 2069, 539, 4672, 3536, 9809, 434, 3981, 702, 632, 891, 7211, 30, 2653, 3536, 7211, 273, 341, 961, 67, 4923, 12, 2370, 13, 389, 273, 24972, 67, 542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3658, 16, 7211, 33, 4315, 2069, 539, 4672, 3536, 9809, 434, 3981, 702, 632, 891, 7211, 30, 2653, 3536, 7211, 273, 341, 961, 67, 4923, 12, 2370, 13, 389, 273, 24972, 67, 542, ...
express_measure(self.stdev, self.measure)
express_measure(self.stdev, self.measure, decimals)
def calculate_properties(self): self.average = self.data.mean() self.median = numpy.median(self.data) self.stdev = math.sqrt(sum((self.data - self.data.mean())**2) / (len(self.data) - 1))
04a08d802267046de06ff04480c350e911d9a49f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11052/04a08d802267046de06ff04480c350e911d9a49f/distributionic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4604, 67, 4738, 12, 2890, 4672, 365, 18, 15621, 273, 365, 18, 892, 18, 7079, 1435, 365, 18, 22410, 273, 3972, 18, 22410, 12, 2890, 18, 892, 13, 365, 18, 334, 5206, 273, 4233, 18, 244...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4604, 67, 4738, 12, 2890, 4672, 365, 18, 15621, 273, 365, 18, 892, 18, 7079, 1435, 365, 18, 22410, 273, 3972, 18, 22410, 12, 2890, 18, 892, 13, 365, 18, 334, 5206, 273, 4233, 18, 244...
usingDeps(logConf, dset)
usingDeps(depsLogConf, dset)
def usingDeps(logConf, dset):
c18752e3a6a20f73f8cace28d0b3ee01558d13f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/c18752e3a6a20f73f8cace28d0b3ee01558d13f0/Generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1450, 14430, 12, 1330, 3976, 16, 23626, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1450, 14430, 12, 1330, 3976, 16, 23626, 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, -...
f = open(self.dyncfgfile)
f = open("%s/%s" % (self.dir, self.dyncfgfile))
def _retrieveDynConfig(self): f = open(self.dyncfgfile) t = f.read() f.close() return t
c5ffc4ffec54b8f4af65e9d57389559f566007ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13005/c5ffc4ffec54b8f4af65e9d57389559f566007ec/LocalVermontInstance.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17466, 10419, 809, 12, 2890, 4672, 284, 273, 1696, 27188, 87, 5258, 87, 6, 738, 261, 2890, 18, 1214, 16, 365, 18, 72, 1209, 2137, 768, 3719, 268, 273, 284, 18, 896, 1435, 284, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17466, 10419, 809, 12, 2890, 4672, 284, 273, 1696, 27188, 87, 5258, 87, 6, 738, 261, 2890, 18, 1214, 16, 365, 18, 72, 1209, 2137, 768, 3719, 268, 273, 284, 18, 896, 1435, 284, 1...
gobject.timeout_add(1000, self.try_to_launch_convertion)
self.progressbar.pulse() return True
def try_to_launch_convertion(self): # check that all files have loaded their tags not_ready = [s for s in self.filelist.get_files() if not s["META"].tags_read] if not_ready: # retry later gobject.timeout_add(1000, self.try_to_launch_convertion) else: # start convertion self.do_convert() return False
379396c6578d6b0d4b61f3821f039f5fb9768a5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2369/379396c6578d6b0d4b61f3821f039f5fb9768a5f/soundconverter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 775, 67, 869, 67, 20738, 67, 6283, 285, 12, 2890, 4672, 468, 866, 716, 777, 1390, 1240, 4203, 3675, 2342, 486, 67, 1672, 273, 306, 87, 364, 272, 316, 365, 18, 7540, 5449, 18, 588, 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, 775, 67, 869, 67, 20738, 67, 6283, 285, 12, 2890, 4672, 468, 866, 716, 777, 1390, 1240, 4203, 3675, 2342, 486, 67, 1672, 273, 306, 87, 364, 272, 316, 365, 18, 7540, 5449, 18, 588, 67...
txt += format[i%2] % (fname.capitalize(), fval) i += 1 if i % 2 == 0:
txt += format[i % 2] % (f.capitalize(), fval) if i % 2:
def format_props(self): tkt = self.ticket tkt['id'] = '%s' % tkt['id'] t = self.modtime or tkt['time'] tkt['modified'] = time.strftime('%c', time.localtime(t)) fields = ['id', 'status', 'component', 'modified', 'severity', 'milestone', 'priority', 'version', 'owner', 'reporter'] fields.extend(filter(lambda f: f.startswith('custom_'), self.ticket.keys())) i = 1 width = [0,0,0,0] for f in fields: if not tkt.has_key(f): continue fval = str(tkt[f]) if fval.find('\n') > -1: continue fname = f.startswith('custom_') and f[7:] or f idx = 2*(i % 2) if len(fname) > width[idx]: width[idx] = len(fname) if len(fval) > width[idx+1]: width[idx+1] = len(fval) i += 1 format = (' %%%is: %%-%is%s' % (width[0], width[1], CRLF), '%%%is: %%-%is | ' % (width[2], width[3])) i = 1 l = (width[2] + width[3] + 5) sep = l*'-' + '+' + (self.COLS-l)*'-' txt = sep + CRLF big=[] for f in fields: if not tkt.has_key(f): continue fval = tkt[f] fname = f.startswith('custom_') and f[7:] or f if '\n' in str(fval): big.append((fname.capitalize(), fval)) else: txt += format[i%2] % (fname.capitalize(), fval) i += 1 if i % 2 == 0: txt += '\n' if big: txt += sep for k,v in big: txt += '\n%s:\n%s\n\n' % (k,v) txt += sep return txt
e955cc298b14d4c8585186dd50d2db31c6327444 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/e955cc298b14d4c8585186dd50d2db31c6327444/Notify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 268, 8629, 3292, 350, 3546, 273, 1995, 87, 11, 738, 268, 8629, 3292, 350, 3546, 268, 273, 365, 18, 1711, 957, 578, 268, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 268, 8629, 3292, 350, 3546, 273, 1995, 87, 11, 738, 268, 8629, 3292, 350, 3546, 268, 273, 365, 18, 1711, 957, 578, 268, ...
dottedname = 'z3c.testsetup.tests.%s' % (filename[:-3],) test = doctest.DocTestSuite(dottedname,
dottedname = os.path.join('..', filename) test = doctest.DocFileSuite(dottedname,
def suiteFromFile(filename): suite = unittest.TestSuite() dottedname = 'z3c.testsetup.tests.%s' % (filename[:-3],) test = doctest.DocTestSuite(dottedname, setUp=setUpZope, tearDown=cleanUpZope, checker=checker, optionflags=doctest.ELLIPSIS+ doctest.NORMALIZE_WHITESPACE) suite.addTest(test) return suite
f8a30d20635688010d9b6c3351bb0f4545bbb396 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4163/f8a30d20635688010d9b6c3351bb0f4545bbb396/test_testsetup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11371, 13087, 12, 3459, 4672, 11371, 273, 2836, 3813, 18, 4709, 13587, 1435, 20965, 529, 273, 1140, 18, 803, 18, 5701, 2668, 838, 2187, 1544, 13, 1842, 273, 31263, 395, 18, 1759, 812, 13...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11371, 13087, 12, 3459, 4672, 11371, 273, 2836, 3813, 18, 4709, 13587, 1435, 20965, 529, 273, 1140, 18, 803, 18, 5701, 2668, 838, 2187, 1544, 13, 1842, 273, 31263, 395, 18, 1759, 812, 13...
return file.replace("\\", "/")
return (file.replace("\\", "/"), root)
def GetVCSFilename(file, srcdir): """Given a full path to a file, and the top source directory, look for version control information about this file, and return a specially formatted filename that contains the VCS type, VCS location, relative filename, and revision number, formatted like: vcs:vcs location:filename:revision For example: cvs:cvs.mozilla.org/cvsroot:mozilla/browser/app/nsBrowserApp.cpp:1.36""" (path, filename) = os.path.split(file) if path == '' or filename == '': return file fileInfo = None if file in vcsFileInfoCache: # Already cached this info, use it. fileInfo = vcsFileInfoCache[file] else: if os.path.isdir(os.path.join(path, "CVS")): fileInfo = CVSFileInfo(file, srcdir) elif os.path.isdir(os.path.join(path, ".svn")) or \ os.path.isdir(os.path.join(path, "_svn")): fileInfo = SVNFileInfo(file); vcsFileInfoCache[file] = fileInfo if fileInfo: file = fileInfo.filename # we want forward slashes on win32 paths return file.replace("\\", "/")
0a664656fecf2b6ec004785f3fab3d7ee1d79c8d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/0a664656fecf2b6ec004785f3fab3d7ee1d79c8d/symbolstore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 58, 4596, 5359, 12, 768, 16, 1705, 1214, 4672, 3536, 6083, 279, 1983, 589, 358, 279, 585, 16, 471, 326, 1760, 1084, 1867, 16, 2324, 364, 1177, 3325, 1779, 2973, 333, 585, 16, 471,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 58, 4596, 5359, 12, 768, 16, 1705, 1214, 4672, 3536, 6083, 279, 1983, 589, 358, 279, 585, 16, 471, 326, 1760, 1084, 1867, 16, 2324, 364, 1177, 3325, 1779, 2973, 333, 585, 16, 471,...
version, _ = _parseChangesFile( "CHANGES", product )
version, revision = _parseChangesFile( "CHANGES", product ) if version==revision : return version, version
def versionFromRemoteSvn( product="CLAM" ) : os.system("rm CHANGES*" ) os.system("svn export "+ remoteRepository + product + "/CHANGES" ) version, _ = _parseChangesFile( "CHANGES", product ) revision = _svnRevisionOf( remoteRepository ) return version, _svnVersion(version, revision)
2c9356590765884260ab36e5182c20336903ae3c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1456/2c9356590765884260ab36e5182c20336903ae3c/versionInfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1177, 1265, 5169, 55, 25031, 12, 3017, 1546, 5017, 2192, 6, 262, 294, 1140, 18, 4299, 2932, 8864, 6469, 3388, 3991, 7388, 262, 1140, 18, 4299, 2932, 31505, 3359, 13773, 2632, 3305, 397, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1177, 1265, 5169, 55, 25031, 12, 3017, 1546, 5017, 2192, 6, 262, 294, 1140, 18, 4299, 2932, 8864, 6469, 3388, 3991, 7388, 262, 1140, 18, 4299, 2932, 31505, 3359, 13773, 2632, 3305, 397, ...
if not hasattr(p, 'r0'): raise('ShorEllipsoid solver requires r0')
if not hasattr(p, 'r0'): p.err('ShorEllipsoid solver requires r0')
def __solver__(self, p):
92c3e6248dc4a9cecf5da46c81630a5466a8c2be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6196/92c3e6248dc4a9cecf5da46c81630a5466a8c2be/ShorEllipsoid_oo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 27198, 972, 12, 2890, 16, 293, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 27198, 972, 12, 2890, 16, 293, 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...
raise "Error", "Nothing to do"
raise DistutilsError, "Nothing to do"
def run (self): if not self.distribution.scripts: # nothing to do # should raise an error! raise "Error", "Nothing to do" return
861f80c86dfc6fe385ed252257e1e114e03443ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1361/861f80c86dfc6fe385ed252257e1e114e03443ed/build_exe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 261, 2890, 4672, 309, 486, 365, 18, 16279, 18, 12827, 30, 468, 5083, 358, 741, 468, 1410, 1002, 392, 555, 5, 1002, 19893, 5471, 668, 16, 315, 23814, 358, 741, 6, 327, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 261, 2890, 4672, 309, 486, 365, 18, 16279, 18, 12827, 30, 468, 5083, 358, 741, 468, 1410, 1002, 392, 555, 5, 1002, 19893, 5471, 668, 16, 315, 23814, 358, 741, 6, 327, 2, -100, ...
sage: print next_conjugate(L)
sage: next_conjugate(L)
def next_conjugate(L): """ Permute L[r, c] = e to the conjugate L[c, e] = r We assume that L is an n by n matrix and has values in the range 0, 1, ..., n-1. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: L = back_circulant(6) sage: print L [0 1 2 3 4 5] [1 2 3 4 5 0] [2 3 4 5 0 1] [3 4 5 0 1 2] [4 5 0 1 2 3] [5 0 1 2 3 4] sage: print next_conjugate(L) [0 1 2 3 4 5] [5 0 1 2 3 4] [4 5 0 1 2 3] [3 4 5 0 1 2] [2 3 4 5 0 1] [1 2 3 4 5 0] sage: L == next_conjugate(next_conjugate(next_conjugate(L))) True """ assert L.nrows() == L.ncols() n = L.nrows() C = LatinSquare(n, n) for r in range(n): for c in range(n): e = L[r, c] assert e >= 0 and e < n C[c, e] = r return C
9087d14f978c663baae98e9a365c4a3aa2a6f24c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9087d14f978c663baae98e9a365c4a3aa2a6f24c/latin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 591, 78, 31529, 12, 48, 4672, 3536, 13813, 624, 511, 63, 86, 16, 276, 65, 273, 425, 358, 326, 10550, 31529, 511, 63, 71, 16, 425, 65, 273, 436, 225, 1660, 6750, 716, 511, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 591, 78, 31529, 12, 48, 4672, 3536, 13813, 624, 511, 63, 86, 16, 276, 65, 273, 425, 358, 326, 10550, 31529, 511, 63, 71, 16, 425, 65, 273, 436, 225, 1660, 6750, 716, 511, ...
@gtk_unsafe
def initialize_revision_labels(self): self.set_start_revision(_("N/A")) self.set_end_revision(_("N/A"))
24b1b08d5994060375c7c679756360a9df458992 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5119/24b1b08d5994060375c7c679756360a9df458992/log.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 67, 13057, 67, 5336, 12, 2890, 4672, 365, 18, 542, 67, 1937, 67, 13057, 24899, 2932, 50, 19, 37, 6, 3719, 365, 18, 542, 67, 409, 67, 13057, 24899, 2932, 50, 19, 37, 6, 3719, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 67, 13057, 67, 5336, 12, 2890, 4672, 365, 18, 542, 67, 1937, 67, 13057, 24899, 2932, 50, 19, 37, 6, 3719, 365, 18, 542, 67, 409, 67, 13057, 24899, 2932, 50, 19, 37, 6, 3719, ...
print '==================================', sys.argv[0]
def parseParams(str): result = {} if not str: result['cmd'] = 'listdir' result['type'] = 'root' return result for param in str[1:].split('&'): key = param.split('=')[0] value = param.split('=')[1] result[key] = value return result
72bd6e41c402759fe0ff8ff85aae3ef7ee18845c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5614/72bd6e41c402759fe0ff8ff85aae3ef7ee18845c/default.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 1370, 12, 701, 4672, 563, 273, 2618, 309, 486, 609, 30, 563, 3292, 4172, 3546, 273, 296, 1098, 1214, 11, 563, 3292, 723, 3546, 273, 296, 3085, 11, 327, 563, 364, 579, 316, 609, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 1370, 12, 701, 4672, 563, 273, 2618, 309, 486, 609, 30, 563, 3292, 4172, 3546, 273, 296, 1098, 1214, 11, 563, 3292, 723, 3546, 273, 296, 3085, 11, 327, 563, 364, 579, 316, 609, ...
mat *= self.world.getBzToBlendMatrix()
transform = self.world.getBzToBlendMatrix() transform.resize4x4() mat *= transform mat *= Blender.Mathutils.TranslationMatrix( self.world.blendObject.mat.translationPart())
def transformBlenderObject(self, obj): """Set the transformation on the given Blender object to match our position, size, and rotation. This will be used both by the Box object and by other objects with similar interfaces that subclass Box. """ mat = Blender.Mathutils.Matrix( [self.size[0], 0, 0, 0], [0, self.size[1], 0, 0], [0, 0, self.size[2], 0], [0, 0, 0, 1])
dc17bad6c189621b83147bf8ab70b1b672d8cc91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/dc17bad6c189621b83147bf8ab70b1b672d8cc91/bzflag.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2510, 4802, 2345, 921, 12, 2890, 16, 1081, 4672, 3536, 694, 326, 8620, 603, 326, 864, 8069, 2345, 733, 358, 845, 3134, 1754, 16, 963, 16, 471, 6752, 18, 1220, 903, 506, 1399, 3937, 635...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2510, 4802, 2345, 921, 12, 2890, 16, 1081, 4672, 3536, 694, 326, 8620, 603, 326, 864, 8069, 2345, 733, 358, 845, 3134, 1754, 16, 963, 16, 471, 6752, 18, 1220, 903, 506, 1399, 3937, 635...
status = TEST_FAILURE
status = TEST_FAIL
def load_junit(self, fileobj, configuration): ''' Load test data from a JUnit-style XML file. ''' document = xml.dom.minidom.parse(fileobj) for test in document.childNodes[0].childNodes: if not isinstance(test, xml.dom.minidom.Element): continue assert test.nodeName == 'testcase'
ff0c07bf4060b1cdd94eaa9aea6a141a3c2aedfd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7644/ff0c07bf4060b1cdd94eaa9aea6a141a3c2aedfd/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 78, 4873, 12, 2890, 16, 17041, 16, 1664, 4672, 9163, 4444, 1842, 501, 628, 279, 804, 2802, 17, 4060, 3167, 585, 18, 9163, 1668, 273, 2025, 18, 9859, 18, 1154, 350, 362, 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, 1262, 67, 78, 4873, 12, 2890, 16, 17041, 16, 1664, 4672, 9163, 4444, 1842, 501, 628, 279, 804, 2802, 17, 4060, 3167, 585, 18, 9163, 1668, 273, 2025, 18, 9859, 18, 1154, 350, 362, 18, ...
if activity:
if activity is not None:
def reload(rv, filename, serializer=PickleSerializer, activity=None, testmode=False): """ Loads EIM records from a file and applies them """ translator = getTranslator() if not testmode: oldMaster = waitForDeferred(MasterPassword.get(rv)) else: oldMaster = '' newMaster = 'secret' if activity: activity.update(totalWork=None, msg=_(u"Counting records...")) input = open(filename, "rb") load = serializer.loader(input) i = 0 while True: record = load() if not record: break i += 1 input.close() activity.update(totalWork=i) trans = translator(rv) trans.startImport() input = open(filename, "rb") try: load = serializer.loader(input) i = 0 while True: record = load() if not record: break trans.importRecord(record) i += 1 if activity: activity.update(msg=_(u"Imported %(total)d records") % {'total':i}, work=1) if i % 1000 == 0: # Commit every 1,000 records if activity: activity.update(msg=_(u"Saving...")) rv.commit() del load finally: input.close() trans.finishImport() if activity: activity.update(msg=_(u"Saving...")) rv.commit() # Passwords that existed before reload are encrypted with oldMaster, and # passwords that we reloaded are encrypted with newMaster, so now we need # to go through all passwords and re-encrypt all the old ones with # newMaster. # First, let's get the newMaster waitForDeferred(MasterPassword.clear()) if not testmode: prefs = schema.ns("osaf.framework.MasterPassword", rv).masterPasswordPrefs if prefs.masterPassword: wx.MessageBox (_(u"Please enter the master password you used to protect this file to reload account passwords."), _(u'Protect Passwords'), parent=wx.GetApp().mainFrame) dummy = schema.ns("osaf.framework.password", rv).passwordPrefs.dummyPassword while True: try: newMaster = waitForDeferred(MasterPassword.get(rv, testPassword=dummy)) break except password.NoMasterPassword: if wx.MessageBox(_(u'If you do not remember your master password, all account passwords will be deleted. Delete account passwords?'), _(u'Reset Master Password'), style = wx.YES_NO, parent=wx.GetApp().mainFrame) == wx.YES: MasterPassword.reset(rv) return # Then re-encrypt for item in password.Password.iterItems(rv): if not waitForDeferred(item.initialized()): # Don't need to re-encrypt uninitialized passwords continue try: pw = waitForDeferred(item.decryptPassword(masterPassword=oldMaster)) except password.DecryptionError: # Maybe this was one of the new passwords loaded from # dump, so let's try the new master password try: waitForDeferred(item.decryptPassword(masterPassword=newMaster)) except password.DecryptionError: # Oops, we are in trouble, can't really do much but # reset() to avoid further problems. logger.exception('found passwords that could not be decrypted; clearing passwords') MasterPassword.reset(rv) break # Since this is already encrypted with the new # master password we don't need to re-encrypt continue waitForDeferred(item.encryptPassword(pw, masterPassword=newMaster))
47ace3edcac6912ffb5dfe00f96f9b282b9f8217 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9228/47ace3edcac6912ffb5dfe00f96f9b282b9f8217/dumpreload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7749, 12, 4962, 16, 1544, 16, 6340, 33, 17968, 298, 6306, 16, 5728, 33, 7036, 16, 1842, 3188, 33, 8381, 4672, 3536, 4444, 87, 512, 3445, 3853, 628, 279, 585, 471, 10294, 2182, 3536, 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, 7749, 12, 4962, 16, 1544, 16, 6340, 33, 17968, 298, 6306, 16, 5728, 33, 7036, 16, 1842, 3188, 33, 8381, 4672, 3536, 4444, 87, 512, 3445, 3853, 628, 279, 585, 471, 10294, 2182, 3536, 22...
x.getElementsByTagName('name')[0].firstChild.nodeValue + " - " + x.getElementsByTagName('title')[0].firstChild.nodeValue, matches)
x.getElementsByTagName('name')[0].firstChild.nodeValue + " - " + x.getElementsByTagName('title')[0].firstChild.nodeValue, matches)
def __search(self, song, buffer, refresh, add): artist = song.comma("artist") title = song.comma("title") self.songlist = [] try: sock = urllib.urlopen( "http://api.leoslyrics.com/api_search.php?auth=" "QuodLibet&artist=%s&songtitle=%s"%( urllib.quote(artist.encode('utf-8')), urllib.quote(title.encode('utf-8')))) xmldoc = minidom.parse(sock).documentElement except: gobject.idle_add(buffer.set_text, "Server did not respond.") return
63c128b7327ce6dee959a14868c499dd91d69fbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/63c128b7327ce6dee959a14868c499dd91d69fbf/lyrics.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3072, 12, 2890, 16, 17180, 16, 1613, 16, 4460, 16, 527, 4672, 15469, 273, 17180, 18, 25034, 2932, 25737, 7923, 2077, 273, 17180, 18, 25034, 2932, 2649, 7923, 365, 18, 816, 75, 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, 1001, 3072, 12, 2890, 16, 17180, 16, 1613, 16, 4460, 16, 527, 4672, 15469, 273, 17180, 18, 25034, 2932, 25737, 7923, 2077, 273, 17180, 18, 25034, 2932, 2649, 7923, 365, 18, 816, 75, 1098...
r += "[+ ELSE +]" + c2() + "[+ ENDIF +]" return r def platform_values(platform, group_tag, default_tag):
r += "[+ ELSE +]" + snippet_else + "[+ ENDIF +]" return r def foreach_platform_value(platform, tag, suffix, closure):
def if_platform_tagged(platform, tag, closure, c2=None): r = "" r += "[+ IF " + tag + " defined +]" r += "[+ FOR " + tag + " +][+ CASE " + tag + " +]" for group in RMAP[platform]: r += "[+ = \"" + group + "\" +]" + closure() r += "[+ ESAC +][+ ENDFOR +]" if c2 == None: r += "[+ ENDIF +]" return r r += "[+ ELSE +]" + c2() + "[+ ENDIF +]" return r
c8d22d34fb910911782f3cb62d58a3495edc8286 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9475/c8d22d34fb910911782f3cb62d58a3495edc8286/gentpl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 309, 67, 9898, 67, 23023, 12, 9898, 16, 1047, 16, 7213, 16, 276, 22, 33, 7036, 4672, 436, 273, 1408, 436, 1011, 5158, 15, 11083, 315, 397, 1047, 397, 315, 2553, 397, 4279, 436, 1011, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 309, 67, 9898, 67, 23023, 12, 9898, 16, 1047, 16, 7213, 16, 276, 22, 33, 7036, 4672, 436, 273, 1408, 436, 1011, 5158, 15, 11083, 315, 397, 1047, 397, 315, 2553, 397, 4279, 436, 1011, ...
self.sf.close() except: pass
try: self.sf.close() except: pass finally: self.sf = None
def closeSession(self): # If 'sf' does not exist we don't have a session at all if not hasattr(self, 'sf'): return # But even if we do have 'sf', the connection may have been lost and 'close' will fail try: self.sf.close() except: pass # Now destroy the actual session, which will always trigger an exception, regardless of # actually being connected or not prx = self.ic.getDefaultRouter() router = Glacier2.RouterPrx.checkedCast(prx) try: router.destroySession() except Ice.ConnectionLostException: pass
fe19cee08dc004304b993c57574982b39bc39783 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12409/fe19cee08dc004304b993c57574982b39bc39783/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27578, 12, 2890, 4672, 468, 971, 296, 21668, 11, 1552, 486, 1005, 732, 2727, 1404, 1240, 279, 1339, 622, 777, 309, 486, 3859, 12, 2890, 16, 296, 21668, 11, 4672, 327, 468, 12484, 5456, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27578, 12, 2890, 4672, 468, 971, 296, 21668, 11, 1552, 486, 1005, 732, 2727, 1404, 1240, 279, 1339, 622, 777, 309, 486, 3859, 12, 2890, 16, 296, 21668, 11, 4672, 327, 468, 12484, 5456, ...
if ( PyString_Check(args) ) { OSStatus err;
if ( PyString_Check(v) ) {
#ifdef WITHOUT_FRAMEWORKS
0d3945c1b6ce8c3d7027bc8f9a84299861cf9b01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/0d3945c1b6ce8c3d7027bc8f9a84299861cf9b01/filesupport.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 430, 536, 13601, 5069, 67, 15072, 10566, 55, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 430, 536, 13601, 5069, 67, 15072, 10566, 55, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...