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
else
else:
def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 362) else quickfix.IntField.__init__(self, 362, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 6580, 22, 13, 469, 30, 9549, 904, 18, 1702, 974, 16186, 2738...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 6580, 22, 13, 469, 30, 9549, 904, 18, 1702, 974, 16186, 2738...
cr.execute("select id from ir_module_module where state in ('to install','to upgrade') and name=%s", ('base',)) if cr.rowcount: modobj.update_list(cr, 1)
modobj.update_list(cr, 1)
def load_modules(db, force_demo=False, status=None, update_module=False): if not status: status={} cr = db.cursor() force = [] if force_demo: force.append('demo') pool = pooler.get_pool(cr.dbname) report = tools.assertion_report() if update_module: basegraph = create_graph(['base'], force) load_module_graph(cr, basegraph, status, check_access_rules=False, report=report) modobj = pool.get('ir.module.module') logger.notifyChannel('init', netsvc.LOG_INFO, 'updating modules list') cr.execute("select id from ir_module_module where state in ('to install','to upgrade') and name=%s", ('base',)) if cr.rowcount: modobj.update_list(cr, 1) mods = [k for k in tools.config['init'] if tools.config['init'][k]] if mods: ids = modobj.search(cr, 1, ['&', ('state', '=', 'uninstalled'), ('name', 'in', mods)]) if ids: modobj.button_install(cr, 1, ids) mods = [k for k in tools.config['update'] if tools.config['update'][k]] if mods: ids = modobj.search(cr, 1, ['&',('state', '=', 'installed'), ('name', 'in', mods)]) if ids: modobj.button_upgrade(cr, 1, ids) cr.execute("update ir_module_module set state=%s where name=%s", ('installed', 'base')) cr.execute("select name from ir_module_module where state in ('installed', 'to install', 'to upgrade')") else: cr.execute("select name from ir_module_module where state in ('installed', 'to upgrade')") module_list = [name for (name,) in cr.fetchall()] graph = create_graph(module_list, force) # the 'base' module has already been updated base = graph['base'] base.state = 'installed' for kind in ('init', 'demo', 'update'): if hasattr(base, kind): delattr(base, kind) load_module_graph(cr, graph, status, report=report) if report.get_report(): logger.notifyChannel('init', netsvc.LOG_INFO, report) for kind in ('init', 'demo', 'update'): tools.config[kind]={} cr.commit() if update_module: cr.execute("select id,name from ir_module_module where state in ('to remove')") for mod_id, mod_name in cr.fetchall(): pool = pooler.get_pool(cr.dbname) cr.execute('select model,res_id from ir_model_data where not noupdate and module=%s order by id desc', (mod_name,)) for rmod,rid in cr.fetchall(): uid = 1 pool.get(rmod).unlink(cr, uid, [rid]) cr.commit() # # TODO: remove menu without actions of childs # while True: cr.execute('''delete from ir_ui_menu where (id not in (select parent_id from ir_ui_menu where parent_id is not null)) and (id not in (select res_id from ir_values where model='ir.ui.menu')) and (id not in (select res_id from ir_model_data where model='ir.ui.menu'))''') if not cr.rowcount: break else: logger.notifyChannel('init', netsvc.LOG_INFO, 'removed %d unused menus' % (cr.rowcount,)) cr.execute("update ir_module_module set state=%s where state in ('to remove')", ('uninstalled', )) cr.commit() #pooler.restart_pool(cr.dbname) cr.close()
3732232ac75fff289f3551a35aebb33a21450c06 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/3732232ac75fff289f3551a35aebb33a21450c06/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 6400, 12, 1966, 16, 2944, 67, 27928, 33, 8381, 16, 1267, 33, 7036, 16, 1089, 67, 2978, 33, 8381, 4672, 309, 486, 1267, 30, 1267, 12938, 4422, 273, 1319, 18, 9216, 1435, 2944,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6400, 12, 1966, 16, 2944, 67, 27928, 33, 8381, 16, 1267, 33, 7036, 16, 1089, 67, 2978, 33, 8381, 4672, 309, 486, 1267, 30, 1267, 12938, 4422, 273, 1319, 18, 9216, 1435, 2944,...
simu = simulator(population(), noMating())
simu = simulator(population(), cloneMating())
def getActiveGens(endGen=20, *args, **kwargs): d = opRecorder(*args, **kwargs) simu = simulator(population(), noMating()) simu.evolve(ops=[d], gen=endGen) return simu.population(0).dvars().hist
d2a64a33ec8b3752c1da1631cb187d71b2fdc1b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/401/d2a64a33ec8b3752c1da1631cb187d71b2fdc1b7/test_03_operator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11960, 43, 773, 12, 409, 7642, 33, 3462, 16, 380, 1968, 16, 2826, 4333, 4672, 302, 273, 1061, 10777, 30857, 1968, 16, 2826, 4333, 13, 3142, 89, 273, 3142, 11775, 12, 23555, 9334, 3236, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11960, 43, 773, 12, 409, 7642, 33, 3462, 16, 380, 1968, 16, 2826, 4333, 4672, 302, 273, 1061, 10777, 30857, 1968, 16, 2826, 4333, 13, 3142, 89, 273, 3142, 11775, 12, 23555, 9334, 3236, ...
if self.precondition and hasattr(self,self.precondition):
if self.precondition and hasattr(self, str(self.precondition)):
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
7109384bbfc8e6b0e9150f2caf5c8e0db02d0ff2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7109384bbfc8e6b0e9150f2caf5c8e0db02d0ff2/Image.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 67, 2620, 12, 2890, 16, 12492, 16, 20645, 4672, 3536, 1021, 805, 1476, 434, 326, 2939, 434, 279, 1387, 578, 3421, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 770, 67, 2620, 12, 2890, 16, 12492, 16, 20645, 4672, 3536, 1021, 805, 1476, 434, 326, 2939, 434, 279, 1387, 578, 3421, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
canCapitalize = string.lower(character) != string.upper(character) if not canCapitalize: capCount = 0
if ((string.lower(character) == string.upper(character)) and (character != "'")): wordSoFar = '' wasNonWordChar = True
def _autoCapitalize(self): name = self.get().decode('utf-8') # capitalize each word capName = '' # allow no more than two capital letters per word capCount = 0 capMax = 2 for i in xrange(len(name)): character = name[i] # is it a letter that can be capitalized? # This assumes that string.lower and string.upper will return different # values for all unicode letters. canCapitalize = string.lower(character) != string.upper(character) if not canCapitalize: # this is a non-capitalize-able letter, assume we are between words. # reset the per-word capital letter count capCount = 0 else: capitalize = False # if it's not preceded by a letter, capitalize it unconditionally; # it's the first letter of a word if (i == 0) or string.lower(name[i-1]) == string.upper(name[i-1]): capitalize = True elif capCount < capMax: # we haven't hit the per-word limit for capital letters yet # is it a capital letter? if (character == string.upper(character)): # allow this letter to remain capitalized capitalize = True if capitalize: character = string.upper(character) capCount += 1 else: character = string.lower(character) capName += character self.enterText(capName.encode('utf-8'))
7e1083d8f97f208e4d9cb13ceab3cbf3a414014e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7242/7e1083d8f97f208e4d9cb13ceab3cbf3a414014e/DirectEntry.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 4664, 7053, 554, 12, 2890, 4672, 508, 273, 365, 18, 588, 7675, 3922, 2668, 3158, 17, 28, 6134, 468, 17451, 1517, 2076, 3523, 461, 273, 875, 468, 1699, 1158, 1898, 2353, 2795, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6079, 4664, 7053, 554, 12, 2890, 4672, 508, 273, 365, 18, 588, 7675, 3922, 2668, 3158, 17, 28, 6134, 468, 17451, 1517, 2076, 3523, 461, 273, 875, 468, 1699, 1158, 1898, 2353, 2795, ...
count = int(float((end-start)/step))
count = int(math.ceil((float((end-start)/step))))
def srange(start, end=None, step=1, universe=None, check=True, include_endpoint=False): """ Return list of numbers \code{a, a+step, ..., a+k*step}, where \code{a+k*step < b} and \code{a+(k+1)*step > b}. This is the best way to get an iterator over SAGE integers as opposed to Python int's. It also allows you to specify step sizes to iterate. It is potentially much slower than the Python range statement, depending on your application. INPUT: a -- number b -- number (default: None) step -- number (default: 1) include_endpoint -- whether or not to include the endpoint (default: False) OUTPUT: list If b is None, then b is set equal to a and a is set equal to the 0 in the parent of b. Unlike range, a and b can be any type of numbers, and the resulting list involves numbers of that type. NOTE: This function is called \code{srange} to distinguish it from the builtin Python \code{range} command. The s at the beginning of the name stands for ``SAGE''. SEE ALSO: xsrange -- iterator version EXAMPLES: sage: v = srange(5); v [0, 1, 2, 3, 4] sage: type(v[2]) <type 'sage.rings.integer.Integer'> sage: srange(1, 10) [1, 2, 3, 4, 5, 6, 7, 8, 9] sage: srange(10, 1, -1) [10, 9, 8, 7, 6, 5, 4, 3, 2] sage: srange(10,1,-1, include_endpoint=True) [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] sage: Q = RationalField() sage: srange(1,10,Q('1/2')) [1, 3/2, 2, 5/2, 3, 7/2, 4, 9/2, 5, 11/2, 6, 13/2, 7, 15/2, 8, 17/2, 9, 19/2] sage: R = RealField() sage: srange(1,5,R('0.5')) [1.00000000000000, 1.50000000000000, 2.00000000000000, 2.50000000000000, 3.00000000000000, 3.50000000000000, 4.00000000000000, 4.50000000000000] sage: srange(0,1,R('0.4')) [0.000000000000000, 0.400000000000000, 0.800000000000000] sage: srange(1.0, 5.0, include_endpoint=True) [1.00000000000000, 2.00000000000000, 3.00000000000000, 4.00000000000000, 5.00000000000000] sage: V = VectorSpace(QQ, 2) sage: srange(V([0,0]), V([5,5]), step=V([2,2])) [(0, 0), (2, 2), (4, 4)] """ from sage.structure.sequence import Sequence from sage.rings.all import ZZ if end is None: end = start start = 0 if check: if universe is None: universe = Sequence([start, end, step]).universe() start, end, step = universe(start), universe(end), universe(step) if include_endpoint: if universe in [int, long, ZZ]: if (end-start) % step == 0: end += step else: count = (end-start)/step if count == int(float(count)): end += step if universe is int or universe is long: return range(start, end, step) elif universe is ZZ: return ZZ.range(start, end, step) else: L = [] sign = 1 if step > 0 else -1 # In order for range to make sense, start, end, and step must lie in a 1-dim real subspace... count = int(float((end-start)/step)) if count <= 0: return L # we assume that a+b*c = a + b + ... + b if not (start + (count+1) * step)*sign > end*sign: # we won't get there by adding, perhaps comparison in the ring is bad # rather than enter an infinite loop, do something sensible # the 'not' is hear because incomparable items return False L = [start + k*step for k in range(count)] # this is slower due to coercion and mult elif step > 0: while start < end: L.append(start) start += step elif step < 0: while start > end: L.append(start) start += step else: raise ValueError, "step must not be 0" return L
b0407bebdcafbc7357b33c8faa600978ff6cc467 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b0407bebdcafbc7357b33c8faa600978ff6cc467/misc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 3676, 12, 1937, 16, 679, 33, 7036, 16, 2235, 33, 21, 16, 29235, 33, 7036, 16, 866, 33, 5510, 16, 2341, 67, 8003, 33, 8381, 4672, 3536, 2000, 666, 434, 5600, 521, 710, 95, 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, 272, 3676, 12, 1937, 16, 679, 33, 7036, 16, 2235, 33, 21, 16, 29235, 33, 7036, 16, 866, 33, 5510, 16, 2341, 67, 8003, 33, 8381, 4672, 3536, 2000, 666, 434, 5600, 521, 710, 95, 69, ...
log = subprocess.Popen(['git', 'log', '--no-color', '--first-parent', '--pretty=medium', 'origin'], shell=(os.name == 'nt'), stdout=subprocess.PIPE)
cmd = ['git', 'log', '--no-color', '--first-parent', '--pretty=medium', 'origin/master'] logging.info(' '.join(cmd)) log = subprocess.Popen(cmd, shell=(os.name == 'nt'), stdout=subprocess.PIPE)
def FindSVNRev(target_rev): """Map an SVN revision to a git hash. Like 'git svn find-rev' but without the git-svn bits.""" # We iterate through the commit log looking for "git-svn-id" lines, # which contain the SVN revision of that commit. We can stop once # we've found our target (or hit a revision number lower than what # we're looking for, indicating not found). target_rev = int(target_rev) # regexp matching the "commit" line from the log. commit_re = re.compile(r'^commit ([a-f\d]{40})$') # regexp matching the git-svn line from the log. git_svn_re = re.compile(r'^\s+git-svn-id: [^@]+@(\d+) ') log = subprocess.Popen(['git', 'log', '--no-color', '--first-parent', '--pretty=medium', 'origin'], shell=(os.name == 'nt'), stdout=subprocess.PIPE) # Track whether we saw a revision *later* than the one we're seeking. saw_later = False for line in log.stdout: match = commit_re.match(line) if match: commit = match.group(1) continue match = git_svn_re.match(line) if match: rev = int(match.group(1)) if rev <= target_rev: log.stdout.close() # Break pipe. if rev < target_rev: if not saw_later: return None # Can't be sure whether this rev is ok. print ("WARNING: r%d not found, so using next nearest earlier r%d" % (target_rev, rev)) return commit else: saw_later = True print "Error: reached end of log without finding commit info." print "Something has likely gone horribly wrong." return None
44352fb92c99120b312967481ebe6e000b76bfa4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/44352fb92c99120b312967481ebe6e000b76bfa4/sync-webkit-git.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4163, 23927, 50, 10070, 12, 3299, 67, 9083, 4672, 3536, 863, 392, 29537, 50, 6350, 358, 279, 5071, 1651, 18, 23078, 296, 6845, 5893, 82, 1104, 17, 9083, 11, 1496, 2887, 326, 5071, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4163, 23927, 50, 10070, 12, 3299, 67, 9083, 4672, 3536, 863, 392, 29537, 50, 6350, 358, 279, 5071, 1651, 18, 23078, 296, 6845, 5893, 82, 1104, 17, 9083, 11, 1496, 2887, 326, 5071, 17, ...
func : function
func : ``func(shape, data)``
def func(shape, data): pass
f9765fcc1bdc068ddbeb0748663f6a99218e918b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8535/f9765fcc1bdc068ddbeb0748663f6a99218e918b/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 12, 4867, 16, 501, 4672, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 12, 4867, 16, 501, 4672, 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...
datas.append(dest_dir + "/" + (fn[len(base)+1:], fn, 'DATA'))
if os.path.isfile(fn): datas.append((dest_dir + fn[len(base)+1:], fn, 'DATA'))
def visit((base,dest_dir,datas), dirname, names): for fn in names: fn = os.path.join(dirname, fn) datas.append(dest_dir + "/" + (fn[len(base)+1:], fn, 'DATA'))
edc368d22c0b3a4281fa23ccbc1b215107e18981 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11925/edc368d22c0b3a4281fa23ccbc1b215107e18981/mf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 12443, 1969, 16, 10488, 67, 1214, 16, 13178, 3631, 4283, 16, 1257, 4672, 364, 2295, 316, 1257, 30, 2295, 273, 1140, 18, 803, 18, 5701, 12, 12287, 16, 2295, 13, 5386, 18, 6923, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 12443, 1969, 16, 10488, 67, 1214, 16, 13178, 3631, 4283, 16, 1257, 4672, 364, 2295, 316, 1257, 30, 2295, 273, 1140, 18, 803, 18, 5701, 12, 12287, 16, 2295, 13, 5386, 18, 6923, 12...
for j in range(3):
for j in xrange(3):
def _test0(self): "This makes one long multi-page paragraph." # Build story. story = [] a = story.append styleSheet = getSampleStyleSheet() h1 = styleSheet['Heading1'] h1.pageBreakBefore = 1 h1.keepWithNext = 1 h2 = styleSheet['Heading2'] h2.frameBreakBefore = 1 h2.keepWithNext = 1 h3 = styleSheet['Heading3'] h3.backColor = colors.cyan h3.keepWithNext = 1 bt = styleSheet['BodyText'] a(Paragraph(""" Subsequent pages test pageBreakBefore, frameBreakBefore and keepTogether attributes. Generated at %s. The number in brackets at the end of each paragraph is its position in the story. (%d)""" % ( time.ctime(time.time()), len(story)), bt)) for i in range(10): a(Paragraph('Heading 1 always starts a new page (%d)' % len(story), h1)) for j in range(3): a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) a(Paragraph('Heading 2 always starts a new frame (%d)' % len(story), h2)) a(Paragraph('Heading1 paragraphs should always' 'have a page break before. Heading 2 on the other hand' 'should always have a FRAME break before (%d)' % len(story), bt)) for j in range(3): a(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt)) a(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h3)) a(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt)) a(Paragraph('Now we do &lt;br/&gt; tests', h1)) a(Paragraph('First off no br tags',h3)) a(Paragraph(_text1,bt)) a(Paragraph("&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'the' in line 4",h3)) a(Paragraph(_text1.replace('forms of the','forms of the<br/><br/>',1),bt)) a(Paragraph("&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/>',1),bt)) a(Paragraph("2*&lt;br/&gt; after 'I suggested ' in line 5",h3)) a(Paragraph(_text1.replace('I suggested ','I suggested<br/><br/>',1),bt)) doc = MyDocTemplate(outputfile('test_platypus_breaking.pdf')) doc.multiBuild(story)
4e2840b02ac5973b70f10febb5ebbd3b9df8d339 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/4e2840b02ac5973b70f10febb5ebbd3b9df8d339/test_platypus_breaking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 20, 12, 2890, 4672, 315, 2503, 7297, 1245, 1525, 3309, 17, 2433, 10190, 1199, 225, 468, 3998, 17285, 18, 17285, 273, 5378, 279, 273, 17285, 18, 6923, 282, 2154, 8229, 273, 260...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 20, 12, 2890, 4672, 315, 2503, 7297, 1245, 1525, 3309, 17, 2433, 10190, 1199, 225, 468, 3998, 17285, 18, 17285, 273, 5378, 279, 273, 17285, 18, 6923, 282, 2154, 8229, 273, 260...
def format_option_strings_long_first (self, option): opts = [] takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for lopt in option._long_opts: opts.append(lopt + "=" + metavar) for sopt in option._short_opts: opts.append(sopt + metavar) else: for opt in option._long_opts + option._short_opts: opts.append(opt) return ", ".join(opts)
def format_option_strings_short_first (self, option): opts = [] # list of "-a" or "--foo=FILE" strings takes_value = option.takes_value() if takes_value: metavar = option.metavar or option.dest.upper() for sopt in option._short_opts: opts.append(sopt + metavar) for lopt in option._long_opts: opts.append(lopt + "=" + metavar) else: for opt in option._short_opts + option._long_opts: opts.append(opt) return ", ".join(opts)
05fbfbcaa14cc9093790f5eb3ae75558f3fdb250 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/05fbfbcaa14cc9093790f5eb3ae75558f3fdb250/optparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 3482, 67, 10219, 67, 6620, 67, 3645, 261, 2890, 16, 1456, 4672, 1500, 273, 5378, 15604, 468, 666, 434, 3701, 69, 6, 578, 5238, 11351, 33, 3776, 6, 2064, 5530, 67, 1132, 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, 740, 67, 3482, 67, 10219, 67, 6620, 67, 3645, 261, 2890, 16, 1456, 4672, 1500, 273, 5378, 15604, 468, 666, 434, 3701, 69, 6, 578, 5238, 11351, 33, 3776, 6, 2064, 5530, 67, 1132, 273, ...
"""Iterates over all dates in the range from the first to the last."""
"""Iterate over all dates in the range from the first to the last."""
def __iter__(): """Iterates over all dates in the range from the first to the last."""
5ba2b5ea4a81f7081be373d909b14bfbb8e141d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/5ba2b5ea4a81f7081be373d909b14bfbb8e141d0/interfaces.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2165, 972, 13332, 3536, 22051, 1879, 777, 7811, 316, 326, 1048, 628, 326, 1122, 358, 326, 1142, 12123, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2165, 972, 13332, 3536, 22051, 1879, 777, 7811, 316, 326, 1048, 628, 326, 1122, 358, 326, 1142, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
id = self.id_get(cr, model, w_ref)
id = self.id_get(cr, w_ref)
def _tag_workflow(self, cr, rec, data_node=None): if self.isnoupdate(data_node) and self.mode != 'init': return model = str(rec.get('model','')) w_ref = rec.get('ref','') if w_ref: id = self.id_get(cr, model, w_ref) else: number_children = len(rec) assert number_children > 0,\ 'You must define a child node if you dont give a ref' assert number_children == 1,\ 'Only one child node is accepted (%d given)' % number_children id = _eval_xml(self, rec[0], self.pool, cr, self.uid, self.idref)
4bc20ff99f4251e4705e5836bf656f172bf6fd92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4bc20ff99f4251e4705e5836bf656f172bf6fd92/convert.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2692, 67, 13815, 12, 2890, 16, 4422, 16, 1950, 16, 501, 67, 2159, 33, 7036, 4672, 309, 365, 18, 291, 2135, 2725, 12, 892, 67, 2159, 13, 471, 365, 18, 3188, 480, 296, 2738, 4278,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2692, 67, 13815, 12, 2890, 16, 4422, 16, 1950, 16, 501, 67, 2159, 33, 7036, 4672, 309, 365, 18, 291, 2135, 2725, 12, 892, 67, 2159, 13, 471, 365, 18, 3188, 480, 296, 2738, 4278,...
localCFG = CFG() localCFG.loadFromFile(DIRACROOT+'/etc/dirac.cfg') section = os.path.dirname(option[1:]) if not localCFG.isSection(section): self.__createSection(localCFG,section) localCFG.setOption(option,value) cfgfile = open( DIRACROOT+'/etc/dirac.cfg', "w" ) cfgfile.write(str(localCFG)) return S_OK()
return InstallTools.addOptionToDiracCfg()
def export_setLocalConfigurationOption(self,option,value): """ Set option in the local configuration file """ localCFG = CFG() localCFG.loadFromFile(DIRACROOT+'/etc/dirac.cfg') section = os.path.dirname(option[1:]) if not localCFG.isSection(section): self.__createSection(localCFG,section) localCFG.setOption(option,value) cfgfile = open( DIRACROOT+'/etc/dirac.cfg', "w" ) cfgfile.write(str(localCFG))
12be5ded5b2add0661f20d7fa8bd6def28fb091b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/12be5ded5b2add0661f20d7fa8bd6def28fb091b/SystemAdministratorHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 542, 2042, 1750, 1895, 12, 2890, 16, 3482, 16, 1132, 4672, 3536, 1000, 1456, 316, 326, 1191, 1664, 585, 3536, 1191, 19727, 273, 7577, 1435, 1191, 19727, 18, 945, 13087, 12, 453...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 542, 2042, 1750, 1895, 12, 2890, 16, 3482, 16, 1132, 4672, 3536, 1000, 1456, 316, 326, 1191, 1664, 585, 3536, 1191, 19727, 273, 7577, 1435, 1191, 19727, 18, 945, 13087, 12, 453...
_e_eval_function = lambda *args:printfunc(tuple(args), len(args), prefix="tupleeval")
_e_eval_function = staticmethod(lambda *args:printfunc(tuple(args), len(args), prefix="tupleeval"))
def __str__(self): return "%s" % (tuple(self._e_args),) #e need parens?
e43579121411f5e5828d4cd7348cdefa881eb839 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e43579121411f5e5828d4cd7348cdefa881eb839/Exprs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 2213, 87, 6, 738, 261, 8052, 12, 2890, 6315, 73, 67, 1968, 3631, 13, 468, 73, 1608, 30821, 35, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 2213, 87, 6, 738, 261, 8052, 12, 2890, 6315, 73, 67, 1968, 3631, 13, 468, 73, 1608, 30821, 35, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
print "Done shutting down."
print "DTV: Done shutting down."
def OnShutdown(self):
d65bb3328e720b1cef515093feb0207d55feee02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/d65bb3328e720b1cef515093feb0207d55feee02/app.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 10961, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 10961, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return None
return None, []
def _readmmp(assy, filename, isInsert = False, showProgressDialog = False): """ Read an mmp file, print errors and warnings to history, modify assy in various ways (a bad design, see comment in insertmmp) (but don't actually add file contents to assy -- let caller do that if and where it prefers), and return either None (after an error for which caller should store no file contents at all) or a list of 3 Groups, which caller should treat as having roles "viewdata", "tree", "shelf", regardless of how many toplevel items were in the file, or of whether they were groups. (We handle normal mmp files with exactly those 3 groups, old sim-input files with only the first two, and newer sim-input files for Parts (one group) or for minimize selection (maybe no groups at all). And most other weird kinds of mmp files someone might create.) @param assy: the assembly the file contents are being added into @type assy: assembly.assembly @param filename: where the data will be read from @type filename: string @param isInsert: if True, the file contents are being added to an existing assembly, otherwise the file contents are being used to initialize a new assembly. @type isInsert: boolean @param showProgressDialog: if True, display a progress dialog while reading a file. Default is False. @type showProgressDialog: boolean """ state = _readmmp_state( assy, isInsert) # The following code is experimental. It reads an mmp file that is contained # within a ZIP file. To test, create a zipfile (i.e. "part.zip") which # contains an MMP file named "main.mmp", then rename "part.zip" to # "part.mmp". Set the constant READ_MAINMMP_FROM_ZIPFILE = True, # then run NE1 and open "part.mpp" using "File > Open...". # Mark 2008-02-03 READ_MAINMMP_FROM_ZIPFILE = False # Don't commit with True. if READ_MAINMMP_FROM_ZIPFILE: # Experimental. Read "main.mmp", a standard mmp file contained within # a zipfile opened via "File > Open...". from zipfile import ZipFile _zipfile = ZipFile(filename, 'r') _bytes = _zipfile.read("main.mmp") lines = _bytes.splitlines() else: # The normal way to read an MMP file. lines = open(filename,"rU").readlines() # 'U' in filemode is for universal newline support if not isInsert: assy.filename = filename ###e would it be better to do this at the end, and not at all if we fail? # Create and display a Progress dialog while reading the MMP file. # One issue with this implem is that QProgressDialog always displays # a "Cancel" button, which is not hooked up. I think this is OK for now, # but later we should either hook it up or create our own progress # dialog that doesn't include a "Cancel" button. --mark 2007-12-06 if showProgressDialog: kluge_main_assy = env.mainwindow().assy # see comment about kluge_main_assy elsewhere in this file # [bruce 080319] assert not kluge_main_assy.assy_valid #bruce 080117 _progressValue = 0 _progressFinishValue = len(lines) win = env.mainwindow() win.progressDialog.setLabelText("Reading file...") win.progressDialog.setRange(0, _progressFinishValue) _progressDialogDisplayed = False _timerStart = time.time() for card in lines: try: errmsg = state.readmmp_line( card) # None or an error message except: # note: the following two error messages are similar but not identical errmsg = "bug while reading this mmp line: %s" % (card,) #e include line number; note, two lines might be identical print_compact_traceback("bug while reading this mmp line:\n %s\n" % (card,) ) #e assert errmsg is None or a string if errmsg: ###e general history msg for stopping early on error ###e special return value then?? break if showProgressDialog: # Update the progress dialog. _progressValue += 1 if _progressValue >= _progressFinishValue: win.progressDialog.setLabelText("Building model...") elif _progressDialogDisplayed: win.progressDialog.setValue(_progressValue) # WARNING: this can directly call glpane.paintGL! # So can the other 2 calls here of progressDialog.setValue. # To prevent bugs or slowdowns from drawing incomplete # models or from trying to run updaters (or take undo # checkpoints?) before drawing them, the GLPane now checks # kluge_main_assy.assy_valid to prevent redrawing when this happens. # (Does ThumbView also need this fix?? ### REVIEW) # [bruce 080117 comment / bugfix] else: _timerDuration = time.time() - _timerStart if _timerDuration > 0.25: # Display progress dialog after 0.25 seconds win.progressDialog.setValue(_progressValue) _progressDialogDisplayed = True grouplist = state.extract_toplevel_items() # for a normal mmp file this has 3 Groups, whose roles are viewdata, tree, shelf # now fix up sim input files and other nonstandardly-structured files; # use these extra groups if necessary, else discard them: viewdata = Group("Fake View Data", assy, None) # name is never used or stored shelf = Group("Clipboard", assy, None) # name might not matter since caller resets it for g in grouplist: if not g.is_group(): # might happen for files that ought to be 'one_part', too, I think, if clipboard item was not grouped state.guess_sim_input('missing_group_or_chunk') # normally same warning already went out for the missing chunk tree = Group("tree", assy, None, grouplist) grouplist = [ viewdata, tree, shelf ] break if len(grouplist) == 0: state.format_error("nothing in file") return None elif len(grouplist) == 1: state.guess_sim_input('one_part') # note: 'one_part' gives same warning as 'missing_group_or_chunk' as of 050406 tree = Group("tree", assy, None, grouplist) #bruce 050406 removed [0] to fix bug in last night's new code grouplist = [ viewdata, tree, shelf ] elif len(grouplist) == 2: state.guess_sim_input('no_shelf') grouplist.append( shelf) elif len(grouplist) > 3: state.format_error("more than 3 toplevel groups -- treating them all as in the main part") #bruce 050405 change; old code discarded all the data tree = Group("tree", assy, None, grouplist) grouplist = [ viewdata, tree, shelf ] else: pass # nothing was wrong! assert len(grouplist) == 3 listOfAtomsInFileOrder = state.listOfAtomsInFileOrder state.destroy() # not before now, since it keeps track of which warnings we already emitted if showProgressDialog: # Make the progress dialog go away. win.progressDialog.setValue(_progressFinishValue) return grouplist, listOfAtomsInFileOrder # from _readmmp
3998fff97a3884ef52428d1c15069ef3480921fd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/3998fff97a3884ef52428d1c15069ef3480921fd/files_mmp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 896, 81, 1291, 12, 428, 93, 16, 1544, 16, 353, 4600, 273, 1083, 16, 2405, 5491, 6353, 273, 1083, 4672, 3536, 2720, 392, 312, 1291, 585, 16, 1172, 1334, 471, 5599, 358, 4927, 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, 389, 896, 81, 1291, 12, 428, 93, 16, 1544, 16, 353, 4600, 273, 1083, 16, 2405, 5491, 6353, 273, 1083, 4672, 3536, 2720, 392, 312, 1291, 585, 16, 1172, 1334, 471, 5599, 358, 4927, 16, ...
======= """ This file implements the Grammar class, a grammar type representing a natlink grammar. """ try: import natlink import natlinkutils except ImportError: natlink = None natlinkutils = None import state as state_ import rule as rule_ import list as list_ import compiler as compiler_ import context as context_ import dragonfly.log as log_ class GrammarError(Exception): pass class Grammar(object): _log_load = log_.get_log("grammar.load") _log_begin = log_.get_log("grammar.begin") _log_results = log_.get_log("grammar.results") def __init__(self, name, description=None, context=None): self._name = name self._description = description assert isinstance(context, context_.Context) or context is None self._context = context self._rules = [] self._lists = [] self._rule_names = None self._loaded = False self._enabled = True self._grammar_object = natlink.GramObj() def __del__(self): self.unload() def __str__(self): return "%s(%s)" % (self.__class__.__name__, self._name) name = property(lambda self: self._name, doc="Read-only access to name attribute.") def add_rule(self, rule): """Add a rule to this grammar.""" if self._log_load: self._log_load.debug("Grammar %s: adding rule %s." % (self._name, rule.name)) assert not self._loaded assert isinstance(rule, rule_.Rule), \ "Dragonfly rule objects must be of the type dragonfly.rule.Rule" if rule in self._rules: return elif [True for r in self._rules if r.name == rule.name]: raise GrammarError("Two rules with the same name '%s' not" "allowed." % rule.name) self._rules.append(rule) rule.grammar = self def add_list(self, lst): """Add a list to this grammar.""" if self._log_load: self._log_load.debug("Grammar %s: adding list %s." % (self._name, lst.name)) assert not self._loaded assert isinstance(lst, list_.ListBase), \ "Dragonfly list objects must be of the ListBase." if lst in self._lists: return elif [True for l in self._lists if l.name == lst.name]: raise GrammarError("Two lists with the same name '%s' not" "allowed." % lst.name) self._lists.append(lst) def add_dependency(self, dep): if isinstance(dep, rule_.Rule): self.add_rule(dep) elif isinstance(dep, list_.ListBase): self.add_list(dep) else: raise GrammarError("Unknown dependency type %s." % dep) def i_activate_rule(self, rule): """Activate a rule loaded in this grammar.""" if self._log_load: self._log_load.debug("Grammar %s: activating rule %s." \ % (self._name, rule.name)) assert self._loaded assert isinstance(rule, rule_.Rule), \ "Dragonfly rule objects must be of the type dragonfly.rule.Rule" if rule not in self._rules: raise GrammarError("Rule '%s' not loaded in this grammar." \ % rule.name) self._grammar_object.activate(rule.name, 0) def i_deactivate_rule(self, rule): """Deactivate a rule loaded in this grammar.""" if self._log_load: self._log_load.debug("Grammar %s: deactivating rule %s." \ % (self._name, rule.name)) assert self._loaded assert isinstance(rule, rule_.Rule), \ "Dragonfly rule objects must be of the type dragonfly.rule.Rule" if rule not in self._rules: raise GrammarError("Rule '%s' not loaded in this grammar." \ % rule.name) self._grammar_object.deactivate(rule.name) def update_list(self, lst): """Update a list loaded in this grammar.""" if self._log_load: self._log_load.debug("Grammar %s: updating list %s." \ % (self._name, lst.name)) assert self._loaded if lst not in self._lists: raise GrammarError("List '%s' not loaded in this grammar." \ % lst.name) elif [True for w in lst.get_list_items() if not isinstance(w, (str, unicode))]: raise GrammarError("List '%s' contains objects other than" \ "strings." % lst.name) n = lst.name f = self._grammar_object.appendList self._grammar_object.emptyList(n) [f(n, word) for word in lst.get_list_items()] def load(self): """Load this grammar into natlink.""" if self._loaded: return if self._log_load: self._log_load.debug("Grammar %s: loading." \ % (self._name)) self._grammar_object.setBeginCallback(self._begin_callback) self._grammar_object.setResultsCallback(self._results_callback) self._grammar_object.setHypothesisCallback(None) for r in self._rules: for d in r.i_dependencies(): self.add_dependency(d) c = compiler_.Compiler() [r.i_compile(c) for r in self._rules] compiled_grammar = c.compile() self._rule_names = c.rule_names all_results = False hypothesis = False self._grammar_object.load(compiled_grammar, all_results, hypothesis) self._loaded = True for lst in self._lists: if lst.grammar is None: lst.grammar = self lst._update() def unload(self): """Unload this grammar from natlink.""" if not self._loaded: return if self._log_load: self._log_load.debug("Grammar %s: unloading." \ % (self._name)) self._grammar_object.setBeginCallback(None) self._grammar_object.setResultsCallback(None) self._grammar_object.setHypothesisCallback(None) self._grammar_object.unload() self._loaded = False loaded = property(lambda self: self._loaded, doc = "Whether a grammar is loaded into natlink or not.") def enable(self): """Enable this grammar so that it is active to receive recognitions.""" self._enabled = True def disable(self): """Disable this grammar so that it is not active to receive recognitions.""" self._enabled = False enabled = property(lambda self: self._enabled, doc = "Whether a grammar is active to receive" " recognitions or not.") def _begin_callback(self, module_info): executable, title, handle = module_info if self._log_begin: self._log_begin.debug("Grammar %s:" \ " detected beginning of utterance." % (self._name)) self._log_begin.debug("Grammar %s:" \ " executable '%s', title '%s'." \ % (self._name, executable, title)) if not self._enabled: [r.deactivate() for r in self._rules if r.active] elif self._context \ and not self._context.matches(executable, title, handle): [r.deactivate() for r in self._rules if r.active] else: [r.i_process_begin(executable, title, handle) for r in self._rules if r.exported] if self._log_begin: self._log_begin.debug("Grammar %s:" \ " active rules: %s." \ % (self._name, [r.name for r in self._rules if r.active])) def _results_callback(self, words, results): if words == "other": words_rules = results.getResults(0) elif words == "reject": words_rules = [] else: words_rules = words if self._log_results: self._log_results.debug( \ "Grammar %s: received recognition %s." \ % (self._name, words)) s = state_.State(words_rules, self._rule_names) for r in self._rules: if not r.active: continue s.initialize_decoding() for result in r.i_decode(s): if s.finished(): root, data = s.evaluate() r.process_results(data) r.process_recognition(root) return if self._log_results: self._log_results.warning("Grammar %s:" \ " failed to decode recognition %s." % (self._name, words)) >>>>>>> .r15
def _results_callback(self, words, results): if words == "other": words_rules = results.getResults(0) elif words == "reject": words_rules = [] else: words_rules = words if self._log_results: self._log_results.debug( \ "Grammar %s: received recognition %s." \ % (self._name, words))
59a301b13a5a766985d6665d689c19c0ef6466b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6624/59a301b13a5a766985d6665d689c19c0ef6466b8/grammar_base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4717, 67, 3394, 12, 2890, 16, 4511, 16, 1686, 4672, 309, 4511, 422, 315, 3011, 6877, 565, 4511, 67, 7482, 273, 1686, 18, 588, 3447, 12, 20, 13, 1327, 4511, 422, 315, 24163, 6877, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4717, 67, 3394, 12, 2890, 16, 4511, 16, 1686, 4672, 309, 4511, 422, 315, 3011, 6877, 565, 4511, 67, 7482, 273, 1686, 18, 588, 3447, 12, 20, 13, 1327, 4511, 422, 315, 24163, 6877, ...
begin = process.read_uint( self.get_linear_address('SegFs', 8) ) end = process.read_uint( self.get_linear_address('SegFs', 4) )
begin = process.read_pointer(address + (ptrsize * 2)) end = process.read_pointer(address + ptrsize)
def get_stack_range(self): """ @rtype: tuple( int, int ) @return: Stack beginning and end pointers, in memory addresses order. """ process = self.get_process() begin = process.read_uint( self.get_linear_address('SegFs', 8) ) end = process.read_uint( self.get_linear_address('SegFs', 4) ) return (begin, end)
9e5e2825842110db01bbb8f1878c6cb94a638822 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7261/9e5e2825842110db01bbb8f1878c6cb94a638822/system.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3772, 67, 3676, 12, 2890, 4672, 3536, 632, 86, 723, 30, 225, 3193, 12, 509, 16, 509, 262, 632, 2463, 30, 7283, 8435, 471, 679, 13857, 16, 316, 3778, 6138, 1353, 18, 3536, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3772, 67, 3676, 12, 2890, 4672, 3536, 632, 86, 723, 30, 225, 3193, 12, 509, 16, 509, 262, 632, 2463, 30, 7283, 8435, 471, 679, 13857, 16, 316, 3778, 6138, 1353, 18, 3536, 12...
ret = subprocess.call(('light.exe','gotmgui.wixobj','files.wixobj','-b','../dist','-o','gotmgui.msi'))
ret = subprocess.call(('light.exe','gotmgui.wixobj','files.wixobj','-b','../dist','-o','gotmgui-%s.msi' % version))
def writeline(self,string,addindent=0): if addindent<0: self.indent += addindent self.f.write(self.indent*indent+string+'\n') if addindent>0: self.indent += addindent
3f5df13775b0939764b97b8d28d1571b62cae1ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/3f5df13775b0939764b97b8d28d1571b62cae1ed/buildmsi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2518, 3027, 12, 2890, 16, 1080, 16, 1289, 9355, 33, 20, 4672, 309, 527, 9355, 32, 20, 30, 365, 18, 9355, 1011, 527, 9355, 365, 18, 74, 18, 2626, 12, 2890, 18, 9355, 14, 9355, 15, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2518, 3027, 12, 2890, 16, 1080, 16, 1289, 9355, 33, 20, 4672, 309, 527, 9355, 32, 20, 30, 365, 18, 9355, 1011, 527, 9355, 365, 18, 74, 18, 2626, 12, 2890, 18, 9355, 14, 9355, 15, 1...
read('CHANGES.txt')
read('docs', 'HISTORY.txt')
def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
d471893be737d4f2cf0b0819051c8ed3c3bf9f39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11878/d471893be737d4f2cf0b0819051c8ed3c3bf9f39/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 30857, 86, 1973, 4672, 327, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 380, 86, 1973, 13, 2934, 896, 1435, 225, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 30857, 86, 1973, 4672, 327, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 380, 86, 1973, 13, 2934, 896, 1435, 225, 2, -100, -100, -100,...
None.
True if the crontab was able to be modified, False otherwise.
def setup_linux_or_mac_startup(): """ <Purpose> Sets up seattle to run at startup on this Linux or Macintosh machine. This means adding an entry to crontab after running tests to make sure that cron is running and that the user has the ability to modify the crontab. If any of these tests show problems, the appropriate output is given to the user. Otherwise, if seattle is successfully configured to run automatically at machine boot, then no output is given to the user. <Arguments> None. <Exceptions> UnsupportedOSError if the os is not supported. AlreadyInstalledError if seattle has already been installed on the system. cron nor crond are found on this system. <Side Effects> None. <Returns> None. """ if OS != "Linux" and OS != "Darwin": raise UnsupportedOSError _output("Attempting to add an entry to the crontab...") # The error_output will only be displayed to the user if the ultimate attempt # to add an entry to the crontab fails. error_output = "" # First, check to see that cron is running. # If this check raises a general exception, fall through to continue # attempting to set up the crontab since we want the crontab to be set up # properly in case this user is able to use cron in the future. try: cron_is_running,executable_cron_file = test_cron_is_running() except CannotDetermineCronStatusError: # This exception means cron is installed, though whether or not it is # running cannot be determined. error_output = error_output + "It cannot be determined whether or not " \ + "cron is installed and running. Please confirm with the root user " \ + "that cron is installed and indeed running. If you believe cron is " \ + "running on your system and seattle does not get configured to run " \ + "automatically at startup, please read the following instructions " \ + "or contact the seattle development team if no further " \ + "instructions are given.\n" except Exception,e: # If there is an unexpected exception raised when accessing cron, fall # through the try: block to continue trying to set up the crontab. pass else: if not cron_is_running: _output("cron is not currently running on your system. Only the root " \ + "user may start cron by running the following command:") _output(str(executable_cron_file) + " start") _output("An attempt to setup crontab to run seattle at startup will " \ + "still be made, although seattle will not automatically " \ + "run at startup until cron is started as described above.") # Second, check that the user has permission to use cron. If this check raises # a general exception, fall through to continue attempting to set up the # crontab since we want the crontab to be set up properly in case this user # is able to use cron in the future. try: crontab_accessible,cron_deny_permission_filepath = test_cron_accessibility() except CronAccessibilityFilesPermissionDeniedError,c: error_output = error_output + "One or both of the files listing users " \ + "who have access and who do not have access to use cron have been " \ + "found, but this user does not have permission to read them. If " \ + "seattle does not get configured to run automatically at machine " \ + "boot, it is possible that it is because this user name must be " \ + "listed in the cron 'allow' file which can be found in the man " \ + "document for crontab (found by running the command 'man crontab' " \ + "from the terminal).\n" except CronAccessibilityFilesNotFoundError,n: error_output = error_output + "The cron allow and deny files, which " \ + "specify which users have permission to use the cron service, " \ + "cannot be found. If seattle is not able to be configured to " \ + "run automatically at startup, it may be that your user name " \ + "needs to be added to the cron allow file. The location of this " \ + "cron allow file can be found in the man document for crontab " \ + "(found by running the command 'man crontab' from the terminal).\n" except DetectUserError,d: error_output = error_output + "The cron accessibility files were found, " \ + "but the current user name could not be determined; therefore, the " \ + "ability for this user to use the cron service could not be " \ + "determined. If seattle fails to be configured to run " \ + "automatically at startup, it is probable that the user name needs " \ + "be added to the cron allow file. The location of the cron allow " \ + "file can be found in the man document for crontab (found by " \ + "running the command 'man crontab' from the terminal).\n" except Exception,e: # If there is an unexpected exception raised when accessing the # allow/deny files, fall through the try: block to continue trying to set up # the crontab. pass else: if not crontab_accessible: _output("You do not have permission to use cron which makes seattle " \ + "run automatically at startup. To get permission to use " \ + "the cron service, the root user must remove your user " \ + "name from the " + str(cron_deny_permission_filepath) \ + " file.") servicelogger.log("seattle was not added to the crontab because the " \ + "user does not have permission to use cron.") return False # Lastly, add seattle to the crontab. try: successfully_added_to_crontab = add_seattle_to_crontab() except AlreadyInstalledError,a: raise AlreadyInstalledError() except Exception: if not error_output: _output("seattle could not be configured to run automatically at " \ + "startup on your machine for an unknown reason. It is " \ + "that you do not have permission to access crontab. Please " \ + "contact the seattle development team for more assistance.") servicelogger.log("seattle could not be successfully added to the " \ + "crontab for an unknown reason, although it is " \ + "likely due to the user not having permission to " \ + "use crontab since an exception was most likely " \ + "raised when the 'crontab -l' command was run.") else: _output("seattle could not be configured to run automatically at " \ + "machine boot. Following are more details:") _output(error_output) servicelogger.log("seattle could not be successfully added to the " \ + "crontab. Following was the error output:") servicelogger.log(error_output) return False else: if successfully_added_to_crontab: return True else: if not error_output: _output("seattle could not be configured to run automatically at " \ + "startup on your machine for an unknown reason. Please " \ + "contact the seattle development team for assistance.") servicelogger.log("seattle could not be successfully added to the " \ + "crontab for an unknown reason.") else: _output("seattle could not be configured to run automatically at " \ + "machine boot. Following are more details:") _output(error_output) servicelogger.log("seattle could not be successfully added to the " \ + "crontab. Following was the error output:") servicelogger.log(error_output) return False
77e602aea360b67ee347bb157c15b2538cd3e0d1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/77e602aea360b67ee347bb157c15b2538cd3e0d1/seattleinstaller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 20132, 67, 280, 67, 5821, 67, 23939, 13332, 3536, 411, 10262, 4150, 34, 11511, 731, 695, 4558, 298, 358, 1086, 622, 11850, 603, 333, 13318, 578, 13217, 474, 17636, 5228, 18, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 20132, 67, 280, 67, 5821, 67, 23939, 13332, 3536, 411, 10262, 4150, 34, 11511, 731, 695, 4558, 298, 358, 1086, 622, 11850, 603, 333, 13318, 578, 13217, 474, 17636, 5228, 18, 12...
running = property (lambda self: self.__running) def __init__ (self, query_element = None, pipeline = None):
running = property(lambda self: self.__running) def __init__(self, query_element = None, pipeline = None):
def _finalize (self, event_id, error = None): super (Gst08Operation, self)._finalize (event_id, error) if self.__source is not None: gobject.source_remove (self.__source) self.__source = None
016aec4a85d3438c0d49f1f8b2012e23eb7805ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2207/016aec4a85d3438c0d49f1f8b2012e23eb7805ec/audio.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 30343, 261, 2890, 16, 871, 67, 350, 16, 555, 273, 599, 4672, 2240, 261, 43, 334, 6840, 2988, 16, 365, 2934, 67, 30343, 261, 2575, 67, 350, 16, 555, 13, 309, 365, 16186, 3168, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 30343, 261, 2890, 16, 871, 67, 350, 16, 555, 273, 599, 4672, 2240, 261, 43, 334, 6840, 2988, 16, 365, 2934, 67, 30343, 261, 2575, 67, 350, 16, 555, 13, 309, 365, 16186, 3168, 35...
self.libraries = ['casa_casa', 'pyrap']
self.libraries = ['pyrap', 'casa_casa']
def initialize_options(self): """
dbce75a37fb0829acaa50ded018b8f3f1c6dec1e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7472/dbce75a37fb0829acaa50ded018b8f3f1c6dec1e/setupext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 67, 2116, 12, 2890, 4672, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 4046, 67, 2116, 12, 2890, 4672, 3536, 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, -10...
gLogger.info("RemovalAgent.execute: Successfully removed %s at %s in %s seconds." % (lfn,diracSE,res['Value']['Successful'][lfn])) oRequest.setSubRequestFileAttributeValue(ind,'removal',lfn,'Status','Done')
gLogger.info( "RemovalAgent.execute: Successfully removed %s at %s in %s seconds." % ( lfn, diracSE, res['Value']['Successful'][lfn] ) ) oRequest.setSubRequestFileAttributeValue( ind, 'removal', lfn, 'Status', 'Done' )
def executeRequest(self): ################################################ # Get a request from request DB gMonitor.addMark( "Iteration", 1 ) res = self.RequestDBClient.getRequest('removal') if not res['OK']: gLogger.info("RemovalAgent.execute: Failed to get request from database.") return S_OK() elif not res['Value']: gLogger.info("RemovalAgent.execute: No requests to be executed found.") return S_OK() requestString = res['Value']['RequestString'] requestName = res['Value']['RequestName'] sourceServer= res['Value']['Server'] try: jobID = int(res['Value']['JobID']) except: jobID = 0 gLogger.info("RemovalAgent.execute: Obtained request %s" % requestName)
639c184ef75c7730d44d5168750f1731c63bf98b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/639c184ef75c7730d44d5168750f1731c63bf98b/RemovalAgent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 691, 12, 2890, 4672, 19709, 26487, 13151, 468, 968, 279, 590, 628, 590, 2383, 314, 7187, 18, 1289, 3882, 12, 315, 10795, 3113, 404, 262, 400, 273, 365, 18, 691, 2290, 1227, 18, 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, 1836, 691, 12, 2890, 4672, 19709, 26487, 13151, 468, 968, 279, 590, 628, 590, 2383, 314, 7187, 18, 1289, 3882, 12, 315, 10795, 3113, 404, 262, 400, 273, 365, 18, 691, 2290, 1227, 18, 5...
sll t1, t1, imm
slli t1, t1, imm st t1, ds, [0, t0, t7], disp }; def macroop SAL_R_R { slli reg, reg, regm }; def macroop SAL_M_R { ld t1, ds, [scale, index, base], disp slli t1, t1, reg st t1, ds, [scale, index, base], disp }; def macroop SAL_P_R { rdip t7 ld t1, ds, [0, t0, t7], disp slli t1, t1, reg
def macroop SAL_P_I
15f57bd7cb84892809f6a9793d11ea27895e9b31 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6787/15f57bd7cb84892809f6a9793d11ea27895e9b31/shift.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11522, 556, 348, 1013, 67, 52, 67, 45, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11522, 556, 348, 1013, 67, 52, 67, 45, 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, ...
self.body.append('}')
self.body.append('\\end{DUlegend}\n')
def depart_legend(self, node): self.body.append('}')
ed598cd6757b811933f52a8921093176419ccbdb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8194/ed598cd6757b811933f52a8921093176419ccbdb/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 16292, 12, 2890, 16, 756, 4672, 365, 18, 3432, 18, 6923, 2668, 1713, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 16292, 12, 2890, 16, 756, 4672, 365, 18, 3432, 18, 6923, 2668, 1713, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
self.__skeleton__[table][col_name]['primary_key'] = True
self.__skeleton__[table_name][col_name]['primary_key'] = True
def make_primary_key(self, table, col_name): """ WORD ON THE STREET IS THAT SQLITE IS RETARDED ABOUT *ALTER TABLE* COMMANDS... SO MEANWHILE WE ACCOMPLISH THIS BY CREATING A TEMPORARY TABLE. SUGGESTIONS FOR SPEEDUP ARE WELCOME. (OR JUST SEND A PATCH...)
85d02cb25b26fc015382d67ed0b0b5b5529e5568 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/85d02cb25b26fc015382d67ed0b0b5b5529e5568/database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 8258, 67, 856, 12, 2890, 16, 1014, 16, 645, 67, 529, 4672, 3536, 21464, 6229, 12786, 2347, 862, 1584, 4437, 7662, 789, 3063, 5398, 4437, 10366, 985, 7660, 10336, 5069, 380, 188...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 8258, 67, 856, 12, 2890, 16, 1014, 16, 645, 67, 529, 4672, 3536, 21464, 6229, 12786, 2347, 862, 1584, 4437, 7662, 789, 3063, 5398, 4437, 10366, 985, 7660, 10336, 5069, 380, 188...
disc_map[entry].append( [ self.find_address_from_map(a, begin, entry), self.find_address_from_map(next, begin, entry) ] )
def read_new_map(self, header, begin, end): disc_map = {} a = begin current_piece = None current_start = 0 next_zone = header + self.sector_size # Copy the free space map. free_space = self.free_space[:] while a < end: # The next entry to be read will occur one byte after this one # unless one of the following checks override this behaviour. next = a + 1 if (a % self.sector_size) < 4: # In a zone header. next = a + 4 - (a % self.sector_size) # Set the next zone offset. next_zone = next_zone + self.sector_size elif free_space != [] and a >= free_space[0][0]: # In the next free space entry. Go to the entry following # it and discard this free space entry. next = free_space[0][1] free_space.pop(0) elif current_piece is None and (next_zone - a) >= 2: value = self.str2num(2, self.sectors[a:a+2]) entry = value & 0x7fff # See ADFS/EAddrs.htm document for restriction on # the disc address and hence the file number. # i.e.the top bit of the file number cannot be set. # Entry must be above 1 (defect) if entry > 1: next = a + 2 # Define a new entry. #print "Begin:", hex(entry), hex(a) if not disc_map.has_key(entry): disc_map[entry] = [] # For the relevant entry, add the block to the list # of pieces found and implicitly finish reading this # fragment. disc_map[entry].append( [ self.find_address_from_map(a, begin, entry), self.find_address_from_map(next, begin, entry) ] ) if (value & 0x8000) == 0: # Record the file number and start of this fragment. current_piece = entry current_start = a else: # Search for a valid file number. next = a + 1 else: # In a piece being read. value = ord(self.sectors[a]) if value == 0: # Still in the block. next = a + 1 elif value == 0x80: # At the end of the block. next = a + 1 # For relevant entries add the block to the list of # pieces found. disc_map[current_piece].append( [ self.find_address_from_map( current_start, begin, current_piece ), self.find_address_from_map( next, begin, current_piece ) ] ) current_piece = None else: # The byte found was unexpected - backtrack to the # byte after the start of this block and try again. print "Backtrack from %s to %s" % (hex(a), hex(current_start+1)) next = current_start + 1 current_piece = None # Move to the next relevant byte. a = next #for k, v in disc_map.items(): # # print hex(k), map(lambda x: map(hex, x), v) return disc_map
873d489d618cc2f7b62057fdd588d610e36c54c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3059/873d489d618cc2f7b62057fdd588d610e36c54c2/ADFSlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 2704, 67, 1458, 12, 2890, 16, 1446, 16, 2376, 16, 679, 4672, 225, 19169, 67, 1458, 273, 2618, 225, 279, 273, 2376, 225, 783, 67, 30100, 273, 599, 783, 67, 1937, 273, 374, 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, 855, 67, 2704, 67, 1458, 12, 2890, 16, 1446, 16, 2376, 16, 679, 4672, 225, 19169, 67, 1458, 273, 2618, 225, 279, 273, 2376, 225, 783, 67, 30100, 273, 599, 783, 67, 1937, 273, 374, 22...
if DEBUG: print_exc(file=sys.stderr)
def try_write(self): if self.connected: dead = False try: while self.buffer: buf = self.buffer[0] amount = self.socket.send(buf) if amount == 0: self.skipped += 1 break self.skipped = 0 if amount != len(buf): self.buffer[0] = buf[amount:] break del self.buffer[0] except socket.error, e: if DEBUG: print_exc(file=sys.stderr) blocked=False try: blocked = (e[0] == SOCKET_BLOCK_ERRORCODE) dead = not blocked except: dead = True if not blocked: self.skipped += 1 if self.skipped >= 5: dead = True if dead: self.socket_handler.dead_from_write.append(self) return if self.buffer: self.socket_handler.poll.register(self.socket, all) else: self.socket_handler.poll.register(self.socket, POLLIN)
ae620bb204862d797aec54e5d039a0d29fda77a5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9686/ae620bb204862d797aec54e5d039a0d29fda77a5/SocketHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 775, 67, 2626, 12, 2890, 4672, 225, 309, 365, 18, 8537, 30, 8363, 273, 1083, 775, 30, 1323, 365, 18, 4106, 30, 1681, 273, 365, 18, 4106, 63, 20, 65, 3844, 273, 365, 18, 7814, 18, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 775, 67, 2626, 12, 2890, 4672, 225, 309, 365, 18, 8537, 30, 8363, 273, 1083, 775, 30, 1323, 365, 18, 4106, 30, 1681, 273, 365, 18, 4106, 63, 20, 65, 3844, 273, 365, 18, 7814, 18, 4...
else: x = '0'
def circle(self, attrs): if self.in_defs: id = attrs.get('id', '') if id: self.named_objects[id] = ('object', 'circle', attrs) return if attrs.has_key('cx'): x = attrs['cx'] else: x = '0' if attrs.has_key('cy'): y = attrs['cy'] else: y = '0' x, y = self.point(x, y) r = self.point(attrs['r'], '0', relative = 1).x t = Trafo(r, 0, 0, r, x, y) self._print('circle', t) style = attrs.get('style', '') if style: self.parse_style(style) self.set_loader_style() apply(self.loader.ellipse, t.coeff())
20f97a1a1862b824365b83f00419d19bd29be2c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3123/20f97a1a1862b824365b83f00419d19bd29be2c5/svgloader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12470, 12, 2890, 16, 3422, 4672, 309, 365, 18, 267, 67, 12537, 30, 612, 273, 3422, 18, 588, 2668, 350, 2187, 28707, 309, 612, 30, 365, 18, 13188, 67, 6911, 63, 350, 65, 273, 7707, 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, 12470, 12, 2890, 16, 3422, 4672, 309, 365, 18, 267, 67, 12537, 30, 612, 273, 3422, 18, 588, 2668, 350, 2187, 28707, 309, 612, 30, 365, 18, 13188, 67, 6911, 63, 350, 65, 273, 7707, 16...
Like itermonthdates(), but will yield day numbers tuples. For days outside the specified month the day number is 0.
Like itermonthdates(), but will yield day numbers. For days outside the specified month the day number is 0.
def itermonthdays(self, year, month): """ Like itermonthdates(), but will yield day numbers tuples. For days outside the specified month the day number is 0. """ for date in self.itermonthdates(year, month): if date.month != month: yield 0 else: yield date.day
d81135f5cbf099ad28d623bcb2a4d2ad1f6b34cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/d81135f5cbf099ad28d623bcb2a4d2ad1f6b34cb/calendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 7496, 9810, 12, 2890, 16, 3286, 16, 3138, 4672, 3536, 23078, 1400, 7496, 9683, 9334, 1496, 903, 2824, 2548, 5600, 18, 2457, 4681, 8220, 326, 1269, 3138, 326, 2548, 1300, 353, 374, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 7496, 9810, 12, 2890, 16, 3286, 16, 3138, 4672, 3536, 23078, 1400, 7496, 9683, 9334, 1496, 903, 2824, 2548, 5600, 18, 2457, 4681, 8220, 326, 1269, 3138, 326, 2548, 1300, 353, 374, ...
('L,OffsetToData', 'L,Size', 'L,CodePage', 'L,Reserved'))
('I,OffsetToData', 'I,Size', 'I,CodePage', 'I,Reserved'))
def __init__(self, **args): for key, value in args.items(): setattr(self, key, value)
b1bfd27bf7c329d36f68dc5f4ed5adda7c025501 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4177/b1bfd27bf7c329d36f68dc5f4ed5adda7c025501/pefile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 1968, 4672, 364, 498, 16, 460, 316, 833, 18, 3319, 13332, 9241, 12, 2890, 16, 498, 16, 460, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 1968, 4672, 364, 498, 16, 460, 316, 833, 18, 3319, 13332, 9241, 12, 2890, 16, 498, 16, 460, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
Indexed sequence of elements [21.000000000000000, -3.0000000000000027 - 1.7320508075688741*I, -2.9999999999999964 + 1.7320508075688821*I, -9.0000000000000000 + 0.0000000000000020751629580000000*I, 0.0000000000000013322676295501878 - 0.0000000000000026645352591003757*I, -0.00000000000000088817841970012523 - 0.0000000000000026645352591003757*I] indexed by Cyclic group of order 6 as a permutation group
Indexed sequence: [21.0000000000000, -2.99999999999997 - 1.73205080756885*I, -2.99999999999999 + 1.73205080756888*I, -9.00000000000000 + 0.0000000000000485744257349999*I, -0.00000000000000976996261670137 - 0.0000000000000159872115546022*I, -0.00000000000000621724893790087 - 0.0000000000000106581410364015*I] indexed by Cyclic group of order 6 as a permutation group
def dft(self, chi = lambda x: x): """ Implements a discrete Fourier transform "over QQ" using exact N-th roots of unity.
5d0c7d543a1b24ac0a1d29ac68884870541a3a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/5d0c7d543a1b24ac0a1d29ac68884870541a3a98/dft.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 1222, 12, 2890, 16, 17198, 273, 3195, 619, 30, 619, 4672, 3536, 29704, 279, 20035, 478, 24775, 2510, 315, 1643, 2238, 53, 6, 1450, 5565, 423, 17, 451, 12876, 434, 640, 560, 18, 2,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 1222, 12, 2890, 16, 17198, 273, 3195, 619, 30, 619, 4672, 3536, 29704, 279, 20035, 478, 24775, 2510, 315, 1643, 2238, 53, 6, 1450, 5565, 423, 17, 451, 12876, 434, 640, 560, 18, 2,...
- [1] K-core. Wikipedia. (2007). [Online] Available:
.. [WPkcore] K-core. Wikipedia. (2007). [Online] Available:
def cores(self, with_labels=False): """ Returns the core number for each vertex in an ordered list. 'K-cores in graph theory were introduced by Seidman in 1983 and by Bollobas in 1984 as a method of (destructively) simplifying graph topology to aid in analysis and visualization. They have been more recently defined as the following by Batagelj et al: given a graph G with vertices set V and edges set E, the k-core is computed by pruning all the vertices (with their respective edges) with degree less than k. That means that if a vertex u has degree d_u, and it has n neighbors with degree less than k, then the degree of u becomes d_u - n, and it will be also pruned if k d_u - n. This operation can be useful to filter or to study some properties of the graphs. For instance, when you compute the 2-core of graph G, you are cutting all the vertices which are in a tree part of graph. (A tree is a graph with no loops),' [1]. INPUT: - ``with_labels`` - default False returns list as described above. True returns dict keyed by vertex labels. REFERENCE:
3d6e7c6939400b2aaa5adeeb13dd904c18baaffe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/3d6e7c6939400b2aaa5adeeb13dd904c18baaffe/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15355, 12, 2890, 16, 598, 67, 5336, 33, 8381, 4672, 3536, 2860, 326, 2922, 1300, 364, 1517, 5253, 316, 392, 5901, 666, 18, 225, 296, 47, 17, 12906, 316, 2667, 326, 630, 4591, 26339, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15355, 12, 2890, 16, 598, 67, 5336, 33, 8381, 4672, 3536, 2860, 326, 2922, 1300, 364, 1517, 5253, 316, 392, 5901, 666, 18, 225, 296, 47, 17, 12906, 316, 2667, 326, 630, 4591, 26339, 63...
handlers = [httphandler()]
self.handler = httphandler() handlers = [self.handler]
def __init__(self, ui, path): self.path = path self.caps = None scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path) if query or frag: raise util.Abort(_('unsupported URL component: "%s"') % (query or frag)) if not urlpath: urlpath = '/' host, port, user, passwd = netlocsplit(netloc)
644a7b62b0cefec8af582c89f948d7c1af20b37a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/644a7b62b0cefec8af582c89f948d7c1af20b37a/httprepo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5915, 16, 589, 4672, 365, 18, 803, 273, 589, 365, 18, 22984, 273, 599, 4355, 16, 17345, 16, 880, 803, 16, 843, 16, 10111, 273, 15185, 18, 718, 4939, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5915, 16, 589, 4672, 365, 18, 803, 273, 589, 365, 18, 22984, 273, 599, 4355, 16, 17345, 16, 880, 803, 16, 843, 16, 10111, 273, 15185, 18, 718, 4939, 12...
return string_to_list_of_solutions(a)
sol_list = string_to_list_of_solutions(a) if 'solution_dict' in kwds and kwds['solution_dict']==True: sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list] return sol_dict else: return sol_list
def solve(f, *args, **kwds): """ Algebraically solve an equation of system of equations for given variables. INPUT: f -- equation or system of equations (given by a list or tuple) *args -- variables to solve for. EXAMPLES: sage: x, y = var('x, y') sage: solve([x+y==6, x-y==4], x, y) [[x == 5, y == 1]] sage: solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y) [[x == (-sqrt(3)*I - 1)/2, y == -sqrt(3 - sqrt(3)*I)/sqrt(2)], [x == (-sqrt(3)*I - 1)/2, y == sqrt(3 - sqrt(3)*I)/sqrt(2)], [x == (sqrt(3)*I - 1)/2, y == -sqrt(sqrt(3)*I + 3)/sqrt(2)], [x == (sqrt(3)*I - 1)/2, y == sqrt(sqrt(3)*I + 3)/sqrt(2)], [x == 0, y == -1], [x == 0, y == 1]] """ if isinstance(f, (list, tuple)): m = maxima(list(f)) try: s = m.solve(args) except: raise ValueError, "Unable to solve %s for %s"%(f, args) a = repr(s) return string_to_list_of_solutions(a) else: return f.solve(*args, **kwds)
2a24239c7a06f99972aa77ab93cc52f15cf48280 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/2a24239c7a06f99972aa77ab93cc52f15cf48280/equations.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12439, 12, 74, 16, 380, 1968, 16, 2826, 25577, 4672, 3536, 2262, 29087, 6478, 12439, 392, 15778, 434, 2619, 434, 30369, 364, 864, 3152, 18, 225, 12943, 30, 284, 1493, 15778, 578, 2619, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12439, 12, 74, 16, 380, 1968, 16, 2826, 25577, 4672, 3536, 2262, 29087, 6478, 12439, 392, 15778, 434, 2619, 434, 30369, 364, 864, 3152, 18, 225, 12943, 30, 284, 1493, 15778, 578, 2619, 4...
def init(self): self.emacs = emacs.EmacsClient(self.cb)
def do_init(self): self.emacs = emacs.EmacsClient(self.pida)
def init(self): self.emacs = emacs.EmacsClient(self.cb)
518b82419de485144d055d575c58905409a56188 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/518b82419de485144d055d575c58905409a56188/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 4672, 365, 18, 351, 28965, 273, 801, 28965, 18, 1514, 28965, 1227, 12, 2890, 18, 7358, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 4672, 365, 18, 351, 28965, 273, 801, 28965, 18, 1514, 28965, 1227, 12, 2890, 18, 7358, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
version_page,
dialog.version_page,
def changeBertosVersion(self): dialog = BVersionDialog() if dialog.exec_(): version = qvariant_converter.getString(dialog.version_page.currentItem().data(Qt.UserRole)) if version != current_version: if QMessageBox.question( version_page, self.tr("BeRTOS version update"), self.tr("Changing the BeRTOS version will destroy all the modification done on the BeRTOS sources"), QMessageBox.Ok | QMessageBox.Cancel ) == QMessageBox.Ok: qApp.setOverrideCursor(QCursor(Qt.WaitCursor)) dialog.version_page.setProjectInfo("SOURCES_PATH", version) dialog.version_page.setProjectInfo("OLD_SOURCES_PATH", current_version) enabled_modules = bertos_utils.enabledModules(dialog.version_page.project()) old_configuration = dialog.version_page.projectInfo("CONFIGURATIONS") bertos_utils.loadSourceTree(dialog.version_page.project()) bertos_utils.loadModuleData(dialog.version_page.project()) new_configuration = dialog.version_page.projectInfo("CONFIGURATIONS") merged_configuration = {} for conf in new_configuration: if conf in old_configuration: configuration = bertos_utils.updateConfigurationValues(new_configuration[conf], old_configuration[conf]) else: configuration = new_configuration[conf] merged_configuration[conf] = configuration dialog.version_page.setProjectInfo("CONFIGURATIONS", merged_configuration) bertos_utils.setEnabledModules(dialog.version_page.project(), enabled_modules) self.module_page.fillModuleTree() qApp.restoreOverrideCursor()
c9f5b182bcdf0efabe6be5730ab21e6b74dcd290 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9114/c9f5b182bcdf0efabe6be5730ab21e6b74dcd290/BEditingDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 38, 1051, 538, 1444, 12, 2890, 4672, 6176, 273, 605, 1444, 6353, 1435, 309, 6176, 18, 4177, 67, 13332, 1177, 273, 1043, 8688, 67, 15747, 18, 588, 780, 12, 12730, 18, 1589, 67, 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, 2549, 38, 1051, 538, 1444, 12, 2890, 4672, 6176, 273, 605, 1444, 6353, 1435, 309, 6176, 18, 4177, 67, 13332, 1177, 273, 1043, 8688, 67, 15747, 18, 588, 780, 12, 12730, 18, 1589, 67, 24...
types_commitRegisters = [ types.ListType ]
types_removeRegisters = [ types.ListType ]
def export_remove( self, typeName, startTime, endTime, valuesList ): """ Remove a record for a type """ setup = self.serviceInfoDict[ 'clientSetup' ] typeName = "%s_%s" % ( setup, typeName ) startTime = int( Time.toEpoch( startTime ) ) endTime = int( Time.toEpoch( endTime ) ) return gAccountingDB.deleteRecord( typeName, startTime, endTime, valuesList )
40294d2721f6386cbe907e9f1c8ff4f5bf48e045 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/40294d2721f6386cbe907e9f1c8ff4f5bf48e045/DataStoreHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 4479, 12, 365, 16, 8173, 16, 8657, 16, 13859, 16, 924, 682, 262, 30, 3536, 3581, 279, 1409, 364, 279, 618, 3536, 3875, 273, 365, 18, 3278, 966, 5014, 63, 296, 2625, 7365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 4479, 12, 365, 16, 8173, 16, 8657, 16, 13859, 16, 924, 682, 262, 30, 3536, 3581, 279, 1409, 364, 279, 618, 3536, 3875, 273, 365, 18, 3278, 966, 5014, 63, 296, 2625, 7365, 1...
return self.render()
return self.render(request)
def __call__(self, environ, start_response): if environ['PATH_INFO'].startswith(self.auth_prefix): self.environ = environ self.start = start_response self.body = [] self.base_url = request.construct_url(environ, with_path_info=False, with_query_string=False) path = re.sub(self.auth_prefix, '', environ['PATH_INFO']) self.parsed_uri = urlparse.urlparse(path) self.query = dict(request.parse_querystring(environ)) path = self.parsed_uri[2] if path == '/' or not path: return self.render() elif path == '/verify': return self.do_verify() elif path == '/process': return self.do_process() else: return self.not_found() else: return self.app(environ, start_response)
3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 309, 5473, 3292, 4211, 67, 5923, 29489, 17514, 1918, 12, 2890, 18, 1944, 67, 3239, 4672, 365, 18, 28684, 273, 5473, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 309, 5473, 3292, 4211, 67, 5923, 29489, 17514, 1918, 12, 2890, 18, 1944, 67, 3239, 4672, 365, 18, 28684, 273, 5473, 365, 1...
debug(" setting cookie: %s", cookie)
_debug(" setting cookie: %s", cookie)
def extract_cookies(self, response, request): """Extract cookies from response, where allowable given the request.""" debug("extract_cookies: %s", response.info()) self._cookies_lock.acquire() self._policy._now = self._now = int(time.time())
7fde00696ae6c872310a407df8b8923ab907f247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7fde00696ae6c872310a407df8b8923ab907f247/cookielib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 67, 16240, 12, 2890, 16, 766, 16, 590, 4672, 3536, 4976, 7237, 628, 766, 16, 1625, 30727, 864, 326, 590, 12123, 1198, 2932, 8004, 67, 16240, 30, 738, 87, 3113, 766, 18, 1376, 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, 2608, 67, 16240, 12, 2890, 16, 766, 16, 590, 4672, 3536, 4976, 7237, 628, 766, 16, 1625, 30727, 864, 326, 590, 12123, 1198, 2932, 8004, 67, 16240, 30, 738, 87, 3113, 766, 18, 1376, 107...
if pitch in range(-20, -10):
pitch = pitch * 57.2957795 roll = roll * 57.2957795 if pitch > 50:
def runRemoteControl(): droid.startSensing() time.sleep(1.0) # give the sensors a chance to start up while running: try: sensor_result = droid.readSensors() pitch=int(sensor_result.result['pitch']) roll=int(sensor_result.result['roll']) except TypeError: pitch = 0 roll = 0 specialToast("Failed to read sensors") # Assumes the phone is held in portrait orientation and that # people naturally hold the phone slightly pitched forward. # Translate and scale a bit to keep the values mostly in -150:20 # with 50 degrees forward and back multiple by 2 for a full range -100:100 if pitch in range(-20, -10): speed = 100 droid.vibrate((pitch + 20) * 10) specialToast("Too far forward") # Range for forward elif pitch in range(-70, -20): speed = (pitch + 70) * 2 # Center gutter elif pitch in range(-100, -70): speed = 0 # Range for backward elif pitch in range(-150, -100): speed = (pitch + 100) * 2 elif pitch in range(-170, -150): speed = -100 droid.vibrate(((pitch + 150) *-1) * 10) specialToast("Too far backward") else: # We set speed to zero and fake roll to zero so laying the phone flat stops bot speed = 0 roll =0 # Translate the roll into a direction ranging from -100 (full left) to 100 (full right). # Also support a gutter (dead spot) in the middle and buzz the phone when user is out of range. if roll > 50: direction = -100 droid.vibrate((roll -50) * 10) specialToast("Too far left") elif roll < -50: direction = 100 droid.vibrate(((roll *-1) -50) * 10) specialToast("Too far right") elif roll in range(-5,5): direction = 0 else: # Take the roll that range from 50 to -50 and multiply it by two and reverse the sign direction = roll * 2 * -1 # Reverse turning when going backwards to mimic what happens when steering a non-differential drive system # where direction is really a "bias" and not a true turning angle. if speed < 0: direction = direction * -1 # Clamp speed and direction between -100 and 100 just in case the above let's something slip speed = max(min(speed, 100), -100) direction = max(min(direction, 100), -100) # Apply acceleration scaling factor since linear use of the accelerometer goes to fast with minor tilts scaledSpeed = math.pow(abs(speed) / 100.00, speedScaleFactor) speed = math.copysign(scaledSpeed, speed) * 100.00 scaledDirection = math.pow(abs(direction) / 100.00, directionScaleFactor) direction = math.copysign(scaledDirection, direction) * 100.00 # Okay, speed and direction are now both in the range of -100:100. # Speed=100 means to move forward at full speed. direction=100 means # to turn right as much as possible. # Treat direction as the X axis, and speed as the Y axis. # If we're driving a differential-drive robot (each wheel moving forward # or back), then consider the left wheel as the X axis and the right # wheel as Y. # If we do that, then we can translate [speed,direction] into [left,right] # by rotating by -45 degrees. # See the writeup at http://code.google.com/p/cellbots/wiki/TranslatingUserControls # This actually rotates by 45 degrees and scales by 1.414, so that full # forward = [100,100] right = speed - direction left = speed + direction # But now that we've scaled, asking for full forward + full right turn # means the motors need to go to 141. If we're asking for > 100, scale # back without changing the proportion of forward/turning if abs(left) > 100 or abs(right) > 100: scale = 1.0 # if left is bigger, use it to get the scaling amount if abs(left) > abs(right): scale = 100.0 / abs(left) else: scale = 100.0 / abs(right) left = int(scale * left) right = int(scale * right) #print pitch, roll, int(speed), int(direction) command = "w %d %d" % (left, right) #print command commandOut(command) time.sleep(0.10) sys.exit()
16ff387ae53cb87e0d337381f161afa5119cfc02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5143/16ff387ae53cb87e0d337381f161afa5119cfc02/cellbotRemote.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 5169, 3367, 13332, 302, 5560, 18, 1937, 55, 773, 310, 1435, 813, 18, 19607, 12, 21, 18, 20, 13, 468, 8492, 326, 31349, 279, 17920, 358, 787, 731, 1323, 3549, 30, 775, 30, 10583, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 5169, 3367, 13332, 302, 5560, 18, 1937, 55, 773, 310, 1435, 813, 18, 19607, 12, 21, 18, 20, 13, 468, 8492, 326, 31349, 279, 17920, 358, 787, 731, 1323, 3549, 30, 775, 30, 10583, ...
this = apply(_quickfix.new_RootPartySubIDType, args)
this = _quickfix.new_RootPartySubIDType(*args)
def __init__(self, *args): this = apply(_quickfix.new_RootPartySubIDType, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 2375, 17619, 1676, 734, 559, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 2375, 17619, 1676, 734, 559, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, ...
if m: return int(m.group(1)) return None
if not m: return None s = m.group(1) try: return int(s) except OverflowError: return long(s)
def parse150(resp): '''Parse the '150' response for a RETR request. Returns the expected transfer size or None; size is not guaranteed to be present in the 150 message. ''' if resp[:3] != '150': raise error_reply, resp global _150_re if _150_re is None: import re _150_re = re.compile("150 .* \((\d+) bytes\)", re.IGNORECASE) m = _150_re.match(resp) if m: return int(m.group(1)) return None
6dfbf508da0b3545cb13d0b40a80585300a0773b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6dfbf508da0b3545cb13d0b40a80585300a0773b/ftplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 23014, 12, 12243, 4672, 9163, 3201, 326, 296, 23014, 11, 766, 364, 279, 10366, 54, 590, 18, 2860, 326, 2665, 7412, 963, 578, 599, 31, 963, 353, 486, 15403, 358, 506, 3430, 316, 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, 1109, 23014, 12, 12243, 4672, 9163, 3201, 326, 296, 23014, 11, 766, 364, 279, 10366, 54, 590, 18, 2860, 326, 2665, 7412, 963, 578, 599, 31, 963, 353, 486, 15403, 358, 506, 3430, 316, 3...
header = " "
indent = 1
def dump(self, header): game_count = float(self.count)
bdcfdca30f625b23165d7f66079f1ec6deafafa8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/bdcfdca30f625b23165d7f66079f1ec6deafafa8/process.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 12, 2890, 16, 1446, 4672, 7920, 67, 1883, 273, 1431, 12, 2890, 18, 1883, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 12, 2890, 16, 1446, 4672, 7920, 67, 1883, 273, 1431, 12, 2890, 18, 1883, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
cpu_nanny_cmd = "python win_cpu_nanny.py "+str(os.getpid())+" "+str(cpuallowed)+" "+str(frequency)
cpu_nanny_cmd = "..\python ..\win_cpu_nanny.py "+str(os.getpid())+" "+str(cpuallowed)+" "+str(frequency)
def monitor_cpu_disk_and_mem(cpuallowed, diskallowed, memallowed): if ostype == 'Linux' or ostype == 'Darwin': # The frequency constant here seems to effect the "burstiness" of the # cpu use but not the overall amount. do_forked_monitor(.1, cpuallowed, diskallowed, memallowed) elif ostype == 'Windows': frequency = .2 # start the CPU nanny and tell them our pid and limit... cpu_nanny_cmd = "python win_cpu_nanny.py "+str(os.getpid())+" "+str(cpuallowed)+" "+str(frequency) # need to set the cwd so that we know where to find it. Let's assume it's # in the same directory we are in nannydir = os.path.dirname(sys.argv[0]) # fix it if there is no dir... if nannydir == '': nannydir="." # execute the nanny... junkprocessinfo = subprocess.Popen(cpu_nanny_cmd, cwd=nannydir) # our nanny should outlive us, so it's okay to leave it alone... # now we set up a memory / disk thread nanny... WindowsNannyThread(frequency,diskallowed, memallowed).start() else: raise UnsupportedSystemException, "Unsupported system type: '"+osrealtype+"' (alias: "+ostype+")"
8af407c6c3ded98aa8e1adca130e4f632351fede /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7995/8af407c6c3ded98aa8e1adca130e4f632351fede/nonportable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6438, 67, 11447, 67, 10863, 67, 464, 67, 3917, 12, 4057, 1462, 3788, 16, 4234, 8151, 16, 1663, 8151, 4672, 225, 309, 320, 27273, 422, 296, 19475, 11, 578, 320, 27273, 422, 296, 40, 199...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6438, 67, 11447, 67, 10863, 67, 464, 67, 3917, 12, 4057, 1462, 3788, 16, 4234, 8151, 16, 1663, 8151, 4672, 225, 309, 320, 27273, 422, 296, 19475, 11, 578, 320, 27273, 422, 296, 40, 199...
elif arg.startswith('-namespace:'): self.namespaces = [int(arg[11:])]
elif arg.startswith('-ns:'): self.namespaces.append( int(arg[4:]) )
def __init__(self, args): for arg in args: arg = wikipedia.argHandler(arg, 'casechecker') if arg: if arg.startswith('-from:'): self.apfrom = arg[6:] elif arg.startswith('-from'): self.apfrom = wikipedia.input(u'Which page to start from: ') elif arg.startswith('-reqsize:'): self.aplimit = int(arg[9:]) elif arg == '-links': self.links = True elif arg == '-linksonly': self.links = True self.titles = False elif arg == '-replace': self.replace = True elif arg.startswith('-limit:'): self.stopAfter = int(arg[7:]) elif arg == '-verbose': self.verbose = True elif arg == '-autonomous': self.autonomous = True elif arg.startswith('-namespace:'): self.namespaces = [int(arg[11:])] elif arg.startswith('-wikilog:'): try: self.wikilog = codecs.open(arg[9:], 'a', 'utf-8') except IOError: self.wikilog = codecs.open(arg[9:], 'w', 'utf-8') else: wikipedia.output(u'Unknown argument %s' % arg) sys.exit()
d7ae8d783a650481e56e5f8027b09cf5b7a199dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/d7ae8d783a650481e56e5f8027b09cf5b7a199dc/casechecker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 833, 4672, 225, 364, 1501, 316, 833, 30, 1501, 273, 21137, 18, 3175, 1503, 12, 3175, 16, 296, 3593, 19243, 6134, 309, 1501, 30, 309, 1501, 18, 17514, 191...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 833, 4672, 225, 364, 1501, 316, 833, 30, 1501, 273, 21137, 18, 3175, 1503, 12, 3175, 16, 296, 3593, 19243, 6134, 309, 1501, 30, 309, 1501, 18, 17514, 191...
for account_id, sum in ff: res[account_id][f] = round(sum, dp)
for account_id, hq in ff: res[account_id][f] = round(hq, dp)
def _analysis_all(self, cr, uid, ids, fields, arg, context=None): dp = 2 res = dict([(i, {}) for i in ids])
1a63e1c0446ff8a7681b88775ab2dc9fbd57a788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/1a63e1c0446ff8a7681b88775ab2dc9fbd57a788/account_analytic_analysis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12746, 67, 454, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 1466, 16, 1501, 16, 819, 33, 7036, 4672, 9986, 273, 576, 400, 273, 2065, 3816, 12, 77, 16, 2618, 13, 364, 277, 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, 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, 12746, 67, 454, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 1466, 16, 1501, 16, 819, 33, 7036, 4672, 9986, 273, 576, 400, 273, 2065, 3816, 12, 77, 16, 2618, 13, 364, 277, 316, ...
self._port_handle.RtsEnable = level def setDTR(self, level=1):
self._port_handle.RtsEnable = bool(level) def setDTR(self, level=True):
def setRTS(self, level=1): """Set terminal status line: Request To Send""" if not self._port_handle: raise portNotOpenError self._port_handle.RtsEnable = level
d40fa4acd709af2126b92f5562e2ffdd28a1926e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10955/d40fa4acd709af2126b92f5562e2ffdd28a1926e/serialcli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 54, 8047, 12, 2890, 16, 1801, 33, 21, 4672, 3536, 694, 8651, 1267, 980, 30, 1567, 2974, 2479, 8395, 309, 486, 365, 6315, 655, 67, 4110, 30, 1002, 1756, 1248, 3678, 668, 365, 6315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 54, 8047, 12, 2890, 16, 1801, 33, 21, 4672, 3536, 694, 8651, 1267, 980, 30, 1567, 2974, 2479, 8395, 309, 486, 365, 6315, 655, 67, 4110, 30, 1002, 1756, 1248, 3678, 668, 365, 6315,...
s = idaapi.get_struc(id)
s = idaapi.get_struc(sid)
def GetMemberOffset(id, member_name): """ Get offset of a member of a structure by the member name @param id: structure type ID @param member_name: name of structure member @return: -1 if bad structure type ID is passed or no such member in the structure otherwise returns offset of the specified member. """ s = idaapi.get_struc(id) if not s: return -1 m = idaapi.get_member_by_name(s, member_name) if not m: return -1 return m.get_soff()
4f22943d42ee1d5013421d280b3bd776bee83fb9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3410/4f22943d42ee1d5013421d280b3bd776bee83fb9/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 4419, 2335, 12, 350, 16, 3140, 67, 529, 4672, 3536, 968, 1384, 434, 279, 3140, 434, 279, 3695, 635, 326, 3140, 508, 225, 632, 891, 612, 30, 3695, 618, 1599, 632, 891, 3140, 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, 968, 4419, 2335, 12, 350, 16, 3140, 67, 529, 4672, 3536, 968, 1384, 434, 279, 3140, 434, 279, 3695, 635, 326, 3140, 508, 225, 632, 891, 612, 30, 3695, 618, 1599, 632, 891, 3140, 67, ...
def refresh_groups(self, grp):
def refresh_groups(self, grp, flag=0):
def refresh_groups(self, grp): tmp = wordz_db.list_groups() n = len(tmp) for i in range(0,n): self.get_group.remove_text(0) for x in tmp: self.get_group.append_text(x)
eba433485830e647ddd80b79d3570b93a29200f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10994/eba433485830e647ddd80b79d3570b93a29200f4/wordgroupz_new.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4460, 67, 4650, 12, 2890, 16, 14295, 16, 2982, 33, 20, 4672, 1853, 273, 2076, 94, 67, 1966, 18, 1098, 67, 4650, 1435, 290, 273, 562, 12, 5645, 13, 364, 277, 316, 1048, 12, 20, 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, 4460, 67, 4650, 12, 2890, 16, 14295, 16, 2982, 33, 20, 4672, 1853, 273, 2076, 94, 67, 1966, 18, 1098, 67, 4650, 1435, 290, 273, 562, 12, 5645, 13, 364, 277, 316, 1048, 12, 20, 16, ...
def send_client_header(self):
def proxy_send_client_header(self):
def send_client_header(self): self.logger.log('*** Sending client request header to remote server...') ok = self.client_head_obj.send(self.rserver_socket) if ok: self.client_header_sent = 1 self.logger.log('Done.\n') else: self.rserver_socket_closed = 1 self.logger.log('Failed.\n')
7f2028b2eb7e9e7a49b9303c49b39276e0742d9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2865/7f2028b2eb7e9e7a49b9303c49b39276e0742d9d/proxy_client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2889, 67, 4661, 67, 2625, 67, 3374, 12, 2890, 4672, 365, 18, 4901, 18, 1330, 2668, 14465, 2479, 310, 1004, 590, 1446, 358, 2632, 1438, 7821, 13, 1529, 273, 365, 18, 2625, 67, 1978, 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, 2889, 67, 4661, 67, 2625, 67, 3374, 12, 2890, 4672, 365, 18, 4901, 18, 1330, 2668, 14465, 2479, 310, 1004, 590, 1446, 358, 2632, 1438, 7821, 13, 1529, 273, 365, 18, 2625, 67, 1978, 67,...
global infilename match = re.search (kwd+'\s+\"*([\\\.\+\-,:\w]+)\"*', record) if match: return match.group(1) else: if optional == None: print "\nChecker.py:%55s "%os.path.basename(infilename) print "\nMissing keyword \"", kwd, "\" in\n", record exit (1) else: return optional
global infilename match = re.search (kwd+'\s+\"*([\\\.\+\-,:\w]+)\"*', record) if match: return match.group(1) else: if optional == None: print "\nChecker.py:%55s "%os.path.basename(infilename) print "\nMissing keyword \"", kwd, "\" in\n", record exit (1) else: return optional
def getKeywordValue (record, kwd, optional = None): global infilename match = re.search (kwd+'\s+\"*([\\\.\+\-,:\w]+)\"*', record) if match: return match.group(1) else: #issue an error if argument compulsory if optional == None: print "\nChecker.py:%55s "%os.path.basename(infilename) print "\nMissing keyword \"", kwd, "\" in\n", record exit (1) else: return optional
aa37b2bdfae39b7dbc77c6303652ba62381c3298 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1573/aa37b2bdfae39b7dbc77c6303652ba62381c3298/extractor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3579, 1095, 620, 261, 3366, 16, 417, 3623, 16, 3129, 273, 599, 4672, 2552, 316, 3459, 845, 273, 283, 18, 3072, 261, 79, 3623, 6797, 64, 87, 15, 2412, 14, 3816, 1695, 19002, 15, 12907, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3579, 1095, 620, 261, 3366, 16, 417, 3623, 16, 3129, 273, 599, 4672, 2552, 316, 3459, 845, 273, 283, 18, 3072, 261, 79, 3623, 6797, 64, 87, 15, 2412, 14, 3816, 1695, 19002, 15, 12907, ...
search in groupinfo.description.lower()):
(groupinfo.description and search in groupinfo.description.lower())):
def search(self, query, start=None, batch_size=None): """ Search for groups""" search = query.get('search') if search is not None: i = 0 n = 0 search = search.lower() for id, groupinfo in self.items(): if (search in groupinfo.title.lower() or search in groupinfo.description.lower()): if not ((start is not None and i < start) or (batch_size is not None and n >= batch_size)): n += 1 yield self.prefix+id i += 1
3a2172481fa0221ae11720436d8bd20291c176ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9655/3a2172481fa0221ae11720436d8bd20291c176ec/groupfolder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2890, 16, 843, 16, 787, 33, 7036, 16, 2581, 67, 1467, 33, 7036, 4672, 3536, 5167, 364, 3252, 8395, 1623, 273, 843, 18, 588, 2668, 3072, 6134, 309, 1623, 353, 486, 599, 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, 1623, 12, 2890, 16, 843, 16, 787, 33, 7036, 16, 2581, 67, 1467, 33, 7036, 4672, 3536, 5167, 364, 3252, 8395, 1623, 273, 843, 18, 588, 2668, 3072, 6134, 309, 1623, 353, 486, 599, 30, ...
except SystemExit, code: retcode = code
except SystemExit, code: retcode = code
def launch( self ) : """ Launches the app''s "main", gracefully handling any uncaught exceptions. """ retcode = 1
1fdce715bd7f4bffbafabe0ad7f67d33437d55e3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7707/1fdce715bd7f4bffbafabe0ad7f67d33437d55e3/launcher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8037, 12, 365, 262, 294, 3536, 14643, 281, 326, 595, 6309, 87, 315, 5254, 3113, 25063, 5057, 1281, 6301, 16510, 4798, 18, 3536, 22115, 273, 404, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 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, 8037, 12, 365, 262, 294, 3536, 14643, 281, 326, 595, 6309, 87, 315, 5254, 3113, 25063, 5057, 1281, 6301, 16510, 4798, 18, 3536, 22115, 273, 404, 2, -100, -100, -100, -100, -100, -100, -1...
path = dlg.GetPath().encode('utf-8')
if sys.platform == "win32": path = dlg.GetPath() else: path = dlg.GetPath().encode('utf-8')
def ShowImportDirDialog(): current_dir = os.path.abspath(".") dlg = wx.DirDialog(None, "Choose a DICOM folder:", "", style=wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST | wx.DD_CHANGE_DIR) path = None if dlg.ShowModal() == wx.ID_OK: # GetPath returns in unicode, if a path has non-ascii characters a # UnicodeEncodeError is raised. To avoid this, path is encoded in utf-8 path = dlg.GetPath().encode('utf-8') # Only destroy a dialog after you're done with it. dlg.Destroy() os.chdir(current_dir) return path
ec0af2cb2f6bdd60320f9fef855384843af1536f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/ec0af2cb2f6bdd60320f9fef855384843af1536f/dialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9674, 5010, 1621, 6353, 13332, 783, 67, 1214, 273, 1140, 18, 803, 18, 5113, 803, 2932, 1199, 13, 25840, 273, 7075, 18, 1621, 6353, 12, 7036, 16, 315, 24529, 279, 30530, 3009, 2773, 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, 9674, 5010, 1621, 6353, 13332, 783, 67, 1214, 273, 1140, 18, 803, 18, 5113, 803, 2932, 1199, 13, 25840, 273, 7075, 18, 1621, 6353, 12, 7036, 16, 315, 24529, 279, 30530, 3009, 2773, 16, ...
print 'on_advance: %d %s' % (self.frame, mode)
def on_advance(self, mode): if not hasattr(self.atoms,'__iter__'): return
bf5003eb8d198661fa67a10984ec3567869ae6e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8914/bf5003eb8d198661fa67a10984ec3567869ae6e7/atomeye.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 361, 5882, 12, 2890, 16, 1965, 4672, 309, 486, 3859, 12, 2890, 18, 14937, 11189, 972, 2165, 7250, 4672, 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, 603, 67, 361, 5882, 12, 2890, 16, 1965, 4672, 309, 486, 3859, 12, 2890, 18, 14937, 11189, 972, 2165, 7250, 4672, 327, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
from distutils.msvccompiler import get_build_architecture
from numpy.distutils.misc_util import get_build_architecture
def check_func(func_name): return config_cmd.check_func(func_name, libraries=mathlibs, decl=False, headers=['math.h'])
f83cffb4d354e1d0b9fed801f36be967bae8b1fe /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/f83cffb4d354e1d0b9fed801f36be967bae8b1fe/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 644, 12, 644, 67, 529, 4672, 327, 642, 67, 4172, 18, 1893, 67, 644, 12, 644, 67, 529, 16, 14732, 33, 15949, 21571, 16, 3496, 33, 8381, 16, 1607, 33, 3292, 15949, 18, 76, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 866, 67, 644, 12, 644, 67, 529, 4672, 327, 642, 67, 4172, 18, 1893, 67, 644, 12, 644, 67, 529, 16, 14732, 33, 15949, 21571, 16, 3496, 33, 8381, 16, 1607, 33, 3292, 15949, 18, 76, 1...
'sum_debit_buyer': self.sum_debit_buyer
'sum_debit_buyer': self.sum_debit_buyer, 'get_auc_detail': self.get_auc_detail
def __init__(self, cr, uid, name, context): super(auction_total_rml, self).__init__(cr, uid, name, context) self.localcontext.update({ 'time': time, 'sum_taxes':self.sum_taxes, 'sold_item':self.sold_item, 'sum_buyer':self.sum_buyer, 'sum_seller':self.sum_seller, 'sum_buyer_paid':self.sum_buyer_paid, 'sum_adj':self.sum_adj, 'count_comm':self.count_comm, 'sum_minadj':self.sum_minadj, 'sum_maxadj':self.sum_maxadj, 'sum_credit':self.sum_credit, 'sum_debit': self.sum_debit, 'chek_paid': self.chek_paid, 'check_paid_seller': self.chek_paid, 'count_take': self.count_take, 'sum_credit_seller':self.sum_credit_seller, 'sum_debit_buyer': self.sum_debit_buyer })
616eeef3981b06ec896b775d6aa5d4bbfe2b6125 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7339/616eeef3981b06ec896b775d6aa5d4bbfe2b6125/auction_total_rml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4422, 16, 4555, 16, 508, 16, 819, 4672, 2240, 12, 69, 4062, 67, 4963, 67, 86, 781, 16, 365, 2934, 972, 2738, 972, 12, 3353, 16, 4555, 16, 508, 16, 81...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4422, 16, 4555, 16, 508, 16, 819, 4672, 2240, 12, 69, 4062, 67, 4963, 67, 86, 781, 16, 365, 2934, 972, 2738, 972, 12, 3353, 16, 4555, 16, 508, 16, 81...
for curline in range(len(document.body[i:j])): found = document.body[i+curline].find("\\xymatrix@!")
for curline in range(i,j): found = document.body[curline].find("\\xymatrix@!")
def revert_equalspacing_xymatrix(document): " Revert a Formula with xymatrix@! to an ERT inset " i = 0 j = 0 has_preamble = 0 while True: found = -1 i = find_token(document.body, "\\begin_inset Formula", i) if i == -1: break j = find_end_of_inset(document.body, i) if j == -1: document.warning("Malformed LyX document: Could not find end of Formula inset.") break for curline in range(len(document.body[i:j])): found = document.body[i+curline].find("\\xymatrix@!") if found != -1: break if found != -1: content = document.body[i][21:] for curline in range(len(document.body[i+1:j])): content += document.body[i+1+curline] subst = [put_cmd_in_ert(content)] document.body[i:j+1] = subst else: for curline in range(len(document.body[i:j])): l = document.body[i+curline].find("\\xymatrix") if l != -1: has_preamble = 1; i += 1 if has_preamble == 0: add_to_preamble(document, ['\\usepackage[all]{xy}'])
7ba836548ff380070ac0f0e00647b192fafd6ad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/7ba836548ff380070ac0f0e00647b192fafd6ad3/lyx_2_0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 14963, 84, 5330, 67, 1698, 5667, 12, 5457, 4672, 315, 868, 1097, 279, 26758, 598, 619, 2942, 1942, 36, 5, 358, 392, 4232, 56, 316, 542, 315, 277, 273, 374, 525, 273, 374, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 14963, 84, 5330, 67, 1698, 5667, 12, 5457, 4672, 315, 868, 1097, 279, 26758, 598, 619, 2942, 1942, 36, 5, 358, 392, 4232, 56, 316, 542, 315, 277, 273, 374, 525, 273, 374, ...
extend_online = self.check_path('/usr/sbin/ext2online')
extend_online, dummy = self.__extend_online_cmd()
def __init__(self): creatable = self.check_path('/sbin/mkfs.ext3') mountable = self.check_mountable('ext3', 'ext3') resize_offline = self.check_paths(['/sbin/e2fsck', '/sbin/resize2fs']) extend_online = self.check_path('/usr/sbin/ext2online') Filesystem.__init__(self, 'Ext3', creatable, True, mountable, extend_online, resize_offline, False, resize_offline, 'ext3')
22ab73e65a34adec09aa6a70adf566dd5ae4956e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3880/22ab73e65a34adec09aa6a70adf566dd5ae4956e/Filesystem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 1519, 8163, 273, 365, 18, 1893, 67, 803, 2668, 19, 87, 4757, 19, 24816, 2556, 18, 408, 23, 6134, 5344, 429, 273, 365, 18, 1893, 67, 4778, 429, 2668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 1519, 8163, 273, 365, 18, 1893, 67, 803, 2668, 19, 87, 4757, 19, 24816, 2556, 18, 408, 23, 6134, 5344, 429, 273, 365, 18, 1893, 67, 4778, 429, 2668, ...
class ExtendedHTTPSConnection(HTTPSConnection): def __init__(self, *args, **kwargs): self.ignoreCommonName = kwargs.pop('ignoreCommonName', False) HTTPSConnection.__init__(self, *args, **kwargs) def connect(self): self.sock = SSL.Connection(self.ssl_ctx) if self.session: self.sock.set_session(self.session) if self.ignoreCommonName: self.sock.clientPostConnectionCheck = None self.sock.connect((self.host, self.port)) class HTTPSTransport(HTTPTransport): connectionClass = ExtendedHTTPSConnection def __init__(self, ssl_ctx=None, key_file=None, cert_file=None, ignoreCommonName=False, **kwargs): super(HTTPSTransport, self).__init__(**kwargs) if ssl_ctx: self.ssl_ctx = ssl_ctx else: self.ssl_ctx = SSL.Context('sslv23') if key_file: if not cert_file: cert_file = key_file self.ssl_ctx.load_cert(cert_file, key_file) self.ignoreCommonName = ignoreCommonName def make_connection(self, address): return self.connectionClass(address.host, address.port, ssl_context=self.ssl_ctx, ignoreCommonName=self.ignoreCommonName)
def close_connection(conn): conn.close()
61769e6bb945c23db5c5489dd2f69ff94a42f99f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8749/61769e6bb945c23db5c5489dd2f69ff94a42f99f/rpcproxy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 67, 4071, 12, 4646, 4672, 1487, 18, 4412, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 67, 4071, 12, 4646, 4672, 1487, 18, 4412, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
board.myhash = self.myhash ^ zobrit[p.color][p.sign][cord0.x][cord0.y] board.myhash = self.myhash ^ zobrit[p.color][p.sign][cord1.x][cord1.y]
if not p: print move,"\n",board raise Exception
def move (self, move, mvlist=False): board = self.clone() board.movelist = None cord0, cord1 = move.cords p = board[cord0] board.myhash = self.myhash ^ zobrit[p.color][p.sign][cord0.x][cord0.y] board.myhash = self.myhash ^ zobrit[p.color][p.sign][cord1.x][cord1.y] if p.sign == KING: r = cord0.y if cord0.x - cord1.x == -2: board.data[r][5] = board.data[r][7] board.data[r][7] = None elif cord0.x - cord1.x == 2: board.data[r][3] = board.data[r][0] board.data[r][0] = None elif p.sign == PAWN and cord0.y in (3,4): if cord0.x != cord1.x and board[cord1] == None: board.data[cord1.x][cord0.y] = None board[cord1] = p board[cord0] = None board.color = 1 - self.color if board[cord1].sign == KING: if abs(cord0.x - cord1.x) == 2: if board[cord1].color == WHITE: board.castling |= WHITE_CASTLED board.castling = rm(board.castling, WHITE_OO) board.castling = rm(board.castling, WHITE_OOO) else: board.castling |= BLACK_CASTLED board.castling = rm(board.castling, BLACK_OO) board.castling = rm(board.castling, BLACK_OOO) else: if board[cord1].color == WHITE: board.castling = rm(board.castling, WHITE_OO) board.castling = rm(board.castling, WHITE_OOO) else: board.castling = rm(board.castling, BLACK_OO) board.castling = rm(board.castling, BLACK_OOO) elif board[cord1].sign == ROOK: if board[cord1].color == WHITE: if cord0 == a1: board.castling = rm(board.castling, WHITE_OOO) elif cord0 == h1: board.castling = rm(board.castling, WHITE_OO) else: if cord0 == a8: board.castling = rm(board.castling, BLACK_OOO) elif cord0 == h8: board.castling = rm(board.castling, BLACK_OO) elif board[cord1].sign == PAWN and abs(cord0.y - cord1.y) == 2: self.enpassant = Cord(cord0.x, (cord0.y+cord1.y)/2) else: self.enpassant = None iscapture = self[cord1] != None if iscapture or board[cord1].sign != PAWN: board.fifty += 1 else: board.fifty = 0 if mvlist: board.movelist = validator.findMoves(board) if not board[cord1]: log.warn("How is this move possible? "+str(move)) if board[cord1] and board[cord1].sign == "p" and cord1.y in [0,7]: board[cord1] = Piece(board[cord1].color, move.promotion) return board
f785ddee1e116573dac9adb4ac531b424ac32088 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5339/f785ddee1e116573dac9adb4ac531b424ac32088/Board.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 261, 2890, 16, 3635, 16, 7701, 1098, 33, 8381, 4672, 11094, 273, 365, 18, 14056, 1435, 11094, 18, 8683, 941, 376, 273, 599, 276, 517, 20, 16, 276, 517, 21, 273, 3635, 18, 901, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 261, 2890, 16, 3635, 16, 7701, 1098, 33, 8381, 4672, 11094, 273, 365, 18, 14056, 1435, 11094, 18, 8683, 941, 376, 273, 599, 276, 517, 20, 16, 276, 517, 21, 273, 3635, 18, 901, ...
result = float (matches) / total_trials * 100
def findmatches( numbers ): s = set() ans = False for number in numbers: if numbers.count(number) > 1: s.add(number) ans = True return ans, s
d36614ab9fe8ad9552e8c2222136a007a6faf6da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13318/d36614ab9fe8ad9552e8c2222136a007a6faf6da/birthday.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 8436, 12, 5600, 262, 30, 272, 273, 444, 1435, 4152, 273, 1083, 364, 1300, 316, 5600, 30, 309, 5600, 18, 1883, 12, 2696, 13, 405, 404, 30, 272, 18, 1289, 12, 2696, 13, 4152, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 8436, 12, 5600, 262, 30, 272, 273, 444, 1435, 4152, 273, 1083, 364, 1300, 316, 5600, 30, 309, 5600, 18, 1883, 12, 2696, 13, 405, 404, 30, 272, 18, 1289, 12, 2696, 13, 4152, 273...
maxAge = notifySettings['repos'][repoPath]
maxAge = notifySettings['repos'][repoName]
def _getOldRepoInfo(self, repoName, repoPath, notifySettings, isAdminMonitoring): if isAdminMonitoring: maxAge = notifySettings['adminMaxAge'] else: maxAge = notifySettings['anyRepoMaxAge'] if not maxAge: maxAge = notifySettings['repos'][repoPath]
eb0bdb723915fe44054c8cc8bcaf5f1c6e31b364 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2223/eb0bdb723915fe44054c8cc8bcaf5f1c6e31b364/email_notification.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 7617, 8791, 966, 12, 2890, 16, 3538, 461, 16, 3538, 743, 16, 5066, 2628, 16, 23467, 18410, 4672, 309, 23467, 18410, 30, 20100, 273, 5066, 2628, 3292, 3666, 2747, 9692, 3546, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 7617, 8791, 966, 12, 2890, 16, 3538, 461, 16, 3538, 743, 16, 5066, 2628, 16, 23467, 18410, 4672, 309, 23467, 18410, 30, 20100, 273, 5066, 2628, 3292, 3666, 2747, 9692, 3546, 46...
self.assertRaises(TypeError, u'hello'.count, 42)
self.assertRaises(TypeError, u'hello'.title, 42)
def test_title(self): self.checkmethod('title', u' hello ', u' Hello ') self.checkmethod('title', u'Hello ', u'Hello ') self.checkmethod('title', u'hello ', u'Hello ') self.checkmethod('title', u"fOrMaT thIs aS titLe String", u'Format This As Title String') self.checkmethod('title', u"fOrMaT,thIs-aS*titLe;String", u'Format,This-As*Title;String') self.checkmethod('title', u"getInt", u'Getint')
e84943e3c4b55e713c63a89045aee2de8bf6f858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/e84943e3c4b55e713c63a89045aee2de8bf6f858/test_unicode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2649, 12, 2890, 4672, 365, 18, 1893, 2039, 2668, 2649, 2187, 582, 11, 19439, 2265, 582, 11, 20889, 8624, 365, 18, 1893, 2039, 2668, 2649, 2187, 582, 11, 18601, 2265, 582, 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, 1842, 67, 2649, 12, 2890, 4672, 365, 18, 1893, 2039, 2668, 2649, 2187, 582, 11, 19439, 2265, 582, 11, 20889, 8624, 365, 18, 1893, 2039, 2668, 2649, 2187, 582, 11, 18601, 2265, 582, 11, ...
parser.add_option("-m", "--mysql", dest="mysqldb", default="benchmark.mysql",
parser.add_option("-m", "--mysql", dest="mysqldb", default=None,
def save_as_mysql(dbname, mysqldump): # See http://stackoverflow.com/questions/1067060/perl-to-python import re conn = sqlite3.connect(dbname) mysqldump = open(mysqldump,'w') for line in conn.iterdump(): process = False for nope in ('BEGIN TRANSACTION','COMMIT', 'sqlite_sequence','CREATE UNIQUE INDEX'): if nope in line: break else: process = True if not process: continue line = re.sub(r"[\n\r\t ]+", " ", line) m = re.search('CREATE TABLE ([a-zA-Z0-9_]*)(.*)', line) if m: name, sub = m.groups() sub = sub.replace('"','`') line = '''DROP TABLE IF EXISTS %(name)s; CREATE TABLE IF NOT EXISTS %(name)s%(sub)s ''' line = line % dict(name=name, sub=sub) # make sure we use an engine that supports foreign keys line = line.rstrip("\n\t ;") + " ENGINE = InnoDB;" else: m = re.search('INSERT INTO "([a-zA-Z0-9_]*)"(.*)', line) if m: line = 'INSERT INTO %s%s\n' % m.groups() line = line.replace('"', r'\"') line = line.replace('"', "'") # foreign keys need special attention line = re.sub(r"([a-zA-Z0-9_]+) references ", "\\1 INTEGER, FOREIGN KEY (\\1) references ", line) line = re.sub(r"([^'])'t'(.)", "\\1THIS_IS_TRUE\\2", line) line = line.replace('THIS_IS_TRUE', '1') line = re.sub(r"([^'])'f'(.)", "\\1THIS_IS_FALSE\\2", line) line = line.replace('THIS_IS_FALSE', '0') line = line.replace('AUTOINCREMENT', 'AUTO_INCREMENT') mysqldump.write(line) mysqldump.close()
ba469da958ce3877ff74c2ed3b86538da976c3fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7332/ba469da958ce3877ff74c2ed3b86538da976c3fb/benchmark_statistics.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 67, 345, 67, 12527, 12, 20979, 16, 7219, 8481, 4672, 468, 2164, 1062, 2207, 20672, 18, 832, 19, 9758, 19, 22135, 7301, 4848, 19, 457, 80, 17, 869, 17, 8103, 1930, 283, 1487, 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, 1923, 67, 345, 67, 12527, 12, 20979, 16, 7219, 8481, 4672, 468, 2164, 1062, 2207, 20672, 18, 832, 19, 9758, 19, 22135, 7301, 4848, 19, 457, 80, 17, 869, 17, 8103, 1930, 283, 1487, 273,...
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
def _search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False, access_rights_uid=None):
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): if not context: context = {}
1f9784df87b4f051d56c06c343f2f70da32ed220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1f9784df87b4f051d56c06c343f2f70da32ed220/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3072, 12, 2890, 16, 4422, 16, 729, 16, 833, 16, 1384, 33, 20, 16, 1800, 33, 7036, 16, 1353, 33, 7036, 16, 819, 33, 7036, 16, 1056, 33, 8381, 16, 2006, 67, 23700, 67, 1911, 33,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3072, 12, 2890, 16, 4422, 16, 729, 16, 833, 16, 1384, 33, 20, 16, 1800, 33, 7036, 16, 1353, 33, 7036, 16, 819, 33, 7036, 16, 1056, 33, 8381, 16, 2006, 67, 23700, 67, 1911, 33,...
this = apply(_quickfix.new_EffectiveTime, args)
this = _quickfix.new_EffectiveTime(*args)
def __init__(self, *args): this = apply(_quickfix.new_EffectiveTime, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 28531, 950, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 28531, 950, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, 1...
[2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 3*5^7 + 4*5^8 + O(5^9) 2*5 + 3*5^2 + 3*5^3 + 3*5^4 + 2*5^5 + O(5^7)] [ 2*5 + 3*5^2 + 3*5^3 + 3*5^4 + 2*5^5 + O(5^7) 3*5^3 + 5^4 + 5^6 + O(5^7)]
[2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 3*5^7 + 4*5^8 + O(5^9) 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + O(5^9)] [ 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + O(5^9) 5 + 4*5^2 + 4*5^3 + 2*5^4 + 4*5^5 + 5^6 + O(5^9)]
def padic_height_pairing_matrix(self, p, prec=20, height=None, check_hypotheses=True): r""" Computes the cyclotomic $p$-adic height pairing matrix of this curve with respect to the basis self.gens() for the Mordell-Weil group for a given odd prime p of good ordinary reduction.
95c03dd8fe032e35e516da8dcd1201fcd934b7e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/95c03dd8fe032e35e516da8dcd1201fcd934b7e6/ell_rational_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4627, 335, 67, 4210, 67, 6017, 310, 67, 5667, 12, 2890, 16, 293, 16, 13382, 33, 3462, 16, 2072, 33, 7036, 16, 866, 67, 76, 879, 10370, 281, 281, 33, 5510, 4672, 436, 8395, 14169, 281...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4627, 335, 67, 4210, 67, 6017, 310, 67, 5667, 12, 2890, 16, 293, 16, 13382, 33, 3462, 16, 2072, 33, 7036, 16, 866, 67, 76, 879, 10370, 281, 281, 33, 5510, 4672, 436, 8395, 14169, 281...
o = os.popen("%s -t" % sendmail,"w")
o = os.popen("%(a)s -t -f %(b)s" % {'a':sendmail, 'b':from_email},"w")
def sendmailme(to_email, msg, email_subject=None, from_email=None, html=True, sendmail=SENDMAIL): """ Quick and dirty, pipe a message to sendmail. Can only work on UNIX type systems with sendmail. Will need the path to sendmail - defaults to the 'SENDMAIL' constant. ``to_email`` can be a single email address, *or* a list of addresses. *Assumes* you are sending an html email created by ``createhtmlmail``. If this isn't the case then set ``html=False``. """ if not isinstance(to_email, list): to_email = [to_email] o = os.popen("%s -t" % sendmail,"w") o.write("To: %s\r\n" % ','.join(to_email)) if from_email: o.write("From: %s\r\n" % from_email) if not html and email_subject: o.write("Subject: %s\r\n" % email_subject) o.write("\r\n") o.write("%s\r\n" % msg) o.close()
e29a21cd6df8f1f7adf1f3c2ddf24842d7e9f22b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7008/e29a21cd6df8f1f7adf1f3c2ddf24842d7e9f22b/cgiutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 4408, 3501, 12, 869, 67, 3652, 16, 1234, 16, 2699, 67, 7857, 33, 7036, 16, 628, 67, 3652, 33, 7036, 16, 1729, 33, 5510, 16, 1366, 4408, 33, 21675, 18191, 4672, 3536, 19884, 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, 1366, 4408, 3501, 12, 869, 67, 3652, 16, 1234, 16, 2699, 67, 7857, 33, 7036, 16, 628, 67, 3652, 33, 7036, 16, 1729, 33, 5510, 16, 1366, 4408, 33, 21675, 18191, 4672, 3536, 19884, 471, ...
- ``proof`` - a boolean (default ``False``), requres height_bound to be set
- ``proof`` - a boolean (default: ``False``), requires height_bound to be set
def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z` is a good approximation to an algebraic number of degree less than `degree`. You can specify the number of known bits or digits with ``known_bits=k`` or ``known_digits=k``; Pari is then told to compute the result using `0.8k` of these bits/digits. (The Pari documentation recommends using a factor between .6 and .9, but internally defaults to .8.) Or, you can specify the precision to use directly with ``use_bits=k`` or ``use_digits=k``. If none of these are specified, then the precision is taken from the input value. A height bound may specified to indicate the maximum coefficient size of the returned polynomial; if a sufficiently small polyomial is not found then ``None`` wil be returned. If ``proof=True`` then the result is returned only if it can be proved correct (i.e. the only possible minimal polynomial satisfying the height bound, or no such polynomial exists). Otherwise a ``ValueError`` is raised indicating that higher precision is required. ALGORITHM: Uses LLL for real/complex inputs, PARI C-library algdep command otherwise. Note that ``algebraic_dependency`` is a synonym for ``algdep``. INPUT: - ``z`` - real, complex, or `p`-adic number - ``degree`` - an integer - ``height_bound`` - an integer (default ``None``) specifying the maximum coefficient size for the returned polynomial - ``proof`` - a boolean (default ``False``), requres height_bound to be set EXAMPLES:: sage: algdep(1.888888888888888, 1) 9*x - 17 sage: algdep(0.12121212121212,1) 33*x - 4 sage: algdep(sqrt(2),2) x^2 - 2 This example involves a complex number. :: sage: z = (1/2)*(1 + RDF(sqrt(3)) *CC.0); z 0.500000000000000 + 0.866025403784439*I sage: p = algdep(z, 6); p x^3 + 1 sage: p.factor() (x + 1) * (x^2 - x + 1) sage: z^2 - z + 1 0 This example involves a `p`-adic number. :: sage: K = Qp(3, print_mode = 'series') sage: a = K(7/19); a 1 + 2*3 + 3^2 + 3^3 + 2*3^4 + 2*3^5 + 3^8 + 2*3^9 + 3^11 + 3^12 + 2*3^15 + 2*3^16 + 3^17 + 2*3^19 + O(3^20) sage: algdep(a, 1) 19*x - 7 These examples show the importance of proper precision control. We compute a 200-bit approximation to sqrt(2) which is wrong in the 33'rd bit. :: sage: z = sqrt(RealField(200)(2)) + (1/2)^33 sage: p = algdep(z, 4); p 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088 sage: factor(p) 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088 sage: algdep(z, 4, known_bits=32) x^2 - 2 sage: algdep(z, 4, known_digits=10) x^2 - 2 sage: algdep(z, 4, use_bits=25) x^2 - 2 sage: algdep(z, 4, use_digits=8) x^2 - 2 Using the ``height_bound`` and ``proof`` parameters, we can see that `pi` is not the root of an integer polynomial of degree at most 5 and coefficients bounded above by 10. :: sage: algdep(pi.n(), 5, height_bound=10, proof=True) is None True For stronger results, we need more precicion. :: sage: algdep(pi.n(), 5, height_bound=100, proof=True) is None Traceback (most recent call last): ... ValueError: insufficient precision for non-existence proof sage: algdep(pi.n(200), 5, height_bound=100, proof=True) is None True sage: algdep(pi.n(), 10, height_bound=10, proof=True) is None Traceback (most recent call last): ... ValueError: insufficient precision for non-existence proof sage: algdep(pi.n(200), 10, height_bound=10, proof=True) is None True We can also use ``proof=True`` to get positive results. :: sage: a = sqrt(2) + sqrt(3) + sqrt(5) sage: algdep(a.n(), 8, height_bound=1000, proof=True) Traceback (most recent call last): ... ValueError: insufficient precision for uniqueness proof sage: f = algdep(a.n(1000), 8, height_bound=1000, proof=True); f x^8 - 40*x^6 + 352*x^4 - 960*x^2 + 576 sage: f(a).expand() 0 """ if proof and not height_bound: raise ValueError, "height_bound must be given for proof=True" x = ZZ['x'].gen() if isinstance(z, (int, long, integer.Integer)): if height_bound and abs(z) >= height_bound: return None return x - ZZ(z) degree = ZZ(degree) if isinstance(z, (sage.rings.rational.Rational)): if height_bound and max(abs(z.denominator()), abs(z.numerator())) >= height_bound: return None return z.denominator()*x - z.numerator() if isinstance(z, float): z = sage.rings.real_mpfr.RR(z) elif isinstance(z, complex): z = sage.rings.complex_field.CC(z) if isinstance(z, (sage.rings.real_mpfr.RealNumber, sage.rings.complex_number.ComplexNumber)): log2_10 = 3.32192809488736 prec = z.prec() - 6 if known_digits is not None: known_bits = known_digits * log2_10 if known_bits is not None: use_bits = known_bits * 0.8 if use_digits is not None: use_bits = use_digits * log2_10 if use_bits is not None: prec = int(use_bits) is_complex = isinstance(z, sage.rings.complex_number.ComplexNumber) n = degree+1 from sage.matrix.all import matrix M = matrix(ZZ, n, n+1+int(is_complex)) r = ZZ(1) << prec M[0, 0] = 1 M[0,-1] = r for k in range(1, degree+1): M[k,k] = 1 r *= z if is_complex: M[k, -1] = r.real().round() M[k, -2] = r.imag().round() else: M[k, -1] = r.round() LLL = M.LLL(delta=.75) coeffs = LLL[0][:n] if height_bound: def norm(v): # norm on an integer vector invokes Integer.sqrt() which tries to factor... from sage.rings.real_mpfi import RIF return v.change_ring(RIF).norm() if max(abs(a) for a in coeffs) > height_bound: if proof: # Given an LLL reduced basis $b_1, ..., b_n$, we only # know that $|b_1| <= 2^((n-1)/2) |x|$ for non-zero $x \in L$. if norm(LLL[0]) <= 2**((n-1)/2) * n.sqrt() * height_bound: raise ValueError, "insufficient precision for non-existence proof" return None elif proof and norm(LLL[1]) < 2**((n-1)/2) * max(norm(LLL[0]), n.sqrt()*height_bound): raise ValueError, "insufficient precision for uniqueness proof" if coeffs[degree] < 0: coeffs = -coeffs f = list(coeffs) elif proof or height_bound: raise NotImplementedError, "proof and height bound only implemented for real and complex numbers" else: y = pari(z) f = y.algdep(degree) return x.parent()(f)
77a54f69e28a7333c3cd3eba5214f2a668319f2c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/77a54f69e28a7333c3cd3eba5214f2a668319f2c/arith.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11989, 15037, 12, 94, 16, 10782, 16, 4846, 67, 6789, 33, 7036, 16, 999, 67, 6789, 33, 7036, 16, 4846, 67, 16649, 33, 7036, 16, 999, 67, 16649, 33, 7036, 16, 2072, 67, 3653, 33, 7036,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11989, 15037, 12, 94, 16, 10782, 16, 4846, 67, 6789, 33, 7036, 16, 999, 67, 6789, 33, 7036, 16, 4846, 67, 16649, 33, 7036, 16, 999, 67, 16649, 33, 7036, 16, 2072, 67, 3653, 33, 7036,...
filename = "" extension = True def __init__(self, label='grid', condition=None): FileParser.__init__(self, label, condition) def reset(self): self.grid = None self.counter = 0 def parse(self, line): if self.grid is None: if line[:21] == " num = int(line[21:]) self.grid = numpy.zeros((num, 4), float) else:
filename = ".out" extension = True def __init__(self, label='grid', trigger=None, condition=None): self.trigger = trigger FileParser.__init__(self, label, condition) def reset(self): self.grid = [] self.active = (self.trigger == None) def parse(self, line): if self.active:
def result(self): if self.num_atoms != None: result = numpy.zeros((self.num_atoms*3, self.num_atoms*3), float) counter = 0 for i in xrange(self.num_atoms*3): for j in xrange(0, i): result[i,j] = self.hessian_elements[counter] result[j,i] = self.hessian_elements[counter] counter += 1 result[i,i] = self.hessian_elements[counter] counter += 1 return result
df6409ad85dfe3891d12c2c83e1fc571a4ca3db2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11053/df6409ad85dfe3891d12c2c83e1fc571a4ca3db2/file_parsers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 563, 12, 2890, 4672, 309, 365, 18, 2107, 67, 14937, 480, 599, 30, 563, 273, 3972, 18, 22008, 12443, 2890, 18, 2107, 67, 14937, 14, 23, 16, 365, 18, 2107, 67, 14937, 14, 23, 3631, 143...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 563, 12, 2890, 4672, 309, 365, 18, 2107, 67, 14937, 480, 599, 30, 563, 273, 3972, 18, 22008, 12443, 2890, 18, 2107, 67, 14937, 14, 23, 16, 365, 18, 2107, 67, 14937, 14, 23, 3631, 143...
return True
return True r = True for hname, cmd in self.ui.configitems("hooks"): s = hname.split(".") if s[0] == name and cmd: r = runhook(hname, cmd) and r return r
def hook(self, name, **args): s = self.ui.config("hooks", name) if s: self.ui.note(_("running hook %s: %s\n") % (name, s)) old = {} for k, v in args.items(): k = k.upper() old[k] = os.environ.get(k, None) os.environ[k] = v
daa952c52b23e93f4023239a51d39063ce34eac5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/daa952c52b23e93f4023239a51d39063ce34eac5/localrepo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3953, 12, 2890, 16, 508, 16, 2826, 1968, 4672, 272, 273, 365, 18, 4881, 18, 1425, 2932, 10468, 3113, 508, 13, 309, 272, 30, 365, 18, 4881, 18, 7652, 24899, 2932, 8704, 3953, 738, 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, 3953, 12, 2890, 16, 508, 16, 2826, 1968, 4672, 272, 273, 365, 18, 4881, 18, 1425, 2932, 10468, 3113, 508, 13, 309, 272, 30, 365, 18, 4881, 18, 7652, 24899, 2932, 8704, 3953, 738, 87, ...
builder.append(unichr(chr))
builder.append(UNICHR(chr))
def hexescape(builder, s, pos, digits, encoding, errorhandler, message, errors): import sys chr = 0 if pos + digits > len(s): message = "end of string in escape sequence" res, pos = errorhandler(errors, "unicodeescape", message, s, pos-2, len(s)) builder.append(res) else: try: chr = r_uint(int(s[pos:pos+digits], 16)) except ValueError: endinpos = pos while s[endinpos] in hexdigits: endinpos += 1 res, pos = errorhandler(errors, encoding, message, s, pos-2, endinpos+1) builder.append(res) else: # when we get here, chr is a 32-bit unicode character if chr <= MAXUNICODE: builder.append(unichr(chr)) pos += digits elif chr <= 0x10ffff: chr -= 0x10000L builder.append(unichr(0xD800 + (chr >> 10))) builder.append(unichr(0xDC00 + (chr & 0x03FF))) pos += digits else: message = "illegal Unicode character" res, pos = errorhandler(errors, encoding, message, s, pos-2, pos+digits) builder.append(res) return pos
4b7cda27b028f6294e3089272cf6ea1eab2275f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/4b7cda27b028f6294e3089272cf6ea1eab2275f7/runicode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3827, 6939, 12, 9574, 16, 272, 16, 949, 16, 6815, 16, 2688, 16, 555, 4176, 16, 883, 16, 1334, 4672, 1930, 2589, 4513, 273, 374, 309, 949, 397, 6815, 405, 562, 12, 87, 4672, 883, 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, 3827, 6939, 12, 9574, 16, 272, 16, 949, 16, 6815, 16, 2688, 16, 555, 4176, 16, 883, 16, 1334, 4672, 1930, 2589, 4513, 273, 374, 309, 949, 397, 6815, 405, 562, 12, 87, 4672, 883, 273,...
logging.getLogger('report').exception(e)
logging.getLogger('report').warning('rml_except: "%s"',n.get('rml_except',''), exc_info=True)
def _child_get(node, self=None, tagname=None): for n in node: if self and self.localcontext and n.get('rml_loop'): for ctx in eval(n.get('rml_loop'),{}, self.localcontext): self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception, e: logging.getLogger('report').exception(e) continue if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr) yield n2 except GeneratorExit: yield n except Exception, e: logging.getLogger('report').exception(e) yield n else: yield n continue if self and self.localcontext and n.get('rml_except'): try: eval(n.get('rml_except'), {}, self.localcontext) except GeneratorExit: continue except Exception, e: logging.getLogger('report').exception(e) continue if self and self.localcontext and n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.deepcopy(n) n2.tag = tag n2.attrib.update(attr or {}) yield n2 tagname = '' except GeneratorExit: pass except Exception, e: logging.getLogger('report').exception(e) pass if (tagname is None) or (n.tag==tagname): yield n
1c0849899f3c33f12ad9257775ddb51dde9fca83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/1c0849899f3c33f12ad9257775ddb51dde9fca83/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3624, 67, 588, 12, 2159, 16, 365, 33, 7036, 16, 25586, 33, 7036, 4672, 364, 290, 316, 756, 30, 309, 365, 471, 365, 18, 3729, 2472, 471, 290, 18, 588, 2668, 86, 781, 67, 6498, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3624, 67, 588, 12, 2159, 16, 365, 33, 7036, 16, 25586, 33, 7036, 4672, 364, 290, 316, 756, 30, 309, 365, 471, 365, 18, 3729, 2472, 471, 290, 18, 588, 2668, 86, 781, 67, 6498, ...
if len(lfns) > 2:
if len( lfns ) > 2:
def getReplicas(self,lfn,allStatus=False): """ Returns replicas for an LFN or list of LFNs """ res = self.__checkArgumentFormat(lfn) if not res['OK']: return res lfns = res['Value'] # If we have less than three lfns to query a session doesn't make sense created = False if len(lfns) > 2: created = self.__openSession() failed = {} successful = {} for lfn in lfns.keys(): res = self.__getFileReplicas(lfn,allStatus) if not res['OK']: failed[lfn] = res['Message'] else: successful[lfn] = res['Value'] if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict)
6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5561, 10528, 12, 2890, 16, 80, 4293, 16, 454, 1482, 33, 8381, 4672, 3536, 2860, 21545, 364, 392, 18803, 50, 578, 666, 434, 18803, 10386, 3536, 400, 273, 365, 16186, 1893, 1379, 1630, 12,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5561, 10528, 12, 2890, 16, 80, 4293, 16, 454, 1482, 33, 8381, 4672, 3536, 2860, 21545, 364, 392, 18803, 50, 578, 666, 434, 18803, 10386, 3536, 400, 273, 365, 16186, 1893, 1379, 1630, 12,...
f_mask = bulk_solvent_mask_obj.structure_factors(self.miller_set) assert f_mask.indices().all_eq( self.miller_set.indices() ) if([f_calc, f_mask].count(None) == 2): set_core_flag = False if(f_calc is None): f_calc = self.f_atoms if(f_mask is None): f_mask = self.f_mask_array self.update_core(f_calc = f_calc, f_mask = f_mask, b_cart = b_cart, k_sol = k_sol, b_sol = b_sol)
f_mask = bulk_solvent_mask_obj.structure_factors(miller_set= self.miller_set) if([f_calc, f_mask].count(None) == 2): set_core_flag = False else: set_core_flag = True if(f_calc is None): f_calc = self.f_calc() if(f_mask is None): f_mask = self.f_mask() if(set_core_flag): self.update_core(f_calc = f_calc, f_mask = f_mask, b_cart = b_cart, k_sol = k_sol, b_sol = b_sol)
def update_xray_structure(self, xray_structure = None, update_f_calc = False, update_f_mask = False, update_f_ordered_solvent = False, force_update_f_mask = False, out = None, k_sol = None, b_sol = None, b_cart = None): consider_mask_update = None set_core_flag =True if xray_structure is not None: self.xray_structure = xray_structure
5be1688480ae84cbec806fb56576b6e1cb83dd3d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/5be1688480ae84cbec806fb56576b6e1cb83dd3d/twin_f_model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 92, 435, 67, 7627, 12, 2890, 16, 619, 435, 67, 7627, 6647, 273, 599, 16, 1089, 67, 74, 67, 12448, 5411, 273, 1083, 16, 1089, 67, 74, 67, 4455, 5411, 273, 1083, 16, 1089, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 92, 435, 67, 7627, 12, 2890, 16, 619, 435, 67, 7627, 6647, 273, 599, 16, 1089, 67, 74, 67, 12448, 5411, 273, 1083, 16, 1089, 67, 74, 67, 4455, 5411, 273, 1083, 16, 1089, ...
return self.tk.call(self._w, 'header', 'exists', col)
return self.tk.call(self._w, 'header', 'exists', col)
def header_exists(self, col):
86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1446, 67, 1808, 12, 2890, 16, 225, 645, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1446, 67, 1808, 12, 2890, 16, 225, 645, 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, ...
logging.error(u'You can configure backends using the "weboob-config add" command:\nweboob-config add <name> [options..]')
weboobcfg.formatter.flush() print '\nYou can configure backends with weboob-config:\n\tweboob-config add <name> [options..]'
def load_backends(self, caps=None, names=None, *args, **kwargs): loaded_backends = BaseApplication.load_backends(self, caps, names, *args, **kwargs) if not loaded_backends: logging.error(u'Cannot start application: no configured backend was found.\nHere is a list of all available backends:') from weboob.applications.weboobcfg import WeboobCfg weboobcfg = WeboobCfg() weboobcfg.options, args = weboobcfg._parser.parse_args([]) weboobcfg._handle_app_options() if caps is not None: if not isinstance(caps, (list, tuple, set)): caps = (caps,) caps = [(cap if isinstance(cap, basestring) else cap.__name__) for cap in caps] weboobcfg.command_backends(*caps) logging.error(u'You can configure backends using the "weboob-config add" command:\nweboob-config add <name> [options..]') with open('/dev/null', 'w') as devnull: process = subprocess.Popen(['which', 'weboob-config-qt'], stdout=devnull) return_code = process.wait() if return_code == 0: logging.error(u'You can configure backends using the "weboob-config-qt" GUI, too.') sys.exit(0)
54f9220555eb8913fedd5adbdf4df39ead7f91f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/54f9220555eb8913fedd5adbdf4df39ead7f91f8/console.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 823, 5839, 12, 2890, 16, 15788, 33, 7036, 16, 1257, 33, 7036, 16, 380, 1968, 16, 2826, 4333, 4672, 4203, 67, 823, 5839, 273, 3360, 3208, 18, 945, 67, 823, 5839, 12, 2890, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 823, 5839, 12, 2890, 16, 15788, 33, 7036, 16, 1257, 33, 7036, 16, 380, 1968, 16, 2826, 4333, 4672, 4203, 67, 823, 5839, 273, 3360, 3208, 18, 945, 67, 823, 5839, 12, 2890, 1...
raise WalkerEror
raise WalkerError
def argument(self, nodelist): raise WalkerEror
3bc4b570e40db00db019e8115adb94b3441b50ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3bc4b570e40db00db019e8115adb94b3441b50ab/transformer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1237, 12, 2890, 16, 30068, 4672, 1002, 7564, 264, 29228, 280, 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, 1237, 12, 2890, 16, 30068, 4672, 1002, 7564, 264, 29228, 280, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
sage: print L
sage: L
def column_containing_sym(L, r, x): """ Given an improper latin square L with L[r, c1] = L[r, c2] = x, return c1 or c2 with equal probability. This is an internal function and should only be used in LatinSquare_generator(). EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: L = matrix([(1, 0, 2, 3), (0, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]) sage: print L [1 0 2 3] [0 2 3 0] [2 3 0 1] [3 0 1 2] sage: c = column_containing_sym(L, 1, 0) sage: print c == 0 or c == 3 True """ c1 = -1 c2 = -1 for c in range(L.ncols()): if c1 >= 0 and c2 >= 0: break if L[r, c] == x and c1 < 0: c1 = c continue if L[r, c] == x and c2 < 0: c2 = c break assert c1 >= 0 and c2 >= 0 if coin(): return c1 else: return c2
0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2/latin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1057, 67, 1213, 3280, 67, 8117, 12, 48, 16, 436, 16, 619, 4672, 3536, 16803, 392, 13069, 457, 30486, 8576, 511, 598, 511, 63, 86, 16, 276, 21, 65, 273, 511, 63, 86, 16, 276, 22, 65...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1057, 67, 1213, 3280, 67, 8117, 12, 48, 16, 436, 16, 619, 4672, 3536, 16803, 392, 13069, 457, 30486, 8576, 511, 598, 511, 63, 86, 16, 276, 21, 65, 273, 511, 63, 86, 16, 276, 22, 65...
if not os.path.isdir(path): return file lc_filename = filename.lower() for f in os.listdir(path): if f.lower() == lc_filename: return os.path.join(path, f) return file
if os.path.isdir(path): lc_filename = filename.lower() for f in os.listdir(path): if f.lower() == lc_filename: result = os.path.join(path, f) break self.fixedFilenameCaseCache[file] = result return result
def FixFilenameCase(self, file): """Recent versions of Visual C++ put filenames into PDB files as all lowercase. If the file exists on the local filesystem, fix it.""" (path, filename) = os.path.split(file) if not os.path.isdir(path): return file lc_filename = filename.lower() for f in os.listdir(path): if f.lower() == lc_filename: return os.path.join(path, f) return file
c8960ff9ddcf63ca19063574a558ab7840b8c02a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13067/c8960ff9ddcf63ca19063574a558ab7840b8c02a/symbolstore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12139, 5359, 2449, 12, 2890, 16, 585, 4672, 3536, 17076, 5244, 434, 26832, 385, 9904, 1378, 9066, 1368, 21601, 1390, 487, 777, 12400, 18, 225, 971, 326, 585, 1704, 603, 326, 1191, 6496, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12139, 5359, 2449, 12, 2890, 16, 585, 4672, 3536, 17076, 5244, 434, 26832, 385, 9904, 1378, 9066, 1368, 21601, 1390, 487, 777, 12400, 18, 225, 971, 326, 585, 1704, 603, 326, 1191, 6496, ...
print ' !!!SKIPPED'
check(ga.C_DCPL, np.complex128)
def main(): if 0 == me: if MIRROR: print ' Performing tests on Mirrored Arrays' print ' GA initialized' # note that MA is not used, so no need to initialize it # "import ga" registers malloc/free as memory allocators internally #if nproc-1 == me: if 0 == me: print 'using %d process(es) %d custer nodes' % ( nproc, ga.cluster_nnodes()) print 'process %d is on node %d with %d processes' % ( me, ga.cluster_nodeid(), ga.cluster_nprocs(-1)) ga.sync() # create array to force staggering of memory and uneven distribution # of pointers dim1 = MEM_INC mapc = [0]*nproc for i in range(nproc): mapc[i] = MEM_INC*i dim1 += MEM_INC*i g_s = ga.create_handle() ga.set_data(g_s, [dim1], ga.C_INT) ga.set_array_name(g_s, 's') ga.set_irreg_distr(g_s, mapc, [nproc]) if MIRROR: if 0 == me: print '' print ' TESTING MIRRORED ARRAYS ' print '' ga.sync() # check support for double precision arrays if 0 == me: print '' print ' CHECKING DOUBLE PRECISION ' print '' check(ga.C_DBL, np.float64) # check support for single precision complex arrays if 0 == me: print '' print ' CHECKING SINGLE COMPLEX ' print '' print ' !!!SKIPPED' #check(ga.C_SCPL, np.complex64) # check support for double precision complex arrays if 0 == me: print '' print ' CHECKING DOUBLE COMPLEX ' print '' print ' !!!SKIPPED' #check(ga.C_DCPL, np.complex128) # check support for integer arrays if 0 == me: print '' print ' CHECKING INT' print '' check(ga.C_INT, np.int32) # check support for long integer arrays if 0 == me: print '' print ' CHECKING LONG INT' print '' check(ga.C_LONG, np.int64) # check support for single precision arrays if 0 == me: print '' print ' CHECKING SINGLE PRECISION ' print '' check(ga.C_FLOAT, np.float32) if 0 == me: print '' print ' CHECKING Wrappers to Message Passing Collective ops ' print '' check_wrappers() # check if memory limits are enforced #check_mem(ma_heap*ga.nnodes()) if 0 == me: ga.print_stats() if 0 == me: print ' ' if 0 == me: print 'All tests successful' # tidy up the ga package # NO NEED -- atexit registered ga.terminate() # tidy up after message-passing library # NO NEED -- atexti registered MPI.Finalize() # Note: so long as mpi4py is imported before ga, cleanup is automatic
9398e6c3a6f6a465ba91c0a69aef76d46e3462eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9416/9398e6c3a6f6a465ba91c0a69aef76d46e3462eb/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 309, 374, 422, 1791, 30, 309, 490, 7937, 2784, 30, 1172, 296, 11217, 310, 7434, 603, 490, 481, 23226, 5647, 11, 1172, 296, 611, 37, 6454, 11, 225, 468, 4721, 716, 19316, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 309, 374, 422, 1791, 30, 309, 490, 7937, 2784, 30, 1172, 296, 11217, 310, 7434, 603, 490, 481, 23226, 5647, 11, 1172, 296, 611, 37, 6454, 11, 225, 468, 4721, 716, 19316, 3...
6
0
def prec(self): """ Return the precision to which self.q_expansion() is currently known. Note that this may be 0.
ecd9697b920b80b66ba7cf9bf7a7ad2e4e866d1c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/ecd9697b920b80b66ba7cf9bf7a7ad2e4e866d1c/element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13382, 12, 2890, 4672, 3536, 2000, 326, 6039, 358, 1492, 365, 18, 85, 67, 2749, 12162, 1435, 353, 4551, 4846, 18, 3609, 716, 333, 2026, 506, 374, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13382, 12, 2890, 4672, 3536, 2000, 326, 6039, 358, 1492, 365, 18, 85, 67, 2749, 12162, 1435, 353, 4551, 4846, 18, 3609, 716, 333, 2026, 506, 374, 18, 2, -100, -100, -100, -100, -100, -...
sys.stderr.write('findtrove: %s %s %s\n' %(name, desFlavor, versionStr)) sys.stderr.flush()
def findTroves(self): for (name, versionStr, flavor, source) in self.addTroveList: try: desFlavor = self.cfg.buildFlavor.copy() if flavor is not None: # specified flavor overrides the default build flavor if isinstance(flavor, use.Flag): flavor = flavor.toDependency() # XXX we likely should not accept multiple types # of flavors, it's not a good API elif (isinstance(flavor, deps.DependencySet) or flavor is None): # nothing needs to be done pass else: raise AssertionError desFlavor.union(flavor, deps.DEP_MERGE_TYPE_OVERRIDE) sys.stderr.write('findtrove: %s %s %s\n' %(name, desFlavor, versionStr)) sys.stderr.flush() pkgList = self.repos.findTrove(self.label, name, desFlavor, versionStr = versionStr) except repository.TroveNotFound, e: raise RecipeFileError, str(e) for trove in pkgList: v = trove.getVersion() f = trove.getFlavor() l = self.troveVersionFlavors.get(name, []) if (v, f) not in l: l.append((v,f)) self.troveVersionFlavors[name] = l
bb6ea43dc7e43a49fbb72c0cd7416f72119b497e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/bb6ea43dc7e43a49fbb72c0cd7416f72119b497e/recipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 56, 303, 3324, 12, 2890, 4672, 364, 261, 529, 16, 1177, 1585, 16, 19496, 16, 1084, 13, 316, 365, 18, 1289, 56, 303, 537, 682, 30, 775, 30, 2832, 2340, 9444, 273, 365, 18, 7066,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 56, 303, 3324, 12, 2890, 4672, 364, 261, 529, 16, 1177, 1585, 16, 19496, 16, 1084, 13, 316, 365, 18, 1289, 56, 303, 537, 682, 30, 775, 30, 2832, 2340, 9444, 273, 365, 18, 7066,...
def blaberr(text=text): text[0] = str(proc.readStderr()) QObject.connect(proc, SIGNAL("readyReadStderr()"), blaberr)
def blaberr(text=text): text[0] = str(proc.readStderr())
9e2d4588bb7bf90cc457f60671307c1cafa1b317 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/9e2d4588bb7bf90cc457f60671307c1cafa1b317/ops_files.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2811, 378, 370, 12, 955, 33, 955, 4672, 977, 63, 20, 65, 273, 609, 12, 9381, 18, 896, 31781, 10756, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2811, 378, 370, 12, 955, 33, 955, 4672, 977, 63, 20, 65, 273, 609, 12, 9381, 18, 896, 31781, 10756, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if user.username == username:
if user:
def login(req, username, password): user = lampadas.users[username] if user.username == username: if user.password == password: if sessions[username] == None: sessions.add(username) # establish random 20 character session_id. # chars = string.letters + string.digits session_id = '' for x in range(20): session_id += whrandom.choice(chars) user = lampadas.users[username] user.session_id = session_id user.save() log(3, 'setting cookie') req.headers_out['Set-Cookie']='lampadas=' + session_id + '; path=/; expires=Wed, 09-Nov-2030 23:59:00 GMT' return page_factory.page('logged_in') else: return "Wrong password" else: return "User not found"
375535bd2c7056840e6ca881cf3d287e45be2ac2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1319/375535bd2c7056840e6ca881cf3d287e45be2ac2/session.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 3658, 16, 2718, 16, 2201, 4672, 225, 729, 273, 328, 931, 361, 345, 18, 5577, 63, 5053, 65, 309, 729, 30, 309, 729, 18, 3664, 422, 2201, 30, 309, 8856, 63, 5053, 65, 422, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 12, 3658, 16, 2718, 16, 2201, 4672, 225, 729, 273, 328, 931, 361, 345, 18, 5577, 63, 5053, 65, 309, 729, 30, 309, 729, 18, 3664, 422, 2201, 30, 309, 8856, 63, 5053, 65, 422, ...
Digraph on 10 vertices
Petersen graph: Digraph on 10 vertices
def to_directed(self): """ Returns a directed version of the graph. A single edge becomes two arcs, one in each direction. EXAMPLE: sage: graphs.PetersenGraph().to_directed() Digraph on 10 vertices
c6ee9b8c95a50319119e91b8cfe37d340af4ae88 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/c6ee9b8c95a50319119e91b8cfe37d340af4ae88/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 26830, 12, 2890, 4672, 3536, 2860, 279, 20830, 1177, 434, 326, 2667, 18, 432, 2202, 3591, 12724, 2795, 21569, 16, 1245, 316, 1517, 4068, 18, 225, 5675, 21373, 30, 272, 410, 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, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 26830, 12, 2890, 4672, 3536, 2860, 279, 20830, 1177, 434, 326, 2667, 18, 432, 2202, 3591, 12724, 2795, 21569, 16, 1245, 316, 1517, 4068, 18, 225, 5675, 21373, 30, 272, 410, 30, ...
sage: M.hecke_operator(f.qexp(), 3)
sage: M.hecke_operator(f.q_expansion(), 3)
def hecke_operator(self, f, m): r""" Given an element `f` and an integer `m`, calculates the Hecke operator `T_m` acting on `f`.
ed0a3ce8f392224845d699a88cf40b90f375c64a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ed0a3ce8f392224845d699a88cf40b90f375c64a/genus0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 366, 762, 73, 67, 9497, 12, 2890, 16, 284, 16, 312, 4672, 436, 8395, 16803, 392, 930, 1375, 74, 68, 471, 392, 3571, 1375, 81, 9191, 17264, 326, 670, 762, 73, 3726, 1375, 56, 67, 81, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 366, 762, 73, 67, 9497, 12, 2890, 16, 284, 16, 312, 4672, 436, 8395, 16803, 392, 930, 1375, 74, 68, 471, 392, 3571, 1375, 81, 9191, 17264, 326, 670, 762, 73, 3726, 1375, 56, 67, 81, ...
self.names = names
self.names = names
def __init__( self, names, description ): self.names = names self.description = description
5e441a6d3c8bf4a1d1361e5553c2257c04555ada /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1545/5e441a6d3c8bf4a1d1361e5553c2257c04555ada/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 1257, 16, 2477, 262, 30, 365, 18, 1973, 273, 1257, 365, 18, 3384, 273, 2477, 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, 365, 16, 1257, 16, 2477, 262, 30, 365, 18, 1973, 273, 1257, 365, 18, 3384, 273, 2477, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
print ' %s_init();' % (functionnameify(o[0])) pass print ' gimp_composite_options.initialised = 1;' print ' }'
print ' %s_init ();' % (functionnameify(o[0])) pass print ' gimp_composite_options.initialised = TRUE;' print ' }'
def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'void' print 'gimp_composite_init()' print '{' print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' print ' g_printerr("Using new image composite functions\n");' print ' }' print '' print ' if (!gimp_composite_options.initialised) {' for o in function_tables: print ' %s_init();' % (functionnameify(o[0])) pass print ' gimp_composite_options.initialised = 1;' print ' }' print '}' pass
73af860ff4a9ad2d64dbee32023a1ec49e63a340 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11058/73af860ff4a9ad2d64dbee32023a1ec49e63a340/make-gimp-composite-dispatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 14532, 67, 27676, 67, 2738, 12, 915, 67, 9373, 4672, 364, 320, 316, 445, 67, 9373, 30, 1172, 296, 338, 798, 918, 738, 87, 67, 2738, 1435, 4359, 738, 261, 915, 529, 1164, 12, 83,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 14532, 67, 27676, 67, 2738, 12, 915, 67, 9373, 4672, 364, 320, 316, 445, 67, 9373, 30, 1172, 296, 338, 798, 918, 738, 87, 67, 2738, 1435, 4359, 738, 261, 915, 529, 1164, 12, 83,...
resp=disp.SendAndWaitForResponse(iq)
if sync: resp=disp.SendAndWaitForResponse(iq) _ReceivedRegInfo(disp.Dispatcher,resp, host) else: disp.SendAndCallForResponse(iq,_ReceivedRegInfo, {'agent': host}) def _ReceivedRegInfo(con, resp, agent): iq=Iq('get',NS_REGISTER,to=agent)
def getRegInfo(disp,host,info={}): """ Gets registration form from remote host. You can pre-fill the info dictionary. F.e. if you are requesting info on registering user joey than specify info as {'username':'joey'}. See JEP-0077 for details. 'disp' must be connected dispatcher instance.""" iq=Iq('get',NS_REGISTER,to=host) for i in info.keys(): iq.setTagData(i,info[i]) resp=disp.SendAndWaitForResponse(iq) if not isResultNode(resp): return df=resp.getTag('query',namespace=NS_REGISTER).getTag('x',namespace=NS_DATA) if df: return DataForm(node=df) df=DataForm(typ='form') for i in resp.getQueryPayload(): if type(i)<>type(iq): pass elif i.getName()=='instructions': df.addInstructions(i.getData()) else: df.setField(i.getName()).setValue(i.getData()) return df
594dd948068e8f3471b40a60454614aaf6ff2681 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/594dd948068e8f3471b40a60454614aaf6ff2681/features.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1617, 966, 12, 25453, 16, 2564, 16, 1376, 12938, 4672, 3536, 11881, 7914, 646, 628, 2632, 1479, 18, 4554, 848, 675, 17, 5935, 326, 1123, 3880, 18, 478, 18, 73, 18, 309, 1846, 854,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1617, 966, 12, 25453, 16, 2564, 16, 1376, 12938, 4672, 3536, 11881, 7914, 646, 628, 2632, 1479, 18, 4554, 848, 675, 17, 5935, 326, 1123, 3880, 18, 478, 18, 73, 18, 309, 1846, 854,...
fileBlockId = fileBlock.get('blockName')
def getFileListFromDBS(self, datasetId): """ _getFileListFromDBS_ Get the list of files of the dataset from DBS Arguments: datasetId -- the name of the dataset Return: list of tuples (name,size,fileBlockId) for all files in dataset """
87d7e4aaef9a55485525200d47dab0552b5b83de /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/87d7e4aaef9a55485525200d47dab0552b5b83de/MergeSensorComponent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6034, 682, 1265, 2290, 55, 12, 2890, 16, 3709, 548, 4672, 3536, 389, 588, 26098, 1265, 2290, 55, 67, 225, 968, 326, 666, 434, 1390, 434, 326, 3709, 628, 2383, 55, 225, 13599, 30, 225, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6034, 682, 1265, 2290, 55, 12, 2890, 16, 3709, 548, 4672, 3536, 389, 588, 26098, 1265, 2290, 55, 67, 225, 968, 326, 666, 434, 1390, 434, 326, 3709, 628, 2383, 55, 225, 13599, 30, 225, ...
self.__pari_prime = P[0] return self.__pari_prime is not None
self._pari_prime = P[0] return self._pari_prime is not None
def is_prime(self): """ Return True if this ideal is prime.
ac86cf629cd70ef14800b50ffee5d28d528a0ae5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/ac86cf629cd70ef14800b50ffee5d28d528a0ae5/number_field_ideal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 16382, 12, 2890, 4672, 3536, 2000, 1053, 309, 333, 23349, 353, 17014, 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, ...
[ 1, 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, 353, 67, 16382, 12, 2890, 4672, 3536, 2000, 1053, 309, 333, 23349, 353, 17014, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
assert_almost_equal(mx, rx)
yield assert_almost_equal, mx, rx
def test_multivariate_forms():
28ced10dcda0774f441c79732924430d1295b8a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12658/28ced10dcda0774f441c79732924430d1295b8a0/test_rft.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5421, 27693, 67, 9741, 13332, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 5421, 27693, 67, 9741, 13332, 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, -...
Res.FSCreateResourceFile(destdir, destfile, RESOURCE_FORK_NAME)
Res.FSCreateResourceFile(destdir, unicode(destfile), RESOURCE_FORK_NAME)
def process_common(template, progress, code, rsrcname, destname, is_update, copy_codefragment, raw=0, others=[]): if MacOS.runtimemodel == 'macho': return process_common_macho(template, progress, code, rsrcname, destname, is_update, raw, others) if others: raise BuildError, "Extra files only allowed for MachoPython applets" # Create FSSpecs for the various files template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1) template = template_fsr.as_pathname() # Copy data (not resources, yet) from the template if progress: progress.label("Copy data fork...") progress.set(10) if copy_codefragment: tmpl = open(template, "rb") dest = open(destname, "wb") data = tmpl.read() if data: dest.write(data) dest.close() tmpl.close() del dest del tmpl # Open the output resource fork if progress: progress.label("Copy resources...") progress.set(20) try: output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) except MacOS.Error: destdir, destfile = os.path.split(destname) Res.FSCreateResourceFile(destdir, destfile, RESOURCE_FORK_NAME) output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE) # Copy the resources from the target specific resource template, if any typesfound, ownertype = [], None try: input = Res.FSOpenResourceFile(rsrcname, RESOURCE_FORK_NAME, READ) except (MacOS.Error, ValueError): pass if progress: progress.inc(50) else: if is_update: skip_oldfile = ['cfrg'] else: skip_oldfile = [] typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress) Res.CloseResFile(input) # Check which resource-types we should not copy from the template skiptypes = [] if 'vers' in typesfound: skiptypes.append('vers') if 'SIZE' in typesfound: skiptypes.append('SIZE') if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4', 'icl8', 'ics4', 'ics8', 'ICN#', 'ics#'] if not copy_codefragment: skiptypes.append('cfrg')
c7954225421f46bb82b6dec9bd1fb86cc7a4c573 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c7954225421f46bb82b6dec9bd1fb86cc7a4c573/buildtools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 6054, 12, 3202, 16, 4007, 16, 981, 16, 3597, 1310, 529, 16, 1570, 529, 16, 353, 67, 2725, 16, 1610, 67, 710, 11956, 16, 1831, 33, 20, 16, 10654, 33, 8526, 4672, 309, 13217,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 6054, 12, 3202, 16, 4007, 16, 981, 16, 3597, 1310, 529, 16, 1570, 529, 16, 353, 67, 2725, 16, 1610, 67, 710, 11956, 16, 1831, 33, 20, 16, 10654, 33, 8526, 4672, 309, 13217,...
if tests.unit(self.to_run, uses_mmap): if sys.version[:3] == (2, 4, 2): print "You're running Python 2.4.2, which is buggy." raise SystemExit("Test failures are listed above.")
self.__test(uses_mmap)
def close(self): pass
ce4fe8d062f8329cd537cea40e0e8bdbb8351916 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/ce4fe8d062f8329cd537cea40e0e8bdbb8351916/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 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, -...
html = PhpDeuglifier().format(odata.splitlines()[1])
fst_nl = odata.find('\n') snd_nl = odata.find('\n', fst_nl + 1) odata = odata[snd_nl + 1:] html = PhpDeuglifier().format(odata)
def render(self, req, mimetype, content, filename=None, rev=None): cmdline = self.config.get('mimeviewer', 'php_path') cmdline += ' -s' self.env.log.debug("PHP command line: %s" % cmdline)
0032c42fd5ab8c79d45587a3f1b9ff721d124701 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/0032c42fd5ab8c79d45587a3f1b9ff721d124701/php.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1111, 16, 12595, 16, 913, 16, 1544, 33, 7036, 16, 5588, 33, 7036, 4672, 22877, 273, 365, 18, 1425, 18, 588, 2668, 11757, 25256, 2187, 296, 2684, 67, 803, 6134, 2287...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1111, 16, 12595, 16, 913, 16, 1544, 33, 7036, 16, 5588, 33, 7036, 4672, 22877, 273, 365, 18, 1425, 18, 588, 2668, 11757, 25256, 2187, 296, 2684, 67, 803, 6134, 2287...