rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
w.writerow([str(i + 2), str(volumeum), str(volume), str(cog), str(umcog), str(avgint)])
w.writerow([str(i + 1), str(volumeum), str(volume), str(cog), str(umcog), str(avgint)])
def writeToFile(self, filename, dataUnit, timepoint): """ Created: 16.08.2007, KP Description: write the objects from a given timepoint to file """ f = codecs.open(filename, "awb", "latin1") Logging.info("Saving statistics to file %s"%filename, kw="processing") w = csv.writer(f, dialect = "excel", delimiter = ";") settings = dataUnit.getSettings() settings.set("StatisticsFile", filename) w.writerow(["Timepoint %d" % timepoint]) w.writerow(["Object #", "Volume (micrometers)", "Volume (pixels)", "Center of Mass", \ "Center of Mass (micrometers)", "Avg. Intensity"]) for i, (volume, volumeum) in enumerate(self.values): cog = self.centersofmass[i] umcog = self.umcentersofmass[i] avgint = self.avgIntList[i] w.writerow([str(i + 2), str(volumeum), str(volume), str(cog), str(umcog), str(avgint)]) f.close()
4530ea472b06c5d6c3f04e7511d583014dd90884 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/4530ea472b06c5d6c3f04e7511d583014dd90884/SegmentationFilters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12870, 812, 12, 2890, 16, 1544, 16, 501, 2802, 16, 813, 1153, 4672, 3536, 12953, 30, 2872, 18, 6840, 18, 6976, 27, 16, 1475, 52, 6507, 30, 1045, 326, 2184, 628, 279, 864, 813, 1153, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12870, 812, 12, 2890, 16, 1544, 16, 501, 2802, 16, 813, 1153, 4672, 3536, 12953, 30, 2872, 18, 6840, 18, 6976, 27, 16, 1475, 52, 6507, 30, 1045, 326, 2184, 628, 279, 864, 813, 1153, ...
self.assertRaises((struct.error, OverflowError), pack, ">" + code, x) self.assertRaises((struct.error, OverflowError), pack, "<" + code, x)
self.assertRaises(struct.error, pack, ">" + code, x) self.assertRaises(struct.error, pack, "<" + code, x)
def test_one(self, x, pack=struct.pack, unpack=struct.unpack, unhexlify=binascii.unhexlify): # Try signed. code = self.signed_code if self.signed_min <= x <= self.signed_max: # Try big-endian. expected = x if x < 0: expected += 1 << self.bitsize self.assert_(expected > 0) expected = hex(expected)[2:] # chop "0x" if len(expected) & 1: expected = "0" + expected expected = unhexlify(expected) expected = b"\x00" * (self.bytesize - len(expected)) + expected
464fc36404c8475efe36accdb1ecde6aac75098a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/464fc36404c8475efe36accdb1ecde6aac75098a/test_struct.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 476, 12, 2890, 16, 619, 16, 2298, 33, 1697, 18, 2920, 16, 6167, 33, 1697, 18, 17309, 16, 640, 7118, 22451, 33, 4757, 9184, 18, 318, 7118, 22451, 4672, 468, 6161, 6726, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 476, 12, 2890, 16, 619, 16, 2298, 33, 1697, 18, 2920, 16, 6167, 33, 1697, 18, 17309, 16, 640, 7118, 22451, 33, 4757, 9184, 18, 318, 7118, 22451, 4672, 468, 6161, 6726, 18, ...
hlr_utils.result_insert(result,res_descr,value,None,"all")
hlr_utils.result_insert(result, res_descr, value, None, "all")
def rebin_efficiency(obj1,obj2,**kwargs): """ This function takes two SOMs or two SOs and rebins the data for obj1 onto the axis provided by obj2. The units on the x-axes needs to be Angstroms, since this is what the efficiencies will be present as. Parameters: ---------- -> obj1 is a SOM or SO that will be rebinned -> obj2 is a SOM or SO that will provide the axis for rebinning -> kwargs is a list of key word arguments that the function accepts: units= a string containing the expected units for this function. The default for this function is Angstroms Returns: ------- <- A SOM or SO that has been rebinned Exceptions: ---------- <- TypeError is raised if the SOM-SO operation is attempted <- TypeError is raised if the SO-SOM operation is attempted <- TypeError is raised is obj1 not a SOM or SO <- TypeError is raised is obj2 not a SOM or SO <- IndexError is raised if the SOMs do not have the same number of SOs <- RuntimeError is raised if the SOM x-axis units are not Angstroms <- RuntimeError is raised if the x-axis units of the SOMs do not match """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj1,obj2) (o1_descr,o2_descr)=hlr_utils.get_descr(obj1,obj2) # error checking for types if o1_descr == "SOM" and o2_descr == "SO": raise TypeError, "SOM-SO operation not supported" elif o1_descr == "SO" and o2_descr == "SOM": raise TypeError, "SO-SOM operation not supported" # Have the right object combination, go on else: pass # Setup keyword arguments try: units = kwargs["units"] except KeyError: units = "Angstroms" if o1_descr == "SOM" and o2_descr == "SOM": hlr_utils.hlr_math_compatible(obj1,o1_descr,obj2,o2_descr) # If both objects are not SOMs, do nothing else: pass result=hlr_utils.copy_som_attr(result,res_descr,obj2,o2_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "Angstroms") # Can't force units on anything other than a SOM else: pass # iterate through the values import common_lib for i in range(hlr_utils.get_length(obj1,obj2)): val1 = hlr_utils.get_value(obj1,i,o1_descr,"all") val2 = hlr_utils.get_value(obj2,i,o2_descr,"x") value=common_lib.rebin_axis_1D(val1, val2) hlr_utils.result_insert(result,res_descr,value,None,"all") return result
b71ce59d64b8722e53e1e93a78aa55e2f761ac0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/b71ce59d64b8722e53e1e93a78aa55e2f761ac0d/hlr_rebin_efficiency.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 283, 4757, 67, 73, 22217, 12, 2603, 21, 16, 2603, 22, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 2795, 348, 1872, 87, 578, 2795, 7460, 87, 471, 283, 11862, 326, 501, 364, 1081, 21, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 283, 4757, 67, 73, 22217, 12, 2603, 21, 16, 2603, 22, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 2795, 348, 1872, 87, 578, 2795, 7460, 87, 471, 283, 11862, 326, 501, 364, 1081, 21, ...
def __init__(self):
def __init__(self, bar_image_path=None, cursor_image_path=None):
def __init__(self): clutter.Actor.__init__(self) self._progression = 0.0
92cca698a379d5dab44c70e37ca8d0af24228539 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5279/92cca698a379d5dab44c70e37ca8d0af24228539/seekbar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4653, 67, 2730, 67, 803, 33, 7036, 16, 3347, 67, 2730, 67, 803, 33, 7036, 4672, 927, 18220, 18, 17876, 16186, 2738, 972, 12, 2890, 13, 365, 6315, 8298, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4653, 67, 2730, 67, 803, 33, 7036, 16, 3347, 67, 2730, 67, 803, 33, 7036, 4672, 927, 18220, 18, 17876, 16186, 2738, 972, 12, 2890, 13, 365, 6315, 8298, ...
for i in range(0,15): getData(ec2Data[i])
getAllData(ec2Data)
def main(): usage = "usage: %prog [options]" parser = OptionParser(prog='ec2-get-info', usage=usage) parser.add_option('--ami-id', dest='amiid', action='store_true', help='Display the ami-id.') parser.add_option('--launch-index', dest='launch', action='store_true', help='Display the AMI launch index.') parser.add_option('--manifest', dest='manifest', action='store_true', help='Display the AMI manifest path.') parser.add_option('--ancestor-id', dest='ancestor', action='store_true', help='Display the AMI ancestor id.') parser.add_option('--block-device', dest='block', action='store_true', help='Display the block device id.') parser.add_option('--instance-id', dest='id', action='store_true', help='Display the instance id.') parser.add_option('--instance-type', dest='type', action='store_true', help='Display the instance type.') parser.add_option('--local-hostname', dest='lhostname', action='store_true', help='Display the local hostname.') parser.add_option('--local-ipv4', dest='lipv4', action='store_true', help='Display the local ipv4 IP address.') parser.add_option('--kernel-id', dest='aki', action='store_true', help='List the AKI.') parser.add_option('--product-codes', dest='code', action='store_true', help='List the product codes associated with thsi AMI.') parser.add_option('--public-hostname', dest='phostname', action='store_true', help='Show the public hostname.') parser.add_option('--public_ipv4', dest='pipv4', action='store_true', help='Show the public IPV4 IP address.') parser.add_option('--ramdisk-id', dest='ari', action='store_true', help='Display the ARI.') parser.add_option('--reservation-id', dest='rid', action='store_true', help='Display the reservation id.') parser.add_option('--security-groups', dest='security', action='store_true', help='Display the security groups.') parser.add_option('--ec2-version', dest='ec2', action='store_true', help='Display the current Ubuntu EC2 version') parser.add_option('--all',dest='all', action='store_true', help='Display all informantion.') options, args = parser.parse_args() if options.amiid: getData(ec2Data[0]) if options.launch: getData(ec2Data[1]) if options.manifest: getData(ec2Data[2]) if options.ancestor: getData(ec2Data[3]) if options.block: getData(ec2Data[4]) if options.id: getData(ec2Data[5]) if options.type: getData(ec2Data[6]) if options.lhostname: getData(ec2Data[7]) if options.lipv4: getData(ec2Data[8]) if options.aki: getData(ec2Data[9]) if options.code: getData(ec2Data[10]) if options.phostname: getData(ec2Data[11]) if options.pipv4: getData(ec2Data[12]) if options.ari: getData(ec2Data[13]) if options.rid: getData(ec2Data[14]) if options.security: getData(ec2Data[15]) if options.ec2: ec2Version() if options.all: for i in range(0,15): getData(ec2Data[i])
7fc548cf64af5a6a6d3b1b56a8147995102bf6e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7197/7fc548cf64af5a6a6d3b1b56a8147995102bf6e4/ec2-get-info.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 4084, 273, 315, 9167, 30, 738, 14654, 306, 2116, 4279, 225, 2082, 273, 18862, 12, 14654, 2218, 557, 22, 17, 588, 17, 1376, 2187, 4084, 33, 9167, 13, 2082, 18, 1289, 67, 34...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4084, 273, 315, 9167, 30, 738, 14654, 306, 2116, 4279, 225, 2082, 273, 18862, 12, 14654, 2218, 557, 22, 17, 588, 17, 1376, 2187, 4084, 33, 9167, 13, 2082, 18, 1289, 67, 34...
lam = sum([tsum(n)*w[n] for n in range(3,prec)]) w1 = R1(w, prec)
lam = sum([tsum(n)*w[n] for n in range(3,prec+1)]) w1 = R1(w, prec+1)
def group_law(self, prec=10): r""" The formal group law. INPUT: - ``prec`` - integer (default 10) OUTPUT: a power series with given precision in ZZ[[ ZZ[['t1']],'t2']] DETAILS: Return the formal power series .. math:: F(t_1, t_2) = t_1 + t_2 - a_1 t_1 t_2 - \cdots to precision `O(t^{prec})` of page 115 of [Silverman AEC1]. The result is cached, and a cached version is returned if possible. .. warning::
a2c4453ffa3bb0d609bb14cd8559e945722298b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a2c4453ffa3bb0d609bb14cd8559e945722298b2/formal_group.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1041, 67, 80, 2219, 12, 2890, 16, 13382, 33, 2163, 4672, 436, 8395, 1021, 25739, 1041, 328, 2219, 18, 225, 12943, 30, 282, 300, 225, 12176, 4036, 10335, 300, 3571, 261, 1886, 1728, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1041, 67, 80, 2219, 12, 2890, 16, 13382, 33, 2163, 4672, 436, 8395, 1021, 25739, 1041, 328, 2219, 18, 225, 12943, 30, 282, 300, 225, 12176, 4036, 10335, 300, 3571, 261, 1886, 1728, 13, ...
split = rootpath.split('/') mod.dir = '/'.join(split[:-1]) mod.mod_dir = mod.mod_path[:-1]
mod.dir = '/'.join(relpath[:-1]) mod.mod_dir = relpath[:-1]
def parse_module(name, ast=None, parent=None, node=None): # --- valid name? for c in name: if not c in string.letters+string.digits+'_.': print ("*ERROR*:%s.py: module names should consist of letters, digits and underscores" % name) sys.exit() # --- parse ident = name.split('.')[-1] mod = module(ident, node) mod.builtin = False if ast: # XXX mod.ast = ast mod.filename = name+'.py' mod.dir = '' mod.mod_path = [name] mod.mod_dir = [] else: # --- locate module relname = name.replace('.', '/') relpath = name.split('.') if parent: path = connect_paths(parent.dir, relname) else: path = name libpath = connect_paths(getgx().libdir, relname) rootpath = connect_paths(os.getcwd(), relname) if os.path.isfile(path+'.py'): # local module mod.filename = path+'.py' if parent: mod.mod_path = parent.mod_dir + relpath else: mod.mod_path = relpath split = path.split('/') mod.dir = '/'.join(split[:-1]) mod.mod_dir = mod.mod_path[:-1] mod.builtin = not parent or parent.builtin elif os.path.isfile(connect_paths(path, '__init__.py')): mod.filename = connect_paths(path, '__init__.py') if parent: mod.mod_path = parent.mod_dir + relpath else: mod.mod_path = relpath mod.dir = path mod.mod_dir = mod.mod_path mod.builtin = not parent or parent.builtin elif os.path.isfile(rootpath+'.py'): # root module mod.filename = rootpath+'.py' mod.mod_path = relpath split = rootpath.split('/') mod.dir = '/'.join(split[:-1]) mod.mod_dir = mod.mod_path[:-1] elif os.path.isfile(connect_paths(rootpath, '__init__.py')): mod.filename = connect_paths(rootpath, '__init__.py') mod.mod_path = relpath mod.dir = rootpath mod.mod_dir = mod.mod_path elif os.path.isfile(libpath+'.py'): # library module mod.filename = libpath+'.py' mod.mod_path = relpath split = libpath.split('/') mod.dir = '/'.join(split[:-1]) mod.mod_dir = mod.mod_path[:-1] mod.builtin = True elif os.path.isfile(connect_paths(libpath, '__init__.py')): mod.filename = connect_paths(libpath, '__init__.py') mod.mod_path = relpath mod.dir = libpath mod.mod_dir = mod.mod_path mod.builtin = True else: error('cannot locate module: '+name, node) modpath = '.'.join(mod.mod_path) if modpath in getgx().modules: # cached? return getgx().modules[modpath] #print 'not cached', modpath getgx().modules[modpath] = mod mod.ast = parsefile(mod.filename) old_mv = getmv() mod.mv = mv = moduleVisitor(mod) setmv(mv) mv.visit = mv.dispatch mv.visitor = mv mv.dispatch(mod.ast) mv = old_mv setmv(mv) mod.funcs = mod.mv.funcs mod.classes = mod.mv.classes return mod
051eacf40bd512b7594e2d783b5a679691c17bf6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6661/051eacf40bd512b7594e2d783b5a679691c17bf6/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2978, 12, 529, 16, 3364, 33, 7036, 16, 982, 33, 7036, 16, 756, 33, 7036, 4672, 468, 9948, 923, 508, 35, 364, 276, 316, 508, 30, 309, 486, 276, 316, 533, 18, 26054, 15, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2978, 12, 529, 16, 3364, 33, 7036, 16, 982, 33, 7036, 16, 756, 33, 7036, 4672, 468, 9948, 923, 508, 35, 364, 276, 316, 508, 30, 309, 486, 276, 316, 533, 18, 26054, 15, 10...
logging.warning('The module %s does not contain a description file: __openerp__.py or __terp__.py (deprecated)' % module)
logging.getLogger('addons').debug('The module %s does not contain a description file:'\ '__openerp__.py or __terp__.py (deprecated)', module)
def load_information_from_description_file(module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = addons.get_module_resource(module, filename) if os.path.isfile(description_file): return eval(tools.file_open(description_file).read()) logging.warning('The module %s does not contain a description file: __openerp__.py or __terp__.py (deprecated)' % module) return {}
16749901c7f77b6bf85aa6d82894a23142950259 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/16749901c7f77b6bf85aa6d82894a23142950259/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 13117, 67, 2080, 67, 3384, 67, 768, 12, 2978, 4672, 3536, 294, 891, 1605, 30, 1021, 508, 434, 326, 1605, 261, 87, 5349, 16, 23701, 16, 1372, 13, 3536, 364, 1544, 316, 10228, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13117, 67, 2080, 67, 3384, 67, 768, 12, 2978, 4672, 3536, 294, 891, 1605, 30, 1021, 508, 434, 326, 1605, 261, 87, 5349, 16, 23701, 16, 1372, 13, 3536, 364, 1544, 316, 10228, ...
v += ((n - first) * (n - first - 1)) / 2 tot = (n * (n - 1)) / 2
v += ((n - first) * (n - first - 1)) // 2 tot = (n * (n - 1)) // 2
def mergesort(offs, length): exchcnt = 0 if length == 1: return 0 if length == 2: if y[perm[offs]] <= y[perm[offs+1]]: return 0 t = perm[offs] perm[offs] = perm[offs+1] perm[offs+1] = t return 1 length0 = length / 2 length1 = length - length0 middle = offs + length0 exchcnt += mergesort(offs, length0) exchcnt += mergesort(middle, length1) if y[perm[middle - 1]] < y[perm[middle]]: return exchcnt # merging i = j = k = 0 while j < length0 or k < length1: if k >= length1 or (j < length0 and y[perm[offs + j]] <= y[perm[middle + k]]): temp[i] = perm[offs + j] d = i - j j += 1 else: temp[i] = perm[middle + k] d = (offs + i) - (middle + k) k += 1 if d > 0: exchcnt += d; i += 1 perm[offs:offs+length] = temp[0:length] return exchcnt
083d0c7bf11af0499662c5c6b71dec4d93d82dbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/083d0c7bf11af0499662c5c6b71dec4d93d82dbd/stats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19037, 499, 12, 26600, 16, 769, 4672, 431, 343, 13085, 273, 374, 309, 769, 422, 404, 30, 327, 374, 309, 769, 422, 576, 30, 309, 677, 63, 12160, 63, 26600, 13563, 1648, 677, 63, 12160, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19037, 499, 12, 26600, 16, 769, 4672, 431, 343, 13085, 273, 374, 309, 769, 422, 404, 30, 327, 374, 309, 769, 422, 576, 30, 309, 677, 63, 12160, 63, 26600, 13563, 1648, 677, 63, 12160, ...
os.unlink(old_jokosher_file)
os.unlink(old_jokosher_file)
def write(self): """ Writes configuration settings to the Settings config file. """ for key in self.general: self.config.set("General", key, self.general[key]) for key in self.recording: self.config.set("Recording", key, self.recording[key]) for key in self.playback: self.config.set("Playback", key, self.playback[key]) for key in self.extensions: self.config.set("Extensions", key, self.extensions[key]) # delete a .jokosher file if it exists, because that's old-fashioned old_jokosher_file = os.path.expanduser("~/.jokosher") if os.path.isfile(old_jokosher_file): os.unlink(old_jokosher_file) # make sure that the directory that the config file is in exists new_jokosher_file_dir = os.path.split(self.filename)[0] if not os.path.isdir(new_jokosher_file_dir): os.makedirs(new_jokosher_file_dir) file = open(self.filename, 'w') self.config.write(file) file.close() #_____________________________________________________________________
850cd3c81ba4d14e83467abfe04d40095cd9dc70 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10033/850cd3c81ba4d14e83467abfe04d40095cd9dc70/Globals.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 4672, 3536, 30053, 1664, 1947, 358, 326, 8709, 642, 585, 18, 3536, 364, 498, 316, 365, 18, 12259, 30, 365, 18, 1425, 18, 542, 2932, 12580, 3113, 498, 16, 365, 18, 12259...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 4672, 3536, 30053, 1664, 1947, 358, 326, 8709, 642, 585, 18, 3536, 364, 498, 316, 365, 18, 12259, 30, 365, 18, 1425, 18, 542, 2932, 12580, 3113, 498, 16, 365, 18, 12259...
print 'data:', `data`
print 'data:', repr(data)
def flush(self): data = self.testdata if data: self.testdata = "" print 'data:', `data`
3109365b75b53693df5734f4313af1277bfd2722 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2355/3109365b75b53693df5734f4313af1277bfd2722/sgmllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 501, 273, 365, 18, 3813, 892, 309, 501, 30, 365, 18, 3813, 892, 273, 1408, 1172, 296, 892, 30, 2187, 1375, 892, 68, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 501, 273, 365, 18, 3813, 892, 309, 501, 30, 365, 18, 3813, 892, 273, 1408, 1172, 296, 892, 30, 2187, 1375, 892, 68, 2, -100, -100, -100, -100, -100, -100, -100, ...
def _parse_commit_log(self, message):
def _parse_commit_log_message(self, message):
def _parse_commit_log(self, message): l = message.getElementsByTagName('msg') l[0].normalize() try: return l[0].childNodes[0].data except: return ''
4b27fadb15d3f44c46e23dd9f9205164147efb6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2516/4b27fadb15d3f44c46e23dd9f9205164147efb6f/msvnstats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 7371, 67, 1330, 67, 2150, 12, 2890, 16, 883, 4672, 328, 273, 883, 18, 588, 3471, 10401, 2668, 3576, 6134, 328, 63, 20, 8009, 12237, 1435, 775, 30, 327, 328, 63, 20, 80...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 7371, 67, 1330, 67, 2150, 12, 2890, 16, 883, 4672, 328, 273, 883, 18, 588, 3471, 10401, 2668, 3576, 6134, 328, 63, 20, 8009, 12237, 1435, 775, 30, 327, 328, 63, 20, 80...
getGWConfig().especific5 = escape(safe_unicode(value))
getGWConfig().especific5 = value
def set(self, value): getGWConfig().especific5 = escape(safe_unicode(value))
070938d23071aedec649c8a62af7f37abc39f9d9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13072/070938d23071aedec649c8a62af7f37abc39f9d9/controlpanel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12, 2890, 16, 460, 4672, 7162, 59, 809, 7675, 281, 705, 1507, 25, 273, 4114, 12, 4626, 67, 9124, 12, 1132, 3719, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12, 2890, 16, 460, 4672, 7162, 59, 809, 7675, 281, 705, 1507, 25, 273, 4114, 12, 4626, 67, 9124, 12, 1132, 3719, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
vcs2=str(inv.number[3]) + '00' +str(vcs3)
vcs2 = vcs3.rjust(6,'0')
def action_number(self, cr, uid, ids, *args): res = super(account_invoice,self).action_number(cr, uid, ids, args) for inv in self.browse(cr, uid, ids): vcs ='' if inv.number and not inv.name: vcs3=str(inv.number).split('/')[1] vcs1='0'+ str(inv.date_invoice[2:4]) if len(str(vcs3))>=5: vcs2=str(inv.number[3]) + str(vcs3[0:5]) elif len(str(vcs3))==4: vcs2=str(inv.number[3]) + '0' +str(vcs3) else: vcs2=str(inv.number[3]) + '00' +str(vcs3)
0176f8d6729c68d5bc1fc571c8356082945b681e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/0176f8d6729c68d5bc1fc571c8356082945b681e/cci_account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 2696, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 400, 273, 2240, 12, 4631, 67, 16119, 16, 2890, 2934, 1128, 67, 2696, 12, 3353, 16, 4555, 16, 3258, 16, 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, 1301, 67, 2696, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 400, 273, 2240, 12, 4631, 67, 16119, 16, 2890, 2934, 1128, 67, 2696, 12, 3353, 16, 4555, 16, 3258, 16, 83...
if ':' in par:
val = par.split('=') if len(val) == 1 and not skip:
def findFilenameOnCommons(self, localImagePage): filenameOnCommons = None for templateName, params in localImagePage.templatesWithParams(): if templateName in self.ncTemplates(): if params == []: filenameOnCommons = localImagePage.titleWithoutNamespace() elif self.site.lang in namespaceInTemplate: for par in params: if ':' in par: filenameOnCommons = par[par.index(':') + 1:] else: filenameOnCommons = params[0] return filenameOnCommons
b79e0c98ffb26830e98bd15bd305272bd9bec681 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/b79e0c98ffb26830e98bd15bd305272bd9bec681/nowcommons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 5359, 1398, 6517, 87, 12, 2890, 16, 1191, 2040, 1964, 4672, 1544, 1398, 6517, 87, 273, 599, 364, 15523, 16, 859, 316, 1191, 2040, 1964, 18, 8502, 19591, 13332, 309, 15523, 316, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 5359, 1398, 6517, 87, 12, 2890, 16, 1191, 2040, 1964, 4672, 1544, 1398, 6517, 87, 273, 599, 364, 15523, 16, 859, 316, 1191, 2040, 1964, 18, 8502, 19591, 13332, 309, 15523, 316, 365...
self.selenium.wait_for_condition(self._selenium_page_timeout)
self.selenium.wait_for_condition('window.selenium_ready == true', self._selenium_page_timeout)
def check_result(user): "Check if the user is alone in the result list" #Also check if the the results are right assert self.selenium.get_text(\ "//table[contains(@class, 'datatable')]/tbody/tr[last()]//td[2]") ==\ user
86303dc63816cf1e2a9fa04c1e0c110d6dda88f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/86303dc63816cf1e2a9fa04c1e0c110d6dda88f7/test_user_management.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2088, 12, 1355, 4672, 315, 1564, 309, 326, 729, 353, 24068, 316, 326, 563, 666, 6, 468, 1067, 2048, 866, 309, 326, 326, 1686, 854, 2145, 1815, 365, 18, 1786, 17327, 18, 588, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2088, 12, 1355, 4672, 315, 1564, 309, 326, 729, 353, 24068, 316, 326, 563, 666, 6, 468, 1067, 2048, 866, 309, 326, 326, 1686, 854, 2145, 1815, 365, 18, 1786, 17327, 18, 588, ...
if contextName is not None:
if contextName is None:
def addV1System(snmpEngine, securityName, communityName, contextEngineId=None, contextName=None, transportTag=None): snmpCommunityEntry, tblIdx, snmpEngineID = __cookV1SystemInfo( snmpEngine, securityName ) if contextEngineId is None: contextEngineId = snmpEngineID.syntax if contextName is not None: contextName = communityName snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpCommunityEntry.name + (8,) + tblIdx, 'destroy'),) ) snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((snmpCommunityEntry.name + (8,) + tblIdx, 'createAndGo'), (snmpCommunityEntry.name + (2,) + tblIdx, communityName), (snmpCommunityEntry.name + (3,) + tblIdx, securityName), (snmpCommunityEntry.name + (4,) + tblIdx, contextEngineId), (snmpCommunityEntry.name + (5,) + tblIdx, contextName), (snmpCommunityEntry.name + (6,) + tblIdx, transportTag), (snmpCommunityEntry.name + (7,) + tblIdx, 'nonVolatile')) )
591b0902bfef17383a3b3e7d3927705c060026be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/591b0902bfef17383a3b3e7d3927705c060026be/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 58, 21, 3163, 12, 26527, 4410, 16, 4373, 461, 16, 19833, 461, 16, 819, 4410, 548, 33, 7036, 16, 819, 461, 33, 7036, 16, 4736, 1805, 33, 7036, 4672, 15366, 12136, 13352, 1622, 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, 527, 58, 21, 3163, 12, 26527, 4410, 16, 4373, 461, 16, 19833, 461, 16, 819, 4410, 548, 33, 7036, 16, 819, 461, 33, 7036, 16, 4736, 1805, 33, 7036, 4672, 15366, 12136, 13352, 1622, 16, ...
self.results = []
self.results = None
def initialize(self): self.job.require_gcc() self.results = []
2585e887f05bf821ead10ca6315c71bf1e88fe8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/2585e887f05bf821ead10ca6315c71bf1e88fe8f/hackbench.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 12, 2890, 4672, 365, 18, 4688, 18, 6528, 67, 75, 952, 1435, 365, 18, 4717, 273, 5378, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 12, 2890, 4672, 365, 18, 4688, 18, 6528, 67, 75, 952, 1435, 365, 18, 4717, 273, 5378, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def render(self):
def __call__(self):
def render(self):
e940a419a159767449495b17a856334e20452cba /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8420/e940a419a159767449495b17a856334e20452cba/chooser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
if lu_class.REQ_WSSTORE: self.sstore = ssconf.WritableSimpleStore() else: self.sstore = ssconf.SimpleStore()
def ExecOpCode(self, op): """Execute an opcode.
c6868e1d7fd7ce6179942b2b909686d0a9ec2b0b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/c6868e1d7fd7ce6179942b2b909686d0a9ec2b0b/mcpu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3889, 3817, 1085, 12, 2890, 16, 1061, 4672, 3536, 5289, 392, 11396, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3889, 3817, 1085, 12, 2890, 16, 1061, 4672, 3536, 5289, 392, 11396, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file)
code = """%(return_type)s %(func_name)s(%(args)s) { helper_->SetBucketSize(kResultBucketId, 0); helper_->%(func_name)s(%(id_name)s, kResultBucketId); std::string str; if (GetBucketAsString(kResultBucketId, &str)) { GLsizei max_size = std::min(static_cast<size_t>(%(bufsize_name)s) - 1, str.size()); if (%(length_name)s != NULL) { *%(length_name)s = max_size; } memcpy(%(dest_name)s, str.c_str(), max_size); %(dest_name)s[max_size] = '\\0'; } } """ args = func.GetOriginalArgs() file.Write(code % { 'return_type': func.return_type, 'func_name': func.original_name, 'args': func.MakeTypedOriginalArgString(""), 'id_name': args[0].name, 'bufsize_name': args[1].name, 'length_name': args[2].name, 'dest_name': args[3].name, })
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" file.Write("// TODO(gman): Implement this\n") TypeHandler.WriteGLES2ImplementationHeader(self, func, file)
1ef566cc7626f0180e4b8b44da00e60fdbb0de8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1ef566cc7626f0180e4b8b44da00e60fdbb0de8e/build_gles2_cmd_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 43, 11386, 22, 13621, 1864, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 585, 18, 3067, 2932, 759, 2660, 12, 75, 4728, 4672, 10886, 333, 64, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 43, 11386, 22, 13621, 1864, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 585, 18, 3067, 2932, 759, 2660, 12, 75, 4728, 4672, 10886, 333, 64, ...
algorithm -- (default: 'bober')
algorithm -- (default: 'default')
def number_of_partitions(n,k=None, algorithm='bober'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'bober') 'bober' -- use Jonathon Bober's implementation (*very* fast, but new and not well tested yet). 'gap' -- use GAP (VERY *slow*) 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5, algorithm='gap') 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bober') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) if algorithm == 'gap': if k==None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) elif algorithm == 'bober': return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': if not k is None: raise ValueError, "cannot specify second argument k if the algorithm is PARI" return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm
8a5d6da61789d8ca741f4ba72dacb9a127d70350 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/8a5d6da61789d8ca741f4ba72dacb9a127d70350/combinat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1300, 67, 792, 67, 21275, 12, 82, 16, 79, 33, 7036, 16, 4886, 2218, 1075, 744, 11, 4672, 436, 8395, 2860, 326, 963, 434, 10060, 67, 1098, 12, 82, 16, 79, 2934, 225, 12943, 30, 290, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1300, 67, 792, 67, 21275, 12, 82, 16, 79, 33, 7036, 16, 4886, 2218, 1075, 744, 11, 4672, 436, 8395, 2860, 326, 963, 434, 10060, 67, 1098, 12, 82, 16, 79, 2934, 225, 12943, 30, 290, ...
keys = self._list_keys(path)
return list(self.ilistdir(path,wildcard,full,absolute,dirs_only,files_only)) def listdirinfo(self,path="./",wildcard=None,full=False,absolute=False,dirs_only=False,files_only=False): return list(self.ilistdirinfo(path,wildcard,full,absolute,dirs_only,files_only)) def ilistdir(self,path="./",wildcard=None,full=False,absolute=False,dirs_only=False,files_only=False): """List contents of a directory.""" keys = self._iter_keys(path)
def listdir(self,path="./",wildcard=None,full=False,absolute=False,dirs_only=False,files_only=False): """List contents of a directory.""" keys = self._list_keys(path) entries = self._filter_keys(path,keys,wildcard,full,absolute,dirs_only,files_only) return [nm for (nm,k) in entries]
8ef6d26a6a9b6416ad98420a072855a138f4fecc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5579/8ef6d26a6a9b6416ad98420a072855a138f4fecc/s3fs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13529, 12, 2890, 16, 803, 1546, 18, 19, 3113, 22887, 33, 7036, 16, 2854, 33, 8381, 16, 12547, 33, 8381, 16, 8291, 67, 3700, 33, 8381, 16, 2354, 67, 3700, 33, 8381, 4672, 3536, 682, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13529, 12, 2890, 16, 803, 1546, 18, 19, 3113, 22887, 33, 7036, 16, 2854, 33, 8381, 16, 12547, 33, 8381, 16, 8291, 67, 3700, 33, 8381, 16, 2354, 67, 3700, 33, 8381, 4672, 3536, 682, 2...
SendResponse(reply.getvalue()) return
return SendResponse(reply.getvalue(), **kw)
def _Dispatch(ps, modules, SendResponse, SendFault, docstyle=0, nsdict={}, typesmodule=None, rpc=None, **kw): '''Find a handler for the SOAP request in ps; search modules. Call SendResponse or SendFault to send the reply back, appropriately. ''' global _client_binding try: what = ps.body_root.localName # See what modules have the element name. if modules is None: modules = ( sys.modules['__main__'], ) handlers = [ getattr(m, what) for m in modules if hasattr(m, what) ] if len(handlers) == 0: raise TypeError("Unknown method " + what) # Of those modules, see who's callable. handlers = [ h for h in handlers if callable(h) ] if len(handlers) == 0: raise TypeError("Unimplemented method " + what) if len(handlers) > 1: raise TypeError("Multiple implementations found: " + `handlers`) handler = handlers[0] _client_binding = ClientBinding(ps) if docstyle: result = handler(ps.body_root) else: data = _child_elements(ps.body_root) if len(data) == 0: arg = [] else: try: try: type = data[0].localName tc = getattr(typesmodule, type).typecode except Exception, e: tc = TC.Any() arg = [ tc.parse(e, ps) for e in data ] except EvaluateException, e: SendFault(FaultFromZSIException(e)) return result = [ handler(*arg) ] reply = StringIO.StringIO() tc = TC.Any(aslist=1, pname=what + 'Response') SoapWriter(reply, nsdict=nsdict).serialize(result, tc, rpc=rpc) SendResponse(reply.getvalue()) return except Exception, e: # Something went wrong, send a fault. SendFault(FaultFromException(e, 0, sys.exc_info()[2]))
40bcccf9009cc5a60459459cd4b84029841b0bb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/40bcccf9009cc5a60459459cd4b84029841b0bb9/dispatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5325, 12, 1121, 16, 4381, 16, 2479, 1064, 16, 2479, 7083, 16, 997, 4060, 33, 20, 16, 3153, 1576, 28793, 1953, 2978, 33, 7036, 16, 6724, 33, 7036, 16, 2826, 9987, 4672, 9163, 3125,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5325, 12, 1121, 16, 4381, 16, 2479, 1064, 16, 2479, 7083, 16, 997, 4060, 33, 20, 16, 3153, 1576, 28793, 1953, 2978, 33, 7036, 16, 6724, 33, 7036, 16, 2826, 9987, 4672, 9163, 3125,...
if userExercise.streak==10: now_proficient_string = "&proficient=1" query = UserData.all() query.filter("user =", user) user_data = query.get() if user_data is None: user_data = UserData(user=user,last_login=datetime.datetime.now(),proficient_exercises=[],suggested_exercises=[],assigned_exercises=[])
if userExercise.streak >= 10: now_proficient_string = "&proficient=1" if userExercise.streak == 10: query = UserData.all() query.filter("user =", user) user_data = query.get() if user_data is None: user_data = UserData(user=user, last_login=datetime.datetime.now(), proficient_exercises=[], suggested_exercises=[], assigned_exercises=[])
def post(self): user = users.get_current_user() if user: key = self.request.get('key') exid = self.request.get('exid') correct = int(self.request.get('correct')) start_time = float(self.request.get('start_time')) elapsed_time = int(float(time.time())-start_time) problem_log = ProblemLog() problem_log.user = user problem_log.exercise = exid problem_log.correct = False if correct==1: problem_log.correct = True problem_log.time_done = datetime.datetime.now() problem_log.time_taken = elapsed_time problem_log.put() userExercise = db.get(key) userExercise.last_done = datetime.datetime.now() query = UserData.all() query.filter("user =", userExercise.user) user_data = query.get() suggested = exid in user_data.suggested_exercises proficient = exid in user_data.proficient_exercises if user_data.points == None: user_data.points = 0 user_data.points = user_data.points + PointCalculator(userExercise.streak,suggested,proficient) user_data.put() if (userExercise.total_done): userExercise.total_done = userExercise.total_done+1 else: userExercise.total_done=1 now_proficient_string = "" if (correct==1): userExercise.streak = userExercise.streak+1 if (userExercise.streak > userExercise.longest_streak): userExercise.longest_streak = userExercise.streak if userExercise.streak==10: now_proficient_string = "&proficient=1" query = UserData.all() query.filter("user =", user) user_data = query.get() if user_data is None: user_data = UserData(user=user,last_login=datetime.datetime.now(),proficient_exercises=[],suggested_exercises=[],assigned_exercises=[]) if userExercise.exercise not in user_data.proficient_exercises: user_data.proficient_exercises.append(userExercise.exercise) user_data.need_to_reassess = True user_data.put() else: userExercise.streak =0 userExercise.put() self.redirect('/exercises?exid='+exid+now_proficient_string) else: self.redirect(users.create_login_url(self.request.uri))
88bdc7d338864d7b69b68698595fe7409514fa58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12010/88bdc7d338864d7b69b68698595fe7409514fa58/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 12, 2890, 4672, 729, 273, 3677, 18, 588, 67, 2972, 67, 1355, 1435, 309, 729, 30, 498, 273, 365, 18, 2293, 18, 588, 2668, 856, 6134, 431, 350, 273, 365, 18, 2293, 18, 588, 2668,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 12, 2890, 4672, 729, 273, 3677, 18, 588, 67, 2972, 67, 1355, 1435, 309, 729, 30, 498, 273, 365, 18, 2293, 18, 588, 2668, 856, 6134, 431, 350, 273, 365, 18, 2293, 18, 588, 2668,...
row_sums = [solver.IntVar(0, 300, "row_sums(%i)" % i) for i in range(rows)] col_sums = [solver.IntVar(0, 300, "col_sums(%i)" % j) for j in range(cols)] row_signs = [solver.IntVar(-1, 1, "row_signs(%i)" % i) for i in range(rows)] col_signs = [solver.IntVar(-1, 1, "col_signs(%i)" % j) for j in range(cols)] total_sum = solver.IntVar(0, 1000, "total_sum")
row_signs = [solver.IntVar([-1, 1], "row_signs(%i)" % i) for i in range(rows)] col_signs = [solver.IntVar([-1, 1], "col_signs(%i)" % j) for j in range(cols)]
def main(): # Create the solver. solver = pywrapcp.Solver('Einav puzzle') # # data # # small problem rows = 3; cols = 3; data = [ [ 33, 30, -10], [-16, 19, 9], [-17, -12, -14] ] # # variables # x = {} for i in range(rows): for j in range(cols): x[i,j] = solver.IntVar(-100, 100, "x[%i,%i]" % (i,j)) x_flat = [x[i,j] for i in range(rows) for j in range(cols)] row_sums = [solver.IntVar(0, 300, "row_sums(%i)" % i) for i in range(rows)] col_sums = [solver.IntVar(0, 300, "col_sums(%i)" % j) for j in range(cols)] row_signs = [solver.IntVar(-1, 1, "row_signs(%i)" % i) for i in range(rows)] col_signs = [solver.IntVar(-1, 1, "col_signs(%i)" % j) for j in range(cols)] # total sum: to be minimized total_sum = solver.IntVar(0, 1000, "total_sum") # # constraints # for i in range(rows): for j in range(cols): solver.Add(x[i,j] == data[i][j]*row_signs[i]*col_signs[j]) total_sum_a = [data[i][j]*row_signs[i]*col_signs[j] for i in range(rows) for j in range(cols) ] solver.Add(total_sum == solver.Sum(total_sum_a)) # row sums for i in range(rows): s = [row_signs[i]*col_signs[j]*data[i][j] for j in range(cols)] solver.Add(row_sums[i] == solver.Sum(s)) # column sums for j in range(cols): s = [row_signs[i]*col_signs[j]*data[i][j] for i in range(rows)] solver.Add(col_sums[j] == solver.Sum(s)) # objective objective = solver.Minimize(total_sum, 1) # # search and result # db = solver.Phase(x_flat + row_sums + col_sums, solver.INT_VAR_SIMPLE, solver.INT_VALUE_SIMPLE) solver.NewSearch(db, [objective]) num_solutions = 0 while solver.NextSolution(): num_solutions += 1 print "row_sums:", [row_sums[i].Value() for i in range(rows)] print "col_sums:", [col_sums[j].Value() for j in range(cols)] for i in range(rows): for j in range(cols): print x[i,j].Value(), print print solver.EndSearch() print print "num_solutions:", num_solutions print "failures:", solver.failures() print "branches:", solver.branches() print "wall_time:", solver.wall_time()
d55b553ab319a285a09242c7fd29e2caaaf2cc87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4695/d55b553ab319a285a09242c7fd29e2caaaf2cc87/issue5.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 225, 468, 1788, 326, 12776, 18, 12776, 273, 2395, 4113, 4057, 18, 27721, 2668, 41, 267, 842, 293, 31550, 6134, 225, 468, 468, 501, 468, 282, 468, 5264, 6199, 2595, 273, 890,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 225, 468, 1788, 326, 12776, 18, 12776, 273, 2395, 4113, 4057, 18, 27721, 2668, 41, 267, 842, 293, 31550, 6134, 225, 468, 468, 501, 468, 282, 468, 5264, 6199, 2595, 273, 890,...
messages.extend(msgs)
skipped.extend(msgs)
def _skipFromTransaction(self,po): skipped = [] if rpmUtils.arch.isMultiLibArch(): archs = rpmUtils.arch.getArchList() n,a,e,v,r = po.pkgtup # skip for all combat archs for a in archs: pkgtup = (n,a,e,v,r) if self.tsInfo.exists(pkgtup): for txmbr in self.tsInfo.getMembers(pkgtup): pkg = txmbr.po skip = self._removePoFromTransaction(pkg) skipped.extend(skip) else: msgs = self._removePoFromTransaction(po) messages.extend(msgs) return skipped
7acbb8264438a3b7f30b2f5e8d4e950e3bf136b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5445/7acbb8264438a3b7f30b2f5e8d4e950e3bf136b7/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7457, 1265, 3342, 12, 2890, 16, 1631, 4672, 9700, 273, 225, 5378, 309, 25228, 1989, 18, 991, 18, 291, 5002, 5664, 12269, 13332, 6637, 87, 273, 25228, 1989, 18, 991, 18, 588, 12269, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7457, 1265, 3342, 12, 2890, 16, 1631, 4672, 9700, 273, 225, 5378, 309, 25228, 1989, 18, 991, 18, 291, 5002, 5664, 12269, 13332, 6637, 87, 273, 25228, 1989, 18, 991, 18, 588, 12269, ...
vetoMatch.append([vetoName,startT,stopT])
vetoMatch.append([os.path.basename(vetoNameLong).split(self.vetoExtension,1)[0],startT,stopT])
def __checkIntervals__(self,vList,gpsTime): """ This method is not to be called explicity. It is called by self.findInterval(IFO,gpsTime). This method returns a text string giving the veto list names and intervals that the gpsTime intersects with. """ vetoMatch=list() for vetoName,vetoList in vList: for startT,stopT,KWSig in vetoList: if ((startT-self.tolWin)<=gpsTime<=(stopT+self.tolWin)): vetoMatch.append([vetoName,startT,stopT]) tmpList=list() for a,b,c in vetoMatch: tmpList.append("%s %s %s\n"%(str(a),str(b),str(c))) outputString=str().join(tmpList) if vetoMatch.__len__()==0: outputString="%s %s %s\n"%("NONE","0","0") return outputString
2ff8af9590ca63b071d6e20dbc1b9a01df460e6d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3592/2ff8af9590ca63b071d6e20dbc1b9a01df460e6d/fu_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1893, 24224, 972, 12, 2890, 16, 90, 682, 16, 75, 1121, 950, 4672, 3536, 1220, 707, 353, 486, 358, 506, 2566, 431, 20458, 18, 2597, 353, 2566, 635, 365, 18, 4720, 4006, 12, 45, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1893, 24224, 972, 12, 2890, 16, 90, 682, 16, 75, 1121, 950, 4672, 3536, 1220, 707, 353, 486, 358, 506, 2566, 431, 20458, 18, 2597, 353, 2566, 635, 365, 18, 4720, 4006, 12, 45, ...
"Attempt to read ZIP archive that was already closed"
"Attempt to read ZIP archive that was already closed"
def read(self, name): "Return file bytes (as a string) for name" if self.mode not in ("r", "a"): raise RuntimeError, 'read() requires mode "r" or "a"' if not self.fp: raise RuntimeError, \ "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() self.fp.seek(zinfo.file_offset, 0) bytes = self.fp.read(zinfo.compress_size) self.fp.seek(filepos, 0) if zinfo.compress_type == ZIP_STORED: pass elif zinfo.compress_type == ZIP_DEFLATED: if not zlib: raise RuntimeError, \ "De-compression requires the (missing) zlib module" # zlib compress/decompress code by Jeremy Hylton of CNRI dc = zlib.decompressobj(-15) bytes = dc.decompress(bytes) # need to feed in unused pad byte so that zlib won't choke ex = dc.decompress('Z') + dc.flush() if ex: bytes = bytes + ex else: raise BadZipfile, \ "Unsupported compression method %d for file %s" % \ (zinfo.compress_type, name) crc = binascii.crc32(bytes) if crc != zinfo.CRC: raise BadZipfile, "Bad CRC-32 for file %s" % name return bytes
22171cafae2345fe7bc544232932e6979cc26f17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/22171cafae2345fe7bc544232932e6979cc26f17/zipfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 508, 4672, 315, 990, 585, 1731, 261, 345, 279, 533, 13, 364, 508, 6, 309, 365, 18, 3188, 486, 316, 7566, 86, 3113, 315, 69, 6, 4672, 1002, 7265, 16, 296, 896, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 508, 4672, 315, 990, 585, 1731, 261, 345, 279, 533, 13, 364, 508, 6, 309, 365, 18, 3188, 486, 316, 7566, 86, 3113, 315, 69, 6, 4672, 1002, 7265, 16, 296, 896, 14...
speech.speakSymbol(unichr(ascii))
speech.speakSymbol(unicode(chr(ascii), errors="replace"))
def speakKey(keyPress,ascii): global word if ascii==32 and ((config.conf["keyboard"]["speakTypedCharacters"] and not config.conf["keyboard"]["speakTypedWords"]) or (config.conf["keyboard"]["speakTypedCharacters"] and config.conf["keyboard"]["speakTypedWords"] and (len(word)==0))): speech.speakSymbol(unichr(ascii)) if ((keyPress[0] is None) or (keyPress[0]==frozenset(['Shift'])) or (keyPress[0]==frozenset(['Control','Alt']))) and (ascii in range(33,255)): if isTypingProtected(): char="*" else: char=unichr(ascii) if config.conf["keyboard"]["speakTypedCharacters"]: speech.speakSymbol(char) if config.conf["keyboard"]["speakTypedWords"] and ((ascii >=128) or ((keyPress[1]>=ord('a')) and (ascii<=ord('z'))) or ((ascii>=ord('A')) and (ascii<=ord('Z')))): word+=char elif config.conf["keyboard"]["speakTypedWords"] and (len(word)>=1): speech.speakText(word) word="" else: if config.conf["keyboard"]["speakCommandKeys"]: keyList=[] if (keyPress[0] is not None) and (len(keyPress[0])>0): keyList+=keyPress[0] keyList.append(keyPress[1]) label="+".join(keyList) speech.speakMessage(keyList) if config.conf["keyboard"]["speakTypedWords"] and (len(word)>=1): speech.speakMessage(word) word=""
c347b7b1a7b6a59004a1bd44b4f3caabfafb87d5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/c347b7b1a7b6a59004a1bd44b4f3caabfafb87d5/keyboardHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 10244, 653, 12, 856, 11840, 16, 9184, 4672, 2552, 2076, 309, 11384, 631, 1578, 471, 14015, 1425, 18, 3923, 9614, 31486, 6, 6362, 6, 87, 10244, 11985, 11600, 11929, 471, 486, 642, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 10244, 653, 12, 856, 11840, 16, 9184, 4672, 2552, 2076, 309, 11384, 631, 1578, 471, 14015, 1425, 18, 3923, 9614, 31486, 6, 6362, 6, 87, 10244, 11985, 11600, 11929, 471, 486, 642, 18...
(e.g., images or tables). (type=C{string})
(e.g., images or tables). (type=C{string})
def __init__(self, docmap, **kwargs): """ Construct a new HTML outputter, using the given L{DocMap} object. @param docmap: The documentation to output. @type docmap: L{DocMap} @param kwargs: Keyword arguments: - C{prj_name}: A name for the documentation (for the navbar). This name can contain arbitrary HTML code (e.g., images or tables). (type=C{string}) - C{prj_url}: A URL for the documentation (for the navbar). (type=C{string}) - C{css}: The CSS stylesheet file. If C{css} is a file, then its conents will be used. Otherwise, if C{css} is the name of a CSS stylesheet in L{epydoc.css}, then that stylesheet will be used. Otherwise, an error is reported. """ self._docmap = docmap
dd7fc26b7d69af6d4765be2a892edca4603899ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/dd7fc26b7d69af6d4765be2a892edca4603899ee/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 997, 1458, 16, 2826, 4333, 4672, 3536, 14291, 279, 394, 3982, 876, 387, 16, 1450, 326, 864, 511, 95, 1759, 863, 97, 733, 18, 225, 632, 891, 997, 1458, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 997, 1458, 16, 2826, 4333, 4672, 3536, 14291, 279, 394, 3982, 876, 387, 16, 1450, 326, 864, 511, 95, 1759, 863, 97, 733, 18, 225, 632, 891, 997, 1458, ...
_platform_cache_terse = None _platform_cache_not_terse = None _platform_aliased_cache_terse = None _platform_aliased_cache_not_terse = None
_platform_cache = {}
def python_compiler(): """ Returns a string identifying the compiler used for compiling Python. """ return _sys_version()[3]
8d11639dfe73b699dade6cef00e2eb91ec8b7e34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/8d11639dfe73b699dade6cef00e2eb91ec8b7e34/platform.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5790, 67, 9576, 13332, 225, 3536, 2860, 279, 533, 29134, 326, 5274, 1399, 364, 1161, 4973, 6600, 18, 225, 3536, 327, 389, 9499, 67, 1589, 1435, 63, 23, 65, 225, 2, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5790, 67, 9576, 13332, 225, 3536, 2860, 279, 533, 29134, 326, 5274, 1399, 364, 1161, 4973, 6600, 18, 225, 3536, 327, 389, 9499, 67, 1589, 1435, 63, 23, 65, 225, 2, -100, -100, -100, -1...
def update_buttons_sensitivity(self):
def update_buttons_sensitivity(self,a=None,b=None,c=None):
def update_buttons_sensitivity(self): enable = self.selection.count_selected_rows() + \ self.closed_selection.count_selected_rows() > 0 self.edit_mi.set_sensitive(enable) self.new_subtask_mi.set_sensitive(enable) self.mark_done_mi.set_sensitive(enable) self.dismiss_mi.set_sensitive(enable) self.delete_mi.set_sensitive(enable) self.donebutton.set_sensitive(enable) self.dismissbutton.set_sensitive(enable) self.deletebutton.set_sensitive(enable)
40921dd2a7f8aacd13e031ba1f8078fdfcd3d351 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/40921dd2a7f8aacd13e031ba1f8078fdfcd3d351/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1089, 67, 16016, 67, 87, 773, 20862, 12, 2890, 16, 69, 33, 7036, 16, 70, 33, 7036, 16, 71, 33, 7036, 4672, 4237, 273, 365, 18, 10705, 18, 1883, 67, 8109, 67, 3870, 1435, 397, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1089, 67, 16016, 67, 87, 773, 20862, 12, 2890, 16, 69, 33, 7036, 16, 70, 33, 7036, 16, 71, 33, 7036, 4672, 4237, 273, 365, 18, 10705, 18, 1883, 67, 8109, 67, 3870, 1435, 397, ...
if err.errno == 17: pass else :
if err.errno != 17:
def archiveJob(self, success, job, reportfilename): """ __archiveJob__
a3407a8723662230ef8282c6a2793d5bb1a36583 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/a3407a8723662230ef8282c6a2793d5bb1a36583/JobHandling.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5052, 2278, 12, 2890, 16, 2216, 16, 1719, 16, 2605, 3459, 4672, 3536, 1001, 10686, 2278, 972, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5052, 2278, 12, 2890, 16, 2216, 16, 1719, 16, 2605, 3459, 4672, 3536, 1001, 10686, 2278, 972, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
angle = hlr_utils.get_value(polar,i,p_descr) angle_err2 = hlr_utils.get_err2(polar,i,p_descr)
angle = hlr_utils.get_value(polar, i, p_descr) angle_err2 = hlr_utils.get_err2(polar, i, p_descr)
def init_scatt_wavevector_to_scalar_Q(initk,scattk,**kwargs): """ This function takes an initial wavevector and a scattered wavevector as a tuple and a SOM, a tuple and a SO or two tuples and calculates the quantity scalar_Q units of 1/Angstroms. The SOM principle axis must be in units of 1/Angstroms. The SOs and tuple(s) is(are) assumed to be in units of 1/Angstroms. The polar angle must be provided if one of the initial arguments is not a SOM. If a SOM is passed, by providing the polar angle at the function call time, the polar angle carried in the SOM instrument will be overridden. Parameters: ---------- -> initk is a SOM, SO or tuple of the initial wavevector -> scattk is a SOM, SO or tuple of the scattered wavevector -> kwargs is a list of key word arguments that the function accepts: polar= a tuple or list of tuples containing the polar angle and its associated error^2 units= a string containing the expected units for this function. The default for this function is 1/Angstroms Return: ------ <- A SOM, SO or tuple calculated for scalar_Q Exceptions: ---------- <- TypeError is raised if the SOM-SOM operation is attempted <- TypeError is raised if the SOM-SO operation is attempted <- TypeError is raised if the SO-SOM operation is attempted <- TypeError is raised if the SO-SO operation is attempted <- RuntimeError is raised if the SOM x-axis units are not 1/Angstroms <- RuntimeError is raised if a SOM is not passed and no polar angle is provided <- RuntimeError is raised if no instrument is provided in a SOM """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(initk,scattk) (i_descr,s_descr)=hlr_utils.get_descr(initk,scattk) # error checking for types if i_descr == "SOM" and s_descr == "SOM": raise TypeError, "SOM-SOM operation not supported" elif i_descr == "SOM" and s_descr == "SO": raise TypeError, "SOM-SO operation not supported" elif i_descr == "SO" and s_descr == "SOM": raise TypeError, "SO-SOM operation not supported" elif i_descr == "SO" and s_descr == "SO": raise TypeError, "SO-SO operation not supported" else: pass # Setup keyword arguments try: polar = kwargs["polar"] except KeyError: polar = None try: units = kwargs["units"] except KeyError: units = "1/Angstroms" result=hlr_utils.copy_som_attr(result,res_descr,initk,i_descr, scattk,s_descr) if res_descr == "SOM": index = hlr_utils.hlr_1D_units(result, units) result = hlr_utils.hlr_force_units(result, units, index) result.setAxisLabel(index, "scalar wavevector transfer") result.setYUnits("Counts/A-1") result.setYLabel("Intensity") else: pass if polar == None: if i_descr == "SOM": try: initk.attr_list.instrument.get_primary() inst = initk.attr_list.instrument except RuntimeError: raise RuntimeError, "A detector was not provided!" elif s_descr == "SOM": try: scattk.attr_list.instrument.get_primary() inst = scattk.attr_list.instrument except RuntimeError: raise RuntimeError, "A detector was not provided!" else: raise RuntimeError, "If no SOM is provided, then polar "\ +"information must be given." else: (p_descr,e_descr) = hlr_utils.get_descr(polar) # iterate through the values import axis_manip for i in range(hlr_utils.get_length(initk,scattk)): val1 = hlr_utils.get_value(initk,i,i_descr,"x") err2_1 = hlr_utils.get_err2(initk,i,i_descr,"x") val2 = hlr_utils.get_value(scattk,i,s_descr,"x") err2_2 = hlr_utils.get_err2(scattk,i,s_descr,"x") map_so = hlr_utils.get_map_so(initk,scattk,i) if polar == None: (angle,angle_err2) = hlr_utils.get_parameter("polar",map_so,inst) else: angle = hlr_utils.get_value(polar,i,p_descr) angle_err2 = hlr_utils.get_err2(polar,i,p_descr) value=axis_manip.init_scatt_wavevector_to_scalar_Q(val1, err2_1, val2, err2_2, angle, angle_err2) hlr_utils.result_insert(result,res_descr,value,map_so,"x") return result
dcfad031d5f907a400d4659737e261c4d7fdc434 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/dcfad031d5f907a400d4659737e261c4d7fdc434/hlr_init_scatt_wavevector_to_scalar_Q.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 1017, 4558, 67, 17838, 7737, 67, 869, 67, 8748, 67, 53, 12, 2738, 79, 16, 1017, 4558, 79, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 392, 2172, 10794, 7737, 471, 279, 14644,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 1017, 4558, 67, 17838, 7737, 67, 869, 67, 8748, 67, 53, 12, 2738, 79, 16, 1017, 4558, 79, 16, 636, 4333, 4672, 3536, 1220, 445, 5530, 392, 2172, 10794, 7737, 471, 279, 14644,...
def buildOperandTypeMap(userDict, lineno):
def buildOperandTypeMap(user_dict, lineno):
def buildOperandTypeMap(userDict, lineno): global operandTypeMap operandTypeMap = {} for (ext, (desc, size)) in userDict.iteritems(): if desc == 'signed int': ctype = 'int%d_t' % size is_signed = 1 elif desc == 'unsigned int': ctype = 'uint%d_t' % size is_signed = 0 elif desc == 'float': is_signed = 1 # shouldn't really matter if size == 32: ctype = 'float' elif size == 64: ctype = 'double' elif desc == 'twin64 int': is_signed = 0 ctype = 'Twin64_t' elif desc == 'twin32 int': is_signed = 0 ctype = 'Twin32_t' if ctype == '': error(lineno, 'Unrecognized type description "%s" in userDict') operandTypeMap[ext] = (size, ctype, is_signed)
eb4ce01056f92ba971e929d57db047fc5e280a9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6787/eb4ce01056f92ba971e929d57db047fc5e280a9a/isa_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 10265, 23968, 12, 1355, 67, 1576, 16, 7586, 4672, 2552, 9886, 23968, 9886, 23968, 273, 2618, 364, 261, 408, 16, 261, 5569, 16, 963, 3719, 316, 729, 5014, 18, 2165, 3319, 13332, 309...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 10265, 23968, 12, 1355, 67, 1576, 16, 7586, 4672, 2552, 9886, 23968, 9886, 23968, 273, 2618, 364, 261, 408, 16, 261, 5569, 16, 963, 3719, 316, 729, 5014, 18, 2165, 3319, 13332, 309...
return t.serialize(encoding="utf-8", cfg = self.cfg, **values)
return t.serialize(encoding = "utf-8", cfg = self.cfg, req = self.req, hasWrite = self.hasWrite, isAdmin = self.isAdmin, currentUser = self.authToken[0], **values) @checkAuth(write=False) def main(self, auth): self._redirect("browse")
def _write(self, templateName, **values): path = os.path.join(self.templatePath, templateName + ".kid") t = kid.load_template(path) return t.serialize(encoding="utf-8", cfg = self.cfg, **values)
674195b950d2599eff3655945f910c8f1f5a7763 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/674195b950d2599eff3655945f910c8f1f5a7763/http.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 12, 2890, 16, 15523, 16, 2826, 2372, 4672, 589, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18, 3202, 743, 16, 15523, 397, 3552, 79, 350, 7923, 268, 273, 17395, 18, 945, 67, 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, 389, 2626, 12, 2890, 16, 15523, 16, 2826, 2372, 4672, 589, 273, 1140, 18, 803, 18, 5701, 12, 2890, 18, 3202, 743, 16, 15523, 397, 3552, 79, 350, 7923, 268, 273, 17395, 18, 945, 67, 3...
s_h = pgl.Shape(h, houppier_material(r,g,b), obj.pid) s_tr = pgl.Shape(tr, trunk_material(), obj.pid+100000)
s_h = pgl.Shape(h, stand_material(r,g,b, spec_name)) s_tr = pgl.Shape(tr, stand_material(spec_name="trunk_mat"), s_h.id*10 )
def cones( obj , **kwds ): X_attr = kwds.get('X_attr', 'X') Y_attr = kwds.get('Y_attr', 'Y') pos_dist = kwds.get('dist', 'Distance') pos_az = kwds.get('az', 'Azimuth') circ_attr = kwds.get('circ_attr', 'Circonference') height_attr = kwds.get('height_attr', 'Haut') botHoup_attr = kwds.get('botHoup', 'BaseHoup') radiusHoup = kwds.get('radiusHoup', None) wood = kwds.get( 'wood', True ) rgb = kwds.get('rgb', None) if not obj.__dict__.has_key("posX") and not obj.__dict__.has_key("posY"): try : r = obj.__dict__[pos_dist] a = obj.__dict__[pos_az] obj.posX = r*cos( radians(forest2geomAZ(a)) ) obj.posY = r*sin( radians(forest2geomAZ(a)) ) except KeyError: obj.posX = obj.__dict__[X_attr] obj.posY = obj.__dict__[Y_attr] ht = 100* (obj.__dict__[height_attr] - obj.__dict__[botHoup_attr]) if radiusHoup : cone_radius = obj.__dict__[radiusHoup] else : cone_radius = ht/2. h = pgl.Translated( pgl.Vector3(obj.posX, obj.posY, obj.__dict__[botHoup_attr]*100 ), pgl.Cone(cone_radius,ht,1,12) ) tr = pgl.Translated(pgl.Vector3(obj.posX, obj.posY, 0), pgl.Cylinder( obj.__dict__[circ_attr]/(2*pi), obj.__dict__[botHoup_attr]*100 + ht*0.1) ) if rgb == None: s_h = pgl.Shape(h, houppier_material(), obj.pid) else : r,g,b = rgb s_h = pgl.Shape(h, houppier_material(r,g,b), obj.pid) s_tr = pgl.Shape(tr, trunk_material(), obj.pid+100000) if wood: return ( s_h, s_tr ) else : return ( s_h, )
8e57cbfdff4ebb559b6e45cdafb7b70293078052 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/799/8e57cbfdff4ebb559b6e45cdafb7b70293078052/dresser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 356, 281, 12, 1081, 269, 2826, 25577, 262, 30, 1139, 67, 1747, 273, 17149, 18, 588, 2668, 60, 67, 1747, 2187, 296, 60, 6134, 1624, 67, 1747, 273, 17149, 18, 588, 2668, 61, 67, 1747, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 356, 281, 12, 1081, 269, 2826, 25577, 262, 30, 1139, 67, 1747, 273, 17149, 18, 588, 2668, 60, 67, 1747, 2187, 296, 60, 6134, 1624, 67, 1747, 273, 17149, 18, 588, 2668, 61, 67, 1747, ...
+ shape_statements
+ shape_statements
def statements(lst): return ';\n'.join(lst) + ';'
7b011a76754f98a5a84059bd6ecc117b3fafe5f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/7b011a76754f98a5a84059bd6ecc117b3fafe5f9/elemwise.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6317, 12, 16923, 4672, 327, 296, 9747, 82, 10332, 5701, 12, 16923, 13, 397, 7554, 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, 6317, 12, 16923, 4672, 327, 296, 9747, 82, 10332, 5701, 12, 16923, 13, 397, 7554, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if of.startswith("xm"): req.write("""<collection xmlns="http://www.loc.gov/MARC21/slim">\n""") else: req.write("""<collection>\n""")
def page_start(req, of, cc, as, ln, uid, title_message=None, description='', keywords=''): "Start page according to given output format." _ = gettext_set_language(ln) if not title_message: title_message = _("Search Results") if not req: return # we were called from CLI content_type = get_output_format_content_type(of) if of.startswith('x'): # we are doing XML output: req.content_type = "text/xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") if of.startswith("xm"): req.write("""<collection xmlns="http://www.loc.gov/MARC21/slim">\n""") else: req.write("""<collection>\n""") elif of.startswith('t') or str(of[0:3]).isdigit(): # we are doing plain text output: req.content_type = "text/plain" req.send_http_header() elif of == "id": pass # nothing to do, we shall only return list of recIDs elif content_type == 'text/html': # we are doing HTML output: req.content_type = "text/html" req.send_http_header() if not description: description = "%s %s." % (cc, _("Search Results")) if not keywords: keywords = "CDS Invenio, WebSearch, %s" % cc req.write(pageheaderonly(req=req, title=title_message, navtrail=create_navtrail_links(cc, as, ln), description=description, keywords=keywords, uid=uid, language=ln)) req.write(websearch_templates.tmpl_search_pagestart(ln=ln)) #else: # req.send_http_header()
612bfa4556cb3e32bb6c386a04c55cca9e340b34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/612bfa4556cb3e32bb6c386a04c55cca9e340b34/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1363, 67, 1937, 12, 3658, 16, 434, 16, 4946, 16, 487, 16, 7211, 16, 4555, 16, 2077, 67, 2150, 33, 7036, 16, 2477, 2218, 2187, 7093, 2218, 11, 4672, 315, 1685, 1363, 4888, 358, 864, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1363, 67, 1937, 12, 3658, 16, 434, 16, 4946, 16, 487, 16, 7211, 16, 4555, 16, 2077, 67, 2150, 33, 7036, 16, 2477, 2218, 2187, 7093, 2218, 11, 4672, 315, 1685, 1363, 4888, 358, 864, 8...
def formattree(self, tree, modname, classes={}, parent=None):
def formattree(self, tree, modname, parent=None):
def formattree(self, tree, modname, classes={}, parent=None): """Produce HTML for a class tree as given by inspect.getclasstree().""" result = '' for entry in tree: if type(entry) is type(()): c, bases = entry result = result + '<dt><font face="helvetica, arial"><small>' result = result + self.classlink(c, modname, classes) if bases and bases != (parent,): parents = [] for base in bases: parents.append(self.classlink(base, modname, classes)) result = result + '(' + join(parents, ', ') + ')' result = result + '\n</small></font></dt>' elif type(entry) is type([]): result = result + '<dd>\n%s</dd>\n' % self.formattree( entry, modname, classes, c) return '<dl>\n%s</dl>\n' % result
829253c953a1561afa1fc68f3f1f063bd3197494 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/829253c953a1561afa1fc68f3f1f063bd3197494/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 3413, 12, 2890, 16, 2151, 16, 16037, 16, 982, 33, 7036, 4672, 3536, 25884, 3982, 364, 279, 667, 2151, 487, 864, 635, 5334, 18, 588, 830, 345, 334, 992, 1435, 12123, 563, 273, 875,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3413, 12, 2890, 16, 2151, 16, 16037, 16, 982, 33, 7036, 4672, 3536, 25884, 3982, 364, 279, 667, 2151, 487, 864, 635, 5334, 18, 588, 830, 345, 334, 992, 1435, 12123, 563, 273, 875,...
_cfunc_refs[tmpval1] = c_cb
def fl_setpup_entercb(nm, py_cb, data): """ fl_setpup_entercb(nm, py_cb, data) -> pup_entercb ref. """ c_cb = FL_PUP_ENTERCB(py_cb) retval = _fl_setpup_entercb(nm, c_cb, data) _cfunc_refs[tmpval1] = c_cb return retval
8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 84, 416, 67, 2328, 7358, 12, 15094, 16, 2395, 67, 7358, 16, 501, 4672, 3536, 1183, 67, 542, 84, 416, 67, 2328, 7358, 12, 15094, 16, 2395, 67, 7358, 16, 501, 13, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 84, 416, 67, 2328, 7358, 12, 15094, 16, 2395, 67, 7358, 16, 501, 4672, 3536, 1183, 67, 542, 84, 416, 67, 2328, 7358, 12, 15094, 16, 2395, 67, 7358, 16, 501, 13, 317, ...
diff = vis_diff.make_table( a, b, safe_utf8(self.id1), safe_utf8(self.id2), context=context)
diff = safe_utf8(vis_diff.make_table(a, b, safe_unicode(self.id1), safe_unicode(self.id2), context=context))
def html_diff(self, context=True, wrapcolumn=40): """Return an HTML table showing differences""" # difflib is not Unicode-aware, so we need to force everything to # utf-8 manually a = [safe_utf8(i) for i in self._parseField(self.oldValue)] b = [safe_utf8(i) for i in self._parseField(self.newValue)] vis_diff = difflib.HtmlDiff(wrapcolumn=wrapcolumn) diff = vis_diff.make_table( a, b, safe_utf8(self.id1), safe_utf8(self.id2), context=context) return diff
db7dab53a4b5309102e3d2a1f624eec1341907d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11957/db7dab53a4b5309102e3d2a1f624eec1341907d0/TextDiff.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 67, 5413, 12, 2890, 16, 819, 33, 5510, 16, 2193, 2827, 33, 7132, 4672, 3536, 990, 392, 3982, 1014, 17253, 16440, 8395, 468, 1901, 12678, 353, 486, 9633, 17, 30799, 16, 1427, 732, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 67, 5413, 12, 2890, 16, 819, 33, 5510, 16, 2193, 2827, 33, 7132, 4672, 3536, 990, 392, 3982, 1014, 17253, 16440, 8395, 468, 1901, 12678, 353, 486, 9633, 17, 30799, 16, 1427, 732, ...
def J_B(self, k, alpha, beta, Cterms):
def J_B(self, k, Cterms, alpha, beta):
def J_B(self, k, alpha, beta, Cterms): """Solution for J_B which is the integral for B in terms of constants C3 and C4.""" kmax = k[-1] kmin = k[0] C3 = Cterms[2] C4 = Cterms[3] J_B = ((alpha ** 2 * (Sqrt(kmax * (k + kmax)) * (112 * C3 * (105 * k ** 4 + 250 * k ** 3 * kmax - 104 * k ** 2 * kmax ** 2 - 48 * k * kmax ** 3 + 96 * kmax ** 4) + 3 * C4 * (945 * k ** 6 - 630 * k ** 5 * kmax + 504 * k ** 4 * kmax ** 2 + 4688 * k ** 3 * kmax ** 3 - 2176 * k ** 2 * kmax ** 4 - 1280 * k * kmax ** 5 + 2560 * kmax ** 6)) - Sqrt(kmax * (-k + kmax)) * (112 * C3 * (105 * k ** 4 - 250 * k ** 3 * kmax - 104 * k ** 2 * kmax ** 2 + 48 * k * kmax ** 3 + 96 * kmax ** 4) + 3 * C4 * (945 * k ** 6 + 630 * k ** 5 * kmax + 504 * k ** 4 * kmax ** 2 - 4688 * k ** 3 * kmax ** 3 - 2176 * k ** 2 * kmax ** 4 + 1280 * k * kmax ** 5 + 2560 * kmax ** 6)) - Sqrt(kmin) * Sqrt(k + kmin) * (112 * C3 * (105 * k ** 4 + 250 * k ** 3 * kmin - 104 * k ** 2 * kmin ** 2 - 48 * k * kmin ** 3 + 96 * kmin ** 4) + 3 * C4 * (945 * k ** 6 - 630 * k ** 5 * kmin + 504 * k ** 4 * kmin ** 2 + 4688 * k ** 3 * kmin ** 3 - 2176 * k ** 2 * kmin ** 4 - 1280 * k * kmin ** 5 + 2560 * kmin ** 6)) - Sqrt((k - kmin) * kmin) * (112 * C3 * (105 * k ** 4 - 250 * k ** 3 * kmin - 104 * k ** 2 * kmin ** 2 + 48 * k * kmin ** 3 + 96 * kmin ** 4) + 3 * C4 * (945 * k ** 6 + 630 * k ** 5 * kmin + 504 * k ** 4 * kmin ** 2 - 4688 * k ** 3 * kmin ** 3 - 2176 * k ** 2 * kmin ** 4 + 1280 * k * kmin ** 5 + 2560 * kmin ** 6)) - (105 * k ** 5 * (112 * C3 + 27 * C4 * k ** 2) * Pi) / 2. + 105 * k ** 5 * (112 * C3 + 27 * C4 * k ** 2) * ArcTan(Sqrt(kmin / (k - kmin))) + 105 * k ** 5 * (112 * C3 + 27 * C4 * k ** 2) * Log(2 * Sqrt(k)) - 105 * k ** 5 * (112 * C3 + 27 * C4 * k ** 2) * Log(2 * (Sqrt(kmax) + Sqrt(-k + kmax))) - 105 * k ** 5 * (112 * C3 + 27 * C4 * k ** 2) * Log(2 * (Sqrt(kmax) + Sqrt(k + kmax))) + 105 * k ** 5 * (112 * C3 + 27 * C4 * k ** 2) * Log(2 * (Sqrt(kmin) + Sqrt(k + kmin))))) / (282240. * k ** 2))
b8fae0a32ac41bd9dfe5603883bc8b6fef6aa865 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7283/b8fae0a32ac41bd9dfe5603883bc8b6fef6aa865/analyticsolution.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 804, 67, 38, 12, 2890, 16, 417, 16, 385, 10112, 16, 4190, 16, 6796, 4672, 3536, 16135, 364, 804, 67, 38, 1492, 353, 326, 21423, 364, 605, 316, 6548, 434, 6810, 385, 23, 471, 385, 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, 804, 67, 38, 12, 2890, 16, 417, 16, 385, 10112, 16, 4190, 16, 6796, 4672, 3536, 16135, 364, 804, 67, 38, 1492, 353, 326, 21423, 364, 605, 316, 6548, 434, 6810, 385, 23, 471, 385, 24,...
pkg = model.Package.by_name(CreateTestData.pkgname1)
pkg = model.Package.by_name(CreateTestData.pkgname2)
def test_1(self): startrev = model.repo.youngest_revision().id pkg = model.Package.by_name(CreateTestData.pkgname1) assert pkg is not None
df50e97e1d2ad1b7292c29e20f51508428a05042 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/265/df50e97e1d2ad1b7292c29e20f51508428a05042/test_extras.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 21, 12, 2890, 4672, 787, 9083, 273, 938, 18, 7422, 18, 93, 465, 17592, 67, 13057, 7675, 350, 3475, 273, 938, 18, 2261, 18, 1637, 67, 529, 12, 1684, 4709, 751, 18, 10657, 52...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 67, 21, 12, 2890, 4672, 787, 9083, 273, 938, 18, 7422, 18, 93, 465, 17592, 67, 13057, 7675, 350, 3475, 273, 938, 18, 2261, 18, 1637, 67, 529, 12, 1684, 4709, 751, 18, 10657, 52...
return _base.ELEMENT, node.name, \ dict(node.attrs).items(), node.contents
return (_base.ELEMENT, namespaces["html"], node.name, dict(node.attrs).items(), node.contents)
def getNodeDetails(self, node): if isinstance(node, BeautifulSoup): # Document or DocumentFragment return (_base.DOCUMENT,)
23926b18bc75e4b0ef0743e5ede65cd4d339480c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9368/23926b18bc75e4b0ef0743e5ede65cd4d339480c/soup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5973, 3790, 12, 2890, 16, 756, 4672, 309, 1549, 12, 2159, 16, 28132, 4672, 468, 4319, 578, 4319, 7456, 327, 261, 67, 1969, 18, 18450, 16, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5973, 3790, 12, 2890, 16, 756, 4672, 309, 1549, 12, 2159, 16, 28132, 4672, 468, 4319, 578, 4319, 7456, 327, 261, 67, 1969, 18, 18450, 16, 13, 2, -100, -100, -100, -100, -100, -100, -10...
def assetsMatchResource(self, assetSet, resource, resVal): resId, embImgs = resVal for assetRex in assetSet: if embImgs: for embId in embImgs: if assetRex.match(embId): return True if assetRex.match(resId): return True return False def assetIdFromPath(self, resource, lib): def extractAssetPart(libresuri, imguri): pre,libsfx,imgsfx = Path.getCommonPrefix(libresuri, imguri) if imgsfx[0] == os.sep: imgsfx = imgsfx[1:] return imgsfx librespath = os.path.normpath(os.path.join(lib['path'], lib['resource'])) assetId = extractAssetPart(librespath, resource) assetId = Path.posifyPath(assetId) return assetId
def embedsInList(self, combObj, resList): matchingEmbeds = [] for embed in combObj.embeds: # embed = Image() if embed in resList: matchingEmbeds.append(embed) return matchingEmbeds
261a8f34d7d9862771dfdc12dbb186e627bbfa4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/261a8f34d7d9862771dfdc12dbb186e627bbfa4a/ResourceHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4724, 87, 24218, 12, 2890, 16, 3894, 2675, 16, 400, 682, 4672, 3607, 9538, 87, 273, 5378, 364, 4724, 316, 3894, 2675, 18, 8483, 87, 30, 468, 4724, 273, 3421, 1435, 309, 4724, 316, 400,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4724, 87, 24218, 12, 2890, 16, 3894, 2675, 16, 400, 682, 4672, 3607, 9538, 87, 273, 5378, 364, 4724, 316, 3894, 2675, 18, 8483, 87, 30, 468, 4724, 273, 3421, 1435, 309, 4724, 316, 400,...
labeltabColsTitle.pack(side=TOP,anchor=W,padx=5) self.scaleTabCols.pack(side=TOP,padx=5,fill=X)
def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabPages.pages['Fonts/Tabs']['page'] #body section frames frameFont=Frame(frame,borderwidth=2,relief=GROOVE) frameIndent=Frame(frame,borderwidth=2,relief=GROOVE) #frameFont labelFontTitle=Label(frameFont,text='Set Base Editor Font') frameFontName=Frame(frameFont) frameFontParam=Frame(frameFont) labelFontNameTitle=Label(frameFontName,justify=LEFT, text='Font :') self.listFontName=Listbox(frameFontName,height=5,takefocus=FALSE, exportselection=FALSE) self.listFontName.bind('<ButtonRelease-1>',self.OnListFontButtonRelease) scrollFont=Scrollbar(frameFontName) scrollFont.config(command=self.listFontName.yview) self.listFontName.config(yscrollcommand=scrollFont.set) labelFontSizeTitle=Label(frameFontParam,text='Size :') self.optMenuFontSize=DynOptionMenu(frameFontParam,self.fontSize,None, command=self.SetFontSample) checkFontBold=Checkbutton(frameFontParam,variable=self.fontBold, onvalue=1,offvalue=0,text='Bold',command=self.SetFontSample) frameFontSample=Frame(frameFont,relief=SOLID,borderwidth=1) self.labelFontSample=Label(frameFontSample, text='AaBbCcDdEe\nFfGgHhIiJjK\n1234567890\n#:+=(){}[]', justify=LEFT,font=self.editFont) #frameIndent labelIndentTitle=Label(frameIndent,text='Set Indentation Defaults') frameIndentType=Frame(frameIndent) frameIndentSize=Frame(frameIndent) labelIndentTypeTitle=Label(frameIndentType, text='Choose indentation type :') radioUseSpaces=Radiobutton(frameIndentType,variable=self.indentBySpaces, value=1,text='Tab key inserts spaces') radioUseTabs=Radiobutton(frameIndentType,variable=self.indentBySpaces, value=0,text='Tab key inserts tabs') labelIndentSizeTitle=Label(frameIndentSize, text='Choose indentation size :') labelSpaceNumTitle=Label(frameIndentSize,justify=LEFT, text='when tab key inserts spaces,\nspaces per tab') self.scaleSpaceNum=Scale(frameIndentSize,variable=self.spaceNum, orient='horizontal',tickinterval=2,from_=2,to=8) labeltabColsTitle=Label(frameIndentSize,justify=LEFT, text='when tab key inserts tabs,\ncolumns per tab') self.scaleTabCols=Scale(frameIndentSize,variable=self.tabCols, orient='horizontal',tickinterval=2,from_=2,to=8) #widget packing #body frameFont.pack(side=LEFT,padx=5,pady=10,expand=TRUE,fill=BOTH) frameIndent.pack(side=LEFT,padx=5,pady=10,fill=Y) #frameFont labelFontTitle.pack(side=TOP,anchor=W,padx=5,pady=5) frameFontName.pack(side=TOP,padx=5,pady=5,fill=X) frameFontParam.pack(side=TOP,padx=5,pady=5,fill=X) labelFontNameTitle.pack(side=TOP,anchor=W) self.listFontName.pack(side=LEFT,expand=TRUE,fill=X) scrollFont.pack(side=LEFT,fill=Y) labelFontSizeTitle.pack(side=LEFT,anchor=W) self.optMenuFontSize.pack(side=LEFT,anchor=W) checkFontBold.pack(side=LEFT,anchor=W,padx=20) frameFontSample.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) self.labelFontSample.pack(expand=TRUE,fill=BOTH) #frameIndent labelIndentTitle.pack(side=TOP,anchor=W,padx=5,pady=5) frameIndentType.pack(side=TOP,padx=5,fill=X) frameIndentSize.pack(side=TOP,padx=5,pady=5,fill=BOTH) labelIndentTypeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) radioUseSpaces.pack(side=TOP,anchor=W,padx=5) radioUseTabs.pack(side=TOP,anchor=W,padx=5) labelIndentSizeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) labelSpaceNumTitle.pack(side=TOP,anchor=W,padx=5) self.scaleSpaceNum.pack(side=TOP,padx=5,fill=X) labeltabColsTitle.pack(side=TOP,anchor=W,padx=5) self.scaleTabCols.pack(side=TOP,padx=5,fill=X) return frame
22cc40d7b201cf9033ebbca4fe11980daac2a344 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22cc40d7b201cf9033ebbca4fe11980daac2a344/configDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1788, 1964, 5711, 5661, 12, 2890, 4672, 468, 16099, 5555, 365, 18, 5776, 1225, 33, 780, 1537, 12, 2890, 13, 365, 18, 5776, 38, 1673, 33, 5507, 1537, 12, 2890, 13, 365, 18, 5776, 461, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1788, 1964, 5711, 5661, 12, 2890, 4672, 468, 16099, 5555, 365, 18, 5776, 1225, 33, 780, 1537, 12, 2890, 13, 365, 18, 5776, 38, 1673, 33, 5507, 1537, 12, 2890, 13, 365, 18, 5776, 461, ...
track_flag=False
track_flag = False
def action_done(self, cr, uid, ids, context=None): track_flag=False for move in self.browse(cr, uid, ids): if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting','confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'}) if move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) else: pass # self.action_done(cr, uid, [move.move_dest_id.id]) if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context)
369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3298, 67, 6420, 273, 1083, 364, 3635, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, 4672, 309, 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, 1301, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3298, 67, 6420, 273, 1083, 364, 3635, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, 4672, 309, 3...
table_alias, name, db_type, lookup_type, value_annot, params = child
if len(child) == 6: table_alias, name, db_type, lookup_type, value_annot, params = child else: (table_alias, name, db_type), lookup_type, value_annot, params = child
def _update_where(self, query, where, value): _import_datatree() qn = query.quote_name_unless_alias new_children = [] datatree_id = getattr(value, 'id', value)
ac4db7355fa1e693476c7dfa7d21d3e8933e3dd5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/ac4db7355fa1e693476c7dfa7d21d3e8933e3dd5/query_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 6051, 12, 2890, 16, 843, 16, 1625, 16, 460, 4672, 389, 5666, 67, 3404, 270, 992, 1435, 31054, 273, 843, 18, 6889, 67, 529, 67, 28502, 67, 4930, 394, 67, 5906, 273, 537...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 6051, 12, 2890, 16, 843, 16, 1625, 16, 460, 4672, 389, 5666, 67, 3404, 270, 992, 1435, 31054, 273, 843, 18, 6889, 67, 529, 67, 28502, 67, 4930, 394, 67, 5906, 273, 537...
r""" Oblong (or pronic, or heteromecic) numbers: $n(n+1)$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A002378;a Oblong (or pronic, or heteromecic) numbers: n(n+1). sage: a(-1) Traceback (most recent call last): ... ValueError: input n (=-1) must be an integer >= 0 sage: a(0) 0 sage: a(1) 2 sage: a(11) 132 sage: a.list(12) [0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132] AUTHOR: -- Jaap Spies (2007-01-26) """ def __init__(self):
def __init__(self): r""" Oblong (or pronic, or heteromecic) numbers: $n(n+1)$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A002378;a Oblong (or pronic, or heteromecic) numbers: n(n+1). sage: a(-1) Traceback (most recent call last): ... ValueError: input n (=-1) must be an integer >= 0 sage: a(0) 0 sage: a(1) 2 sage: a(11) 132 sage: a.list(12) [0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132] AUTHOR: -- Jaap Spies (2007-01-26) """
def _eval(self, n): return Integer(n*(3*n-1)//2)
8b300fed02e947af57b58146f62dccfc715cf0b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8b300fed02e947af57b58146f62dccfc715cf0b9/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 327, 2144, 12, 82, 21556, 23, 14, 82, 17, 21, 13, 759, 22, 13, 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, 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, 389, 8622, 12, 2890, 16, 290, 4672, 327, 2144, 12, 82, 21556, 23, 14, 82, 17, 21, 13, 759, 22, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
def __init__(self, indexname='HG_INDEX'):
def __init__(self, indexname='HG_INDEX', repo_location=None):
def __init__(self, indexname='HG_INDEX'): self.indexname = indexname
9678d60a22f33156e6641f2bbf1088d57998287c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4230/9678d60a22f33156e6641f2bbf1088d57998287c/daemon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 770, 529, 2218, 44, 43, 67, 9199, 2187, 3538, 67, 3562, 33, 7036, 4672, 365, 18, 1615, 529, 273, 770, 529, 282, 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, 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, 1001, 2738, 972, 12, 2890, 16, 770, 529, 2218, 44, 43, 67, 9199, 2187, 3538, 67, 3562, 33, 7036, 4672, 365, 18, 1615, 529, 273, 770, 529, 282, 2, -100, -100, -100, -100, -100, -100, ...
file = tempfile.NamedTemporaryFile(delete=False) filename = file.name file.write(' '.join(s[1:])) file.close()
(fd, filename) = tempfile.mkstemp() os.write(fd, ' '.join(s[1:])) os.close(fd)
def exec_command(s, **kw): filename = '' if sys.platform.startswith('win') and len(' '.join(s)) > 32000: import tempfile file = tempfile.NamedTemporaryFile(delete=False) filename = file.name file.write(' '.join(s[1:])) file.close() s = [s[0], '@' + filename] if 'log' in kw: kw['stdout'] = kw['stderr'] = kw['log'] del(kw['log']) kw['shell'] = isinstance(s, str) def cleanup(): try: if os.path.exists(filename): os.remove(filename) except: pass try: proc = subprocess.Popen(s, **kw) result = proc.wait() cleanup() return result except OSError: cleanup() raise
65c1605051fb0d05ae6a81da4292b966b165cafd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/65c1605051fb0d05ae6a81da4292b966b165cafd/waf_extensions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1196, 67, 3076, 12, 87, 16, 2826, 9987, 4672, 1544, 273, 875, 309, 2589, 18, 9898, 18, 17514, 1918, 2668, 8082, 6134, 471, 562, 2668, 2418, 5701, 12, 87, 3719, 405, 3847, 3784, 30, 193...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1196, 67, 3076, 12, 87, 16, 2826, 9987, 4672, 1544, 273, 875, 309, 2589, 18, 9898, 18, 17514, 1918, 2668, 8082, 6134, 471, 562, 2668, 2418, 5701, 12, 87, 3719, 405, 3847, 3784, 30, 193...
usage()
Script.showHelp()
def usage(): print 'Usage: %s < ce name> [< ce name>]' % ( Script.scriptName ) DIRAC.exit( 2 )
096c758e5e556790bf90e5743318f77f9fc92894 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/096c758e5e556790bf90e5743318f77f9fc92894/dirac-admin-ce-info.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1172, 296, 5357, 30, 738, 87, 411, 5898, 508, 34, 306, 32, 5898, 508, 34, 3864, 738, 261, 7739, 18, 4263, 461, 262, 18544, 2226, 18, 8593, 12, 576, 262, 225, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1172, 296, 5357, 30, 738, 87, 411, 5898, 508, 34, 306, 32, 5898, 508, 34, 3864, 738, 261, 7739, 18, 4263, 461, 262, 18544, 2226, 18, 8593, 12, 576, 262, 225, 2, -100, -1...
self.nc = nowCommons['_default'] self.nowCommonsTemplate = wikipedia.Page(self.site, 'Template:' + self.nc) if nowCommonsRedirects.has_key(self.site.lang): self.nc = ('(%s|%s)' % (self.nc, '|'.join(nowCommonsRedirects[self.site.lang]))) if self.site.lang in namespaceInTemplate: self.nowCommonsR = re.compile(u'{{%s(\|%s:(?P<filename>.+?))?}}' % (self.nc, self.site.namespace(6))) else: self.nowCommonsR = re.compile(u'{{%s(\|(?P<filename>.+?))?}}' % self.nc)
return nowCommons['_default']
def __init__(self): self.site = wikipedia.getSite() if repr(self.site) == 'commons:commons': sys.exit('Don\'t run this bot on Commons!') if nowCommons.has_key(self.site.lang): self.nc = nowCommons[self.site.lang] else: self.nc = nowCommons['_default'] self.nowCommonsTemplate = wikipedia.Page(self.site, 'Template:' + self.nc) if nowCommonsRedirects.has_key(self.site.lang): self.nc = ('(%s|%s)' % (self.nc, '|'.join(nowCommonsRedirects[self.site.lang]))) if self.site.lang in namespaceInTemplate: self.nowCommonsR = re.compile(u'{{%s(\|%s:(?P<filename>.+?))?}}' % (self.nc, self.site.namespace(6))) else: self.nowCommonsR = re.compile(u'{{%s(\|(?P<filename>.+?))?}}' % self.nc)
2394a0ac4617f33654dc4fe7081565760d8eac26 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/2394a0ac4617f33654dc4fe7081565760d8eac26/nowcommons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 4256, 273, 21137, 18, 588, 4956, 1435, 309, 8480, 12, 2890, 18, 4256, 13, 422, 296, 6054, 87, 30, 6054, 87, 4278, 2589, 18, 8593, 2668, 22293,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 4256, 273, 21137, 18, 588, 4956, 1435, 309, 8480, 12, 2890, 18, 4256, 13, 422, 296, 6054, 87, 30, 6054, 87, 4278, 2589, 18, 8593, 2668, 22293,...
name = GetNonTextControlName(control, visible_text_controls)
non_text_names = GetNonTextControlName(control, allcontrols)
def get_control_names(control, visible_text_controls): "Returns a list of names for this control" names = [] # if it has a reference control - then use that #if hasattr(control, 'ref') and control.ref: # control = control.ref # Add the control based on it's friendly class name names.append(control.FriendlyClassName()) # if it has some character text then add it base on that # and based on that with friendly class name appended cleaned = _clean_text(control.WindowText()) if cleaned: names.append(cleaned) names.append(cleaned + control.FriendlyClassName()) # it didn't have visible text else: # so find the text of the nearest text visible control name = GetNonTextControlName(control, visible_text_controls) # and if one was found - add it if name: names.append(name) # return the names - and make sure there are no duplicates return set(names)
dad780378efcdbedd6303bcebc73ca917c87e3f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6953/dad780378efcdbedd6303bcebc73ca917c87e3f3/findbestmatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7098, 67, 1973, 12, 7098, 16, 6021, 67, 955, 67, 24350, 4672, 315, 1356, 279, 666, 434, 1257, 364, 333, 3325, 6, 1257, 273, 5378, 225, 468, 309, 518, 711, 279, 2114, 3325, 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, 336, 67, 7098, 67, 1973, 12, 7098, 16, 6021, 67, 955, 67, 24350, 4672, 315, 1356, 279, 666, 434, 1257, 364, 333, 3325, 6, 1257, 273, 5378, 225, 468, 309, 518, 711, 279, 2114, 3325, 3...
QT4_MOC = locateQt4Command(env,'moc', env['QTDIR']), QT4_UIC = locateQt4Command(env,'uic', env['QTDIR']), QT4_RCC = locateQt4Command(env,'rcc', env['QTDIR']), QT4_LUPDATE = locateQt4Command(env,'lupdate', env['QTDIR']), QT4_LRELEASE = locateQt4Command(env,'lrelease', env['QTDIR']),
QT4_MOC = locateQt4Command(env,'moc'), QT4_UIC = locateQt4Command(env,'uic'), QT4_RCC = locateQt4Command(env,'rcc'), QT4_LUPDATE = locateQt4Command(env,'lupdate'), QT4_LRELEASE = locateQt4Command(env,'lrelease'),
def locateQt4Command(env, command, qtdir) : suffixes = [ '-qt4', '-qt4.exe', '4', '4.exe', '', '.exe', ] triedPaths = [] for suffix in suffixes : fullpath = os.path.join(qtdir,'bin',command + suffix) if os.access(fullpath, os.X_OK) : return fullpath triedPaths.append(fullpath)
a33cee949312a320ed8090474867fc90dc6510aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1456/a33cee949312a320ed8090474867fc90dc6510aa/qt4.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10627, 23310, 24, 2189, 12, 3074, 16, 1296, 16, 25672, 1214, 13, 294, 18333, 273, 306, 2400, 23311, 24, 2187, 2400, 23311, 24, 18, 14880, 2187, 296, 24, 2187, 296, 24, 18, 14880, 2187, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10627, 23310, 24, 2189, 12, 3074, 16, 1296, 16, 25672, 1214, 13, 294, 18333, 273, 306, 2400, 23311, 24, 2187, 2400, 23311, 24, 18, 14880, 2187, 296, 24, 2187, 296, 24, 18, 14880, 2187, ...
sage: EtaProduct(2,{2:24,1:-24}).qexp(100) == delta_qexp(101)(q^2)/delta_qexp(101)(q)
sage: EtaProduct(2,{2:24,1:-24}).q_expansion(100) == delta_qexp(101)(q^2)/delta_qexp(101)(q)
def qexp(self, n): r""" The q-expansion of self at the cusp at infinity. INPUT: - ``n`` (integer): number of terms to calculate OUTPUT: - a power series over `\ZZ` in the variable `q`, with a *relative* precision of `1 + O(q^n)`. ALGORITHM: Calculates eta to (n/m) terms, where m is the smallest integer dividing self.level() such that self.r(m) != 0. Then multiplies. EXAMPLES:: sage: EtaProduct(36, {6:6, 2:-6}).qexp(10) q + 6*q^3 + 27*q^5 + 92*q^7 + 279*q^9 + O(q^11) sage: R.<q> = ZZ[[]] sage: EtaProduct(2,{2:24,1:-24}).qexp(100) == delta_qexp(101)(q^2)/delta_qexp(101)(q) True """ R,q = PowerSeriesRing(ZZ, 'q').objgen() pr = R(1) if self == self.parent()(1): return pr eta_n = max([ (n/d).floor() for d in self._keys if self.r(d) != 0]) eta = qexp_eta(R, eta_n) for d in self._keys: if self.r(d) != 0: pr *= eta(q**d)**self.r(d) return pr*q**(self._sumDR / ZZ(24))*( R(1).add_bigoh(n))
8fbb51909df80e6433ced6679942a109bd279d6f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/8fbb51909df80e6433ced6679942a109bd279d6f/etaproducts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1043, 2749, 12, 2890, 16, 290, 4672, 436, 8395, 1021, 1043, 17, 2749, 12162, 434, 365, 622, 326, 27964, 84, 622, 27272, 18, 225, 12943, 30, 282, 300, 12176, 82, 10335, 261, 7745, 4672, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1043, 2749, 12, 2890, 16, 290, 4672, 436, 8395, 1021, 1043, 17, 2749, 12162, 434, 365, 622, 326, 27964, 84, 622, 27272, 18, 225, 12943, 30, 282, 300, 12176, 82, 10335, 261, 7745, 4672, ...
'amount' : -1 * authorization.amount,
'amount' : Decimal('0.00'),
def get_void_auth_data(self, authorization): """Build the dictionary needed to process a prior auth release.""" settings = self.settings trans = { 'authorization' : authorization, 'amount' : -1 * authorization.amount, }
bbba1e77a13246f5989efb5d0c4dbe104c377643 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/171/bbba1e77a13246f5989efb5d0c4dbe104c377643/processor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6459, 67, 1944, 67, 892, 12, 2890, 16, 6093, 4672, 3536, 3116, 326, 3880, 3577, 358, 1207, 279, 6432, 1357, 3992, 12123, 1947, 273, 365, 18, 4272, 906, 273, 288, 296, 12218, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6459, 67, 1944, 67, 892, 12, 2890, 16, 6093, 4672, 3536, 3116, 326, 3880, 3577, 358, 1207, 279, 6432, 1357, 3992, 12123, 1947, 273, 365, 18, 4272, 906, 273, 288, 296, 12218, 1...
cin.found_terminator () return True
return cin.found_terminator ()
def found_terminator (): if cout.found_terminator (): del ( cin.collect_incoming_data, cin.found_terminator ) cin.found_terminator () return True return False
3761ef6542265e9472ab30505ab4a70e31a63f6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/3761ef6542265e9472ab30505ab4a70e31a63f6e/collector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1392, 67, 9505, 639, 1832, 30, 309, 276, 659, 18, 7015, 67, 9505, 639, 1832, 30, 1464, 261, 276, 267, 18, 14676, 67, 31033, 67, 892, 16, 276, 267, 18, 7015, 67, 9505, 639, 262, 327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1392, 67, 9505, 639, 1832, 30, 309, 276, 659, 18, 7015, 67, 9505, 639, 1832, 30, 1464, 261, 276, 267, 18, 14676, 67, 31033, 67, 892, 16, 276, 267, 18, 7015, 67, 9505, 639, 262, 327, ...
salt = string[:4]
def unserialize(cls, string, secret_key): """Load the secure cookie from a serialized string.""" if isinstance(string, unicode): string = string.encode('utf-8', 'ignore') salt = string[:4] try: base64_hash, data = string[4:].split('?', 1) except (ValueError, IndexError): items = () else: items = {} hash = sha1(secret_key + salt) for item in data.split('&'): hash.update('|' + item) if not '=' in item: items = None break key, value = item.split('=', 1) items[url_unquote_plus(key)] = value
84eabcaa81f60d47939ac2d43f01d01eeab598a4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14437/84eabcaa81f60d47939ac2d43f01d01eeab598a4/securecookie.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10954, 12, 6429, 16, 533, 16, 4001, 67, 856, 4672, 3536, 2563, 326, 8177, 3878, 628, 279, 5343, 533, 12123, 309, 1549, 12, 1080, 16, 5252, 4672, 533, 273, 533, 18, 3015, 2668, 3158, 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, 10954, 12, 6429, 16, 533, 16, 4001, 67, 856, 4672, 3536, 2563, 326, 8177, 3878, 628, 279, 5343, 533, 12123, 309, 1549, 12, 1080, 16, 5252, 4672, 533, 273, 533, 18, 3015, 2668, 3158, 17...
sub_key = CreateKey(key, "sub_key")
sub_key = CreateKey(key, subkeystr)
def WriteTestData(self, root_key): # Set the default value for this key. SetValue(root_key, test_key_name, REG_SZ, "Default value") key = CreateKey(root_key, test_key_name) # Create a sub-key sub_key = CreateKey(key, "sub_key") # Give the sub-key some named values
f82d9b52fae475a132a21d1b7174730f17b735de /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/f82d9b52fae475a132a21d1b7174730f17b735de/test_winreg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 4709, 751, 12, 2890, 16, 1365, 67, 856, 4672, 468, 1000, 326, 805, 460, 364, 333, 498, 18, 23995, 12, 3085, 67, 856, 16, 1842, 67, 856, 67, 529, 16, 11980, 67, 28830, 16, 315, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 4709, 751, 12, 2890, 16, 1365, 67, 856, 4672, 468, 1000, 326, 805, 460, 364, 333, 498, 18, 23995, 12, 3085, 67, 856, 16, 1842, 67, 856, 67, 529, 16, 11980, 67, 28830, 16, 315, ...
""" Compare item.some_attribute """
"""Compare item.some_attribute."""
def trans_args(self): return `self.attr`
2e7b15abd167a17bf8f880c7e0bd7891362e04de /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/873/2e7b15abd167a17bf8f880c7e0bd7891362e04de/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 906, 67, 1968, 12, 2890, 4672, 327, 1375, 2890, 18, 1747, 68, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 906, 67, 1968, 12, 2890, 4672, 327, 1375, 2890, 18, 1747, 68, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
log("Already found tuple: %s %s " % (name, arch))
log(2,"Already found tuple: %s %s " % (name, arch))
def genhdrs(rpms,headerdir,rpmcheck): rpmdelete = 0 # define this if you have the rpmheader stripping patch built into rpm rpminfo = {} numrpms = len(rpms) goodrpm = 0 currpm = 0 for rpmfn in rpms: rpmname = os.path.basename(rpmfn) currpm=currpm + 1 percent = (currpm*100)/numrpms sys.stdout.write('\r' + ' ' * 80) sys.stdout.write("\rDigesting rpms %d %% complete: %s" % (percent,rpmname)) sys.stdout.flush() if rpmcheck==1: log("\nChecking sig on %s" % (rpmname)) serverStuff.checkSig(rpmfn) header=serverStuff.readHeader(rpmfn) #check to ignore src.rpms if header != 'source': if header[rpm.RPMTAG_EPOCH] == None: epoch = '0' else: epoch = '%s' % header[rpm.RPMTAG_EPOCH] name = header[rpm.RPMTAG_NAME] ver = header[rpm.RPMTAG_VERSION] rel = header[rpm.RPMTAG_RELEASE] arch = header[rpm.RPMTAG_ARCH] rpmloc = rpmfn rpmtup = (name,arch) # do we already have this name.arch tuple in the dict? if rpminfo.has_key(rpmtup): log("Already found tuple: %s %s " % (name, arch)) (e1, v1, r1, l1) = rpminfo[rpmtup] oldhdrfile = "%s/%s-%s-%s-%s.%s.hdr" % (headerdir, name, e1, v1, r1, arch) # which one is newer? rc = rpm.labelCompare((e1,v1,r1), (epoch, ver, rel)) if rc == -1: # if the more recent one in is newer then throw away the old one del rpminfo[rpmtup] if os.path.exists(oldhdrfile): print "\nignoring older pkg: %s" % (l1) os.unlink(oldhdrfile) if rpmdelete: shortheader = serverStuff.cleanHeader(header) else: shortheader = header headerloc = serverStuff.writeHeader(headerdir,shortheader) rpminfo[rpmtup]=(epoch,ver,rel,rpmloc) elif rc == 0: # hmm, they match complete - warn the user that they've got a dupe in the tree print "\nignoring dupe pkg: %s" % (rpmloc) elif rc == 1: # move along, move along, nothing more to see here print "\nignoring older pkg: %s" % (rpmloc) else: if rpmdelete: shortheader = serverStuff.cleanHeader(header) else: shortheader = header headerloc = serverStuff.writeHeader(headerdir,shortheader) rpminfo[rpmtup]=(epoch,ver,rel,rpmloc) goodrpm = goodrpm + 1 else: log("ignoring srpm: %s" % rpmfn) print "\n Total: %d\n Used: %d" %(numrpms, goodrpm) return rpminfo
4cd8cd48b2883533fc2c05b5841bf3c87397eb25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/4cd8cd48b2883533fc2c05b5841bf3c87397eb25/pullheaders.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 16587, 87, 12, 13832, 959, 16, 3374, 1214, 16, 86, 7755, 1893, 4672, 8715, 1264, 929, 273, 374, 468, 4426, 333, 309, 1846, 1240, 326, 25228, 3374, 2569, 1382, 4729, 6650, 1368, 252...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 16587, 87, 12, 13832, 959, 16, 3374, 1214, 16, 86, 7755, 1893, 4672, 8715, 1264, 929, 273, 374, 468, 4426, 333, 309, 1846, 1240, 326, 25228, 3374, 2569, 1382, 4729, 6650, 1368, 252...
print 'word_lookup_stopped for %r' % word
log.debug('word_lookup_stopped for %r', word)
def word_lookup_stopped(self, word): print 'word_lookup_stopped for %r' % word
67a3086e42b74c3a053a1f3d5818584b41ba19d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14305/67a3086e42b74c3a053a1f3d5818584b41ba19d4/qtui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2076, 67, 8664, 67, 24228, 12, 2890, 16, 2076, 4672, 1172, 296, 1095, 67, 8664, 67, 24228, 364, 738, 86, 11, 738, 2076, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2076, 67, 8664, 67, 24228, 12, 2890, 16, 2076, 4672, 1172, 296, 1095, 67, 8664, 67, 24228, 364, 738, 86, 11, 738, 2076, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
def ligolw_blob_format_func(b): return ligolw_string_format_func(tokenizer.blob_format_func(b))
def ligolw_blob_format_func(b): return ligolw_string_format_func(tokenizer.blob_format_func(b))
6dd7727dd60457bbe81b9d6655b468495aea092e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3589/6dd7727dd60457bbe81b9d6655b468495aea092e/types.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 377, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
raise RuntimeError("thread already started")
raise RuntimeError("threads can only be started once")
def start(self): if not self.__initialized: raise RuntimeError("thread.__init__() not called") if self.__started.is_set(): raise RuntimeError("thread already started") if __debug__: self._note("%s.start(): starting thread", self) with _active_limbo_lock: _limbo[self] = self try: _start_new_thread(self.__bootstrap, ()) except Exception: with _active_limbo_lock: del _limbo[self] raise self.__started.wait()
9500639e42c187671052a5ae28eb81400130f1a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/9500639e42c187671052a5ae28eb81400130f1a2/threading.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 4672, 309, 486, 365, 16186, 13227, 30, 1002, 7265, 2932, 5930, 16186, 2738, 972, 1435, 486, 2566, 7923, 309, 365, 16186, 14561, 18, 291, 67, 542, 13332, 1002, 7265, 2932, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 4672, 309, 486, 365, 16186, 13227, 30, 1002, 7265, 2932, 5930, 16186, 2738, 972, 1435, 486, 2566, 7923, 309, 365, 16186, 14561, 18, 291, 67, 542, 13332, 1002, 7265, 2932, ...
title = _('Repl&yAll'),
title = _(u'Repl&yAll'),
def makeVisibleHourMenuItems(parcel): """ Create the 'Visible Hours' submenu. Should look like: Automatic --------- 5 hours 6 hours
043a08a77771b31713425ec3f48a9c0186570e1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/043a08a77771b31713425ec3f48a9c0186570e1d/menus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 6207, 13433, 4599, 3126, 12, 1065, 2183, 4672, 3536, 1788, 326, 296, 6207, 670, 4390, 11, 27539, 18, 9363, 2324, 3007, 30, 225, 11809, 4941, 300, 788, 1381, 7507, 1666, 7507, 2, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 6207, 13433, 4599, 3126, 12, 1065, 2183, 4672, 3536, 1788, 326, 296, 6207, 670, 4390, 11, 27539, 18, 9363, 2324, 3007, 30, 225, 11809, 4941, 300, 788, 1381, 7507, 1666, 7507, 2, -1...
The log function also works in finite fields as long as the base is generator of the multiplicative group::
The log function also works in finite fields as long as the argument lies in the multiplicative group generated by the base::
def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024, 2); RDF(log(1024, 2)) 10 10.0 sage: log(10, 4); RDF(log(10, 4)) log(10)/log(4) 1.66096404744 :: sage: log(10, 2) log(10)/log(2) sage: n(log(10, 2)) 3.32192809488736 sage: log(10, e) log(10) sage: n(log(10, e)) 2.30258509299405 The log function works for negative numbers, complex numbers, and symbolic numbers too, picking the branch with angle between `-pi` and `pi`:: sage: log(-1+0*I) I*pi sage: log(CC(-1)) 3.14159265358979*I sage: log(-1.0) 3.14159265358979*I For input zero, the following behavior occurs:: sage: log(0) -Infinity sage: log(CC(0)) -infinity sage: log(0.0) -infinity The log function also works in finite fields as long as the base is generator of the multiplicative group:: sage: F = GF(13); g = F.multiplicative_generator(); g 2 sage: a = F(8) sage: log(a,g); g^log(a,g) 3 8 sage: log(a,3) Traceback (most recent call last): ... ValueError: base (=3) for discrete log must generate multiplicative group The log function also works for p-adics (see documentation for p-adics for more information):: sage: R = Zp(5); R 5-adic Ring with capped relative precision 20 sage: a = R(16); a 1 + 3*5 + O(5^20) sage: log(a) 3*5 + 3*5^2 + 3*5^4 + 3*5^5 + 3*5^6 + 4*5^7 + 2*5^8 + 5^9 + 5^11 + 2*5^12 + 5^13 + 3*5^15 + 2*5^16 + 4*5^17 + 3*5^18 + 3*5^19 + O(5^20) """ if base is None: try: return x.log() except AttributeError: return ln(x) else: try: return x.log(base) except (AttributeError, TypeError): return log(x) / log(base)
01b15c975c30578de38c8a596b3bf1155c98c45f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/01b15c975c30578de38c8a596b3bf1155c98c45f/log.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 613, 12, 92, 16, 1026, 33, 7036, 4672, 3536, 2000, 326, 613, 31249, 434, 619, 358, 326, 864, 1026, 18, 225, 23665, 326, 12176, 1330, 10335, 707, 434, 326, 733, 619, 1347, 20303, 326, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 613, 12, 92, 16, 1026, 33, 7036, 4672, 3536, 2000, 326, 613, 31249, 434, 619, 358, 326, 864, 1026, 18, 225, 23665, 326, 12176, 1330, 10335, 707, 434, 326, 733, 619, 1347, 20303, 326, 6...
if isinstance(a,list):
if isinstance(a,(list,tuple)):
def gcd(a, b=0, integer=False): """ The greatest commond divisor of a and b. INPUT: a -- number b -- number (optional) integer -- (default: False); if True, do an integer GCD or v -- vector integer -- (default: False); if True, do an integer GCD NOTE -- this is *vastly* faster than doing the generic GCD EXAMPLES: sage: GCD(97,100) 1 sage: GCD(97*10^15, 19^20*97^2) 97 sage: GCD(2/3, 4/3) 2/3 sage: GCD([2,4,6,8]) 2 sage: GCD(srange(0,10000,10)) # fast !! 10 """ if integer: if isinstance(a,list): return sage.rings.integer.GCD_list(a) else: return integer_ring.ZZ(a).gcd(\ integer_ring.ZZ(b)) if isinstance(a,list): return __GCD_list(a) if not isinstance(a, RingElement): a = integer_ring.ZZ(a) return a.gcd(b)
3177af520256eb6c612771ab650ecad228e39079 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3177af520256eb6c612771ab650ecad228e39079/arith.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14876, 12, 69, 16, 324, 33, 20, 16, 3571, 33, 8381, 4672, 3536, 1021, 18825, 395, 1543, 1434, 15013, 434, 279, 471, 324, 18, 225, 12943, 30, 279, 1493, 1300, 324, 1493, 1300, 261, 1044...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14876, 12, 69, 16, 324, 33, 20, 16, 3571, 33, 8381, 4672, 3536, 1021, 18825, 395, 1543, 1434, 15013, 434, 279, 471, 324, 18, 225, 12943, 30, 279, 1493, 1300, 324, 1493, 1300, 261, 1044...
curr_pos = e.scenePos()
curr_pos = self.selector.mapFromScene(e.scenePos())
def mouseMoveEvent(self,e): curr_pos = e.scenePos() if self.selector.isActive(): x = min(self.selector.startPoint.x(),curr_pos.x()) y = min(self.selector.startPoint.y(),curr_pos.y()) w = max(self.selector.startPoint.x(),curr_pos.x()) - x h = max(self.selector.startPoint.y(),curr_pos.y()) - y self.selector.setRect(x,y,w,h) QtGui.QGraphicsScene.mouseMoveEvent(self, e)
259ff5736e95ef329503c0cbd1635e83345101e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/259ff5736e95ef329503c0cbd1635e83345101e9/qt4render.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7644, 7607, 1133, 12, 2890, 16, 73, 4672, 4306, 67, 917, 273, 365, 18, 9663, 18, 1458, 1265, 14370, 12, 73, 18, 23694, 1616, 10756, 309, 365, 18, 9663, 18, 291, 3896, 13332, 619, 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, 7644, 7607, 1133, 12, 2890, 16, 73, 4672, 4306, 67, 917, 273, 365, 18, 9663, 18, 1458, 1265, 14370, 12, 73, 18, 23694, 1616, 10756, 309, 365, 18, 9663, 18, 291, 3896, 13332, 619, 273, ...
print "DEPS: %s (%s)" % (thisclass, superclass) if not deptree.has_key(filename): deptree[filename] = [] if not posttree.has_key(filename): posttree[filename] = []
if thisclass == None: print "Error while extracting classname: %s" % filename return if not deptree.has_key(thisclass): deptree[thisclass] = [] if not posttree.has_key(thisclass): posttree[thisclass] = [] if superclass != None: if superclass in BUILTIN: pass else: deptree[thisclass].append(superclass)
def getdeps(data, filename, deptree, posttree, packages): thisclass = False superclass = False dc = R_QXDEFINECLASS.search(data) if dc: thisclass = dc.group(1) superclass = dc.group(2) else: # print "Sorry. Don't find any class informations. Trying namespace flag" ns = R_QXNAMESPACE.search(data) if ns: thisclass = ns.group(1) print "DEPS: %s (%s)" % (thisclass, superclass) if not deptree.has_key(filename): deptree[filename] = [] if not posttree.has_key(filename): posttree[filename] = [] for line in data.split("\n"): ext = R_QXEXTEND.search(line) req = R_QXREQUIRE.search(line) pos = R_QXPOST.search(line) pkg = R_QXPACKAGE.search(line) if ext: inherited = ext.group(1) base = ext.group(2) if base in BUILTIN: if not deptree.has_key(inherited): deptree[inherited] = [] else: if deptree.has_key(inherited): deptree[inherited].append(base) else: deptree[inherited] = [base] if req: deptree[filename].append(req.group(1)) if pos: posttree[filename].append(pos.group(1)) if pkg: pkgname = pkg.group(1) if packages.has_key(pkgname): packages[pkgname].append(filename) else: packages[pkgname] = [ filename ]
2d8f9682420a9322f17740fff18434667e5ed5ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/2d8f9682420a9322f17740fff18434667e5ed5ed/compile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 14877, 12, 892, 16, 1544, 16, 443, 337, 992, 16, 1603, 3413, 16, 5907, 4672, 333, 1106, 273, 1083, 12098, 273, 1083, 225, 6744, 273, 534, 67, 53, 60, 12904, 3740, 5237, 18, 3072, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14877, 12, 892, 16, 1544, 16, 443, 337, 992, 16, 1603, 3413, 16, 5907, 4672, 333, 1106, 273, 1083, 12098, 273, 1083, 225, 6744, 273, 534, 67, 53, 60, 12904, 3740, 5237, 18, 3072, ...
if not img: print 'Not',
if not Image: print 'Not',
def _test(): import EasyDialogs try: import img except ImportError: img = None import MacOS Qt.EnterMovies() path = EasyDialogs.AskFileForOpen(message='Video to convert') if not path: sys.exit(0) rdr = reader(path) if not rdr: sys.exit(1) dstdir = EasyDialogs.AskFileForSave(message='Name for output folder') if not dstdir: sys.exit(0) num = 0 os.mkdir(dstdir) videofmt = rdr.GetVideoFormat() imgfmt = videofmt.getformat() imgw, imgh = videofmt.getsize() timestamp, data = rdr.ReadVideo() while data: fname = 'frame%04.4d.jpg'%num num = num+1 pname = os.path.join(dstdir, fname) if not img: print 'Not', print 'Writing %s, size %dx%d, %d bytes'%(fname, imgw, imgh, len(data)) if img: wrt = img.writer(imgfmt, pname) wrt.width = imgw wrt.height = imgh wrt.write(data) timestamp, data = rdr.ReadVideo() MacOS.SetCreatorAndType(pname, 'ogle', 'JPEG') if num > 20: print 'stopping at 20 frames so your disk does not fill up:-)' break print 'Total frames:', num
d16a81f618c57db98b90cc90eca7add4efaed9d9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/d16a81f618c57db98b90cc90eca7add4efaed9d9/videoreader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 13332, 1930, 29442, 11885, 14072, 775, 30, 1930, 3774, 1335, 11308, 30, 3774, 273, 599, 1930, 13217, 4618, 7354, 18, 10237, 16727, 29028, 1435, 589, 273, 29442, 11885, 14072, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 13332, 1930, 29442, 11885, 14072, 775, 30, 1930, 3774, 1335, 11308, 30, 3774, 273, 599, 1930, 13217, 4618, 7354, 18, 10237, 16727, 29028, 1435, 589, 273, 29442, 11885, 14072, 18, ...
class SimpleDataTestCase(unittest.TestCase):
class DataTestCase(unittest.TestCase):
def testDefault(self): assert kmldom.AsExtendedData(self.extendeddata) assert 0 == self.extendeddata.get_data_array_size() assert 0 == self.extendeddata.get_schemadata_array_size()
43b021e553a80990d62fa4e4e7701045428f803c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8372/43b021e553a80990d62fa4e4e7701045428f803c/kmldom_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1868, 12, 2890, 4672, 1815, 417, 781, 9859, 18, 1463, 11456, 751, 12, 2890, 18, 408, 275, 323, 449, 396, 13, 1815, 374, 422, 365, 18, 408, 275, 323, 449, 396, 18, 588, 67, 892,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1868, 12, 2890, 4672, 1815, 417, 781, 9859, 18, 1463, 11456, 751, 12, 2890, 18, 408, 275, 323, 449, 396, 13, 1815, 374, 422, 365, 18, 408, 275, 323, 449, 396, 18, 588, 67, 892,...
""" Generic method to get attributes """ return self.subrequests[ind]['Attributes'][self.item_called]
""" Generic method to get attributes """ return self.subrequests[ind]['Attributes'][self.item_called]
def __get_subattribute(self,ind): """ Generic method to get attributes """ return self.subrequests[ind]['Attributes'][self.item_called]
bc213aaf6cf3a7e67bde7d90ca743f5caa5810bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/bc213aaf6cf3a7e67bde7d90ca743f5caa5810bd/Request.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 67, 1717, 4589, 12, 2890, 16, 728, 4672, 3536, 7928, 707, 358, 336, 1677, 3536, 327, 365, 18, 1717, 11420, 63, 728, 23962, 2498, 3546, 63, 2890, 18, 1726, 67, 11777, 65, 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, 1001, 588, 67, 1717, 4589, 12, 2890, 16, 728, 4672, 3536, 7928, 707, 358, 336, 1677, 3536, 327, 365, 18, 1717, 11420, 63, 728, 23962, 2498, 3546, 63, 2890, 18, 1726, 67, 11777, 65, 2, ...
return False
return None
def getSeek(self): service = self.session.nav.getCurrentService() if service is None: return False
d59d5deafcc782ae5f94309e54d43374314870e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/d59d5deafcc782ae5f94309e54d43374314870e8/InfoBarGenerics.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1322, 3317, 12, 2890, 4672, 1156, 273, 365, 18, 3184, 18, 11589, 18, 588, 3935, 1179, 1435, 309, 1156, 353, 599, 30, 327, 1083, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 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, 1322, 3317, 12, 2890, 4672, 1156, 273, 365, 18, 3184, 18, 11589, 18, 588, 3935, 1179, 1435, 309, 1156, 353, 599, 30, 327, 1083, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print "---- measures: _remove_measurements"
def _remove_measurements(self, pubsub_evt): print "---- measures: _remove_measurements" indexes = pubsub_evt.data print indexes for index in indexes: m, mr = self.measures.pop(index) actors = mr.GetActors() prj.Project().RemoveMeasurement(index) ps.Publisher().sendMessage(('Remove actors', m.location), (actors, m.slice_number)) ps.Publisher().sendMessage('Update slice viewer') ps.Publisher().sendMessage('Render volume viewer')
cb04cd6cdac023798ed05e08a23e2aab72b0da4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/cb04cd6cdac023798ed05e08a23e2aab72b0da4b/measures.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4479, 67, 26550, 12, 2890, 16, 23288, 67, 73, 11734, 4672, 5596, 273, 23288, 67, 73, 11734, 18, 892, 1172, 5596, 364, 770, 316, 5596, 30, 312, 16, 9752, 273, 365, 18, 21992, 1823,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4479, 67, 26550, 12, 2890, 16, 23288, 67, 73, 11734, 4672, 5596, 273, 23288, 67, 73, 11734, 18, 892, 1172, 5596, 364, 770, 316, 5596, 30, 312, 16, 9752, 273, 365, 18, 21992, 1823,...
left join (select items.item_id as item_id, %s as bucket, sum(inp.quantity) as demand from dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where date(inp.due) = d.day and inp.due >= '%s' and inp.due < '%s' and inp.item_id = items.item_id group by items.item_id, bucket) data on combi.item_id = data.item_id and combi.bucket = data.bucket -- Sort the result order by combi.item_id, combi.start ''' % (filterstring, limitstring,bucket,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate)
left join demand on items.item_id = demand.item_id and d.startdate <= date(demand.due) and d.enddate > date(demand.due) -- Ordering and grouping group by items.item_id, d.bucket, d.startdate, d.enddate order by items.item_id, d.startdate ''' % (filterstring, limitstring,bucket,bucket,bucket,startdate,enddate)
def demandquery(item, bucket, startdate, enddate, offset=0, limit=None): if item: filterstring = 'where item_id = %s' else: filterstring = '' if limit: if offset == 0: limitstring = 'limit %d' % int(limit) else: limitstring = 'limit %d offset %d' % (int(limit),int(offset)) else: limitstring = '' cursor = connection.cursor() query = ''' select combi.item_id, combi.bucket, coalesce(data.demand,0), coalesce(data2.planned,0) from (select item_id, d.bucket as bucket, d.start as start from (select distinct item_id from demand %s order by item_id %s) as items cross join (select %s as bucket, min(day) as start from dates where day >= '%s' and day < '%s' group by bucket) d ) as combi -- Planned quantity left join (select items.item_id as item_id, %s as bucket, sum(out_operationplan.quantity) as planned from out_operationplan, dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where out_operationplan.enddate = d.day and out_operationplan.demand_id = inp.name and inp.item_id = items.item_id and out_operationplan.enddate >= '%s' and out_operationplan.enddate < '%s' group by items.item_id, bucket) data2 on combi.item_id = data2.item_id and combi.bucket = data2.bucket -- Requested quantity left join (select items.item_id as item_id, %s as bucket, sum(inp.quantity) as demand from dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where date(inp.due) = d.day and inp.due >= '%s' and inp.due < '%s' and inp.item_id = items.item_id group by items.item_id, bucket) data on combi.item_id = data.item_id and combi.bucket = data.bucket -- Sort the result order by combi.item_id, combi.start ''' % (filterstring, limitstring,bucket,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate) if item: cursor.execute(query, (item,item,item)) else: cursor.execute(query) resultset = [] previtem = None rowset = [] for row in cursor.fetchall(): if row[0] != previtem: if previtem: resultset.append(rowset) rowset = [] previtem = row[0] backlog = 0 # @todo Setting the backlog to 0 is not correct: it may be non-zero from the plan before the start date backlog += row[2] - row[3] rowset.append( { 'item': row[0], 'bucket': row[1], 'requested': row[2], 'supplied': row[3], 'backlog': backlog, } ) if previtem: resultset.append(rowset) return resultset
776cd72ff4cb8fa56a39290bfbe91a5586a0ae6d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8604/776cd72ff4cb8fa56a39290bfbe91a5586a0ae6d/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23653, 2271, 12, 1726, 16, 2783, 16, 787, 712, 16, 679, 712, 16, 1384, 33, 20, 16, 1800, 33, 7036, 4672, 309, 761, 30, 1034, 1080, 273, 296, 6051, 761, 67, 350, 273, 738, 87, 11, 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, 23653, 2271, 12, 1726, 16, 2783, 16, 787, 712, 16, 679, 712, 16, 1384, 33, 20, 16, 1800, 33, 7036, 4672, 309, 761, 30, 1034, 1080, 273, 296, 6051, 761, 67, 350, 273, 738, 87, 11, 4...
arguments.append('%s = %s ( %s )' %(key,kwargs[key],type(kwargs[key]))) finalReport = 'Problem with %s.%s() call:\nArguments: %s\nMessage: %s\n' %(className,methodName,string.join(arguments,', '),message) if self.errorDict.has_key(methodName):
arguments.append( '%s = %s ( %s )' % ( key, kwargs[key], type( kwargs[key] ) ) ) finalReport = 'Problem with %s.%s() call:\nArguments: %s\nMessage: %s\n' % ( className, methodName, string.join( arguments, ', ' ), message ) if self.errorDict.has_key( methodName ):
def _reportError(self,message,name='',**kwargs): """Internal Function. Gets caller method name and arguments, formats the information and adds an error to the global error dictionary to be returned to the user. """ className = name if not name: className = __name__ methodName = sys._getframe(1).f_code.co_name arguments = [] for key in kwargs: if kwargs[key]: arguments.append('%s = %s ( %s )' %(key,kwargs[key],type(kwargs[key]))) finalReport = 'Problem with %s.%s() call:\nArguments: %s\nMessage: %s\n' %(className,methodName,string.join(arguments,', '),message) if self.errorDict.has_key(methodName): tmp = self.errorDict[methodName] tmp.append(finalReport) self.errorDict[methodName]=tmp else: self.errorDict[methodName]=[finalReport] self.log.verbose(finalReport) return S_ERROR(finalReport)
50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6006, 668, 12, 2890, 16, 2150, 16, 529, 2218, 2187, 636, 4333, 4672, 3536, 3061, 4284, 18, 11881, 4894, 707, 508, 471, 1775, 16, 6449, 326, 1779, 471, 4831, 392, 555, 358, 326, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6006, 668, 12, 2890, 16, 2150, 16, 529, 2218, 2187, 636, 4333, 4672, 3536, 3061, 4284, 18, 11881, 4894, 707, 508, 471, 1775, 16, 6449, 326, 1779, 471, 4831, 392, 555, 358, 326, 25...
if self.insert_none_breaking_blanks:
if self.insert_non_breaking_blanks:
def encode(self, text): """Return text with special characters (``#$%&~_^\{}``) escaped.""" # \ ~ ^ Escaping with a backslash does not help. # < > are only available in math-mode or tt font. (really ?) # $ starts math- mode. # " active in some languages (e.g. German) TODO! if self.verbatim: return text # compile the regexps once. do it here so one can see them. # # first the braces. if not hasattr(self, 'encode_re_braces'): self.encode_re_braces = re.compile(r'([{}])') text = self.encode_re_braces.sub(r'{\\\1}',text) if not hasattr(self, 'encode_re_bslash'): # find backslash: except in the form '{\{}' or '{\}}'. self.encode_re_bslash = re.compile(r'(?<!{)(\\)(?![{}]})') # then the backslash: except in the form from line above: # either '{\{}' or '{\}}'. text = self.encode_re_bslash.sub(r'{\\textbackslash}', text) # then dollar ... text = text.replace('$', '{\\$}') text = text.replace('&', '{\\&}') text = text.replace('%', '{\\%}') text = text.replace('#', '{\\#}') text = text.replace('^', '{\\textasciicircum}') text = text.replace('~', '{\\textasciitilde}') # if not ( self.literal_block or self.literal ): text = text.replace('|', '{\\textbar}') text = text.replace('<', '{\\textless}') text = text.replace('>', '{\\textgreater}') # Separate compound characters, e.g. '--' to '-{}-'. (The # actual separation is done later; see below.) separate_chars = '-' if self.literal_block or self.literal: # In monospace-font, we also separate ',,', '``' and "''" # and some other characters which can't occur in # non-literal text. separate_chars += ',`\'"<>' # pdflatex does not produce doublequotes for ngerman. text = self.babel.double_quotes_in_tt(text) if self.font_encoding in ['OT1', '']: # We're using OT1 font-encoding and have to replace # underscore by underlined blank, because this has # correct width. text = text.replace('_', '{\\underline{ }}') # And the tt-backslash doesn't work in OT1, so we use # a mirrored slash. text = text.replace('\\textbackslash', '\\reflectbox{/}') else: text = text.replace('_', '{\\_}') else: text = self.babel.quote_quotes(text) if not self.inside_citation_reference_label: text = text.replace('_', '{\\_}') for char in separate_chars * 2: # Do it twice ("* 2") becaues otherwise we would replace # '---' by '-{}--'. text = text.replace(char + char, char + '{}' + char) if self.insert_newline or self.literal_block: # Insert a blank before the newline, to avoid # ! LaTeX Error: There's no line here to end. text = text.replace('\n', '~\\\\\n') text = text.replace('[', '{[}').replace(']', '{]}') if self.insert_none_breaking_blanks: text = text.replace(' ', '~') if self.latex_encoding != 'utf8': text = self.unicode_to_latex(text) text = self.ensure_math(text) return text
1b8dac55202344263da9188c7d59f13cb6f789ae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5620/1b8dac55202344263da9188c7d59f13cb6f789ae/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 990, 977, 598, 4582, 3949, 261, 10335, 30497, 9, 10, 98, 67, 17134, 2916, 10335, 13, 8345, 12123, 468, 282, 521, 4871, 3602, 512, 1017, 24447, 598, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 990, 977, 598, 4582, 3949, 261, 10335, 30497, 9, 10, 98, 67, 17134, 2916, 10335, 13, 8345, 12123, 468, 282, 521, 4871, 3602, 512, 1017, 24447, 598, ...
self.additional_headers['Expires'] = 'Thu, 1 Jan 1970 00:00:00 GMT'
date = rfc822.formatdate(time.time() + 5) self.additional_headers['Expires'] = date
def inner_main(self): ''' Process a request.
af646116969bc98a093baab2ff8726a1c328f01e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/af646116969bc98a093baab2ff8726a1c328f01e/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3443, 67, 5254, 12, 2890, 4672, 9163, 4389, 279, 590, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 3443, 67, 5254, 12, 2890, 4672, 9163, 4389, 279, 590, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
_val.value = value _val.save() self.assertEqual(_val.value, value)
val.value = value val.save() self.assertEqual(val.value, value)
def test_value_types(self): _text = EavAttribute.objects.create(datatype=EavAttribute.TYPE_TEXT, name='Text', help_text='The text') _val = EavValue.objects.create(object=self.entity, attribute = _text) value = "Test text" _val.value = value _val.save() self.assertEqual(_val.value, value)
6ce453e98737d0adf5684712449953c1a5236b7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11809/6ce453e98737d0adf5684712449953c1a5236b7b/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1132, 67, 2352, 12, 2890, 4672, 389, 955, 273, 512, 842, 1499, 18, 6911, 18, 2640, 12, 21540, 33, 41, 842, 1499, 18, 2399, 67, 5151, 16, 508, 2218, 1528, 2187, 2809, 67, 95...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1132, 67, 2352, 12, 2890, 4672, 389, 955, 273, 512, 842, 1499, 18, 6911, 18, 2640, 12, 21540, 33, 41, 842, 1499, 18, 2399, 67, 5151, 16, 508, 2218, 1528, 2187, 2809, 67, 95...
if isinstance(numerator.owner.op, T.DimShuffle):
if numerator.owner and isinstance(numerator.owner.op, T.DimShuffle):
def local_sum_div_dimshuffle(node): '''sum(a / dimshuffle{...}(b), axis=l) -> sum(a, axis=l) / b, if dimension l of the DimShuffle is 'x'.''' # TODO: extend it to product, and quotient of products if isinstance(node.op, T.Sum): axis = node.op.axis if axis is None: axis = range(node.inputs[0].ndim) #print 'axis =', axis thing_summed = node.inputs[0] dimshuffled = None if thing_summed.owner and thing_summed.owner.op == T.true_div: numerator, denominator = thing_summed.owner.inputs if isinstance(numerator.owner.op, T.DimShuffle): new_order = numerator.owner.op.new_order #print 'new_order =', new_order # check compatibility compatible_dims = True for ax in axis: if len(new_order) <= ax or new_order[ax] != 'x': compatible_dims = False break if compatible_dims: #print 'getting num out' new_num = numerator.owner.inputs[0] return [T.true_div(new_num, node.op(denominator))] #else: # print 'incompatible dims:', axis, new_order if isinstance(denominator.owner.op, T.DimShuffle): new_order = denominator.owner.op.new_order #print 'new_order =', new_order # check compatibility compatible_dims = True for ax in axis: #print 'ax =', ax #print 'len(new_order) =', len(new_order) #print 'new_order[ax] =', new_order[ax] if len(new_order) <= ax or new_order[ax] != 'x': compatible_dims = False break if compatible_dims: #print 'getting denom out' new_denom = denominator.owner.inputs[0] return [T.true_div(node.op(numerator), new_denom)] #else: # print 'incompatible dims:', axis, new_order
7397cdf404362ab1cb51f7dac7ef58fd02cf0ec1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/7397cdf404362ab1cb51f7dac7ef58fd02cf0ec1/opt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1191, 67, 1364, 67, 2892, 67, 3509, 31980, 12, 2159, 4672, 9163, 1364, 12, 69, 342, 2464, 31980, 95, 2777, 97, 12, 70, 3631, 2654, 33, 80, 13, 317, 2142, 12, 69, 16, 2654, 33, 80, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1191, 67, 1364, 67, 2892, 67, 3509, 31980, 12, 2159, 4672, 9163, 1364, 12, 69, 342, 2464, 31980, 95, 2777, 97, 12, 70, 3631, 2654, 33, 80, 13, 317, 2142, 12, 69, 16, 2654, 33, 80, ...
self.check_sizeof(func, size(h + '9P'))
check(func, size(h + '9P'))
def func(): pass
2a9c012d274c588c51bc5660baff9bd0676bd399 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/2a9c012d274c588c51bc5660baff9bd0676bd399/test_sys.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 13332, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1326, 13332, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
__swig_setmethods__["LastCityPop"] = _micropolisengine.Micropolis_LastCityPop_set __swig_getmethods__["LastCityPop"] = _micropolisengine.Micropolis_LastCityPop_get if _newclass:LastCityPop = _swig_property(_micropolisengine.Micropolis_LastCityPop_get, _micropolisengine.Micropolis_LastCityPop_set)
__swig_setmethods__["lastCityPop"] = _micropolisengine.Micropolis_lastCityPop_set __swig_getmethods__["lastCityPop"] = _micropolisengine.Micropolis_lastCityPop_get if _newclass:lastCityPop = _swig_property(_micropolisengine.Micropolis_lastCityPop_get, _micropolisengine.Micropolis_lastCityPop_set)
def sim_tick(*args): return _micropolisengine.Micropolis_sim_tick(*args)
1ed757f93ad01940025aae3eda8ba268eec86491 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12485/1ed757f93ad01940025aae3eda8ba268eec86491/micropolisengine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 67, 6470, 30857, 1968, 4672, 327, 389, 27593, 1764, 355, 291, 8944, 18, 49, 335, 1764, 355, 291, 67, 9812, 67, 6470, 30857, 1968, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 67, 6470, 30857, 1968, 4672, 327, 389, 27593, 1764, 355, 291, 8944, 18, 49, 335, 1764, 355, 291, 67, 9812, 67, 6470, 30857, 1968, 13, 2, -100, -100, -100, -100, -100, -100, -100, ...
def make_chunks(self,length=0,overlap=0,play=0):
def make_chunks(self,length=0,overlap=0,play=0,sl=0):
def make_chunks(self,length=0,overlap=0,play=0): """ Divides the science segment into chunks of length seconds overlapped by overlap seconds. If the play option is set, only chunks that contain S2 playground data are generated. If the user has a more complicated way of generating chunks, this method should be overriden in a sub-class. Any data at the end of the ScienceSegment that is too short to contain a chunk is ignored. The length of this unused data is stored and can be retrieved with the unused() method. length = length of chunk in seconds. overlap = overlap between chunks in seconds. play = only generate chunks that overlap with S2 playground data. """ time_left = self.dur() start = self.start() increment = length - overlap while time_left >= length: middle = start + length / 2 end = start + length if (not play) or ( play and ( s2play(start) or s2play(middle) or s2play(end) ) ): self.__chunks.append(AnalysisChunk(start,end)) start += increment time_left -= increment self.__unused = time_left - overlap
ce39186c575b9fc63bd3306f965e417997df49cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/ce39186c575b9fc63bd3306f965e417997df49cb/pipeline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 14691, 12, 2890, 16, 2469, 33, 20, 16, 17946, 33, 20, 16, 1601, 33, 20, 16, 2069, 33, 20, 4672, 3536, 21411, 4369, 326, 888, 6254, 3267, 1368, 6055, 434, 769, 3974, 7227, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14691, 12, 2890, 16, 2469, 33, 20, 16, 17946, 33, 20, 16, 1601, 33, 20, 16, 2069, 33, 20, 4672, 3536, 21411, 4369, 326, 888, 6254, 3267, 1368, 6055, 434, 769, 3974, 7227, 1...
if numpy.sum(validData) >= self.minNumOfExamples:
if numpy.sum(validData) >= self.minNumOfExamples:
def evaluateProjections(self): random.seed(0) # always use the same seed to make results repeatable if not self.data: return self.correctSettingsIfNecessary() if self.timeLimit == self.projectionLimit == 0 and self.__class__.__name__ == "VizRank": print "Evaluation of projections was started without any time or projection restrictions. To prevent an indefinite projection evaluation a time limit of 2 hours was set." self.timeLimit = 2 * 60 self.evaluatedProjectionsCount = 0 self.optimizedProjectionsCount = 0 self.startTime = time.time() self.evaluationData = {} # clear all previous data about tested permutations and stuff self.evaluationData["triedCombinations"] = {}
b9e52e096e6043bf925f92bc9842c2a83b088af5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/b9e52e096e6043bf925f92bc9842c2a83b088af5/orngVizRank.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 14789, 87, 12, 2890, 4672, 2744, 18, 12407, 12, 20, 13, 1377, 468, 3712, 999, 326, 1967, 5009, 358, 1221, 1686, 7666, 429, 309, 486, 365, 18, 892, 30, 327, 365, 18, 6746, 2628, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5956, 14789, 87, 12, 2890, 4672, 2744, 18, 12407, 12, 20, 13, 1377, 468, 3712, 999, 326, 1967, 5009, 358, 1221, 1686, 7666, 429, 309, 486, 365, 18, 892, 30, 327, 365, 18, 6746, 2628, ...
if not item['resources'].has_key(jid.getResource()): item['resources'][jid.getResource()]={'show':None,'status':None,'priority':'0','timestamp':None}
def PresenceHandler(self,dis,pres): """ Presence tracker. Used internally for setting items' resources state in internal roster representation. """ jid=JID(pres.getFrom()) if not self._data.has_key(jid.getStripped()): self._data[jid.getStripped()]={'name':None,'ask':None,'subscription':'none','groups':['Not in roster'],'resources':{}}
4195a1c376cd3f909ad323965dea5d79464265e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/4195a1c376cd3f909ad323965dea5d79464265e8/roster.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31517, 1503, 12, 2890, 16, 2251, 16, 12202, 4672, 3536, 31517, 9745, 18, 10286, 12963, 364, 3637, 1516, 11, 2703, 919, 316, 2713, 721, 8190, 4335, 18, 3536, 14201, 33, 46, 734, 12, 12202...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31517, 1503, 12, 2890, 16, 2251, 16, 12202, 4672, 3536, 31517, 9745, 18, 10286, 12963, 364, 3637, 1516, 11, 2703, 919, 316, 2713, 721, 8190, 4335, 18, 3536, 14201, 33, 46, 734, 12, 12202...
from event import * from simulate import * from main import options if running_m5:
def AddToPath(path): # if it's a relative path and we know what directory the current # python script is in, make the path relative to that directory. if not os.path.isabs(path) and sys.path[0]: path = os.path.join(sys.path[0], path) path = os.path.realpath(path) # sys.path[0] should always refer to the current script's directory, # so place the new dir right after that. sys.path.insert(1, path)
b3b777e5620603db233f0e79326140b4640908c3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7385/b3b777e5620603db233f0e79326140b4640908c3/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1436, 774, 743, 12, 803, 4672, 468, 309, 518, 1807, 279, 3632, 589, 471, 732, 5055, 4121, 1867, 326, 783, 468, 5790, 2728, 353, 316, 16, 1221, 326, 589, 3632, 358, 716, 1867, 18, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1436, 774, 743, 12, 803, 4672, 468, 309, 518, 1807, 279, 3632, 589, 471, 732, 5055, 4121, 1867, 326, 783, 468, 5790, 2728, 353, 316, 16, 1221, 326, 589, 3632, 358, 716, 1867, 18, 309, ...
def messageBox(self, message, screen): msg_rect = pygame.Rect(( 0, 0, 500, 300)) white = (225, 255, 255) backgrnd = (48, 48, 48) msgbox = MessageBox(screen) msgbox.render_textrect(message, self._font, msg_rect, white, backgrnd, 2) def flipMessagePane(self): self._display = not self._display
def messageBox(self, message, screen): msg_rect = pygame.Rect(( 0, 0, 500, 300)) white = (225, 255, 255) backgrnd = (48, 48, 48) msgbox = MessageBox(screen) msgbox.render_textrect(message, self._font, msg_rect, white, backgrnd, 2)
876ccdd87e9cc021f27de4c4f1c310c50a9ae6c4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11641/876ccdd87e9cc021f27de4c4f1c310c50a9ae6c4/tileengine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 883, 3514, 12, 2890, 16, 883, 16, 5518, 4672, 1234, 67, 2607, 273, 2395, 13957, 18, 6120, 12443, 374, 16, 374, 16, 6604, 16, 11631, 3719, 9578, 273, 261, 22, 2947, 16, 4561, 16, 4561, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 883, 3514, 12, 2890, 16, 883, 16, 5518, 4672, 1234, 67, 2607, 273, 2395, 13957, 18, 6120, 12443, 374, 16, 374, 16, 6604, 16, 11631, 3719, 9578, 273, 261, 22, 2947, 16, 4561, 16, 4561, ...
msg = self.message(c, txt)
msg = self.message(c.identity, txt)
def pubmsg (self, connection, event): self.debug("%s -> %s: %r", event.source(), event.target(), event.arguments()) try: nick, txt = map(str.strip, event.arguments()[0].split(":")) except ValueError: return # not for me nick = nick.split("!")[0] if nick == self.nick: self.info("routing public message from %s", event.source()) c = Connection(self, event.source().split("!")[0]) msg = self.message(c, txt) msg.irc_channel = event.target() self.route(msg)
a63b669d3ab93cbccf6ec5737c2aaa65db8233ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/a63b669d3ab93cbccf6ec5737c2aaa65db8233ee/irc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5634, 3576, 261, 2890, 16, 1459, 16, 871, 4672, 365, 18, 4148, 27188, 87, 317, 738, 87, 30, 738, 86, 3113, 871, 18, 3168, 9334, 871, 18, 3299, 9334, 871, 18, 7099, 10756, 775, 30, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5634, 3576, 261, 2890, 16, 1459, 16, 871, 4672, 365, 18, 4148, 27188, 87, 317, 738, 87, 30, 738, 86, 3113, 871, 18, 3168, 9334, 871, 18, 3299, 9334, 871, 18, 7099, 10756, 775, 30, 10...
self.db_conn.execute("insert into ? values (?,?,?)", (name,) + row)
self.db_conn.execute( "insert into %s values (?,?,?)" % name, row)
def synchronize_logs(self): """Transfer data from client ranks to the head rank. Must be called on all ranks simultaneously.""" if self.mpi_comm is None: return
91624587569b2bd587d0d573c86d00a448ff2238 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12871/91624587569b2bd587d0d573c86d00a448ff2238/log.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16978, 67, 10011, 12, 2890, 4672, 3536, 5912, 501, 628, 1004, 24828, 358, 326, 910, 6171, 18, 225, 6753, 506, 2566, 603, 777, 24828, 27504, 715, 12123, 309, 365, 18, 1291, 77, 67, 5702, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16978, 67, 10011, 12, 2890, 4672, 3536, 5912, 501, 628, 1004, 24828, 358, 326, 910, 6171, 18, 225, 6753, 506, 2566, 603, 777, 24828, 27504, 715, 12123, 309, 365, 18, 1291, 77, 67, 5702, ...
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale'))], limit=1)
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')), ('refund_journal', '=', refund_journal.get(type_inv, False))], limit=1)
def _get_journal(self, cr, uid, context): if context is None: context = {} type_inv = context.get('type', 'out_invoice') type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'} journal_obj = self.pool.get('account.journal') res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale'))], limit=1) if res: return res[0] else: return False
7681deb834152087166b72896be7c64059da55c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7681deb834152087166b72896be7c64059da55c3/invoice.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 22644, 12, 2890, 16, 4422, 16, 4555, 16, 819, 4672, 309, 819, 353, 599, 30, 819, 273, 2618, 618, 67, 5768, 273, 819, 18, 588, 2668, 723, 2187, 296, 659, 67, 16119, 6134...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 22644, 12, 2890, 16, 4422, 16, 4555, 16, 819, 4672, 309, 819, 353, 599, 30, 819, 273, 2618, 618, 67, 5768, 273, 819, 18, 588, 2668, 723, 2187, 296, 659, 67, 16119, 6134...
self.out.append(r'\DUfootnotemark{%s}{%s}{' %
self.out.append(r'\DUfootnotemark{%s}{%s}{' %
def visit_footnote_reference(self, node): href = '' if 'refid' in node: href = node['refid'] elif 'refname' in node: href = self.document.nameids[node['refname']] # if self.use_latex_footnotes: # TODO: insert footnote content at (or near) this place # print "footnote-ref to", node['refid'] # footnotes = (self.document.footnotes + # self.document.autofootnotes + # self.document.symbol_footnotes) # for footnote in footnotes: # # print footnote['ids'] # if node.get('refid', '') in footnote['ids']: # print 'matches', footnote['ids'] format = self.settings.footnote_references if format == 'brackets': self.append_hypertargets(node) self.out.append('\\hyperlink{%s}{[' % href) self.context.append(']}') else: self.fallbacks['footnotes'] = PreambleCmds.footnotes # TODO: second argument = backlink id self.out.append(r'\DUfootnotemark{%s}{%s}{' % (node['ids'][0], href)) self.context.append('}')
d37e632395c3a7f2b6d5a2234ac913f70ee48827 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1532/d37e632395c3a7f2b6d5a2234ac913f70ee48827/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 10923, 7652, 67, 6180, 12, 2890, 16, 756, 4672, 3897, 273, 875, 309, 296, 1734, 350, 11, 316, 756, 30, 3897, 273, 756, 3292, 1734, 350, 3546, 1327, 296, 1734, 529, 11, 316, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 10923, 7652, 67, 6180, 12, 2890, 16, 756, 4672, 3897, 273, 875, 309, 296, 1734, 350, 11, 316, 756, 30, 3897, 273, 756, 3292, 1734, 350, 3546, 1327, 296, 1734, 529, 11, 316, ...
class PUTer:
class PUTer(Acquisition.Explicit):
def manage_importHack(self, REQUEST=None): "Imports a previously exported object from /var/export.bbe" f=Globals.data_dir+'/export.bbe' o=self._p_jar.import_file(f) id=o.id if hasattr(id,'im_func'): id=id() self._setObject(id,o) return 'OK, I imported %s' % id
3037ef1e742284417a24582fb954269110270387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3037ef1e742284417a24582fb954269110270387/Folder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 5666, 44, 484, 12, 2890, 16, 12492, 33, 7036, 4672, 315, 13347, 279, 7243, 11518, 733, 628, 342, 1401, 19, 6530, 18, 70, 2196, 6, 284, 33, 19834, 18, 892, 67, 1214, 6797, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 5666, 44, 484, 12, 2890, 16, 12492, 33, 7036, 4672, 315, 13347, 279, 7243, 11518, 733, 628, 342, 1401, 19, 6530, 18, 70, 2196, 6, 284, 33, 19834, 18, 892, 67, 1214, 6797, ...
print repr(self.nodeState[symbol].activationValue)
def getNodeStateBySymbol(self,symbol): """Get the the state of the node which symbol is given.
4c5558d41c268af2aed5dd7e820d0a0a2f432dfd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13131/4c5558d41c268af2aed5dd7e820d0a0a2f432dfd/ConceptNetwork.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5973, 1119, 858, 5335, 12, 2890, 16, 7175, 4672, 3536, 967, 326, 326, 919, 434, 326, 756, 1492, 3273, 353, 864, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5973, 1119, 858, 5335, 12, 2890, 16, 7175, 4672, 3536, 967, 326, 326, 919, 434, 326, 756, 1492, 3273, 353, 864, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
j = create_gaudi_subjob(self, job, job.inputdata)
j = create_gaudi_subjob(job, job.inputdata)
def split(self,job): subjobs=[] for i in range(self.numberOfJobs): j = create_gaudi_subjob(self, job, job.inputdata) first = i*self.eventsPerJob + 1 opts = 'ApplicationMgr.EvtMax = %d;\n' % self.eventsPerJob opts += 'GaussGen.FirstEventNumber = %d;\n' % first # for when we move to .py only option files #opts = 'ApplicationMgr(EvtMax=%d)\n' % self.eventsPerJob #opts += 'GenInit(\"GaussGen\").FirstEventNumber = %d\n' % first j.application.extra.input_buffers['data.opts'] += opts logger.debug("Creating job %d w/ FirstEventNumber = %d"%(i,first)) subjobs.append(j) return subjobs
203f58884a506edd2b980f3b9280acf0663f8d21 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/203f58884a506edd2b980f3b9280acf0663f8d21/Splitters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 12, 2890, 16, 4688, 4672, 720, 10088, 33, 8526, 364, 277, 316, 1048, 12, 2890, 18, 2696, 951, 7276, 4672, 525, 273, 752, 67, 15833, 1100, 77, 67, 1717, 4688, 12, 4688, 16, 1719, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 12, 2890, 16, 4688, 4672, 720, 10088, 33, 8526, 364, 277, 316, 1048, 12, 2890, 18, 2696, 951, 7276, 4672, 525, 273, 752, 67, 15833, 1100, 77, 67, 1717, 4688, 12, 4688, 16, 1719, ...
return self.schema.slug
return (self.schema.slug,)
def natural_key(self): return self.schema.slug
0078aa690bf0b1508e07cdd380682afee2704558 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10327/0078aa690bf0b1508e07cdd380682afee2704558/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15145, 67, 856, 12, 2890, 4672, 327, 365, 18, 4821, 18, 6436, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15145, 67, 856, 12, 2890, 4672, 327, 365, 18, 4821, 18, 6436, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
print "button_press error", e
log.addwarning(_("button_press error, %(error)s") % {'error':e})
def button_press(self, widget, event): try:
5b9c99ed36f23c0f56579a3f05ed0bcf912fdf19 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/5b9c99ed36f23c0f56579a3f05ed0bcf912fdf19/frame.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3568, 67, 1028, 12, 2890, 16, 3604, 16, 871, 4672, 775, 30, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3568, 67, 1028, 12, 2890, 16, 3604, 16, 871, 4672, 775, 30, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
generate = 1
generate = True
def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0, fromfile=None, findleaks=0, use_resources=None): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, generate, exclude, single, randomize, findleaks, and use_resources) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ test_support.record_original_stdout(sys.stdout) try: opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=']) except getopt.error, msg: usage(2, msg) # Defaults if use_resources is None: use_resources = [] for o, a in opts: if o in ('-h', '--help'): usage(0) elif o in ('-v', '--verbose'): verbose += 1 elif o in ('-q', '--quiet'): quiet = 1; verbose = 0 elif o in ('-g', '--generate'): generate = 1 elif o in ('-x', '--exclude'): exclude = 1 elif o in ('-s', '--single'): single = 1 elif o in ('-r', '--randomize'): randomize = 1 elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): findleaks = 1 elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] for r in u: if r == 'all': use_resources[:] = RESOURCE_NAMES continue remove = False if r[0] == '-': remove = True r = r[1:] if r not in RESOURCE_NAMES: usage(1, 'Invalid -u/--use option: ' + a) if remove: if r in use_resources: use_resources.remove(r) elif r not in use_resources: use_resources.append(r) if generate and verbose: usage(2, "-g and -v don't go together!") if single and fromfile: usage(2, "-s and -f don't go together!") good = [] bad = [] skipped = [] resource_denieds = [] if findleaks: try: import gc except ImportError: print 'No GC available, disabling findleaks.' findleaks = 0 else: # Uncomment the line below to report garbage that is not # freeable by reference counting alone. By default only # garbage that is not collectable by the GC is reported. #gc.set_debug(gc.DEBUG_SAVEALL) found_garbage = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = fp.read().strip() tests = [next] fp.close() except IOError: pass if fromfile: tests = [] fp = open(fromfile) for line in fp: guts = line.split() # assuming no test has whitespace in its name if guts and not guts[0].startswith('#'): tests.extend(guts) fp.close() # Strip .py extensions. if args: args = map(removepy, args) if tests: tests = map(removepy, tests) stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() for test in tests: if not quiet: print test sys.stdout.flush() ok = runtest(test, generate, verbose, quiet, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: skipped.append(test) if ok == -2: resource_denieds.append(test) if findleaks: gc.collect() if gc.garbage: print "Warning: test created", len(gc.garbage), print "uncollectable object(s)." # move the uncollectable objects somewhere so we don't see # them again found_garbage.extend(gc.garbage) del gc.garbage[:] # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) # The lists won't be sorted if running with -r good.sort() bad.sort() skipped.sort() if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if verbose: print "CAUTION: stdout isn't compared in verbose mode:" print "a test that passes in verbose mode may fail without it." if bad: print count(len(bad), "test"), "failed:" printlist(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:" printlist(skipped) e = _ExpectedSkips() plat = sys.platform if e.isvalid(): surprise = set(skipped) - e.getexpected() - set(resource_denieds) if surprise: print count(len(surprise), "skip"), \ "unexpected on", plat + ":" printlist(surprise) else: print "Those skips are all expected on", plat + "." else: print "Ask someone to teach regrtest.py about which tests are" print "expected to get skipped on", plat + "." if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) sys.exit(len(bad) > 0)
3feaba6409bd3f4dce920f7a4f22e9e9361f6c5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3feaba6409bd3f4dce920f7a4f22e9e9361f6c5f/regrtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 16341, 33, 7036, 16, 1842, 1214, 33, 7036, 16, 3988, 33, 20, 16, 10902, 33, 20, 16, 2103, 33, 20, 16, 4433, 33, 20, 16, 2202, 33, 20, 16, 2744, 554, 33, 20, 16, 628, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 16341, 33, 7036, 16, 1842, 1214, 33, 7036, 16, 3988, 33, 20, 16, 10902, 33, 20, 16, 2103, 33, 20, 16, 4433, 33, 20, 16, 2202, 33, 20, 16, 2744, 554, 33, 20, 16, 628, 76...