rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
run_test_conv_nnet2_classif(23485, 32, 5, 60, ignore_error=False, n_iter=3)
cmp_run_conv_nnet2_classif(23485, 32, 5, 60, ignore_error=False, n_iter=3)
def test_lenet_32(): #CIFAR10 / Shapeset run_test_conv_nnet2_classif(23485, 32, 5, 60, ignore_error=False, n_iter=3)
132c9d49c0fc507cdeefa0967029d34df3cc3208 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/132c9d49c0fc507cdeefa0967029d34df3cc3208/test_nnet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1897, 278, 67, 1578, 13332, 468, 39, 5501, 985, 2163, 342, 2638, 7315, 278, 9411, 67, 2681, 67, 4896, 67, 82, 2758, 22, 67, 1106, 430, 12, 17959, 7140, 16, 3847, 16, 1381, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 67, 1897, 278, 67, 1578, 13332, 468, 39, 5501, 985, 2163, 342, 2638, 7315, 278, 9411, 67, 2681, 67, 4896, 67, 82, 2758, 22, 67, 1106, 430, 12, 17959, 7140, 16, 3847, 16, 1381, ...
def coset_representatives(x, G): """ For some group element x in G, return a list of the canonical coset representatives for the subgroup <x> in G. EXAMPLES:
def tau_to_bitrade(t1, t2, t3): """ Given permutation t1, t2, t3 that represent a latin bitrade, convert them to an explicit latin bitrade (T1, T2). The result is unique up to isotopism. EXAMPLE:
def coset_representatives(x, G): """ For some group element x in G, return a list of the canonical coset representatives for the subgroup <x> in G. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: a, b, c, G = alternating_group_bitrade_generators(1) sage: print coset_representatives(a, G) [(), (1,2)(3,4), (1,4)(2,3), (1,3)(2,4)] """ rcosets = gap.RightCosets(G, PermutationGroup([x])) cosetReps = [] for i in range(1, len(rcosets)+1): cosetReps.append(gap.Representative(rcosets[i])) assert gap.Index(G, PermutationGroup([x])) == len(cosetReps) return cosetReps
9087d14f978c663baae98e9a365c4a3aa2a6f24c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9087d14f978c663baae98e9a365c4a3aa2a6f24c/latin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12284, 67, 869, 67, 3682, 354, 323, 12, 88, 21, 16, 268, 22, 16, 268, 23, 4672, 3536, 16803, 17440, 268, 21, 16, 268, 22, 16, 268, 23, 716, 2406, 279, 30486, 2831, 354, 323, 16, 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, 12284, 67, 869, 67, 3682, 354, 323, 12, 88, 21, 16, 268, 22, 16, 268, 23, 4672, 3536, 16803, 17440, 268, 21, 16, 268, 22, 16, 268, 23, 716, 2406, 279, 30486, 2831, 354, 323, 16, 17...
print 'Usage: %s <CURRENT_USERS_FILE> <NEW_USERS_FILE>'%(sys.argv[0])
print 'Usage: %s <CURRENT_USERS_FILE> <NEW_USERS_FILE> <CURRENT SYNCING ZONE>'%(sys.argv[0]) try: currentSyncZone = sys.argv[3] except: print 'Usage: %s <CURRENT_USERS_FILE> <NEW_USERS_FILE> <CURRENT SYNCING ZONE>'%(sys.argv[0])
def createUser (u,currentDomains,currentZones): if u['Zone'] not in currentZones: return 0 if u['Domain'] in ignoreDomains: return 0 if u['Domain'] not in currentDomains: res = createDomain(u['Domain']) if res != 0: sys.stderr.write('Error creating Domain %s.'%(u['Domain'])) sys.exit(-1) if u['Type'] == 'group': return 0 else: print("Singestuser %s %s %s %s '' '' '' ENCRPYT1 '' %s"%(u['Name'], random.randrange(1,1000000000), u['Domain'], u['Type'], u['Zone'])) res = os.system("Singestuser %s %s %s %s '' '' '' ENCRPYT1 '' %s"%(u['Name'], random.randrange(1,1000000000), u['Domain'], u['Type'], u['Zone'])) return res
16baca4a4abcb814c097a6b731ff56af1132d477 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1913/16baca4a4abcb814c097a6b731ff56af1132d477/ZoneUserSync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22992, 261, 89, 16, 2972, 15531, 16, 2972, 13600, 4672, 309, 582, 3292, 4226, 3546, 486, 316, 783, 13600, 30, 327, 374, 309, 582, 3292, 3748, 3546, 316, 2305, 15531, 30, 327, 374, 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, 22992, 261, 89, 16, 2972, 15531, 16, 2972, 13600, 4672, 309, 582, 3292, 4226, 3546, 486, 316, 783, 13600, 30, 327, 374, 309, 582, 3292, 3748, 3546, 316, 2305, 15531, 30, 327, 374, 309, ...
return self.timestamp.__cmp__(other.timestamp)
return cmp(timestamp, other.timestamp)
def __cmp__(self,other): return self.timestamp.__cmp__(other.timestamp)
eeb8023a35bfea7c13e830a75533fd6ae47f567a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/eeb8023a35bfea7c13e830a75533fd6ae47f567a/delay.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9625, 972, 12, 2890, 16, 3011, 4672, 327, 365, 18, 5508, 16186, 9625, 972, 12, 3011, 18, 5508, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9625, 972, 12, 2890, 16, 3011, 4672, 327, 365, 18, 5508, 16186, 9625, 972, 12, 3011, 18, 5508, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if sys.platform == 'mac': TOOLBOXDIR=os.path.join(sys.prefix, "Lib", "plat-mac", "Carbon") else: TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon"
TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon"
def _pardir(p): return os.path.split(p)[0]
10d176f77e04ad95c3e501f8b65a0b9ad931a098 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/10d176f77e04ad95c3e501f8b65a0b9ad931a098/bgenlocations.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 84, 1060, 481, 12, 84, 4672, 327, 1140, 18, 803, 18, 4939, 12, 84, 25146, 20, 65, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 84, 1060, 481, 12, 84, 4672, 327, 1140, 18, 803, 18, 4939, 12, 84, 25146, 20, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
the <spine> element of the OPF file.
the <spine> element of the OPF file.
def option_parser(): c = config() return c.option_parser(usage=_('''\
62688a6822fce9a5af20458cd9e4ccc78e487fe7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/62688a6822fce9a5af20458cd9e4ccc78e487fe7/from_html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1456, 67, 4288, 13332, 276, 273, 642, 1435, 327, 276, 18, 3482, 67, 4288, 12, 9167, 33, 67, 2668, 6309, 64, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1456, 67, 4288, 13332, 276, 273, 642, 1435, 327, 276, 18, 3482, 67, 4288, 12, 9167, 33, 67, 2668, 6309, 64, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
from distutils import log
def download_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15,
e7932397a19380975ae6401d2f13f2f5d6ddb716 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/495/e7932397a19380975ae6401d2f13f2f5d6ddb716/distribute_setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4224, 67, 542, 30693, 12, 1177, 33, 5280, 67, 5757, 16, 4224, 67, 1969, 33, 5280, 67, 1785, 16, 358, 67, 1214, 33, 538, 18, 1397, 1214, 16, 4624, 33, 3600, 16, 2, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4224, 67, 542, 30693, 12, 1177, 33, 5280, 67, 5757, 16, 4224, 67, 1969, 33, 5280, 67, 1785, 16, 358, 67, 1214, 33, 538, 18, 1397, 1214, 16, 4624, 33, 3600, 16, 2, -100, -100, -100, ...
sage: P1 in G
sage: P1 in G
def _call_(self, x): r""" TEST::
0bd99622f910c5a456ea17a7a8b3975be000dabb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0bd99622f910c5a456ea17a7a8b3975be000dabb/additive_abelian_wrapper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1991, 67, 12, 2890, 16, 619, 4672, 436, 8395, 22130, 2866, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1991, 67, 12, 2890, 16, 619, 4672, 436, 8395, 22130, 2866, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
).addCallback(self.__selectInbox)
).addCallbacks(self.__selectInbox, self.catchErrors)
def loginClientInsecure(self, error, username, password): if __debug__: self.printCurrentView("loginClientInsecure")
cd0d773c52b7eb7870b5e37e0d7c668e7d25477c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/cd0d773c52b7eb7870b5e37e0d7c668e7d25477c/imap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3925, 1227, 382, 8869, 12, 2890, 16, 555, 16, 2718, 16, 2201, 4672, 309, 1001, 4148, 972, 30, 365, 18, 1188, 3935, 1767, 2932, 5819, 1227, 382, 8869, 7923, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 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, 3925, 1227, 382, 8869, 12, 2890, 16, 555, 16, 2718, 16, 2201, 4672, 309, 1001, 4148, 972, 30, 365, 18, 1188, 3935, 1767, 2932, 5819, 1227, 382, 8869, 7923, 2, -100, -100, -100, -100, -...
print "Warning:", rpm.getFilename(), "contains a conflict", \ depString(name, flag, version), "with", pkg.getFilename()
print "Warning:", rpm.getFilename(), \ "contains a conflict with", pkg.getFilename()
def checkDeps(rpms, checkfileconflicts, runorderer): # Add all packages in. resolver = RpmResolver(rpms, checkfileconflicts) # Check for obsoletes. deps = resolver.obsoletes_list.keys() deps.sort() for (name, flag, version) in deps: orpms = resolver.obsoletes_list[(name, flag, version)] for pkg in resolver.searchDependency(name, flag, version): for rpm in orpms: if rpm.getNEVR0() == pkg.getNEVR0(): continue if rpm["name"] != name: print "Warning:", pkg.getFilename(), "is obsoleted by", \ depString(name, flag, version), "from", \ rpm.getFilename() resolver.removePkg(pkg) # Check all conflicts. deps = resolver.conflicts_list.keys() deps.sort() for (name, flag, version) in deps: orpms = resolver.conflicts_list[(name, flag, version)] for pkg in resolver.searchDependency(name, flag, version): for rpm in orpms: if rpm.getNEVR0() == pkg.getNEVR0(): continue print "Warning:", rpm.getFilename(), "contains a conflict", \ depString(name, flag, version), "with", pkg.getFilename() # Check all requires. deps = resolver.requires_list.keys() deps.sort() for (name, flag, version) in deps: if name[:7] == "rpmlib(": continue if not resolver.searchDependency(name, flag, version): for rpm in resolver.requires_list[(name, flag, version)]: print "Warning:", rpm.getFilename(), \ "did not find a package for:", \ depString(name, flag, version) # Check for fileconflicts. if checkfileconflicts: dirnames = resolver.filenames_list.path.keys() dirnames.sort() for dirname in dirnames: pathdirname = resolver.filenames_list.path[dirname] basenames = pathdirname.keys() basenames.sort() for basename in basenames: s = pathdirname[basename] if len(s) < 2: continue for j in xrange(len(s) - 1): (rpm1, i1) = s[j] filemodesi1 = rpm1["filemodes"][i1] #if not S_ISREG(filemodesi1): # continue filemd5si1 = rpm1["filemd5s"][i1] filecolorsi1 = None if rpm1["filecolors"]: filecolorsi1 = rpm1["filecolors"][i1] for k in xrange(j + 1, len(s)): (rpm2, i2) = s[k] filemodesi2 = rpm2["filemodes"][i2] #if not S_ISREG(filemodesi2): # continue # No fileconflict if mode/md5sum/user/group match. if filemd5si1 == rpm2["filemd5s"][i2] and \ filemodesi1 == filemodesi2 \ and rpm1["fileusername"][i1] == \ rpm2["fileusername"][i2] \ and rpm1["filegroupname"][i1] == \ rpm2["filegroupname"][i2]: continue # No fileconflict for multilib elf32/elf64 files. if filecolorsi1 and rpm2["filecolors"]: filecolorsi2 = rpm2["filecolors"][i2] if filecolorsi2 and filecolorsi1 != filecolorsi2: continue print "fileconflict for", dirname + basename, "in", \ rpm1.getFilename(), "and", rpm2.getFilename() # Order rpms on how they get installed. if runorderer: orderer = RpmOrderer(resolver.rpms, {}, {}, [], resolver) operations = orderer.order() if operations == None: raise #print operations
127c3b94f11114097631e721c7fe1527a811b225 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/127c3b94f11114097631e721c7fe1527a811b225/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 14430, 12, 13832, 959, 16, 866, 768, 20340, 87, 16, 1086, 1019, 264, 4672, 468, 1436, 777, 5907, 316, 18, 5039, 273, 534, 7755, 4301, 12, 13832, 959, 16, 866, 768, 20340, 87, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 14430, 12, 13832, 959, 16, 866, 768, 20340, 87, 16, 1086, 1019, 264, 4672, 468, 1436, 777, 5907, 316, 18, 5039, 273, 534, 7755, 4301, 12, 13832, 959, 16, 866, 768, 20340, 87, 13, ...
if hasattr(self.db, 'close'): self.db.close() self.db = None
if hasattr(self.dict, 'close'): self.dict.close() self.dict = None
def close(self): if hasattr(self.db, 'close'): self.db.close() self.db = None
f54d5697f30a72d7b99b36e297f28c77d5e474f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/f54d5697f30a72d7b99b36e297f28c77d5e474f6/shelve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 309, 3859, 12, 2890, 18, 1966, 16, 296, 4412, 11, 4672, 365, 18, 1966, 18, 4412, 1435, 365, 18, 1966, 273, 599, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 309, 3859, 12, 2890, 18, 1966, 16, 296, 4412, 11, 4672, 365, 18, 1966, 18, 4412, 1435, 365, 18, 1966, 273, 599, 2, -100, -100, -100, -100, -100, -100, -100, -100,...
MAYAVERSIONS=[("MAYA5", "SOFTWARE\\Alias|Wavefront\\Maya\\5.0\\Setup\\InstallPath"), ("MAYA6", "SOFTWARE\\Alias|Wavefront\\Maya\\6.0\\Setup\\InstallPath"), ("MAYA65", "SOFTWARE\\Alias|Wavefront\\Maya\\6.5\\Setup\\InstallPath")
MAYAVERSIONINFO=[("MAYA6", "SOFTWARE\\Alias|Wavefront\\Maya\\6.0\\Setup\\InstallPath"), ("MAYA65", "SOFTWARE\\Alias|Wavefront\\Maya\\6.5\\Setup\\InstallPath"), ("MAYA7", "SOFTWARE\\Alias|Wavefront\\Maya\\7.0\\Setup\\InstallPath")
def parseopts(args): global COMPILER,OPTIMIZE,OMIT,INSTALLER,GENMAN,SLAVEBUILD global VERSION,COMPRESSOR,DIRECTXSDK,VERBOSE,SLAVEFILE,THREADCOUNT longopts = [ "help","package-info","compiler=","directx-sdk=","slavebuild=", "optimize=","everything","nothing","installer","quiet","verbose", "version=","lzma","no-python","slaves=","threads="] anything = 0 for pkg in PACKAGES: longopts.append("no-"+pkg.lower()) for pkg in PACKAGES: longopts.append("use-"+pkg.lower()) try: opts, extras = getopt.getopt(args, "", longopts) for option,value in opts: if (option=="--help"): raise "usage" elif (option=="--package-info"): raise "package-info" elif (option=="--compiler"): COMPILER=value elif (option=="--directx-sdk"): DIRECTXSDK=value elif (option=="--optimize"): OPTIMIZE=value elif (option=="--quiet"): VERBOSE-=1 elif (option=="--verbose"): VERBOSE+=1 elif (option=="--installer"): INSTALLER=1 elif (option=="--genman"): GENMAN=1 elif (option=="--everything"): OMIT=[] elif (option=="--nothing"): OMIT=PACKAGES[:] elif (option=="--slaves"): SLAVEFILE=value elif (option=="--threads"): THREADCOUNT=int(value) elif (option=="--slavebuild"): SLAVEBUILD=value elif (option=="--version"): VERSION=value if (len(VERSION.split(".")) != 3): raise "usage" elif (option=="--lzma"): COMPRESSOR="lzma" else: for pkg in PACKAGES: if (option=="--use-"+pkg.lower()): if (OMIT.count(pkg)): OMIT.remove(pkg) break for pkg in PACKAGES: if (option=="--no-"+pkg.lower()): if (OMIT.count(pkg)==0): OMIT.append(pkg) break anything = 1 except "package-info": packageInfo() except: usage(0) if (anything==0): usage(0) if (OPTIMIZE=="1"): OPTIMIZE=1 elif (OPTIMIZE=="2"): OPTIMIZE=2 elif (OPTIMIZE=="3"): OPTIMIZE=3 elif (OPTIMIZE=="4"): OPTIMIZE=4 else: usage("Invalid setting for OPTIMIZE") if (COMPILERS.count(COMPILER)==0): usage("Invalid setting for COMPILER: "+COMPILER)
c92b9d824116f0d2cc2e67ded17a2f353593d4fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/c92b9d824116f0d2cc2e67ded17a2f353593d4fb/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 4952, 12, 1968, 4672, 2552, 5423, 1102, 14668, 16, 15620, 3445, 15641, 16, 1872, 1285, 16, 28865, 654, 16, 16652, 9560, 16, 55, 2534, 3412, 20215, 2552, 8456, 16, 4208, 22526, 916, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4952, 12, 1968, 4672, 2552, 5423, 1102, 14668, 16, 15620, 3445, 15641, 16, 1872, 1285, 16, 28865, 654, 16, 16652, 9560, 16, 55, 2534, 3412, 20215, 2552, 8456, 16, 4208, 22526, 916, ...
if session_key is not None: service_factory = c.createSession(session_key) else: service_factory = c.createSession(username, password) query_service = service_factory.getQueryService() analysis_ctx = MIASPlateAnalysisCtx(query_service, plate_id) n_measurements = len(analysis_ctx.measurements.keys()) if measurement is not None and measurement >= n_measurements: usage("Measurement %d not a valid index!") if info: print "Found %d measurements." % n_measurements for i, value in enumerate(analysis_ctx.measurements.values()): print "Measurement %d has %d result files." % (i, len(value)) sys.exit(0) for key in analysis_ctx.measurements.keys(): log_file = analysis_ctx.log_files[key] result_files = analysis_ctx.measurements[key] measurement_ctx = MeasurementCtx(analysis_ctx, service_factory, log_file, result_files) measurement_ctx.parse_result_files()
c.enableKeepAlive(60) try: if session_key is not None: service_factory = c.createSession(session_key) else: service_factory = c.createSession(username, password) query_service = service_factory.getQueryService() analysis_ctx = MIASPlateAnalysisCtx(query_service, plate_id) n_measurements = len(analysis_ctx.measurements.keys()) if measurement is not None and measurement >= n_measurements: usage("Measurement %d not a valid index!") if info: print "Found %d measurements." % n_measurements for i, value in enumerate(analysis_ctx.measurements.values()): print "Measurement %d has %d result files." % (i, len(value)) sys.exit(0) for i, key in enumerate(analysis_ctx.measurements.keys()): log_file = analysis_ctx.log_files[key] result_files = analysis_ctx.measurements[key] if len(result_files) > 0 and (measurement is None or measurement == i): measurement_ctx = MeasurementCtx(analysis_ctx, service_factory, log_file, result_files) measurement_ctx.parse_result_files() finally: c.closeSession()
def parse_result_files(self): raw_file_store = self.service_factory.createRawFileStore() try: for result_file in result_files: print "Parsing: %s" % result_file.name.val image = self.image_from_original_file(result_file) unloaded_image = ImageI(image.id.val, False) raw_file_store.setFileId(result_file.id.val) data = raw_file_store.read(0L, result_file.size.val) rows = list(csv.reader(StringIO(data), delimiter='\t')) rows.reverse() columns = self.get_empty_columns(len(rows[0])) rois = list() for row in rows: try: for i, value in enumerate(row): value = float(value) columns[i + 2].values.append(value) columns[self.IMAGE_COL].values.append(image.id.val) rois.append(self.parse_roi(unloaded_image, row)) except ValueError: for i, value in enumerate(row): columns[i + 2].name = value break print "ROI count: %d" % len(rois) t0 = int(time.time() * 1000) rois = self.update_service.saveAndReturnArray(rois) print "ROI update took %sms" % (int(time.time() * 1000) - t0) for roi in rois: columns[self.ROI_COL].values.append(roi.id.val) self.update_table(columns) finally: raw_file_store.close()
0b62b2420d1a6095ae91c928a3fdb4677392f99e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/0b62b2420d1a6095ae91c928a3fdb4677392f99e/populate_roi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2088, 67, 2354, 12, 2890, 4672, 1831, 67, 768, 67, 2233, 273, 365, 18, 3278, 67, 6848, 18, 2640, 4809, 812, 2257, 1435, 775, 30, 364, 563, 67, 768, 316, 563, 67, 2354, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2088, 67, 2354, 12, 2890, 4672, 1831, 67, 768, 67, 2233, 273, 365, 18, 3278, 67, 6848, 18, 2640, 4809, 812, 2257, 1435, 775, 30, 364, 563, 67, 768, 316, 563, 67, 2354, 30, ...
print "TILEVIEWS", tileViews
def handlePoll(self, poll, session):
14b2acc074530e8a6710261615202e97b1b8b23b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12485/14b2acc074530e8a6710261615202e97b1b8b23b/micropolisturbogearsengine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 19085, 12, 2890, 16, 7672, 16, 1339, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 19085, 12, 2890, 16, 7672, 16, 1339, 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...
temp = os.path.join(os.path.dirname(__file__),'templates/success.html') outstr = template.render(temp,{ 'maxp': newRide.max_passengers, 'num_passengers': newRide.num_passengers, 'driver': newRide.driver, 'startloc': newRide.start_point_title, 'startlong': newRide.start_point_long, 'startlat': newRide.start_point_lat, 'dest': newRide.destination_title, 'destlong': newRide.destination_long, 'destlat': newRide.destination_lat, 'partofday': newRide.part_of_day, 'ToD': newRide.ToD, 'contact': newRide.contact, }) self.response.out.write(outstr)
query = db.Query(Ride) ride_list = query.fetch(limit=100) user = users.get_current_user() greeting = '' if user: greeting = ("Welcome, %s! (<a href=\"%s\">sign out</a>) Go to your <a href='/home'>Home Page</a>" % (user.nickname(), users.create_logout_url("/"))) message = 'Your ride has been created!' self.response.out.write(template.render('index.html', { 'ride_list': ride_list, 'greeting': greeting, 'message': message }))
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - destination_long - part_of_day - ToD - contact """
1ebe9fa12154a0a2cf599ce3e2552c7ff6ab4097 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9768/1ebe9fa12154a0a2cf599ce3e2552c7ff6ab4097/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 12, 2890, 4672, 3536, 11782, 1347, 279, 394, 436, 831, 4260, 358, 506, 3096, 358, 326, 2063, 18, 14610, 6906, 598, 777, 434, 333, 501, 518, 1410, 506, 2731, 487, 279, 646, 1603, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3536, 11782, 1347, 279, 394, 436, 831, 4260, 358, 506, 3096, 358, 326, 2063, 18, 14610, 6906, 598, 777, 434, 333, 501, 518, 1410, 506, 2731, 487, 279, 646, 1603, ...
return Exception(scode=winerror.E_UNEXPECTED)
raise Exception(scode=winerror.E_UNEXPECTED)
def Unadvise(self, cookie): # Destroy a connection - simply delete interface from the map. try: del self.connections[cookie] except KeyError: return Exception(scode=winerror.E_UNEXPECTED)
ebad034aef9424da803371d678019810a22b41fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/ebad034aef9424da803371d678019810a22b41fa/connect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1351, 28107, 784, 12, 2890, 16, 3878, 4672, 468, 15701, 279, 1459, 300, 8616, 1430, 1560, 628, 326, 852, 18, 775, 30, 1464, 365, 18, 13313, 63, 8417, 65, 1335, 4999, 30, 327, 1185, 12,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1351, 28107, 784, 12, 2890, 16, 3878, 4672, 468, 15701, 279, 1459, 300, 8616, 1430, 1560, 628, 326, 852, 18, 775, 30, 1464, 365, 18, 13313, 63, 8417, 65, 1335, 4999, 30, 327, 1185, 12,...
start = line.find("brkitr/") if start >= 0:
if line.find("brkitr/") >= 0:
def GenResIndex(dat_list_file_path): res_index = "res_index.txt" header_locale = "res_index:table(nofallback) {\n CLDRVersion { " header_locale += CLDR_VERSION + " }\n InstalledLocales {\n" header = "res_index:table(nofallback) {\nInstalledLocales {\n" footer = " }\n}" empty_value = " {\"\"}\n" # key-value pair for all locale entries locale_index = open(os.path.join(TMP_DAT_PATH, res_index), "w") locale_index.write(header_locale) brkitr_index = open(os.path.join(TMP_DAT_PATH, "brkitr", res_index), "w") brkitr_index.write(header) coll_index = open(os.path.join(TMP_DAT_PATH, "coll", res_index), "w") coll_index.write(header) rbnf_index = open(os.path.join(TMP_DAT_PATH, "rbnf", res_index), "w") rbnf_index.write(header) for line in open(dat_list_file_path, "r"): if line.find("root.") >= 0: continue if line.find("res_index") >= 0: continue if line.find("_.res") >= 0: continue; start = line.find("brkitr/") if start >= 0: end = line.find(".res") if end > 0: brkitr_index.write(line[line.find("/")+1:end] + empty_value) elif line.find("coll/") >= 0: start = line.find("coll/") end = line.find(".res") if end > 0: coll_index.write(line[line.find("/")+1:end] + empty_value) elif line.find("rbnf/") >= 0: start = line.find("rbnf/") end = line.find(".res") if end > 0: rbnf_index.write(line[line.find("/")+1:end] + empty_value) elif line.find(".res") >= 0: # We need to determine the resource is locale resource or misc resource. # To determine the locale resource, we assume max script length is 3. end = line.find(".res") if end <= 3: locale_index.write(line[:end] + empty_value) elif line.find("_") <= 3: if line.find("_") > 0: locale_index.write(line[:end] + empty_value) locale_index.write(footer) brkitr_index.write(footer) coll_index.write(footer) rbnf_index.write(footer) locale_index.close() brkitr_index.close() coll_index.close() rbnf_index.close() # Call genrb to generate new res_index.res. InvokeIcuTool("genrb", TMP_DAT_PATH, [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "brkitr"), [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "coll"), [res_index]) InvokeIcuTool("genrb", os.path.join(TMP_DAT_PATH, "rbnf"), [res_index])
e8aab5e9f14e1c3a670fbea64057a2a5f5c35245 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10672/e8aab5e9f14e1c3a670fbea64057a2a5f5c35245/icu_dat_generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10938, 607, 1016, 12, 3404, 67, 1098, 67, 768, 67, 803, 4672, 400, 67, 1615, 273, 315, 455, 67, 1615, 18, 5830, 6, 1446, 67, 6339, 273, 315, 455, 67, 1615, 30, 2121, 12, 82, 792, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10938, 607, 1016, 12, 3404, 67, 1098, 67, 768, 67, 803, 4672, 400, 67, 1615, 273, 315, 455, 67, 1615, 18, 5830, 6, 1446, 67, 6339, 273, 315, 455, 67, 1615, 30, 2121, 12, 82, 792, 7...
str = ' '*(width-2) + '<b>'+`uid`+'</b>\n'
str = ' '*(width-2) + '<b>'+uid.shortname()+'</b>\n'
def _base_tree(self, uid, width=None, postfix=''): """ Return an HTML picture showing a class's base tree, with multiple inheritance.
29127a15ecd548178da747376d81226f0a835ef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/29127a15ecd548178da747376d81226f0a835ef6/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1969, 67, 3413, 12, 2890, 16, 4555, 16, 1835, 33, 7036, 16, 18923, 2218, 11, 4672, 3536, 2000, 392, 3982, 15406, 17253, 279, 667, 1807, 1026, 2151, 16, 598, 3229, 16334, 18, 2, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1969, 67, 3413, 12, 2890, 16, 4555, 16, 1835, 33, 7036, 16, 18923, 2218, 11, 4672, 3536, 2000, 392, 3982, 15406, 17253, 279, 667, 1807, 1026, 2151, 16, 598, 3229, 16334, 18, 2, -1...
print `name`, "None"
print repr(name), "None"
def _dump_frame_(self, frame,name=None): if name is None: name = "" if frame: if frame.f_code and frame.f_code.co_filename: fname = os.path.split(frame.f_code.co_filename)[1] else: fname = "??" print `name`, fname, frame.f_lineno, frame else: print `name`, "None"
178dc1baacddb19a6e10e4b6e0917695ec36fd18 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/992/178dc1baacddb19a6e10e4b6e0917695ec36fd18/debugger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8481, 67, 3789, 67, 12, 2890, 16, 2623, 16, 529, 33, 7036, 4672, 309, 508, 353, 599, 30, 508, 273, 1408, 309, 2623, 30, 309, 2623, 18, 74, 67, 710, 471, 2623, 18, 74, 67, 710,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8481, 67, 3789, 67, 12, 2890, 16, 2623, 16, 529, 33, 7036, 4672, 309, 508, 353, 599, 30, 508, 273, 1408, 309, 2623, 30, 309, 2623, 18, 74, 67, 710, 471, 2623, 18, 74, 67, 710,...
def run_test(self, cr, uid, module_path):
def run_test_struct(self, cr, uid, module_path):
def run_test(self, cr, uid, module_path): len_module = len(module_path.split('/')) module_name = module_path.split('/') module_name = module_name[len_module-1] list_files = os.listdir(module_path) self.result_dict = {} f_list = [] module_dict = {} module_dict['module'] = [] count = 0 final_score = 0.0
0dda5ea5dc3a5a65af454e7303ddfa578d871533 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/0dda5ea5dc3a5a65af454e7303ddfa578d871533/structure_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3813, 67, 1697, 12, 2890, 16, 4422, 16, 4555, 16, 1605, 67, 803, 4672, 562, 67, 2978, 273, 562, 12, 2978, 67, 803, 18, 4939, 2668, 2473, 3719, 1605, 67, 529, 273, 1605, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3813, 67, 1697, 12, 2890, 16, 4422, 16, 4555, 16, 1605, 67, 803, 4672, 562, 67, 2978, 273, 562, 12, 2978, 67, 803, 18, 4939, 2668, 2473, 3719, 1605, 67, 529, 273, 1605, 67,...
update(node, found, prefix, offset, debug)
update(node, found, prefix, debug)
def search(node, found, level=0, prefix="$", offset=0, register=False, debug=False): if node.type == "function": if register: name = node.get("name", False) if name != None and not name in found: # print "Name: %s" % funcName found.append(name) found = [] register = True if debug: print "\n%s<scope line='%s'>" % ((" " * level), node.get("line")) # e.g. func(name1, name2); elif register and node.type == "variable" and node.hasChildren() and len(node.children) == 1: if node.parent.type == "params" and node.parent.parent.type != "call": first = node.getFirstChild() if first.type == "identifier": name = first.get("name") if not name in found: found.append(name) # e.g. var name1, name2 = "foo"; elif register and node.type == "definition": name = node.get("identifier", False) if name != None: if not name in found: found.append(name) # Iterate over children if node.hasChildren(): if node.type == "function": for child in node.children: search(child, found, level+1, prefix, offset + len(found), register, debug) else: for child in node.children: search(child, found, level, prefix, offset + len(found), register, debug) # Function closed if node.type == "function": # Debug if debug: for item in found: print " %s<item>%s</item>" % ((" " * level), item) print "%s</scope>" % (" " * level) # Iterate over content # Replace variables in current scope update(node, found, prefix, offset, debug)
fcfee1c4d0de1c8faffed9fdf9e77923d2438bfa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/fcfee1c4d0de1c8faffed9fdf9e77923d2438bfa/variableoptimizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2159, 16, 1392, 16, 1801, 33, 20, 16, 1633, 1546, 8, 3113, 1384, 33, 20, 16, 1744, 33, 8381, 16, 1198, 33, 8381, 4672, 309, 756, 18, 723, 422, 315, 915, 6877, 309, 1744, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2159, 16, 1392, 16, 1801, 33, 20, 16, 1633, 1546, 8, 3113, 1384, 33, 20, 16, 1744, 33, 8381, 16, 1198, 33, 8381, 4672, 309, 756, 18, 723, 422, 315, 915, 6877, 309, 1744, ...
config = app.upload_set_config.get(setname)
config = current_app.upload_set_config.get(setname)
def uploaded_file(setname, filename): config = app.upload_set_config.get(setname) if config is None: abort(404) send_from_directory(config.destination, filename)
7a83f9495f1c1ce385b9f5f7e087a8e672183547 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10874/7a83f9495f1c1ce385b9f5f7e087a8e672183547/uploads.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9140, 67, 768, 12, 542, 529, 16, 1544, 4672, 642, 273, 783, 67, 2910, 18, 6327, 67, 542, 67, 1425, 18, 588, 12, 542, 529, 13, 309, 642, 353, 599, 30, 6263, 12, 11746, 13, 1366, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9140, 67, 768, 12, 542, 529, 16, 1544, 4672, 642, 273, 783, 67, 2910, 18, 6327, 67, 542, 67, 1425, 18, 588, 12, 542, 529, 13, 309, 642, 353, 599, 30, 6263, 12, 11746, 13, 1366, 67,...
self.assertTrue(data == '' or data.endswith('\n')) self.assertTrue('Traceback' not in data)
self.assertTrue(data == b'' or data.endswith('\n')) self.assertTrue(b'Traceback' not in data)
def verify_valid_flag(self, cmd_line): data = self.start_python(cmd_line) self.assertTrue(data == '' or data.endswith('\n')) self.assertTrue('Traceback' not in data)
f074b640f913dcf90756676409fc0df841960fb0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/f074b640f913dcf90756676409fc0df841960fb0/test_cmd_line.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 67, 877, 67, 6420, 12, 2890, 16, 1797, 67, 1369, 4672, 501, 273, 365, 18, 1937, 67, 8103, 12, 4172, 67, 1369, 13, 365, 18, 11231, 5510, 12, 892, 422, 875, 578, 501, 18, 5839, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 67, 877, 67, 6420, 12, 2890, 16, 1797, 67, 1369, 4672, 501, 273, 365, 18, 1937, 67, 8103, 12, 4172, 67, 1369, 13, 365, 18, 11231, 5510, 12, 892, 422, 875, 578, 501, 18, 5839, ...
sage: tmp = tmp_dir()
sage: tmp = tmp_dir() + '.sagenb'
def __init__(self, conf, **kwargs): """ Uses the server's configuration to select and set up a challenge.
ebba517baa5d548380d9cdacd6fb8b268637f526 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11792/ebba517baa5d548380d9cdacd6fb8b268637f526/challenge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2195, 16, 2826, 4333, 4672, 3536, 14854, 326, 1438, 1807, 1664, 358, 2027, 471, 444, 731, 279, 12948, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 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, 2195, 16, 2826, 4333, 4672, 3536, 14854, 326, 1438, 1807, 1664, 358, 2027, 471, 444, 731, 279, 12948, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100...
pass
del self._hidden_items[id]
def remove_item(self, id): try: iter = self._iter_map.pop(id) except KeyError: pass # The item isn't in our current list, just skip it else: self.model.remove(iter)
2c6e5a9d9bbefacdf56bcd4914b03aa8f511f034 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/2c6e5a9d9bbefacdf56bcd4914b03aa8f511f034/itemlist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 1726, 12, 2890, 16, 612, 4672, 775, 30, 1400, 273, 365, 6315, 2165, 67, 1458, 18, 5120, 12, 350, 13, 1335, 4999, 30, 225, 1464, 365, 6315, 6345, 67, 3319, 63, 350, 65, 468,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 67, 1726, 12, 2890, 16, 612, 4672, 775, 30, 1400, 273, 365, 6315, 2165, 67, 1458, 18, 5120, 12, 350, 13, 1335, 4999, 30, 225, 1464, 365, 6315, 6345, 67, 3319, 63, 350, 65, 468,...
self.coltypes = self.metarecord._v_formats self.colshapes = self.metarecord._v_shapes
def newRecArray(self, recarr): """Save a recarray to disk, and map it as a Table object
54ff968f9b04bf6a8b480eb4715011a910877c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12687/54ff968f9b04bf6a8b480eb4715011a910877c5d/Table.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 5650, 1076, 12, 2890, 16, 1950, 5399, 4672, 3536, 4755, 279, 1950, 1126, 358, 4234, 16, 471, 852, 518, 487, 279, 3555, 733, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 5650, 1076, 12, 2890, 16, 1950, 5399, 4672, 3536, 4755, 279, 1950, 1126, 358, 4234, 16, 471, 852, 518, 487, 279, 3555, 733, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
params = self.inspector.selCmp.constructor() paramNames = params.keys() paramNames.sort()
def findInConstrLst(name, constrList): for constr in constrList: if constr.name == name: return constr return None
746f53548fb8bb54a235b1bfa31a4bdb769818e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/746f53548fb8bb54a235b1bfa31a4bdb769818e8/Inspector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 382, 442, 701, 28134, 12, 529, 16, 14472, 682, 4672, 364, 14472, 316, 14472, 682, 30, 309, 14472, 18, 529, 422, 508, 30, 327, 14472, 327, 599, 225, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 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, 1104, 382, 442, 701, 28134, 12, 529, 16, 14472, 682, 4672, 364, 14472, 316, 14472, 682, 30, 309, 14472, 18, 529, 422, 508, 30, 327, 14472, 327, 599, 225, 2, -100, -100, -100, -100, -10...
buffer += 'timeout %s\n' % self.timeout
if self.timeout: buffer += 'timeout %s\n' % self.timeout
def write(self): """ write the client menu """ # takes global items, one by one
72428b8f17ac1a08eb43039c74d2924570b83bcd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/72428b8f17ac1a08eb43039c74d2924570b83bcd/menu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 4672, 3536, 1045, 326, 1004, 3824, 3536, 468, 5530, 2552, 1516, 16, 1245, 635, 1245, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 4672, 3536, 1045, 326, 1004, 3824, 3536, 468, 5530, 2552, 1516, 16, 1245, 635, 1245, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print ' changing %s : %s' % (r, f)
repos_path = '/' + relative_name(ctx.cvsroot, f[:-2]) print ' changing %s : %s' % (r, repos_path) dirname = os.path.dirname(repos_path) if dirname != '/': parts = string.split(dirname[1:], os.sep) for i in range(1, len(parts) + 1): parent_dir = '/' + string.join(parts[:i], '/') if fs.check_path(root, parent_dir, f_pool) == svn_node_none: print ' making dir:', parent_dir fs.make_dir(root, parent_dir, f_pool) if fs.check_path(root, repos_path, f_pool) == svn_node_none: created_file = 1 fs.make_file(root, repos_path, f_pool) else: created_file = 0 handler, baton = fs.apply_textdelta(root, repos_path, f_pool) try: statcache.stat(f) except os.error: dirname, fname = os.path.split(f) f = os.path.join(dirname, 'Attic', fname) statcache.stat(f) pipe = os.popen('co -q -p%s %s' % (r, f), 'r', 102400) if created_file: _delta.svn_txdelta_send_string(pipe.read(), handler, baton, f_pool) else: stream2 = util.svn_stream_from_stdio(pipe, f_pool) if repos_path == lastcommit[0]: infile2 = os.popen("co -q -p%s %s" % (lastcommit[1], f), "r", 102400) stream1 = util.svn_stream_from_stdio(infile2, f_pool) else: stream1 = fs.file_contents(root, repos_path, f_pool) txstream = _delta.svn_txdelta(stream1, stream2, f_pool) _delta.svn_txdelta_send_txstream(txstream, handler, baton, f_pool) infile2 = None pipe.close() util.svn_pool_clear(f_pool) lastcommit = (repos_path, r)
def commit(self): # commit this transaction print 'committing: %s, over %d seconds' % (time.ctime(self.t_min), self.t_max - self.t_min) for f, r in self.changes: print ' changing %s : %s' % (r, f) for f, r in self.deletes: print ' deleting %s : %s' % (r, f)
1ea553ef1f59c2ab034594d92c29d3b4b3e1eca7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6036/1ea553ef1f59c2ab034594d92c29d3b4b3e1eca7/cvs2svn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3294, 12, 2890, 4672, 468, 3294, 333, 2492, 1172, 296, 7371, 1787, 30, 738, 87, 16, 1879, 738, 72, 3974, 11, 738, 261, 957, 18, 21261, 12, 2890, 18, 88, 67, 1154, 3631, 365, 18, 88, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3294, 12, 2890, 4672, 468, 3294, 333, 2492, 1172, 296, 7371, 1787, 30, 738, 87, 16, 1879, 738, 72, 3974, 11, 738, 261, 957, 18, 21261, 12, 2890, 18, 88, 67, 1154, 3631, 365, 18, 88, ...
PSEUDOSTATE = "UML:Pseudostate","UML2:PseudoState"
PSEUDOSTATE = "UML:Pseudostate", "UML2:PseudoState", "UML2:Pseudostate"
def getGenerationOption(self, opt): return getattr(self.getGenerator(), opt, None)
1a739b3ca3427e4a12eb2891f1d295cbfe5114b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/1a739b3ca3427e4a12eb2891f1d295cbfe5114b0/XMIParser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 13842, 1895, 12, 2890, 16, 2153, 4672, 327, 3869, 12, 2890, 18, 588, 3908, 9334, 2153, 16, 599, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 13842, 1895, 12, 2890, 16, 2153, 4672, 327, 3869, 12, 2890, 18, 588, 3908, 9334, 2153, 16, 599, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
}
})
def list_themes(self, model): self.model = model curr_name = '' curr_version = '' if os.path.exists(self.AWN_CURRENT): curr = open(self.AWN_CURRENT, "rb") lines = curr.readlines() if len(lines) == 2: curr_name = lines[0].rstrip('\n') curr_version = lines[1].rstrip('\n') curr.close()
b4dd944b18fb6b6a53784d3074b6fb1e58257d0a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8416/b4dd944b18fb6b6a53784d3074b6fb1e58257d0a/awnTheme.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 17328, 12, 2890, 16, 938, 4672, 365, 18, 2284, 273, 938, 4306, 67, 529, 273, 875, 4306, 67, 1589, 273, 875, 309, 1140, 18, 803, 18, 1808, 12, 2890, 18, 37, 5665, 67, 15487, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 17328, 12, 2890, 16, 938, 4672, 365, 18, 2284, 273, 938, 4306, 67, 529, 273, 875, 4306, 67, 1589, 273, 875, 309, 1140, 18, 803, 18, 1808, 12, 2890, 18, 37, 5665, 67, 15487, ...
self.id = issue2id(issue)
self.id = obj2id(issue)
def __init__(self, issue): self.id = issue2id(issue) self.url = issue.absolute_url(1) self.collector_url = issue.aq_parent.absolute_url(1) self.text = '%s: %s' % (issue.getId(), issue.Title())
f7ae226449bba9b9bc932abc19cb489a87dbf461 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/f7ae226449bba9b9bc932abc19cb489a87dbf461/graphviz.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5672, 4672, 365, 18, 350, 273, 1081, 22, 350, 12, 13882, 13, 365, 18, 718, 273, 5672, 18, 12547, 67, 718, 12, 21, 13, 365, 18, 21356, 67, 718, 273, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5672, 4672, 365, 18, 350, 273, 1081, 22, 350, 12, 13882, 13, 365, 18, 718, 273, 5672, 18, 12547, 67, 718, 12, 21, 13, 365, 18, 21356, 67, 718, 273, 5...
"""
def parse_request(self, data): arr = data.split('\r\n') request = None
bf291c1c46a94087b5d6a33aea2672704b43731a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2934/bf291c1c46a94087b5d6a33aea2672704b43731a/child.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2293, 12, 2890, 16, 501, 4672, 2454, 273, 501, 18, 4939, 2668, 64, 86, 64, 82, 6134, 590, 273, 599, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2293, 12, 2890, 16, 501, 4672, 2454, 273, 501, 18, 4939, 2668, 64, 86, 64, 82, 6134, 590, 273, 599, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
('sjj', c_double, 1),
def LPXKKT_FIELDS(): return [ ('pe_ae_max', c_double), # largest absolute error ('pe_ae_row', c_int), # number of row with largest absolute error ('pe_re_max', c_double), # largest relative error ('pe_re_row', c_int), # number of row with largest relative error ('pe_quality', c_int), # quality of primal solution
b88b96f89d7110fff313acd5635a04eef37a525f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1322/b88b96f89d7110fff313acd5635a04eef37a525f/glpk.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 511, 52, 60, 47, 47, 56, 67, 12683, 13332, 327, 306, 7707, 347, 67, 8906, 67, 1896, 2187, 276, 67, 9056, 3631, 468, 12756, 4967, 555, 7707, 347, 67, 8906, 67, 492, 2187, 276, 67, 474...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 511, 52, 60, 47, 47, 56, 67, 12683, 13332, 327, 306, 7707, 347, 67, 8906, 67, 1896, 2187, 276, 67, 9056, 3631, 468, 12756, 4967, 555, 7707, 347, 67, 8906, 67, 492, 2187, 276, 67, 474...
def getDateFormatString( period ):
def get_date_format_string( period ):
def getDateFormatString( period ): """ for a given period (e.g. 'month', 'day', or some numeric interval such as 3600 (in secs)), return the format string that can be used with strftime to format that time to specify the times across that interval, but no more detailed. so, getDateFormatString( 'month' ) == '%Y-%m' getDateFormatString( 3600 ) == getDateFormatString( 'hour' ) == '%Y-%m-%d %H' getDateFormatString( None ) -> raise TypeError getDateFormatString( 'garbage' ) -> raise ValueError """ # handle the special case of 'month' which doesn't have # a static interval in seconds if isinstance( period, basestring ) and string.lower( period ) == 'month': result = '%Y-%m' else: filePeriodSecs = getPeriodSeconds( period ) formatPieces = ( '%Y', '-%m-%d', ' %H', '-%M', '-%S' ) intervals = ( secondsPerYear, secondsPerDay, secondsPerHour, secondsPerMinute, 1 ) mods = map( lambda interval: filePeriodSecs % interval, intervals ) formatPieces = formatPieces[ : mods.index( 0 ) + 1 ] result = string.join( formatPieces, '' ) return result
ccdd4176bbf664bc1e8b113fff77933c61ec889b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/865/ccdd4176bbf664bc1e8b113fff77933c61ec889b/datetools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 712, 67, 2139, 67, 1080, 12, 3879, 262, 30, 3536, 364, 279, 864, 3879, 261, 73, 18, 75, 18, 296, 7496, 2187, 296, 2881, 2187, 578, 2690, 6389, 3673, 4123, 487, 12396, 261, 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, 336, 67, 712, 67, 2139, 67, 1080, 12, 3879, 262, 30, 3536, 364, 279, 864, 3879, 261, 73, 18, 75, 18, 296, 7496, 2187, 296, 2881, 2187, 578, 2690, 6389, 3673, 4123, 487, 12396, 261, 2...
ids = proxy.search(cr, uid, [('object_id.model', '=', object)])
ids = proxy.search(cr, uid, [('object_id.model', '=', object), ('company_id','=',user_company_id)])
def _company_default_get(self, cr, uid, object=False, context=None): """ Check if the object for this company have a default value """ if not context: context = {} proxy = self.pool.get('multi_company.default') ids = proxy.search(cr, uid, [('object_id.model', '=', object)]) for rule in proxy.browse(cr, uid, ids, context): user = self.pool.get('res.users').browse(cr, uid, uid) if eval(rule.expression, {'context': context, 'user': user}): return rule.company_dest_id.id return self.pool.get('res.users').browse(cr, uid, uid).company_id.id
19d7cd3306ee8b32d29783227adfd4664dcbcc87 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/19d7cd3306ee8b32d29783227adfd4664dcbcc87/res_company.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 16840, 67, 1886, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 733, 33, 8381, 16, 819, 33, 7036, 4672, 3536, 2073, 309, 326, 733, 364, 333, 9395, 1240, 279, 805, 460, 3536, 309, 48...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16840, 67, 1886, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 733, 33, 8381, 16, 819, 33, 7036, 4672, 3536, 2073, 309, 326, 733, 364, 333, 9395, 1240, 279, 805, 460, 3536, 309, 48...
>>> ztapi.provideAdapter(ISchoolBellApplication,
>>> ztapi.provideAdapter(ISchoolBellApplication,
def doctest_ACLView(): r""" Set up for local grants: >>> from zope.app.annotation.interfaces import IAnnotatable >>> from zope.app.securitypolicy.interfaces import \ ... IPrincipalPermissionManager >>> from zope.app.securitypolicy.principalpermission import \ ... AnnotationPrincipalPermissionManager >>> setup.setUpAnnotations() >>> setup.setUpTraversal() >>> ztapi.provideAdapter(IAnnotatable, IPrincipalPermissionManager, ... AnnotationPrincipalPermissionManager) >>> from schoolbell.app.interfaces import ISchoolBellApplication >>> from schoolbell.app.interfaces import IApplicationPreferences >>> from schoolbell.app.app import getApplicationPreferences >>> ztapi.provideAdapter(ISchoolBellApplication, ... IApplicationPreferences, ... getApplicationPreferences) Let's set the security policy: >>> from zope.security.management import setSecurityPolicy >>> from zope.app.securitypolicy.zopepolicy import ZopeSecurityPolicy >>> old = setSecurityPolicy(ZopeSecurityPolicy) Suppose we have a SchoolBell app: >>> from schoolbell.app.app import SchoolBellApplication >>> app = SchoolBellApplication() >>> directlyProvides(app, IContainmentRoot) >>> persons = app['persons'] >>> from schoolbell.app.security import setUpLocalAuth >>> setUpLocalAuth(app) >>> from zope.app.component.hooks import setSite >>> setSite(app) We have a couple of persons and groups: >>> from schoolbell.app.app import Person, Group >>> app['persons']['1'] = Person('albert', title='Albert') >>> app['persons']['2'] = Person('marius', title='Marius') >>> app['groups']['3'] = Group('office') >>> app['groups']['4'] = Group('mgmt') We create an ACLView: >>> from schoolbell.app.browser.app import ACLView >>> View = SimpleViewClass("../templates/acl.pt", bases=(ACLView, )) >>> request = TestRequest() >>> class StubPrincipal: ... title = "Some user" ... >>> request.setPrincipal(StubPrincipal()) >>> view = View(app, request) The view has methods to list persons: >>> pprint(view.persons) [{'perms': [], 'id': u'sb.person.albert', 'title': 'Albert'}, {'perms': [], 'id': u'sb.person.marius', 'title': 'Marius'}] >>> pprint(view.groups) [{'perms': [], 'id': u'sb.group.3', 'title': 'office'}, {'perms': [], 'id': u'sb.group.4', 'title': 'mgmt'}] If we have an authenticated group and an unauthenticated group, we get then as well: >>> from zope.app.security.interfaces import IAuthentication >>> from zope.app.security.interfaces import IAuthenticatedGroup >>> from zope.app.security.interfaces import IUnauthenticatedGroup >>> from zope.app.security.principalregistry \ ... import UnauthenticatedGroup >>> from zope.app.security.principalregistry \ ... import AuthenticatedGroup >>> unauthenticated = UnauthenticatedGroup('zope.unauthenticated', ... 'Unauthenticated users', ... '') >>> ztapi.provideUtility(IUnauthenticatedGroup, unauthenticated) >>> authenticated = AuthenticatedGroup('zope.authenticated', ... 'Authenticated users', ... '') >>> ztapi.provideUtility(IAuthenticatedGroup, authenticated) >>> from zope.app.security.principalregistry import principalRegistry >>> ztapi.provideUtility(IAuthentication, principalRegistry) >>> principalRegistry.registerGroup(unauthenticated) >>> principalRegistry.registerGroup(authenticated) >>> pprint(view.groups) [{'perms': [], 'id': 'zope.authenticated', 'title': u'Authenticated users'}, {'id': 'zope.unauthenticated', 'perms': [], 'title': u'Unauthenticated users'}, {'perms': [], 'id': u'sb.group.3', 'title': 'office'}, {'perms': [], 'id': u'sb.group.4', 'title': 'mgmt'}] Also it knows a list of permissions to display: >>> pprint(view.permissions) [('schoolbell.view', u'View'), ('schoolbell.edit', u'Edit'), ('schoolbell.create', u'Create new objects'), ('schoolbell.viewCalendar', u'View calendar'), ('schoolbell.addEvent', u'Add events'), ('schoolbell.modifyEvent', u'Modify/delete events'), ('schoolbell.controlAccess', u'Control access'), ('schoolbell.manageMembership', u'Manage membership')] The view displays a matrix with groups and persons as rows and permisssions as columns: >>> print view() <BLANKLINE> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> ... <form method="post" action="http://127.0.0.1"> ... <h3> Access control for SchoolBell </h3> <fieldset> <legend>Permissions for Groups</legend> ... <table class="acl"> <tr class="header"> <th class="principal">Group</th> <th class="permission">View</th> <th class="permission">Edit</th> <th class="permission">Create new objects</th> <th class="permission">View calendar</th> <th class="permission">Add events</th> <th class="permission">Modify/delete events</th> <th class="permission">Control access</th> <th class="permission">Manage membership</th> </tr> ... <tr class="odd"> <th class="principal"> office <input type="hidden" value="1" name="marker-sb.group.3" /> </th> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.view" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.edit" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.create" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.viewCalendar" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.addEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.modifyEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.controlAccess" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.manageMembership" /> </td> </tr> ... <tr class="odd"> <th class="principal"> Albert <input type="hidden" value="1" name="marker-sb.person.albert" /> </th> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.view" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.edit" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.create" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.viewCalendar" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.addEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.modifyEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.controlAccess" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.manageMembership" /> </td> </tr> ... If we submit a form with a checkbox marked, a user gets a grant: >>> request = TestRequest(form={ ... 'marker-sb.person.albert': '1', ... 'marker-sb.person.marius': '1', ... 'marker-sb.group.3': '1', ... 'sb.person.albert': ['schoolbell.view', ... 'schoolbell.edit'], ... 'sb.person.marius': 'schoolbell.create', ... 'sb.group.3': 'schoolbell.create', ... 'UPDATE_SUBMIT': 'Set'}) >>> view = View(app, request) >>> result = view.update() Now the users should have permissions on app: >>> grants = IPrincipalPermissionManager(app) >>> grants.getPermissionsForPrincipal('sb.person.marius') [('schoolbell.create', PermissionSetting: Allow)] >>> pprint(grants.getPermissionsForPrincipal('sb.person.albert')) [('schoolbell.edit', PermissionSetting: Allow), ('schoolbell.view', PermissionSetting: Allow)] >>> grants.getPermissionsForPrincipal('sb.group.3') [('schoolbell.create', PermissionSetting: Allow)] >>> pprint(view.persons) [{'id': u'sb.person.albert', 'perms': ['schoolbell.view', 'schoolbell.edit'], 'title': 'Albert'}, {'id': u'sb.person.marius', 'perms': ['schoolbell.create'], 'title': 'Marius'}] >>> pprint(view.groups) [{'perms': [], 'id': 'zope.authenticated', 'title': u'Authenticated users'}, {'id': 'zope.unauthenticated', 'perms': [], 'title': u'Unauthenticated users'}, {'perms': ['schoolbell.create'], 'id': u'sb.group.3', 'title': 'office'}, {'perms': [], 'id': u'sb.group.4', 'title': 'mgmt'}] The view redirects to the context's default view: >>> request.response.getStatus() 302 >>> url = zapi.absoluteURL(app, request) >>> request.response.getHeader('Location') == url True If we render the form, we see the appropriate checkboxes checked: >>> request.setPrincipal(StubPrincipal()) >>> print view() <BLANKLINE> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> ... <tr class="odd"> <th class="principal"> office <input type="hidden" value="1" name="marker-sb.group.3" /> </th> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.view" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.edit" /> </td> <td class="permission"> <input type="checkbox" checked="checked" name="sb.group.3" value="schoolbell.create" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.viewCalendar" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.addEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.modifyEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.controlAccess" /> </td> <td class="permission"> <input type="checkbox" name="sb.group.3" value="schoolbell.manageMembership" /> </td> </tr> ... <tr class="odd"> <th class="principal"> Albert <input type="hidden" value="1" name="marker-sb.person.albert" /> </th> <td class="permission"> <input type="checkbox" checked="checked" name="sb.person.albert" value="schoolbell.view" /> </td> <td class="permission"> <input type="checkbox" checked="checked" name="sb.person.albert" value="schoolbell.edit" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.create" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.viewCalendar" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.addEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.modifyEvent" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.controlAccess" /> </td> <td class="permission"> <input type="checkbox" name="sb.person.albert" value="schoolbell.manageMembership" /> </td> </tr> ... If we submit a form without a submit button, nothing is changed: >>> request = TestRequest(form={ ... 'marker-sb.group.4': '1', ... 'sb.group.4': 'schoolbell.addEvent',}) >>> request.setPrincipal(StubPrincipal()) >>> view = View(app, request) >>> result = view.update() >>> grants.getPermissionsForPrincipal('sb.person.marius') [('schoolbell.create', PermissionSetting: Allow)] The user does not get redirected: >>> request.response.getStatus() 599 >>> url = zapi.absoluteURL(app, request) >>> request.response.getHeader('Location') However, if submit was clicked, unchecked permissions are revoked, and new ones granted: >>> request = TestRequest(form={ ... 'marker-sb.person.marius': '1', ... 'marker-sb.group.4': '1', ... 'sb.group.4': 'schoolbell.addEvent', ... 'UPDATE_SUBMIT': 'Set'}) >>> view = View(app, request) >>> result = view.update() >>> grants.getPermissionsForPrincipal('sb.person.marius') [] >>> grants.getPermissionsForPrincipal('sb.group.4') [('schoolbell.addEvent', PermissionSetting: Allow)] If the marker for a particular principal is not present in the request, permission settings for that principal are left untouched: >>> grants.getPermissionsForPrincipal('sb.group.3') [('schoolbell.create', PermissionSetting: Allow)] If the cancel button is hit, the changes are not applied, but the browser is redirected to the default view for context: >>> request = TestRequest(form={ ... 'marker-sb.person.marius': '1', ... 'sb.person.marius': 'schoolbell.editEvent', ... 'CANCEL': 'Cancel'}) >>> view = View(app, request) >>> result = view.update() >>> grants.getPermissionsForPrincipal('sb.person.marius') [] >>> grants.getPermissionsForPrincipal('sb.group.4') [('schoolbell.addEvent', PermissionSetting: Allow)] >>> request.response.getStatus() 302 >>> url = zapi.absoluteURL(app, request) >>> request.response.getHeader('Location') == url True """
492081c988dd0c846f19a6b18ebdd23544055fe5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/492081c988dd0c846f19a6b18ebdd23544055fe5/test_app.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31263, 395, 67, 9486, 1767, 13332, 436, 8395, 1000, 731, 364, 1191, 25638, 30, 225, 4080, 628, 998, 1306, 18, 2910, 18, 11495, 18, 15898, 1930, 467, 11280, 8163, 4080, 628, 998, 1306, 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, 31263, 395, 67, 9486, 1767, 13332, 436, 8395, 1000, 731, 364, 1191, 25638, 30, 225, 4080, 628, 998, 1306, 18, 2910, 18, 11495, 18, 15898, 1930, 467, 11280, 8163, 4080, 628, 998, 1306, 18...
self.parent.gauge1.SetValue(min((100.0,copied/total*100.0)))
progress=min((100.0,copied/total*100.0)) self.parent.gauge1.SetValue(progress) self.parent.list.SetStringItem(self.parent.converting,ID_COL_VIDSTAT,self.parent.meta[self.parent.videos[self.parent.converting]]['status']+' ['+str(int(progress))+'%]')
def run(self): self.abort=False if not self.abort: self.uri=self.uris[0] self.parent.gauge1.SetValue(0.0) self.parent.thisvideo.append(self.parent.videos[self.parent.converting]) self.filename=REGEX_FILE_CLEANUP_FILENAME.sub('',self.parent.meta[self.parent.videos[self.parent.converting]]['name']) self.profile=int(self.parent.meta[self.parent.videos[self.parent.converting]]['profile']) self.outdir=self.parent.prefs.getp(self.profile,'Outdir') if self.outdir[-1:]==os.sep: self.outdir=self.outdir[0:-1] if not os.path.lexists(self.outdir): os.makedirs(self.outdir) elif not os.path.isdir(self.outdir): os.remove(self.outdir) os.makedirs(self.outdir) self.outdir=self.outdir+os.sep if os.path.lexists(self.uri): self.stream=self.uri # It's a file stream, ffmpeg will take care of it else: self.stream='-' # It's another stream, spawn a downloader thread to take care of it and feed the content to ffmpeg via stdin if self.profile==-1: # Do not encode, just copy try: failed=False if self.stream=='-': # Spawn a downloader src=DamnURLPicker(self.uris) total=int(src.info()['Content-Length']) try: tmpuri=src.info()['Content-Disposition'][src.info()['Content-Disposition'].find('filename=')+9:] except: tmpuri='video.avi' # And pray for the best! else: # Just copy the file, lol total=int(os.lstat(self.stream).st_size) src=open(self.stream,'rb') tmpuri=self.stream if REGEX_URI_EXTENSION_EXTRACT.search(tmpuri): ext='.'+REGEX_URI_EXTENSION_EXTRACT.sub('\\1',tmpuri) else: ext='.avi' # And pray for the best again! self.filename=self.getfinalfilename(self.outdir,self.filename,ext) dst=open(self.outdir+self.filename+ext,'wb') keepgoing=True copied=0.0 self.parent.SetStatusText('Copying '+self.parent.meta[self.parent.videos[self.parent.converting]]['name']+' to '+self.filename+ext+'...') while keepgoing and not self.abort: i=src.read(256) if len(i): dst.write(i) copied+=256.0 else: copied=total keepgoing=False self.parent.gauge1.SetValue(min((100.0,copied/total*100.0))) except: failed=True self.grabberrun=False if self.abort or failed: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Failure.' self.parent.list.SetStringItem(self.parent.converting,ID_COL_VIDSTAT,'Failure.') else: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Success!' self.parent.list.SetStringItem(self.parent.converting,ID_COL_VIDSTAT,'Success!') self.parent.go(aborted=self.abort) return os_exe_ext='' if DV_OS_NAME=='nt': os_exe_ext='.exe' elif DV_OS_NAME=='mac': os_exe_ext='osx' self.passes=1 cmd=[DV_BIN_PATH+'ffmpeg'+os_exe_ext,'-i','?DAMNVID_VIDEO_STREAM?','-y','-title',self.parent.meta[self.parent.videos[self.parent.converting]]['name'],'-comment','Converted by DamnVid '+DV_VERSION+'.','-deinterlace','-passlogfile',DV_TMP_PATH+'pass'] for i in DV_PREFERENCES.keys(): if i[0:25]=='damnvid-profile:encoding_': i=i[16:] pref=self.parent.prefs.getp(self.profile,i) if pref: if type(DV_PREFERENCES['damnvid-profile:'+i]['kind']) is type(''): if DV_PREFERENCES['damnvid-profile:'+i]['kind'][0]=='%': pref=str(round(float(pref),0)) # Round if i=='encoding_pass': pref='?DAMNVID_VIDEO_PASS?' cmd.extend(['-'+i[9:],pref]) vidformat=self.parent.prefs.getp(self.profile,'Encoding_f') self.vcodec=self.parent.prefs.getp(self.profile,'Encoding_vcodec') self.totalpasses=self.parent.prefs.getp(self.profile,'Encoding_pass') if not self.totalpasses: self.totalpasses=1 else: self.totalpasses=int(self.totalpasses) if vidformat and DV_FILE_EXT.has_key(vidformat): ext='.'+DV_FILE_EXT[vidformat] else: if self.vcodec and DV_FILE_EXT_BY_CODEC.has_key(self.vcodec): ext='.'+DV_FILE_EXT_BY_CODEC[self.vcodec] else: ext='.avi' flags=[] if self.vcodec and DV_CODEC_ADVANCED_CL.has_key(self.vcodec): for o in DV_CODEC_ADVANCED_CL[self.vcodec]: if type(o) is type(''): if o not in flags: # If the flag is already there, don't add it again flags.append(o) else: if '-'+o[0] not in cmd: # If the option is already there, don't overwrite it cmd.extend(['-'+o[0],o[1]]) if len(flags): cmd.extend(['-flags',''.join(flags)]) self.filename=self.getfinalfilename(self.outdir,self.filename,ext) self.filenamenoext=self.filename self.tmpfilename=self.gettmpfilename(DV_TMP_PATH,self.filenamenoext,ext) cmd.append('?DAMNVID_OUTPUT_FILE?') self.filename=self.filenamenoext+ext self.duration=None self.parent.SetStatusText('Converting '+self.parent.meta[self.parent.videos[self.parent.converting]]['name']+' to '+self.filename+'...') while int(self.passes)<=int(self.totalpasses) and not self.abort: if self.totalpasses!=1: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Pass '+str(self.passes)+'/'+str(self.totalpasses)+'...' self.parent.list.SetStringItem(self.parent.converting,ID_COL_VIDSTAT,'Pass '+str(self.passes)+'/'+str(self.totalpasses)+'...') if self.passes!=1: self.stream=DV_TMP_PATH+self.tmpfilename self.tmpfilename=self.gettmpfilename(DV_TMP_PATH,self.filenamenoext,ext) self.process=DamnSpawner(self.cmd2str(cmd),stderr=subprocess.PIPE,stdin=subprocess.PIPE,cwd=os.path.dirname(DV_TMP_PATH)) if self.stream=='-': self.feeder=DamnDownloader(self.uris,self.process.stdin) self.feeder.start() curline='' while self.process.poll()==None and not self.abort: c=self.process.stderr.read(1) curline+=c if c=="\r" or c=="\n": self.parseLine(curline) curline='' self.passes+=1 self.parent.gauge1.SetValue(100.0) result=self.process.poll() # The process is complete, but .poll() still returns the process's return code time.sleep(.25) # Wait a bit self.grabberrun=False # That'll make the DamnConverterGrabber wake up just in case if result and os.path.lexists(DV_TMP_PATH+self.tmpfilename): os.remove(DV_TMP_PATH+self.tmpfilename) # Delete the output file if ffmpeg has exitted with a bad return code for i in os.listdir(os.path.dirname(DV_TMP_PATH)): if i[0:8]=='damnvid-': i=i[8:] if i==self.tmpfilename and not result: try: os.rename(DV_TMP_PATH+i,self.outdir+self.filename) except: # Maybe the file still isn't unlocked, it happens... Wait moar and retry try: time.sleep(2) os.rename(DV_TMP_PATH+i,self.outdir+self.filename) except: # Now this is really bad, alert the user dlg=wx.MessageDialog(None,'DamnVid successfully converted the file but something prevents it from moving it to the output directory.\nAll hope is not lost, you can still move the file by yourself. It is here:\n'+DV_TMP_PATH+i,'Cannot move file!',wx.OK|wx.ICON_EXCLAMATION) dlg.SetIcon(DV_ICON) dlg.ShowModal() dlg.Destroy() else: try: os.remove(DV_TMP_PATH+i) except: pass if not result: self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Success!' self.parent.list.SetStringItem(self.parent.converting,ID_COL_VIDSTAT,'Success!') self.parent.go(aborted=self.abort) return self.parent.meta[self.parent.videos[self.parent.converting]]['status']='Failure.' self.parent.list.SetStringItem(self.parent.converting,ID_COL_VIDSTAT,'Failure.') self.parent.go(aborted=self.abort)
c40fdb2df1fddd26432a1c83c6925db79812c2b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/c40fdb2df1fddd26432a1c83c6925db79812c2b0/DamnVid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 365, 18, 18623, 33, 8381, 309, 486, 365, 18, 18623, 30, 365, 18, 1650, 33, 2890, 18, 23510, 63, 20, 65, 365, 18, 2938, 18, 75, 8305, 21, 18, 694, 620, 12, 20,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 365, 18, 18623, 33, 8381, 309, 486, 365, 18, 18623, 30, 365, 18, 1650, 33, 2890, 18, 23510, 63, 20, 65, 365, 18, 2938, 18, 75, 8305, 21, 18, 694, 620, 12, 20,...
subRequests = request.getSubRequests(requestType)
subRequests = request.getSubRequests(requestType)['Value']
def update(self,request): """ Add subrequests from another request """ requestTypes = request.getSubRequestTypes()['Value'] for requestType in requestTypes: subRequests = request.getSubRequests(requestType) self.setSubRequests(requestType,subRequests) return S_OK()
091dec634e8e8960027b1338e2638cb55289c170 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/091dec634e8e8960027b1338e2638cb55289c170/RequestContainer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 2293, 4672, 3536, 1436, 720, 11420, 628, 4042, 590, 3536, 590, 2016, 273, 590, 18, 588, 1676, 691, 2016, 1435, 3292, 620, 3546, 364, 27179, 316, 590, 2016, 30, 720, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 2293, 4672, 3536, 1436, 720, 11420, 628, 4042, 590, 3536, 590, 2016, 273, 590, 18, 588, 1676, 691, 2016, 1435, 3292, 620, 3546, 364, 27179, 316, 590, 2016, 30, 720, ...
print "accept call Caller called"
logger.debug("accept call Caller called")
def accept_call(self,emission): #call_id = emission.part_text_get('active_call') #print call_id #self.gsm.gsm_call.Activate(call_id) print "accept call Caller called" emission.signal_emit("activate_call", "*")
01c25941dcc46b5166dcddd3aeed3ae3b26b48e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/01c25941dcc46b5166dcddd3aeed3ae3b26b48e6/paroli-dialer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2791, 67, 1991, 12, 2890, 16, 351, 19710, 4672, 468, 1991, 67, 350, 273, 801, 19710, 18, 2680, 67, 955, 67, 588, 2668, 3535, 67, 1991, 6134, 468, 1188, 745, 67, 350, 468, 2890, 18, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2791, 67, 1991, 12, 2890, 16, 351, 19710, 4672, 468, 1991, 67, 350, 273, 801, 19710, 18, 2680, 67, 955, 67, 588, 2668, 3535, 67, 1991, 6134, 468, 1188, 745, 67, 350, 468, 2890, 18, 5...
if self.Sort>=1 and self.Sort!=3 and self.Sort !=5:
if self.Sort>=2 and self.Sort!=4 and self.Sort !=6:
def sort(self): text=[] if self.Sort==4: self.text.sort(self.compareDist) elif self.Sort==2 or self.Sort==0: self.text.sort(lambda a,b:int(a[self.Sort])-int(b[self.Sort])) else: if self.Sort>5: self.sortBy=self.Sort+1 else: self.sortBy=self.Sort self.text.sort(self.compare) #print self.text if self.Sort>=1 and self.Sort!=3 and self.Sort !=5: self.text.reverse()
f6b6b724b64646141604db59c794c0c0ee707f2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/f6b6b724b64646141604db59c794c0c0ee707f2d/OWCN2RulesViewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1524, 12, 2890, 4672, 977, 33, 8526, 309, 365, 18, 4416, 631, 24, 30, 365, 18, 955, 18, 3804, 12, 2890, 18, 9877, 5133, 13, 1327, 365, 18, 4416, 631, 22, 578, 365, 18, 4416, 631, 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, 1524, 12, 2890, 4672, 977, 33, 8526, 309, 365, 18, 4416, 631, 24, 30, 365, 18, 955, 18, 3804, 12, 2890, 18, 9877, 5133, 13, 1327, 365, 18, 4416, 631, 22, 578, 365, 18, 4416, 631, 2...
result = self.jobDB.getCounters(['Status','Site'])
result = self.jobDB.getCounters(['Status','Site'],{},'')
def execute(self): """ Main execution method """
a6a17ed18f384abb9b41dc091feefd09e74af945 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/a6a17ed18f384abb9b41dc091feefd09e74af945/JobHistoryAgent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 4672, 3536, 12740, 4588, 707, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 4672, 3536, 12740, 4588, 707, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
return '<Uninitialized %r'%(self.TYPE,)
return '<Uninitialized %r>'%(self.TYPE,)
def __repr__(self): return '<Uninitialized %r'%(self.TYPE,)
0c55b3ce928e965969ca2514cbeb5bc9e6fe3646 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/0c55b3ce928e965969ca2514cbeb5bc9e6fe3646/lltype.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 2368, 984, 13227, 738, 86, 1870, 17105, 2890, 18, 2399, 16, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 2368, 984, 13227, 738, 86, 1870, 17105, 2890, 18, 2399, 16, 13, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
fileName = fileName.lstrip('/')
fileName = fileName.lstrip( '/' )
def getCurrentURL(self,fileName): """ Obtain the current file URL from the current working directory and the filename """ if fileName: if fileName[0] == '/': fileName = fileName.lstrip('/') try: fullUrl = '%s://%s:%s%s%s/%s' % (self.protocol,self.host,self.port,self.wspath,self.cwd,fileName) fullUrl = fullUrl.rstrip('/') return S_OK(fullUrl) except Exception,x: errStr = "Failed to create URL %s" % x return S_ERROR(errStr)
70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5175, 1785, 12, 2890, 16, 17812, 4672, 3536, 24850, 326, 783, 585, 1976, 628, 326, 783, 5960, 1867, 471, 326, 1544, 3536, 309, 3968, 30, 309, 3968, 63, 20, 65, 422, 2023, 30, 3968, 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, 5175, 1785, 12, 2890, 16, 17812, 4672, 3536, 24850, 326, 783, 585, 1976, 628, 326, 783, 5960, 1867, 471, 326, 1544, 3536, 309, 3968, 30, 309, 3968, 63, 20, 65, 422, 2023, 30, 3968, 273...
pkg = PimpPackage(self, dict(p))
p = dict(p) flavor = p.get('Flavor') if flavor == 'source': pkg = PimpPackage_source(self, p) elif flavor == 'binary': pkg = PimpPackage_binary(self, p) else: pkg = PimpPackage(self, dict(p))
def _appendPackages(self, packages): """Given a list of dictionaries containing package descriptions create the PimpPackage objects and append them to our internal storage.""" for p in packages: pkg = PimpPackage(self, dict(p)) self._packages.append(pkg)
0dacac48b92563807267c789889eadc8a5b99044 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0dacac48b92563807267c789889eadc8a5b99044/pimp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6923, 11425, 12, 2890, 16, 5907, 4672, 3536, 6083, 279, 666, 434, 16176, 4191, 2181, 15550, 752, 326, 453, 14532, 2261, 2184, 471, 714, 2182, 358, 3134, 2713, 2502, 12123, 225, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6923, 11425, 12, 2890, 16, 5907, 4672, 3536, 6083, 279, 666, 434, 16176, 4191, 2181, 15550, 752, 326, 453, 14532, 2261, 2184, 471, 714, 2182, 358, 3134, 2713, 2502, 12123, 225, 364, ...
all_opt["login_timeout"]["default"] = 15 all_opt["secure"]["default"] = 1
all_opt["login_timeout"]["default"] = "15" all_opt["secure"]["default"] = "1"
def main(): device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", "action", "ipaddr", "login", "passwd", "passwd_script", "secure", "identity_file", "partition", "managed", "hmc_version", "cmd_prompt", "separator", "inet4_only", "inet6_only", "ipport", "power_timeout", "shell_timeout", "login_timeout", "power_wait" ] atexit.register(atexit_handler) all_opt["login_timeout"]["default"] = 15 all_opt["secure"]["default"] = 1 options = check_input(device_opt, process_input(device_opt)) ## ## Fence agent specific settings and default values ##### if 0 == options.has_key("-c"): options["-c"] = [ ":~>", "]\$", "\$ " ] show_docs(options) if 0 == options.has_key("-s"): fail_usage("Failed: You have to enter name of managed system") if (0 == ["list", "monitor"].count(options["-o"].lower())) and (0 == options.has_key("-n")): fail_usage("Failed: You have to enter name of the partition") if 1 == options.has_key("-H") and (options["-H"] != "3" and options["-H"] != "4"): fail_usage("Failed: You have to enter valid version number: 3 or 4") ## ## Operate the fencing device #### conn = fence_login(options) result = fence_action(conn, options, set_power_status, get_power_status, get_lpar_list) ## ## Logout from system ###### try: conn.send("quit\r\n") conn.close() except exceptions.OSError: pass except pexpect.ExceptionPexpect: pass sys.exit(result)
55937766711d33f8941682cc76ac9fae1661c1ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6868/55937766711d33f8941682cc76ac9fae1661c1ca/fence_lpar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2346, 67, 3838, 273, 306, 225, 315, 5201, 3113, 315, 1589, 3113, 315, 5629, 3113, 315, 20380, 3113, 315, 11369, 3113, 315, 4148, 3113, 315, 1128, 3113, 315, 625, 4793, 3113, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2346, 67, 3838, 273, 306, 225, 315, 5201, 3113, 315, 1589, 3113, 315, 5629, 3113, 315, 20380, 3113, 315, 11369, 3113, 315, 4148, 3113, 315, 1128, 3113, 315, 625, 4793, 3113, ...
url = posixpath.join(url, path.lstrip('/')) args += [url, dir_]
final_url = posixpath.join(url, path.lstrip('/')) args += [final_url, dir_]
def checkout(ctxt, url, path=None, revision=None, dir_='.', verbose=False): """Perform a checkout from a Subversion repository. :param ctxt: the build context :type ctxt: `Context` :param url: the URL of the repository :param path: the path inside the repository :param revision: the revision to check out :param dir_: the name of a local subdirectory to check out into :param verbose: whether to log the list of checked out files """ args = ['checkout'] if revision: args += ['-r', revision] if path: url = posixpath.join(url, path.lstrip('/')) args += [url, dir_] cofilter = None if not verbose: cre = re.compile(r'^[AU]\s.*$') cofilter = lambda s: cre.sub('', s) from bitten.build import shtools returncode = shtools.execute(ctxt, file_='svn', args=args, filter_=cofilter) if returncode != 0: ctxt.error('svn checkout failed (%s)' % returncode)
9acdf80db252bd69d09401577f9a829c996081f3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4547/9acdf80db252bd69d09401577f9a829c996081f3/svntools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13926, 12, 20364, 16, 880, 16, 589, 33, 7036, 16, 6350, 33, 7036, 16, 1577, 67, 2218, 1093, 16, 3988, 33, 8381, 4672, 3536, 4990, 279, 13926, 628, 279, 2592, 1589, 3352, 18, 225, 294, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13926, 12, 20364, 16, 880, 16, 589, 33, 7036, 16, 6350, 33, 7036, 16, 1577, 67, 2218, 1093, 16, 3988, 33, 8381, 4672, 3536, 4990, 279, 13926, 628, 279, 2592, 1589, 3352, 18, 225, 294, ...
try: os.remove(test_support.TESTFN) except os.error: pass try: os.rmdir(test_support.TESTFN) except os.error: pass
def test_isfile(self): self.assertIs(posixpath.isfile(test_support.TESTFN), False) f = open(test_support.TESTFN, "wb") try: f.write("foo") f.close() self.assertIs(posixpath.isfile(test_support.TESTFN), True) os.remove(test_support.TESTFN) os.mkdir(test_support.TESTFN) self.assertIs(posixpath.isfile(test_support.TESTFN), False) os.rmdir(test_support.TESTFN) finally: if not f.close(): f.close() try: os.remove(test_support.TESTFN) except os.error: pass try: os.rmdir(test_support.TESTFN) except os.error: pass
a11ac07dffa1601eaedcb5c761a2ded5e280c53b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/a11ac07dffa1601eaedcb5c761a2ded5e280c53b/test_posixpath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 291, 768, 12, 2890, 4672, 365, 18, 11231, 2520, 12, 24463, 803, 18, 291, 768, 12, 3813, 67, 13261, 18, 16961, 19793, 3631, 1083, 13, 284, 273, 1696, 12, 3813, 67, 13261, 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, 291, 768, 12, 2890, 4672, 365, 18, 11231, 2520, 12, 24463, 803, 18, 291, 768, 12, 3813, 67, 13261, 18, 16961, 19793, 3631, 1083, 13, 284, 273, 1696, 12, 3813, 67, 13261, 18, ...
propValueStr = propValue elif isinstance(propValue, str):
if isList: propValueStrList = [] for val in propValue: propValueStrList.append(val) else: propValueStrList = [propValue] elif (propType == str):
def _getEntryXmlDoc(self, properties=None, contentFile=None, contentType=None, contentEncoding=None):
133f2315cde4229ed5e43da09b1eb0804ea58cd9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11664/133f2315cde4229ed5e43da09b1eb0804ea58cd9/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 1622, 4432, 1759, 12, 2890, 16, 1790, 33, 7036, 16, 913, 812, 33, 7036, 16, 5064, 33, 7036, 16, 913, 4705, 33, 7036, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 1622, 4432, 1759, 12, 2890, 16, 1790, 33, 7036, 16, 913, 812, 33, 7036, 16, 5064, 33, 7036, 16, 913, 4705, 33, 7036, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
_int_types = [Byte, Short, Integer, Long]
def __call__(self, args): return [ coercer(arg) for coercer, arg in zip(self._coercers, args) ]
e5c1e8a1557d61bad6015fa881c8ec620c33b6c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/e5c1e8a1557d61bad6015fa881c8ec620c33b6c4/javaargcoercer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 833, 4672, 327, 306, 1825, 264, 2750, 12, 3175, 13, 364, 1825, 264, 2750, 16, 1501, 316, 3144, 12, 2890, 6315, 2894, 12610, 414, 16, 833, 13, 308, 2, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 833, 4672, 327, 306, 1825, 264, 2750, 12, 3175, 13, 364, 1825, 264, 2750, 16, 1501, 316, 3144, 12, 2890, 6315, 2894, 12610, 414, 16, 833, 13, 308, 2, -...
def CheckTryJobExecution(input_api, output_api): outputs = [] if not input_api.change.issue or not input_api.change.patchset: return outputs url = "http://codereview.chromium.org/%d/get_build_results/%d" % ( input_api.change.issue, input_api.change.patchset) PLATFORMS = ('win', 'linux', 'mac') try: connection = input_api.urllib2.urlopen(url) values = [item.split('|', 2) for item in connection.read().splitlines()] connection.close() if not values: return outputs values = dict([[v[0], [v[1], v[2]]] for v in values]) for platform in PLATFORMS: values.setdefault(platform, ['not started', '']) message = None non_success = [k.upper() for k,v in values.iteritems() if v[0] != 'success'] if 'failure' in [v[0] for v in values.itervalues()]: message = 'Try job failures on %s!\n' % ', '.join(non_success) elif non_success: message = ('Unfinished (or not even started) try jobs on ' '%s.\n') % ', '.join(non_success) if message: message += ( 'Is try server wrong or broken? Please notify maruel@chromium.org. ' 'Thanks.\n') outputs.append(output_api.PresubmitPromptWarning(message=message)) except input_api.urllib2.HTTPError, e: if e.code == 404: outputs.append(output_api.PresubmitNotifyResult( 'You should try the patch first.')) else: outputs.append(output_api.PresubmitNotifyResult( 'Got %s while looking for try job status.' % str(e))) return outputs def CheckTreeIsOpen(input_api, output_api, url, closed, url_text): """Similar to the one in presubmit_canned_checks except it shows an helpful status text instead. """ assert(input_api.is_committing) try: connection = input_api.urllib2.urlopen(url) status = connection.read() connection.close() if input_api.re.match(closed, status): long_text = status + '\n' + url try: connection = input_api.urllib2.urlopen(url_text) long_text = connection.read().strip() connection.close() except IOError: pass return [output_api.PresubmitError("The tree is closed.", long_text=long_text)] except IOError: pass return [] def CheckPendingBuilds(input_api, output_api, url, max_pendings, ignored): try: connection = input_api.urllib2.urlopen(url) raw_data = connection.read() connection.close() try: import simplejson data = simplejson.loads(raw_data) except ImportError: patched_data = raw_data.replace('null', 'None') patched_data = patched_data.replace('false', 'False') patched_data = patched_data.replace('true', 'True') data = eval(patched_data) out = [] for (builder_name, builder) in data.iteritems(): if builder_name in ignored: continue pending_builds_len = len(builder.get('pending_builds', [])) if pending_builds_len > max_pendings: out.append('%s has %d build(s) pending' % (builder_name, pending_builds_len)) if out: return [output_api.PresubmitPromptWarning( 'Build(s) pending. It is suggested to wait that no more than %d ' 'builds are pending.' % max_pendings, long_text='\n'.join(out))] except IOError: pass return []
def CheckTryJobExecution(input_api, output_api): outputs = [] if not input_api.change.issue or not input_api.change.patchset: return outputs url = "http://codereview.chromium.org/%d/get_build_results/%d" % ( input_api.change.issue, input_api.change.patchset) PLATFORMS = ('win', 'linux', 'mac') try: connection = input_api.urllib2.urlopen(url) # platform|status|url values = [item.split('|', 2) for item in connection.read().splitlines()] connection.close() if not values: # It returned an empty list. Probably a private review. return outputs # Reformat as an dict of platform: [status, url] values = dict([[v[0], [v[1], v[2]]] for v in values]) for platform in PLATFORMS: values.setdefault(platform, ['not started', '']) message = None non_success = [k.upper() for k,v in values.iteritems() if v[0] != 'success'] if 'failure' in [v[0] for v in values.itervalues()]: message = 'Try job failures on %s!\n' % ', '.join(non_success) elif non_success: message = ('Unfinished (or not even started) try jobs on ' '%s.\n') % ', '.join(non_success) if message: message += ( 'Is try server wrong or broken? Please notify maruel@chromium.org. ' 'Thanks.\n') outputs.append(output_api.PresubmitPromptWarning(message=message)) except input_api.urllib2.HTTPError, e: if e.code == 404: # Fallback to no try job. # TODO(maruel): Change to a PresubmitPromptWarning once the try server is # stable enough and it seems to work fine. outputs.append(output_api.PresubmitNotifyResult( 'You should try the patch first.')) else: # Another HTTP error happened, warn the user. # TODO(maruel): Change to a PresubmitPromptWarning once it deemed to work # fine. outputs.append(output_api.PresubmitNotifyResult( 'Got %s while looking for try job status.' % str(e))) return outputs
edce9ddb96701a2ab3fa50b6ec219bff6aae2c97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/edce9ddb96701a2ab3fa50b6ec219bff6aae2c97/PRESUBMIT.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2073, 7833, 31498, 12, 2630, 67, 2425, 16, 876, 67, 2425, 4672, 6729, 273, 5378, 309, 486, 810, 67, 2425, 18, 3427, 18, 13882, 578, 486, 810, 67, 2425, 18, 3427, 18, 2272, 542, 30, 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, 2073, 7833, 31498, 12, 2630, 67, 2425, 16, 876, 67, 2425, 4672, 6729, 273, 5378, 309, 486, 810, 67, 2425, 18, 3427, 18, 13882, 578, 486, 810, 67, 2425, 18, 3427, 18, 2272, 542, 30, 3...
elif item in run:
elif item in (x.name for x in run):
def buildShallowDeps(): # Notes: # load time = before class = require # runtime = after class = use
9fcc2e06b607aced774242b3f05d49061c46732e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/9fcc2e06b607aced774242b3f05d49061c46732e/DependencyLoader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 1555, 5965, 14430, 13332, 468, 29584, 30, 468, 1262, 813, 273, 1865, 667, 273, 2583, 468, 3099, 273, 1839, 667, 273, 999, 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, 0, 0, 0, 0, 0, 0, 0, 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, 1361, 1555, 5965, 14430, 13332, 468, 29584, 30, 468, 1262, 813, 273, 1865, 667, 273, 2583, 468, 3099, 273, 1839, 667, 273, 999, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
protocol = 'NTLMSSP\000' type = '\003\000' head = protocol + type + '\000\000'
protocol = 'NTLMSSP\x00' type = '\x03' head = protocol + type + '\x00'*3
def create_message3 (nonce, domain, username, host, flags="\x82\x01", lm_hashed_pw=None, nt_hashed_pw=None, ntlm_mode=0): protocol = 'NTLMSSP\000' #name type = '\003\000' #type 3 head = protocol + type + '\000\000' domain_rec = record(domain) user_rec = record(username) host_rec = record(host) additional_rec = record('') if lm_hashed_pw: lm_rec = record(ntlm_procs.calc_resp(lm_hashed_pw, nonce)) else: lm_rec = record('') if nt_hashed_pw: nt_rec = record(ntlm_procs.calc_resp(nt_hashed_pw, nonce)) else: nt_rec = record('') # length of the head and five infos for LM, NT, Domain, User, Host domain_offset = len(head) + 5 * 8 # and unknown record info and flags' lenght if nltm_mode == 0: domain_offset = domain_offset + 8 + len(flags) # create info fields domain_rec.create_record_info(domain_offset) user_rec.create_record_info(domain_rec.next_offset) host_rec.create_record_info(user_rec.next_offset) lm_rec.create_record_info(host_rec.next_offset) nt_rec.create_record_info(lm_rec.next_offset) additional_rec.create_record_info(nt_rec.next_offset) # data part of the message 3 data_part = domain_rec.data + user_rec.data + host_rec.data + lm_rec.data + nt_rec.data # build message 3 m3 = head + lm_rec.record_info + nt_rec.record_info + \ domain_rec.record_info + user_rec.record_info + host_rec.record_info # Experimental feature !!! if ntlm_mode == 0: m3 += additional_rec.record_info + flags m3 += data_part # Experimental feature !!! if ntlm_mode == 0: m3 += additional_rec.data return m3
9b3b7bd7d9bd500538e8ae441a173f0dcd4087d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/9b3b7bd7d9bd500538e8ae441a173f0dcd4087d4/ntlm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2150, 23, 261, 12824, 16, 2461, 16, 2718, 16, 1479, 16, 2943, 1546, 64, 92, 11149, 64, 92, 1611, 3113, 14966, 67, 2816, 329, 67, 14921, 33, 7036, 16, 9513, 67, 2816, 329, 67...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2150, 23, 261, 12824, 16, 2461, 16, 2718, 16, 1479, 16, 2943, 1546, 64, 92, 11149, 64, 92, 1611, 3113, 14966, 67, 2816, 329, 67, 14921, 33, 7036, 16, 9513, 67, 2816, 329, 67...
logging.info("error splitting rbname %s for job %s"%(jobGridId,self.bossStrJobI))
logging.info("error splitting rbname %s for job %s"%(jobGridId,self.bossStrJobId))
def editDashboardInfo(self, dashboardInfo): """ _editDashboardInfo_ Add data about submission to DashboardInfo dictionary before it is published to the dashboard If dashboardInfo is None, it is not available for this job.
415f62484b636ef43af9280472e43757ab1aece6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/415f62484b636ef43af9280472e43757ab1aece6/LCGSubmitter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 14830, 966, 12, 2890, 16, 11825, 966, 4672, 3536, 389, 4619, 14830, 966, 67, 225, 1436, 501, 2973, 8515, 358, 18230, 966, 3880, 1865, 518, 353, 9487, 358, 326, 11825, 282, 971, 118...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3874, 14830, 966, 12, 2890, 16, 11825, 966, 4672, 3536, 389, 4619, 14830, 966, 67, 225, 1436, 501, 2973, 8515, 358, 18230, 966, 3880, 1865, 518, 353, 9487, 358, 326, 11825, 282, 971, 118...
self.print_topics(self.misc_header, help.keys(),15,80)
self.print_topics(self.misc_header, list(help.keys()),15,80)
def do_help(self, arg): if arg: # XXX check arg syntax try: func = getattr(self, 'help_' + arg) except AttributeError: try: doc=getattr(self, 'do_' + arg).__doc__ if doc: self.stdout.write("%s\n"%str(doc)) return except AttributeError: pass self.stdout.write("%s\n"%str(self.nohelp % (arg,))) return func() else: names = self.get_names() cmds_doc = [] cmds_undoc = [] help = {} for name in names: if name[:5] == 'help_': help[name[5:]]=1 names.sort() # There can be duplicates if routines overridden prevname = '' for name in names: if name[:3] == 'do_': if name == prevname: continue prevname = name cmd=name[3:] if cmd in help: cmds_doc.append(cmd) del help[cmd] elif getattr(self, name).__doc__: cmds_doc.append(cmd) else: cmds_undoc.append(cmd) self.stdout.write("%s\n"%str(self.doc_leader)) self.print_topics(self.doc_header, cmds_doc, 15,80) self.print_topics(self.misc_header, help.keys(),15,80) self.print_topics(self.undoc_header, cmds_undoc, 15,80)
143dd520766a5fdcce68c762f389a23c1008fec9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/143dd520766a5fdcce68c762f389a23c1008fec9/cmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 5201, 12, 2890, 16, 1501, 4672, 309, 1501, 30, 468, 11329, 866, 1501, 6279, 775, 30, 1326, 273, 3869, 12, 2890, 16, 296, 5201, 4623, 397, 1501, 13, 1335, 6394, 30, 775, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 5201, 12, 2890, 16, 1501, 4672, 309, 1501, 30, 468, 11329, 866, 1501, 6279, 775, 30, 1326, 273, 3869, 12, 2890, 16, 296, 5201, 4623, 397, 1501, 13, 1335, 6394, 30, 775, 30, ...
saturday = get_days(1, dates[1].day, dates[1].month, dates[1].year, 5) sunday = get_days(1, dates[1].day, dates[1].month, dates[1].year, 6) total_off = saturday + sunday
off_days = 0 days_arr = [0, 1, 2, 3, 4, 5, 6] print 'XXXXXXXXXXXXX : ', dates[1].day, dates[1].month, dates[1].year for dy in range(contract.working_days_per_week, 7): off_days += get_days(1, dates[1].day, dates[1].month, dates[1].year, days_arr[dy]) print 'XXXXXXXXXX : ', off_days total_off = off_days
def get_days(start, end, month, year, calc_day): count = 0 for day in range(start, end): if date(year, month, day).weekday() == calc_day: count += 1 return count
1f0a6f1c920639da7957655e5e9894f18e9370eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/1f0a6f1c920639da7957655e5e9894f18e9370eb/hr_payroll.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 9810, 12, 1937, 16, 679, 16, 3138, 16, 3286, 16, 7029, 67, 2881, 4672, 1056, 273, 374, 364, 2548, 316, 1048, 12, 1937, 16, 679, 4672, 309, 1509, 12, 6874, 16, 3138, 16, 2548...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 336, 67, 9810, 12, 1937, 16, 679, 16, 3138, 16, 3286, 16, 7029, 67, 2881, 4672, 1056, 273, 374, 364, 2548, 316, 1048, 12, 1937, 16, 679, 4672, 309, 1509, 12, 6874, 16, 3138, 16, 2548...
que_ids= que_obj.search(cr,uid,[('category_id','=',int(cate_id))])
tech_skill_obj = self.pool.get("technical.skill") hr_id = super(hr_interview, self).create(cr, uid, vals, context=context) if vals.get('category_id', False): cate_id = vals.get('category_id') que_ids = que_obj.search(cr, uid, [('category_id','=',int(cate_id))], context=context) for rec in que_obj.browse(cr, uid, que_ids, context=context): tech_skill_obj.create(cr, uid, {'name': rec.name, 'tot_marks': rec.tot_marks, 'candidate_id': hr_id}) self._log(cr, uid, [hr_id], 'draft') return hr_id def write(self, cr, uid, ids, vals, context=None): que_obj = self.pool.get("category.question")
def create(self, cr, uid, vals, context=None): cate_id = vals.get('category_id', False) hr_id = super(hr_interview, self).create(cr, uid, vals, context=context) if not cate_id: cate_id = self.read(cr, uid, [hr_id], ['category_id'])[0]['category_id'][0]
8e7c5f7d10818478d285302f3a7e2be85c692721 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/8e7c5f7d10818478d285302f3a7e2be85c692721/hr_interview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 5773, 16, 819, 33, 7036, 4672, 276, 340, 67, 350, 273, 5773, 18, 588, 2668, 4743, 67, 350, 2187, 1083, 13, 15407, 67, 350, 273, 2240, 12, 7256,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 5773, 16, 819, 33, 7036, 4672, 276, 340, 67, 350, 273, 5773, 18, 588, 2668, 4743, 67, 350, 2187, 1083, 13, 15407, 67, 350, 273, 2240, 12, 7256,...
file.write('void InitializeGLBindings%s();\n' % setName.upper())
file.write('void InitializeGLBindings%s();\n' % set_name.upper()) file.write('void InitializeDebugGLBindings%s();\n' % set_name.upper())
file.write('#ifndef APP_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % setName.upper())
218a5a204661ad6185f01d6233b35b2d5f86027b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/218a5a204661ad6185f01d6233b35b2d5f86027b/generate_bindings.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 585, 18, 2626, 2668, 7, 430, 82, 536, 9146, 67, 43, 25172, 67, 11261, 67, 11261, 67, 2739, 55, 67, 18909, 16652, 10185, 87, 67, 44, 22202, 82, 11, 738, 6788, 18, 5797, 10756, 2, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 585, 18, 2626, 2668, 7, 430, 82, 536, 9146, 67, 43, 25172, 67, 11261, 67, 11261, 67, 2739, 55, 67, 18909, 16652, 10185, 87, 67, 44, 22202, 82, 11, 738, 6788, 18, 5797, 10756, 2, -100, -100...
%self.__class__.__name__
% cls.__name__
def processRequest(cls, ps, **kw): """invokes callback that should return a (request,response) tuple. representing the SOAP request and response respectively. ps -- ParsedSoap instance representing HTTP Body. request -- twisted.web.server.Request """ resource = kw['resource'] request = kw['request'] method = getattr(resource, 'soap_%s' % _get_element_nsuri_name(ps.body_root)[-1]) try: req_pyobj,rsp_pyobj = method(ps, request=request) except TypeError, ex: log.err( 'ERROR: service %s is broken, method MUST return request, response'\ %self.__class__.__name__ ) raise except Exception, ex: log.err('failure when calling bound method') raise return rsp_pyobj
76c4093e9231eaeadd12f729147ad99c3c0d1383 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/76c4093e9231eaeadd12f729147ad99c3c0d1383/WSresource.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 691, 12, 6429, 16, 4250, 16, 2826, 9987, 4672, 3536, 5768, 601, 281, 1348, 716, 1410, 327, 279, 261, 2293, 16, 2740, 13, 3193, 18, 5123, 326, 16434, 590, 471, 766, 19629, 18, 425...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 691, 12, 6429, 16, 4250, 16, 2826, 9987, 4672, 3536, 5768, 601, 281, 1348, 716, 1410, 327, 279, 261, 2293, 16, 2740, 13, 3193, 18, 5123, 326, 16434, 590, 471, 766, 19629, 18, 425...
self._write_property_summary(public, private, doc.properties(), uid, doc.by_group(doc.properties()),
self._write_property_summary(public, private, doc, doc.properties(),
def _write_class(self, public, private, uid, doc): """ @return: An HTML page describing the class identified by C{uid}. @rtype: C{string} @param uid: The unique identifier for the class that should be documented. @type uid: L{UID} """ # Write the header, navigation bar, & class name. str = self._header(uid.name()) private.write(str) public.write(str)
dad6dd09c82d3878a78d977cc13da79d4420db2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/dad6dd09c82d3878a78d977cc13da79d4420db2b/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 1106, 12, 2890, 16, 1071, 16, 3238, 16, 4555, 16, 997, 4672, 3536, 632, 2463, 30, 1922, 3982, 1363, 16868, 326, 667, 9283, 635, 385, 95, 1911, 5496, 632, 86, 723, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 1106, 12, 2890, 16, 1071, 16, 3238, 16, 4555, 16, 997, 4672, 3536, 632, 2463, 30, 1922, 3982, 1363, 16868, 326, 667, 9283, 635, 385, 95, 1911, 5496, 632, 86, 723, 30, ...
stdinc_dir = join(prefix, 'include', py_version)
if sys.platform == 'win32': stdinc_dir = join(prefix, 'include') else: stdinc_dir = join(prefix, 'include', py_version)
def create_environment(home_dir, site_packages=True, clear=False): """ Creates a new environment in ``home_dir``. If ``site_packages`` is true (the default) then the global ``site-packages/`` directory will be on the path. If ``clear`` is true (default False) then the environment will first be cleared. """ if sys.platform == 'win32': lib_dir = join(home_dir, 'Lib') else: lib_dir = join(home_dir, 'lib', py_version) inc_dir = join(home_dir, 'include', py_version) if sys.platform == 'win32': bin_dir = join(home_dir, 'Scripts') else: bin_dir = join(home_dir, 'bin') if sys.executable.startswith(bin_dir): print 'Please use the *system* python to run this script' return if clear: rmtree(lib_dir) rmtree(inc_dir) ## FIXME: why not delete it? logger.notify('Not deleting %s', bin_dir) if hasattr(sys, 'real_prefix'): logger.notify('Using real prefix %r' % sys.real_prefix) prefix = sys.real_prefix else: prefix = sys.prefix mkdir(lib_dir) fix_lib64(lib_dir) stdlib_dir = os.path.dirname(os.__file__) for fn in os.listdir(stdlib_dir): if fn != 'site-packages' and os.path.splitext(fn)[0] in REQUIRED_MODULES: copyfile(join(stdlib_dir, fn), join(lib_dir, fn)) mkdir(join(lib_dir, 'site-packages')) writefile(join(lib_dir, 'site.py'), SITE_PY) writefile(join(lib_dir, 'orig-prefix.txt'), prefix) site_packages_filename = join(lib_dir, 'no-global-site-packages.txt') if not site_packages: writefile(site_packages_filename, '') else: if os.path.exists(site_packages_filename): logger.info('Deleting %s' % site_packages_filename) os.unlink(site_packages_filename) stdinc_dir = join(prefix, 'include', py_version) if os.path.exists(stdinc_dir): copyfile(stdinc_dir, inc_dir) else: logger.debug('No include dir %s' % stdinc_dir) if sys.exec_prefix != prefix: if sys.platform == 'win32': exec_dir = join(sys.exec_prefix, 'lib') else: exec_dir = join(sys.exec_prefix, 'lib', py_version) for fn in os.listdir(exec_dir): copyfile(join(exec_dir, fn), join(lib_dir, fn)) mkdir(bin_dir) py_executable = join(bin_dir, os.path.basename(sys.executable)) if 'Python.framework' in prefix: if py_executable.endswith('/Python'): # The name of the python executable is not quite what # we want, rename it. py_executable = os.path.join( os.path.dirname(py_executable), 'python') logger.notify('New python executable in %s', py_executable) if sys.executable != py_executable: ## FIXME: could I just hard link? shutil.copyfile(sys.executable, py_executable) make_exe(py_executable) if 'Python.framework' in prefix: logger.debug('MacOSX Python framework detected') # Create a dummy framework tree frmdir = os.path.join(home_dir, 'lib', 'Python.framework', 'Versions', '%s.%s'%(sys.version_info[0], sys.version_info[1])) mkdir(frmdir) copyfile( os.path.join(prefix, 'Python'), os.path.join(frmdir, 'Python')) # And then change the install_name of the cpied python executable try: call_subprocess( ["install_name_tool", "-change", os.path.join(prefix, 'Python'), '@executable_path/../lib/Python.framework/Versions/%s.%s/Python' % (sys.version_info[0], sys.version_info[1]), py_executable]) except: logger.fatal( "Could not call install_name_tool -- you must have Apple's development tools installed") raise cmd = [py_executable, '-c', 'import sys; print sys.prefix'] logger.info('Testing executable with %s %s "%s"' % tuple(cmd)) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) proc_stdout, proc_stderr = proc.communicate() proc_stdout = os.path.normcase(os.path.abspath(proc_stdout.strip())) if proc_stdout != os.path.normcase(os.path.abspath(home_dir)): logger.fatal( 'ERROR: The executable %s is not functioning' % py_executable) logger.fatal( 'ERROR: It thinks sys.prefix is %r (should be %r)' % (proc_stdout, os.path.normcase(os.path.abspath(home_dir)))) logger.fatal( 'ERROR: virtualenv is not compatible with this system or executable') sys.exit(100) else: logger.info('Got sys.prefix result: %r' % proc_stdout) pydistutils = os.path.expanduser('~/.pydistutils.cfg') if os.path.exists(pydistutils): logger.notify('Please make sure you remove any previous custom paths from ' 'your %s file.' % pydistutils) install_setuptools(py_executable) install_activate(home_dir, bin_dir) install_distutils(lib_dir)
aa6e73ca9dc7b2618491c52b283f2c3378d7b21a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12981/aa6e73ca9dc7b2618491c52b283f2c3378d7b21a/virtualenv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 10274, 12, 8712, 67, 1214, 16, 2834, 67, 10308, 33, 5510, 16, 2424, 33, 8381, 4672, 3536, 10210, 279, 394, 3330, 316, 12176, 8712, 67, 1214, 68, 8338, 225, 971, 12176, 4256, 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, 752, 67, 10274, 12, 8712, 67, 1214, 16, 2834, 67, 10308, 33, 5510, 16, 2424, 33, 8381, 4672, 3536, 10210, 279, 394, 3330, 316, 12176, 8712, 67, 1214, 68, 8338, 225, 971, 12176, 4256, 6...
return C(log_pari)
r, i = C(log_pari) wR, wI = E.period_lattice(emb).basis(prec=precision) k = (r/wR).floor() if k: r -= k*wR if self.is_on_identity_component(emb): return C(r) return C(r)+C(wI/2)
def elliptic_logarithm(self, embedding=None, precision=100, algorithm='pari'): """ Returns the elliptic logarithm of this elliptic curve point.
a1ab9c3ea8558aa05be8905400603242aa82dd20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/a1ab9c3ea8558aa05be8905400603242aa82dd20/ell_point.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 415, 549, 21507, 67, 1330, 31249, 12, 2890, 16, 15853, 33, 7036, 16, 6039, 33, 6625, 16, 4886, 2218, 1065, 77, 11, 4672, 3536, 2860, 326, 415, 549, 21507, 613, 31249, 434, 333, 415, 54...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 415, 549, 21507, 67, 1330, 31249, 12, 2890, 16, 15853, 33, 7036, 16, 6039, 33, 6625, 16, 4886, 2218, 1065, 77, 11, 4672, 3536, 2860, 326, 415, 549, 21507, 613, 31249, 434, 333, 415, 54...
return surface
return new
def command_fill(self, surface, color, opacity=100): ctx = cairo.Context(surface) alpha = self.get_alpha(opacity) c = self.get_color(color) r = float(int(c[1:3], 16))/255 g = float(int(c[3:5], 16))/255 b = float(int(c[5:7], 16))/255 ctx.set_source_rgba(r, g, b) ctx.set_operator(cairo.OPERATOR_SOURCE) ctx.paint_with_alpha(alpha) return surface
4369f4e84f41c9c7272b6e02593281096b5905e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7075/4369f4e84f41c9c7272b6e02593281096b5905e6/dockbarx.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 67, 5935, 12, 2890, 16, 9034, 16, 2036, 16, 12636, 33, 6625, 4672, 1103, 273, 14503, 18, 1042, 12, 18266, 13, 4190, 273, 365, 18, 588, 67, 5429, 12, 19515, 13, 276, 273, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 67, 5935, 12, 2890, 16, 9034, 16, 2036, 16, 12636, 33, 6625, 4672, 1103, 273, 14503, 18, 1042, 12, 18266, 13, 4190, 273, 365, 18, 588, 67, 5429, 12, 19515, 13, 276, 273, 365, 1...
if type == 1: P0 = P if type == 2: P0 = P/(1-2*T+2*T**2) if type == 3: P0 = P/(1+3*T**2) if type == 4: P0 = P/(1+2*T)
if typ == 1: P0 = P if typ == 2: P0 = P/(1-2*T+2*T**2) if typ == 3: P0 = P/(1+3*T**2) if typ == 4: P0 = P/(1+2*T)
def sd_zeta_polynomial(C,type=1): r""" Returns the Duursma zeta function of a self-dual code using the construction in [D].
90ff33abb51043d1baa7fdf15f610546756cd0b7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/90ff33abb51043d1baa7fdf15f610546756cd0b7/linear_code.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8349, 67, 94, 1066, 67, 3915, 13602, 12, 39, 16, 723, 33, 21, 4672, 436, 8395, 2860, 326, 463, 89, 25152, 2540, 998, 1066, 445, 434, 279, 365, 17, 72, 1462, 981, 1450, 326, 16171, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8349, 67, 94, 1066, 67, 3915, 13602, 12, 39, 16, 723, 33, 21, 4672, 436, 8395, 2860, 326, 463, 89, 25152, 2540, 998, 1066, 445, 434, 279, 365, 17, 72, 1462, 981, 1450, 326, 16171, 31...
Construct a C{Token} containing the literal block starting at
Construct a L{Token} containing the literal block starting at
def _tokenize_literal(lines, start, block_indent, tokens, warnings): """ Construct a C{Token} containing the literal block starting at C{lines[start]}, and append it to C{tokens}. C{block_indent} should be the indentation of the literal block. Any warnings generated while tokenizing the literal block will be appended to C{warnings}. @param lines: The list of lines to be tokenized @param start: The index into C{lines} of the first line of the literal block to be tokenized. @param block_indent: The indentation of C{lines[start]}. This is the indentation of the literal block. @param warnings: A list of the warnings generated by parsing. Any new warnings generated while will tokenizing this paragraph will be appended to this list. @return: The line number of the first line following the literal block. @type lines: C{list} of C{string} @type start: C{int} @type block_indent: C{int} @type warnings: C{list} of C{ParseError} @rtype: C{int} """ linenum = start + 1 while linenum < len(lines): # Find the indentation of this line. line = lines[linenum] indent = len(line) - len(line.lstrip()) # A Dedent to block_indent ends the literal block. # (Ignore blank likes, though) if len(line) != indent and indent <= block_indent: break # Go on to the next line. linenum += 1 # Add the token, and return the linenum after the token ends. contents = [line[block_indent+1:] for line in lines[start:linenum]] contents = '\n'.join(contents) contents = re.sub('(\A[ \n]*\n)|(\n[ \n]*\Z)', '', contents) tokens.append(Token(Token.LBLOCK, start, contents, block_indent)) return linenum
0cc72bd3422be83752480f57dbecac32d991815f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/0cc72bd3422be83752480f57dbecac32d991815f/epytext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2316, 554, 67, 13107, 12, 3548, 16, 787, 16, 1203, 67, 9355, 16, 2430, 16, 5599, 4672, 3536, 14291, 279, 511, 95, 1345, 97, 4191, 326, 7158, 1203, 5023, 622, 385, 95, 3548, 63, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2316, 554, 67, 13107, 12, 3548, 16, 787, 16, 1203, 67, 9355, 16, 2430, 16, 5599, 4672, 3536, 14291, 279, 511, 95, 1345, 97, 4191, 326, 7158, 1203, 5023, 622, 385, 95, 3548, 63, ...
Convert spaces in the source to ``&160;``, which are non-breaking
Convert spaces in the source to ``&
def escape_html(text): """Escape &, <, > as well as single and double quotes for HTML.""" return text.replace('&', '&amp;'). \ replace('<', '&lt;'). \ replace('>', '&gt;'). \ replace('"', '&quot;'). \ replace("'", '&#39;')
6ea0cd39a035292cb5c64997d764fc4086ec5f2d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2885/6ea0cd39a035292cb5c64997d764fc4086ec5f2d/svg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4114, 67, 2620, 12, 955, 4672, 3536, 8448, 473, 16, 411, 16, 405, 487, 5492, 487, 2202, 471, 1645, 10681, 364, 3982, 12123, 327, 977, 18, 2079, 2668, 10, 2187, 5183, 931, 4359, 2934, 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, 4114, 67, 2620, 12, 955, 4672, 3536, 8448, 473, 16, 411, 16, 405, 487, 5492, 487, 2202, 471, 1645, 10681, 364, 3982, 12123, 327, 977, 18, 2079, 2668, 10, 2187, 5183, 931, 4359, 2934, 2...
add instance <system> [<instance_name>] System instance name is Production by default """
add instance <system> <instance> """
def do_add(self,args): """ Add new entity to the Configuration Service usage: add instance <system> [<instance_name>] System instance name is Production by default """ argss = args.split() option = argss[0] del argss[0] if option == "instance": system = argss[0] if len(argss)>1: instance = argss[1] else: instance = "Production" client = SystemAdministratorClient(self.host) result = client.addSystemInstance(system,instance) if not result['OK']: print "ERROR:",result['Message'] else: print "%s system instance %s added successfully" % (system,instance)
b68208f4ea74e3c61aead9e641ff73054212c46c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/b68208f4ea74e3c61aead9e641ff73054212c46c/SystemAdministratorClientCLI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1289, 12, 2890, 16, 1968, 4672, 3536, 1436, 394, 1522, 358, 326, 4659, 1956, 225, 4084, 30, 225, 527, 791, 411, 4299, 34, 411, 1336, 34, 3536, 833, 87, 273, 833, 18, 4939, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1289, 12, 2890, 16, 1968, 4672, 3536, 1436, 394, 1522, 358, 326, 4659, 1956, 225, 4084, 30, 225, 527, 791, 411, 4299, 34, 411, 1336, 34, 3536, 833, 87, 273, 833, 18, 4939, 1...
self.valueOf_ or
def hasContent_(self): if ( self.valueOf_ or super(StateSet, self).hasContent_() ): return True else: return False
9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 1350, 67, 12, 2890, 4672, 309, 261, 2240, 12, 1119, 694, 16, 365, 2934, 5332, 1350, 67, 1435, 262, 30, 327, 1053, 469, 30, 327, 1083, 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, 711, 1350, 67, 12, 2890, 4672, 309, 261, 2240, 12, 1119, 694, 16, 365, 2934, 5332, 1350, 67, 1435, 262, 30, 327, 1053, 469, 30, 327, 1083, 2, -100, -100, -100, -100, -100, -100, -100, ...
cdata = self.__process(child)
cdata, cval = self.__process(child)
def import_children(self, data, node): """ Import child nodes into L{data} @param data: The current object being built. @type data: L{Object} @param node: The current node being proecessed. @type node: L{sax.Element} """ for child in node.children: cdata = self.__process(child) key = reserved.get(child.name, child.name) if key in data: v = getattr(data, key) if isinstance(v, list): v.append(cdata) else: setattr(data, key, [v, cdata]) continue if self.unbounded(cdata): if cdata is None: setattr(data, key, []) else: setattr(data, key, [cdata,]) else: setattr(data, key, cdata)
692007d9afb0d2cc2f88cd84fc66410578df926d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5930/692007d9afb0d2cc2f88cd84fc66410578df926d/unmarshaller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 5906, 12, 2890, 16, 501, 16, 756, 4672, 3536, 6164, 1151, 2199, 1368, 511, 95, 892, 97, 632, 891, 501, 30, 1021, 783, 733, 3832, 6650, 18, 632, 723, 501, 30, 511, 95, 921, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1930, 67, 5906, 12, 2890, 16, 501, 16, 756, 4672, 3536, 6164, 1151, 2199, 1368, 511, 95, 892, 97, 632, 891, 501, 30, 1021, 783, 733, 3832, 6650, 18, 632, 723, 501, 30, 511, 95, 921, ...
def sim_frame_callback(self):
def sim_frame_callback(self, last_frame):
def sim_frame_callback(self): #bruce 060102 "Per-frame callback function for simulator object." # Note: this was called 3550 times for minimizing a small C3 sp3 hydrocarbon... better check the elapsed time quickly. #e Maybe we should make this into a lambda, or even code it in C, to optimize it. if self.PREPARE_TO_CLOSE: # wware 060406 bug 1263 - if exiting the program, interrupt the simulator from sim import SimulatorInterrupted raise SimulatorInterrupted self.__frame_number += 1 if debug_all_frames: from sim import getFrame if debug_sim_exceptions: # intentionally buggy code print "frame %d" % self.__frame_number, self._simobj.getFrame() # this is a bug, that attr should not exist else: # correct code print "frame %d" % self.__frame_number, getFrame()[debug_all_frames_atom_index] pass # Decide whether to update the 3D view and/or the progress indicators. # Original code: let sim use up most of the real time used, measuring redraw timing in order to let that happen. # see below for more info. #bruce 060530 generalizing this to ask self.update_cond how to decide. now = time.time() # real time simtime = now - self.__last_3dupdate_time # time the sim has been churning away since the last update was completed pytime = self.__last_pytime nframes = self.__frame_number - self.__last_3dupdate_frame update_3dview = self.sim_frame_callback_update_check( simtime, pytime, nframes ) # call this even if later code overrides it # always show the last frame - wware 060314 if self.__frame_number == self.totalFramesRequested or debug_all_frames: update_3dview = True # now we know whether we want to update the 3d view (and save new values for the __last variables). if update_3dview: if debug_pyrex_prints: print "sim hit frame %d in" % self.__frame_number, simtime #e maybe let frame number be an arg from C to the callback in the future? self.__last_3dupdate_time = now self.__last_3dupdate_frame = self.__frame_number # Note that we also (redundantly) store over this the time *after* we do our other work here, in case redraw takes long. # i.e.(??) (when using original code) we always let sim run for 0.05 sec even if our python loop body took longer. # maybe best to let sim run even longer, i.e. max(0.05, python loop body time), but no more than say 1 or 2 sec. try: self.sim_frame_callback_worker( self.__frame_number) # might call self.abort_sim_run() or set self.need_process_events except: print_compact_traceback("exception in sim_frame_callback_worker, aborting run: ") self.abort_sim_run("exception in sim_frame_callback_worker(%d)" % self.__frame_number ) # sets flag inside sim object self.__last_3dupdate_time = time.time() # in case later than 'now' set earlier # use this difference to adjust 0.05 above, for the upcoming period of sim work; # note, in current code this also affects abortability pytime = self.__last_3dupdate_time - now self.__last_pytime = pytime if debug_pyrex_prints: print "python stuff took", pytime # python stuff took 0.00386619567871 -- for when no real work done, just overhead; small real egs more like 0.03
91ec2b51167720b4740be88aecfdf76e3466408f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/91ec2b51167720b4740be88aecfdf76e3466408f/runSim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 67, 3789, 67, 3394, 12, 2890, 16, 1142, 67, 3789, 4672, 468, 2848, 3965, 13026, 1611, 3103, 315, 2173, 17, 3789, 1348, 445, 364, 3142, 11775, 733, 1199, 468, 3609, 30, 333, 1703, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 67, 3789, 67, 3394, 12, 2890, 16, 1142, 67, 3789, 4672, 468, 2848, 3965, 13026, 1611, 3103, 315, 2173, 17, 3789, 1348, 445, 364, 3142, 11775, 733, 1199, 468, 3609, 30, 333, 1703, ...
Parameters: see `publish_programmatically`.
Parameters: `document` is a `docutils.nodes.document` object, an existing document tree. Other parameters: see `publish_programmatically`.
def publish_from_doctree(document, destination_path=None, writer=None, writer_name='pseudoxml', settings=None, settings_spec=None, settings_overrides=None, config_section=None, enable_exit_status=None): """ Set up & run a `Publisher` to render from an existing document tree data structure, for programmatic use with string I/O. Return a pair of encoded string output and document parts. Note that document.settings is overridden; if you want to use the settings of the original `document` document, pass settings=document.settings. For encoded string output, be sure to set the 'output_encoding' setting to the desired encoding. Set it to 'unicode' for unencoded Unicode string output. Here's one way:: publish_from_doctree( ..., settings_overrides={'output_encoding': 'unicode'}) Parameters: see `publish_programmatically`. """ # Create fresh Transformer object, to be populated from Writer component. document.transformer = Transformer(document) # Don't apply default transforms twice: document.transformer.default_transforms = (document.transformer .reprocess_transforms) reader = docutils.readers.doctree.Reader(parser_name='null') pub = Publisher(reader, None, writer, source=io.DocTreeInput(document), destination_class=io.StringOutput, settings=settings) pub.set_writer(writer_name) pub.process_programmatic_settings( settings_spec, settings_overrides, config_section) pub.set_destination(None, destination_path) output = pub.publish(enable_exit_status=enable_exit_status) return output, pub.writer.parts
bedc37b2f4d7ae0c48570980c864271ef6586551 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/bedc37b2f4d7ae0c48570980c864271ef6586551/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 67, 2080, 67, 2896, 299, 992, 12, 5457, 16, 2929, 67, 803, 33, 7036, 16, 2633, 33, 7036, 16, 2633, 67, 529, 2218, 84, 23715, 2409, 781, 2187, 1947, 33, 7036, 16, 1947, 67, 2793...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 67, 2080, 67, 2896, 299, 992, 12, 5457, 16, 2929, 67, 803, 33, 7036, 16, 2633, 33, 7036, 16, 2633, 67, 529, 2218, 84, 23715, 2409, 781, 2187, 1947, 33, 7036, 16, 1947, 67, 2793...
buf = buf + "--enablecache"
buf = buf + " --enablecache"
def getData(self): data = [] data.append("") data.append("#System authorization information") if (self.nisCheck.get_active()): self.myNisClass.set_domain(self.nisDomainEntry.get_text()) self.myNisClass.set_server(self.nisServerEntry.get_text())
e62b2b2f3cb1cadaca818bf661ca8c878d191906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5376/e62b2b2f3cb1cadaca818bf661ca8c878d191906/auth.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4303, 12, 2890, 4672, 501, 273, 5378, 501, 18, 6923, 2932, 7923, 501, 18, 6923, 2932, 7, 3163, 6093, 1779, 7923, 309, 261, 2890, 18, 82, 291, 1564, 18, 588, 67, 3535, 1435, 4672, 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, 4303, 12, 2890, 4672, 501, 273, 5378, 501, 18, 6923, 2932, 7923, 501, 18, 6923, 2932, 7, 3163, 6093, 1779, 7923, 309, 261, 2890, 18, 82, 291, 1564, 18, 588, 67, 3535, 1435, 4672, 365, ...
if data: setCached(data, "allScaledData", (self.originalData, self.scaledData, self.noJitteringScaledData, self.validDataArray)) if subsetData: setCached(subsetData, "allScaledData", (self.originalSubsetData, self.scaledSubsetData, self.noJitteringScaledSubsetData, self.validSubsetDataArray))
if data: setCached(data, "visualizationData", (self.originalData, self.noJitteringScaledData, self.validDataArray)) if subsetData: setCached(subsetData, "visualizationData", (self.originalSubsetData, self.noJitteringScaledSubsetData, self.validSubsetDataArray)) scaledData = numpy.concatenate([self.noJitteringScaledData, self.noJitteringScaledSubsetData], axis = 1) for index in range(len(data.domain)): attr = data.domain[index] if attr.varType == orange.VarTypes.Discrete: scaledData[index] += (self.jitterSize/(50.0*max(1,len(attr.values))))*(numpy.random.random(len(fullData)) - 0.5) elif attr.varType == orange.VarTypes.Continuous and self.jitterContinuous: scaledData[index] += self.jitterSize/50.0 * (0.5 - numpy.random.random(len(fullData))) scaledData[index] = numpy.absolute(scaledData[index]) ind = numpy.where(scaledData[index] > 1.0, 1, 0) numpy.putmask(scaledData[index], ind, 2.0 - numpy.compress(ind, scaledData[index])) self.scaledData = scaledData[:,:lenData]; self.scaledSubsetData = scaledData[:,lenData:]
def setData(self, data, subsetData = None, **args): if args.get("skipIfSame", 1): if ((data == None and self.rawData == None) or (self.rawData != None and data != None and self.rawData.checksum() == data.checksum())) and \ ((subsetData == None and self.rawSubsetData == None) or (self.rawSubsetData != None and subsetData != None and self.rawSubsetData.checksum() == subsetData.checksum())): return
8ce677dee9eac1034560a6337470c81b757d28d0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/8ce677dee9eac1034560a6337470c81b757d28d0/orngScaleData.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7929, 12, 2890, 16, 501, 16, 7931, 751, 273, 599, 16, 2826, 1968, 4672, 309, 833, 18, 588, 2932, 7457, 2047, 8650, 3113, 404, 4672, 309, 14015, 892, 422, 599, 471, 365, 18, 1899, 751, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7929, 12, 2890, 16, 501, 16, 7931, 751, 273, 599, 16, 2826, 1968, 4672, 309, 833, 18, 588, 2932, 7457, 2047, 8650, 3113, 404, 4672, 309, 14015, 892, 422, 599, 471, 365, 18, 1899, 751, ...
base_ring = rings.Integers(p**prec) output_ring = rings.pAdicField(p, prec) frob_p = monsky_washnitzer.matrix_of_frobenius_alternate( X.a4(), X.a6(), p, prec)
p_to_prec = p**prec R = rings.PolynomialRing(Integers(), "x") Q = R([X.a6() % p_to_prec, X.a4() % p_to_prec, 0, 1]) frob_p = sage.schemes.hyperelliptic_curves.frobenius.frobenius(p, prec, Q)
def matrix_of_frobenius(self, p, prec=20, check=False, check_hypotheses=True, algorithm="auto"): """ See the parameters and documentation for padic_E2. """ # TODO, add lots of comments like the above if check_hypotheses: p = self.__check_padic_hypotheses(p)
6cf6870e1d9f758d34ca33b73efd06dc52859b32 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/6cf6870e1d9f758d34ca33b73efd06dc52859b32/ell_rational_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 67, 792, 67, 74, 303, 19425, 8384, 12, 2890, 16, 293, 16, 13382, 33, 3462, 16, 866, 33, 8381, 16, 866, 67, 76, 879, 10370, 281, 281, 33, 5510, 16, 4886, 1546, 6079, 6, 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, 3148, 67, 792, 67, 74, 303, 19425, 8384, 12, 2890, 16, 293, 16, 13382, 33, 3462, 16, 866, 33, 8381, 16, 866, 67, 76, 879, 10370, 281, 281, 33, 5510, 16, 4886, 1546, 6079, 6, 4672, ...
print "done"
step += 1
def run (self): """Execute a heuristic search of a graph. Returns: A list of nodes that is the path from the source to the goal or ``None`` if there is no path. """ if self.path: return self.path
bfb9de4fcf1a57a89f60298f41ded554fee9567c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/bfb9de4fcf1a57a89f60298f41ded554fee9567c/Algorithms.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 261, 2890, 4672, 3536, 5289, 279, 25833, 1623, 434, 279, 2667, 18, 225, 2860, 30, 432, 666, 434, 2199, 716, 353, 326, 589, 628, 326, 1084, 358, 326, 17683, 578, 12176, 7036, 10335,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 261, 2890, 4672, 3536, 5289, 279, 25833, 1623, 434, 279, 2667, 18, 225, 2860, 30, 432, 666, 434, 2199, 716, 353, 326, 589, 628, 326, 1084, 358, 326, 17683, 578, 12176, 7036, 10335,...
def command_unignore(self, args):
def command_unignore(self, arg):
def command_unignore(self, args): """ /unignore <nick> """ if len(args) != 1: self.command_help(['unignore']) return if self.current_room().name == 'Info' or not self.current_room().joined: return roomname = self.current_room().name nick = args[0] if not self.ignores.has_key(roomname) or (nick not in self.ignores[roomname]): self.add_message_to_room(self.current_room(), _("%s was not ignored") % nick) return self.ignores[roomname].remove(nick) if self.ignores[roomname] == set(): del self.ignores[roomname] self.add_message_to_room(self.current_room(), _("%s is now unignored") % nick)
1c7377804051166c26f33457378524d192077c66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9814/1c7377804051166c26f33457378524d192077c66/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 67, 318, 6185, 12, 2890, 16, 1501, 4672, 3536, 342, 318, 6185, 411, 17091, 34, 3536, 309, 562, 12, 1968, 13, 480, 404, 30, 365, 18, 3076, 67, 5201, 12, 3292, 318, 6185, 19486, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 67, 318, 6185, 12, 2890, 16, 1501, 4672, 3536, 342, 318, 6185, 411, 17091, 34, 3536, 309, 562, 12, 1968, 13, 480, 404, 30, 365, 18, 3076, 67, 5201, 12, 3292, 318, 6185, 19486, ...
self.toolbar = GtkToolbar (ORIENTATION_HORIZONTAL, TOOLBAR_BOTH) self.toolbar.set_button_relief (RELIEF_NONE) self.toolbar.set_space_style (TOOLBAR_SPACE_LINE)
self.toolbar = gtk.Toolbar ()
def __init__ (self, configList): GtkWindow.__init__ (self) self.set_title ("DRI Configuration") self.connect ("destroy", mainquit) self.connect ("delete_event", self.exitHandler) self.vbox = GtkVBox() self.paned = GtkHPaned() self.configTree = ConfigTree (configList) self.configTree.show() scrolledWindow = GtkScrolledWindow () scrolledWindow.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC) scrolledWindow.add (self.configTree) scrolledWindow.show() self.paned.add1(scrolledWindow) self.paned.show() DataPixmap.window = self self.toolbar = GtkToolbar (ORIENTATION_HORIZONTAL, TOOLBAR_BOTH) self.toolbar.set_button_relief (RELIEF_NONE) self.toolbar.set_space_style (TOOLBAR_SPACE_LINE) self.saveButton = self.toolbar.append_item ( "Save", "Save selected configuration file", "priv", DataPixmap (tb_save_xpm), self.configTree.saveConfig) self.reloadButton = self.toolbar.append_item ( "Reload", "Reload selected configuration file", "priv", DataPixmap (tb_revert_xpm), self.configTree.reloadConfig) self.toolbar.append_space() self.newButton = self.toolbar.append_item ( "New", "Create a new device or application", "priv", DataPixmap (tb_new_xpm), self.configTree.newItem) self.removeButton = self.toolbar.append_item ( "Remove", "Remove selected device or application", "priv", DataPixmap (tb_trash_xpm), self.configTree.removeItem) self.upButton = self.toolbar.append_item ( "Up", "Move selected item up", "priv", DataPixmap (tb_up_arrow_xpm), self.configTree.moveUp) self.downButton = self.toolbar.append_item ( "Down", "Move selected item down", "priv", DataPixmap (tb_down_arrow_xpm), self.configTree.moveDown) self.renameButton = self.toolbar.append_item ( "Rename", "Rename selected application", "priv", DataPixmap (tb_edit_xpm), self.configTree.renameApp) self.toolbar.append_space() self.exitButton = self.toolbar.append_item ( "Exit", "Exit DRI configuration", "priv", DataPixmap (tb_exit_xpm), self.exitHandler) if len(configList) != 0: self.activateConfigButtons (configList[0]) self.toolbar.show() self.vbox.pack_start (self.toolbar, FALSE, TRUE, 0) self.vbox.pack_start (self.paned, TRUE, TRUE, 0) self.vbox.show() self.add (self.vbox) self.curDriverPanel = None self.logo = DataPixmap (drilogo_xpm) self.logo.show() self.paned.add2 (self.logo)
ec17e2ee5c945ddc11ff8bcc0cdc586ae535e76d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4580/ec17e2ee5c945ddc11ff8bcc0cdc586ae535e76d/driconf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 642, 682, 4672, 22132, 3829, 16186, 2738, 972, 261, 2890, 13, 365, 18, 542, 67, 2649, 7566, 40, 2259, 4659, 7923, 365, 18, 3612, 7566, 11662, 3113, 2774, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 642, 682, 4672, 22132, 3829, 16186, 2738, 972, 261, 2890, 13, 365, 18, 542, 67, 2649, 7566, 40, 2259, 4659, 7923, 365, 18, 3612, 7566, 11662, 3113, 2774, ...
lines.append("%s%3d: %s" % (header, score, bar(score_map[score] / float(self.count))))
lines.append("%s%3d:%s%s" % (header, score, gen_indent(1), bar(score_map[score] / float(self.count))))
def bar(percentage): length = 25 bar_length = int(length * percentage)
b3e47383e6cd25781c33a94776f4f5c6666b1cd9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/b3e47383e6cd25781c33a94776f4f5c6666b1cd9/process.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4653, 12, 18687, 4672, 769, 273, 6969, 4653, 67, 2469, 273, 509, 12, 2469, 380, 11622, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 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, 4653, 12, 18687, 4672, 769, 273, 6969, 4653, 67, 2469, 273, 509, 12, 2469, 380, 11622, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
is_admin = root.is_in_role('admins', user.name)
is_admin = user is not None and root.is_in_role('admins', user.name)
def profile(self, context): root = context.root user = context.user
88cc75e89c734b8bf1a472eb49c8451702e7020a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/88cc75e89c734b8bf1a472eb49c8451702e7020a/users.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3042, 12, 2890, 16, 819, 4672, 1365, 273, 819, 18, 3085, 729, 273, 819, 18, 1355, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3042, 12, 2890, 16, 819, 4672, 1365, 273, 819, 18, 3085, 729, 273, 819, 18, 1355, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
' -d, --dates=yyyy-mm-dd:yyyy-mm-dd '
' -d, --dates=yyyy-mm-dd:yyyy-mm-dd '
def main(): """Main that construct all the bibtask.""" task_set_option("repository", None) task_set_option("dates", None) task_init(authorization_action='runoaiharvest', authorization_msg="oaiharvest Task Submission", description="""Examples: oaiharvest -r arxiv -s 24h oaiharvest -r pubmed -d 2005-05-05:2005-05-10 -t 10m\n""", help_specific_usage=' -r, --repository=REPOS_ONE, "REPOS TWO" ' 'name of the OAI repositories to be harvested (default=all)\n' ' -d, --dates=yyyy-mm-dd:yyyy-mm-dd ' 'harvest repositories between specified dates ' '(overrides repositories\' last updated timestamps)\n', version=__revision__, specific_params=("r:d:", ["repository=", "dates=", ]), task_submit_elaborate_specific_parameter_fnc= task_submit_elaborate_specific_parameter, task_run_fnc=task_run_core)
830c36a1c7972886b19e696305904e77dee16275 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/830c36a1c7972886b19e696305904e77dee16275/oaiharvestlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 6376, 716, 4872, 777, 326, 25581, 4146, 12123, 1562, 67, 542, 67, 3482, 2932, 9071, 3113, 599, 13, 1562, 67, 542, 67, 3482, 2932, 9683, 3113, 599, 13, 1562, 67, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 6376, 716, 4872, 777, 326, 25581, 4146, 12123, 1562, 67, 542, 67, 3482, 2932, 9071, 3113, 599, 13, 1562, 67, 542, 67, 3482, 2932, 9683, 3113, 599, 13, 1562, 67, 2738, ...
if self.vistrail and (self.changed or fileName!=name):
if self.vistrail and (self.changed or fileName!=self.name):
def writeVistrail(self, fileName): """ writeVistrail(fileName: str) -> None Write vistrail to file and emit changed signal """ if self.vistrail and (self.changed or fileName!=name): self.vistrail.serialize(fileName) self.changed = False self.fileName = fileName self.name = os.path.split(fileName)[1] self.emit(QtCore.SIGNAL('stateChanged'))
5585fab6464325f8c6d0cb717e9c04bd41a802b1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/5585fab6464325f8c6d0cb717e9c04bd41a802b1/vistrail_controller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 3282, 15565, 12, 2890, 16, 3968, 4672, 3536, 1045, 3282, 15565, 12, 17812, 30, 609, 13, 317, 599, 2598, 2281, 15565, 358, 585, 471, 3626, 3550, 4277, 225, 3536, 309, 365, 18, 90, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3282, 15565, 12, 2890, 16, 3968, 4672, 3536, 1045, 3282, 15565, 12, 17812, 30, 609, 13, 317, 599, 2598, 2281, 15565, 358, 585, 471, 3626, 3550, 4277, 225, 3536, 309, 365, 18, 90, ...
if response: self.transport.write("%s %s\r\n" % (self.seq, response))
self.transport.write("%s %s\r\n" % (self.seq, response))
def lineReceived(self, line): if self.command is None: try: command, seq = line.split() except ValueError: log.error("Could not decode command/sequence number pair from dispatcher: %s" % line) return if command in self.required_headers: self.command = command self.seq = seq self.headers = DecodingDict() else: log.error("Unknown command: %s" % command) elif line == "": for header in self.required_headers[self.command]: if header not in self.headers: log.error('Required header "%s" for command "%s" not found' % (header, self.command)) return try: try: response = self.factory.parent.got_command(self.factory.host, self.command, self.headers) except: traceback.print_exc() response = "error" finally: if response: self.transport.write("%s %s\r\n" % (self.seq, response)) self.command = None else: try: name, value = line.split(": ", 1) except ValueError: log.error("Unable to parse header: %s" % line) try: self.headers[name] = value except DecodingError, e: log.error("Could not decode header: %s" % e)
68549f16ad381cc6addb81ca9345060481d15778 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3445/68549f16ad381cc6addb81ca9345060481d15778/relay.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 980, 8872, 12, 2890, 16, 980, 4672, 309, 365, 18, 3076, 353, 599, 30, 775, 30, 1296, 16, 3833, 273, 980, 18, 4939, 1435, 1335, 2068, 30, 613, 18, 1636, 2932, 4445, 486, 2495, 1296, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 980, 8872, 12, 2890, 16, 980, 4672, 309, 365, 18, 3076, 353, 599, 30, 775, 30, 1296, 16, 3833, 273, 980, 18, 4939, 1435, 1335, 2068, 30, 613, 18, 1636, 2932, 4445, 486, 2495, 1296, 1...
if key == 13:
if key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER:
def txt_edit_evt_char(self, event): """Called when the user enter some text in the entry widget.""" key = event.GetKeyCode() if key == 13: # enter # Enter pressed value = self.txt_edit.GetValue() if not value: # ignore event if nothing typed event.Skip() return self.command_buffer.append(value) self.txt_edit.SetValue("") self.current_area_up = 0 self.current_area_down = 0 self.tmp_buffer = "" self.server.text_command(value,self) # Do nothing after this! We might be destroyed!
27fbeb2ff1603a38af53d47f26e78175c77bddc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2718/27fbeb2ff1603a38af53d47f26e78175c77bddc4/window_base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6463, 67, 4619, 67, 73, 11734, 67, 3001, 12, 2890, 16, 871, 4672, 3536, 8185, 1347, 326, 729, 6103, 2690, 977, 316, 326, 1241, 3604, 12123, 498, 273, 871, 18, 967, 653, 1085, 1435, 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, 6463, 67, 4619, 67, 73, 11734, 67, 3001, 12, 2890, 16, 871, 4672, 3536, 8185, 1347, 326, 729, 6103, 2690, 977, 316, 326, 1241, 3604, 12123, 498, 273, 871, 18, 967, 653, 1085, 1435, 309...
sw.add_with_viewport(v)
sw.add_with_viewport(vbox)
def on_expose(self, window, event): a = event.area f = a[1]/self.h k = a[3]/self.h print a, f, k y = f*self.h for i in xrange(f, f+k+1): x = 0 for j, (w, renderer) in enumerate(self.columns): r = gtk.gdk.Rectangle(x, y, w, self.h) background_area = r cell_area = r expose_area = cell_area renderer.set_property("text", self.data.get_item(i, j)) renderer.render(self.window, self, background_area, cell_area, expose_area, gtk.CELL_RENDERER_PRELIT) x += w
67aa47f766fc6d66a3ca063c05e35f0e0efbdb7c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8273/67aa47f766fc6d66a3ca063c05e35f0e0efbdb7c/query_view.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 338, 4150, 12, 2890, 16, 2742, 16, 871, 4672, 279, 273, 871, 18, 5036, 284, 273, 279, 63, 21, 18537, 2890, 18, 76, 417, 273, 279, 63, 23, 18537, 2890, 18, 76, 1172, 279, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 338, 4150, 12, 2890, 16, 2742, 16, 871, 4672, 279, 273, 871, 18, 5036, 284, 273, 279, 63, 21, 18537, 2890, 18, 76, 417, 273, 279, 63, 23, 18537, 2890, 18, 76, 1172, 279, 1...
data['cldr_number_group_separator'] = groupSeparatorNode.text
data['cldr_number_group_separator'] = groupSeparatorNode.text
def extractNumber(tree): data = {} decimalSeparatorNode = tree.find("numbers/symbols/decimal") if decimalSeparatorNode != None: data['cldr_number_decimal_separator'] = decimalSeparatorNode.text groupSeparator = "," groupSeparatorNode = tree.find("numbers/symbols/group") if groupSeparatorNode != None: data['cldr_number_group_separator'] = groupSeparatorNode.text percentFormatNode = tree.find("numbers/percentFormats/percentFormatLength/percentFormat/pattern") if percentFormatNode != None: data['cldr_number_percent_format'] = percentFormatNode.text return data
eb1a4b4f96b21cb38ef782a546b34e1e48dfe76d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/eb1a4b4f96b21cb38ef782a546b34e1e48dfe76d/cldr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 1854, 12, 3413, 4672, 501, 273, 2618, 225, 6970, 6581, 907, 273, 2151, 18, 4720, 2932, 13851, 19, 15536, 19, 12586, 7923, 309, 6970, 6581, 907, 480, 599, 30, 501, 3292, 830, 3069, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 1854, 12, 3413, 4672, 501, 273, 2618, 225, 6970, 6581, 907, 273, 2151, 18, 4720, 2932, 13851, 19, 15536, 19, 12586, 7923, 309, 6970, 6581, 907, 480, 599, 30, 501, 3292, 830, 3069, ...
self.assertContains(super_index) self.assertNotContains(super_index, 'Test app menu')
self.assertContains(super_index, 'Test app menu')
def test_permissions(self): index = self.index_page() self.assertContains(index, 'Foos') self.assertNotContains(index, 'Bars') self.assertNotContains(index, 'Users') self.assertNotContains(index, 'Test app menu')
ebc7f3d2fc95acbbaaeb94897bffd17117648336 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6707/ebc7f3d2fc95acbbaaeb94897bffd17117648336/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9612, 12, 2890, 4672, 770, 273, 365, 18, 1615, 67, 2433, 1435, 365, 18, 11231, 10846, 12, 1615, 16, 296, 42, 83, 538, 6134, 365, 18, 11231, 1248, 10846, 12, 1615, 16, 296, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9612, 12, 2890, 4672, 770, 273, 365, 18, 1615, 67, 2433, 1435, 365, 18, 11231, 10846, 12, 1615, 16, 296, 42, 83, 538, 6134, 365, 18, 11231, 1248, 10846, 12, 1615, 16, 296, ...
if key_tuple in SNPpos_set:
snp_acc = '%s_%s'%(chromosome, position) if not SNPpos_set or key_tuple in SNPpos_set:
def setup_SNP_dstruc2(self, curs, snp_locus_table, cross_linking_table=None): """ 2008-02-07 2nd version """ sys.stderr.write("Setting up SNP data structure ...") SNPpos_set = Set() if cross_linking_table: curs.execute("select distinct chromosome, position from %s"%cross_linking_table) rows = curs.fetchall() for row in rows: chromosome, position = row SNPpos_set.add((chromosome, position)) snp_acc_ls = [] SNPpos2col_index = {} curs.execute("select id, snpid, chromosome, position from %s order by chromosome, position"%(snp_locus_table)) rows = curs.fetchall() for row in rows: snpid, snp_acc, chromosome, position = row key_tuple = (chromosome, position) if key_tuple in SNPpos_set: snp_acc_ls.append(snp_acc) SNPpos2col_index[key_tuple] = len(SNPpos2col_index) sys.stderr.write("Done.\n") return SNPpos2col_index, snp_acc_ls
a811b36f0821b7241b91a595c317395eb4543b84 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/a811b36f0821b7241b91a595c317395eb4543b84/Output2010InCertainSNPs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 13653, 52, 67, 72, 701, 5286, 22, 12, 2890, 16, 25326, 16, 28648, 67, 1829, 407, 67, 2121, 16, 6828, 67, 1232, 310, 67, 2121, 33, 7036, 4672, 3536, 4044, 28, 17, 3103, 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, 3875, 67, 13653, 52, 67, 72, 701, 5286, 22, 12, 2890, 16, 25326, 16, 28648, 67, 1829, 407, 67, 2121, 16, 6828, 67, 1232, 310, 67, 2121, 33, 7036, 4672, 3536, 4044, 28, 17, 3103, 17, ...
self.build_root_re = re.compile('/var/tmp/[\w\!-\.]{1,60}-build')
self.build_root_re = re.compile('/var/tmp/[\w\!-\.]{1,60}-build/')
def __init__(self): AbstractCheck.AbstractFilesCheck.__init__(self, "BuildRootCheck", ".*") self.build_root_re = re.compile('/var/tmp/[\w\!-\.]{1,60}-build')
32e6961357fc1cfca8801d570514f8dd950eabdd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10341/32e6961357fc1cfca8801d570514f8dd950eabdd/CheckBuildRoot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 4115, 1564, 18, 7469, 2697, 1564, 16186, 2738, 972, 12, 2890, 16, 315, 3116, 2375, 1564, 3113, 3552, 7388, 13, 365, 18, 3510, 67, 3085, 67, 266, 273, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 4115, 1564, 18, 7469, 2697, 1564, 16186, 2738, 972, 12, 2890, 16, 315, 3116, 2375, 1564, 3113, 3552, 7388, 13, 365, 18, 3510, 67, 3085, 67, 266, 273, 2...
gLogger.info("RequestDBFile._deleteRequest: Failed to delete %s." % requestName)
gLogger.info( "RequestDBFile._deleteRequest: Failed to delete %s." % requestName )
def deleteRequest(self,requestName): """ Delete all sub requests associated to a request """ gLogger.info("RequestDBFile._deleteRequest: Attempting to delete %s." % requestName) res = self.__locateRequest(requestName,assigned=True) if not res['OK']: gLogger.info("RequestDBFile._deleteRequest: Failed to delete %s." % requestName) return res subRequests = res['Value'] try: for subRequest in subRequests: os.remove(subRequest) gLogger.info("RequestDBFile._deleteRequest: Successfully deleted %s." % requestName) return S_OK() except Exception, x: errStr = "RequestDBFile._deleteRequest: Exception while deleting request." gLogger.exception(errStr,requestName,lException=x) return S_ERROR(errStr)
457151afa0c3cb1200853bb72493b03e8f994fca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/457151afa0c3cb1200853bb72493b03e8f994fca/RequestDBFile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 691, 12, 2890, 16, 2293, 461, 4672, 3536, 2504, 777, 720, 3285, 3627, 358, 279, 590, 3536, 314, 3328, 18, 1376, 2932, 691, 2290, 812, 6315, 3733, 691, 30, 12864, 310, 358, 1430, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 691, 12, 2890, 16, 2293, 461, 4672, 3536, 2504, 777, 720, 3285, 3627, 358, 279, 590, 3536, 314, 3328, 18, 1376, 2932, 691, 2290, 812, 6315, 3733, 691, 30, 12864, 310, 358, 1430, ...
resource_obj = pooler.get_pool(cr.dbname).get('resource.resource').browse(cr,uid,resource_id)[0] if resource_obj.calendar_id:
if resource_id : resource_obj = pooler.get_pool(cr.dbname).get('resource.resource').browse(cr,uid,resource_id)[0] if resource_obj.calendar_id: calendar_id = resource_obj.calendar_id.id resource_leave_ids = pooler.get_pool(cr.dbname).get('resource.calendar.leaves').search(cr,uid,[('resource_id','=',resource_id)]) else: calendar_id = project.resource_calendar_id.id resource_leave_ids = pooler.get_pool(cr.dbname).get('resource.calendar.leaves').search(cr,uid,[('calendar_id','=',project.resource_calendar_id.id)])
def _compute_date(self, cr, uid, data, context):
afacda2c1dc8e7495aa88496b9db7c3ac70bf127 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/afacda2c1dc8e7495aa88496b9db7c3ac70bf127/compute_tasks_date.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9200, 67, 712, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9200, 67, 712, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
f.write('template< %s > static inline be_create<T> create(%s) { return be_create<T>(new T(%s)); }\n' % (types, params, args));
f.write('template< int ARENA, %s > static inline be_pointer_<T> create(%s)\n' % (types, params)) f.write('{\n') f.write(' void* mem = BugEngine::Memory<ARENA>::alloc(sizeof(T), be_alignof(T));\n') f.write(' return be_pointer_<T>(new(mem) T(%s), &BugEngine::Memory<ARENA>::free);\n' % args) f.write('}\n');
def template(f, n, const, types = '', params = '', args = ''): if n > 0: if const: if types: template(f, n-1, False, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) template(f, n-1, True, ('class A%d, ' % n)+types, ('const A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) else: template(f, n-1, False, ('class A%d ' % n), ('const A%d& a%d' %(n,n)), ('a%d'%n)) template(f, n-1, True, ('class A%d ' % n), ('const A%d& a%d' %(n,n)), ('a%d'%n)) else: if types: template(f, n-1, False, ('class A%d, ' % n)+types, ('A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) template(f, n-1, True, ('class A%d, ' % n)+types, ('A%d& a%d, ' %(n,n)) + params, ('a%d, '%n) + args) else: template(f, n-1, False, ('class A%d ' % n), ('A%d& a%d' %(n,n)), ('a%d'%n)) template(f, n-1, True, ('class A%d ' % n), ('A%d& a%d' %(n,n)), ('a%d'%n)) elif const: if types : f.write('template< %s > static inline be_create<T> create(%s) { return be_create<T>(new T(%s)); }\n' % (types, params, args)); else: f.write('static inline be_create<T> create() { return be_create<T>(new T()); }\n');
003bc1c00b1bf57df4dc91ba387d83d9871a9515 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/003bc1c00b1bf57df4dc91ba387d83d9871a9515/generate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1542, 12, 74, 16, 290, 16, 1866, 16, 1953, 273, 10226, 859, 273, 10226, 833, 273, 875, 4672, 309, 290, 405, 374, 30, 309, 1866, 30, 309, 1953, 30, 1542, 12, 74, 16, 290, 17, 21, 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, 1542, 12, 74, 16, 290, 16, 1866, 16, 1953, 273, 10226, 859, 273, 10226, 833, 273, 875, 4672, 309, 290, 405, 374, 30, 309, 1866, 30, 309, 1953, 30, 1542, 12, 74, 16, 290, 17, 21, 16...
def DependentProjects(target_dicts, roots):
def _DependentProjects(target_dicts, roots):
def DependentProjects(target_dicts, roots): dependents = set() for r in roots: spec = target_dicts[r] r_deps = spec.get('dependencies', []) for d in r_deps: if d not in roots: dependents.add(d) for d in DependentProjects(target_dicts, r_deps): if d not in roots: dependents.add(d) return list(dependents)
d249efc89497c4f919111f2805c825218080cdd4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/d249efc89497c4f919111f2805c825218080cdd4/msvs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 18571, 15298, 12, 3299, 67, 16287, 16, 12876, 4672, 2447, 4877, 273, 444, 1435, 364, 436, 316, 12876, 30, 857, 273, 1018, 67, 16287, 63, 86, 65, 436, 67, 14877, 273, 857, 18, 588,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 18571, 15298, 12, 3299, 67, 16287, 16, 12876, 4672, 2447, 4877, 273, 444, 1435, 364, 436, 316, 12876, 30, 857, 273, 1018, 67, 16287, 63, 86, 65, 436, 67, 14877, 273, 857, 18, 588,...
if use_poll: if hasattr(select, 'poll'): poll_fun = poll3 else: poll_fun = poll2
if use_poll and hasattr(select, 'poll'): poll_fun = poll2
def loop(timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll: if hasattr(select, 'poll'): poll_fun = poll3 else: poll_fun = poll2 else: poll_fun = poll while map: poll_fun(timeout, map)
6c366da91f57d174e6fda5e2895875912eea7d00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6c366da91f57d174e6fda5e2895875912eea7d00/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2798, 12, 4538, 33, 5082, 18, 20, 16, 999, 67, 13835, 33, 20, 16, 852, 33, 7036, 4672, 309, 852, 353, 599, 30, 852, 273, 2987, 67, 1458, 225, 309, 999, 67, 13835, 471, 3859, 12, 40...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2798, 12, 4538, 33, 5082, 18, 20, 16, 999, 67, 13835, 33, 20, 16, 852, 33, 7036, 4672, 309, 852, 353, 599, 30, 852, 273, 2987, 67, 1458, 225, 309, 999, 67, 13835, 471, 3859, 12, 40...
'Testing cloning of simulator' pop = population(size=[10, 4], loci=[2, 5])
'Testing simulator::clone() of simulator' pop = population(size=[100, 40], loci=[2, 5])
def testClone(self): 'Testing cloning of simulator' pop = population(size=[10, 4], loci=[2, 5]) simu = simulator(pop, randomMating(), rep = 3) simu.evolve( preOps = [initByFreq([0.3, .7])], ops = [stat(alleleFreq=range(pop.totNumLoci()))], gen = 10 ) simu1 = simu.clone() for i in range(3): self.assertEqual(simu.population(i), simu1.population(i)) self.assertEqual(simu1.gen(), simu.gen()) # test if a cloned simulator can evolve again simu1.evolve( ops = [stat(alleleFreq=range(pop.totNumLoci()))], gen = 20 )
85f8c4f143db569a012cd27352ae6916d9ae14eb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/401/85f8c4f143db569a012cd27352ae6916d9ae14eb/test_04_simulator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 10930, 12, 2890, 4672, 296, 22218, 3142, 11775, 2866, 14056, 1435, 434, 3142, 11775, 11, 1843, 273, 11209, 12, 1467, 22850, 6625, 16, 8063, 6487, 1515, 77, 22850, 22, 16, 1381, 5717,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10930, 12, 2890, 4672, 296, 22218, 3142, 11775, 2866, 14056, 1435, 434, 3142, 11775, 11, 1843, 273, 11209, 12, 1467, 22850, 6625, 16, 8063, 6487, 1515, 77, 22850, 22, 16, 1381, 5717,...
if e.errno <> errno.EEXIST: raise
if e.errno != errno.EEXIST: raise
def setUp(self): if verbose: dbutils._deadlock_VerboseFile = sys.stdout
84bfc1c78111826eccab274298fddefcdd1750be /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/84bfc1c78111826eccab274298fddefcdd1750be/test_thread.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 309, 3988, 30, 1319, 5471, 6315, 22097, 739, 67, 14489, 812, 273, 2589, 18, 10283, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 24292, 12, 2890, 4672, 309, 3988, 30, 1319, 5471, 6315, 22097, 739, 67, 14489, 812, 273, 2589, 18, 10283, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
aString = self.anEml.asString()
aString = anEml.asString()
def saveModel( self , aModel ): # aModel : a file name (string) or a file object # return -> None # This method can thwor exceptions. # creates ana seve an EML instance self.anEml = eml.Eml()
44d8ce7a7552e0f9ae426d587cd45c327adfc1ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/44d8ce7a7552e0f9ae426d587cd45c327adfc1ea/Session.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 1488, 12, 365, 269, 279, 1488, 262, 30, 468, 279, 1488, 294, 279, 585, 508, 261, 1080, 13, 578, 279, 585, 733, 468, 327, 317, 599, 468, 1220, 707, 848, 286, 91, 280, 4798, 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, 1923, 1488, 12, 365, 269, 279, 1488, 262, 30, 468, 279, 1488, 294, 279, 585, 508, 261, 1080, 13, 578, 279, 585, 733, 468, 327, 317, 599, 468, 1220, 707, 848, 286, 91, 280, 4798, 18, ...
total += float(maxImpTotalSci) / player.effSciPoints item.tETC = res.formatTime(value)
if player.effSciPoints > 0: total += float(maxImpTotalSci) / player.effSciPoints item.tETC = res.formatTime(value) else: total = 0 item.tETC = res.getNA()
def show(self): player = client.getPlayer() # title self.win.vRQueueTitle.text = _('Research queue [%d pts/turn]') % ( player.effSciPoints, ) self.win.title = _("Research [TL%d]") % player.techLevel # Known techs items = [] #~researchable = {} disabled = [] taskIDs = {} for task in player.rsrchQueue: taskIDs[task.techID] = None for techID in player.techs.keys(): tech = client.getTechInfo(techID) improvement = player.techs[techID] item = ui.Item(tech.name, techID = techID, tLevel = '%d-%d' % (tech.level, improvement), tStruct = (' ', '*')[tech.isStructure], tShip = (' ', '*')[tech.isShipEquip], ) if improvement < Rules.techMaxImprovement and improvement < tech.maxImprovement: neededSci = Utils.getTechRCost(player, techID) if player.effSciPoints > 0: item.tETC = res.formatTime(float(neededSci) / player.effSciPoints) else: item.tETC = _("N/A") found = 0 if taskIDs.has_key(techID): item.foreground = (0xd0, 0xd0, 0xd0) else: item.foreground = None else: item.tETC = res.getNA() item.foreground = (0x80, 0x80, 0x80) if not self.showCompleted: # skip this item continue items.append(item) disabled.extend(tech.researchDisables) #~for improvement in range(1, improvement + 1): #~ for techID in tech.researchEnables[improvement]: #~ researchable[techID] = 1 self.win.vKTechs.items = items self.win.vKTechs.itemsChanged() # Research queue items = [] index = 0 queueTechs = [] total = 0 for task in player.rsrchQueue: tech = client.getTechInfo(task.techID) fulltech = client.getFullTechInfo(task.techID) queueTechs.append(task.techID) item = ui.Item(tech.name, techID = task.techID, index = index) researchSci = Utils.getTechRCost(player, task.techID, task.improvement) maxImprovement = min(Rules.techMaxImprovement,fulltech.maxImprovement) maxImpTotalSci = 0 if task.improveToMax and task.improvement < maxImprovement: for impr in range(task.improvement+1,maxImprovement+1): maxImpTotalSci += Utils.getTechRCost(player, task.techID, impr) item.tooltip = _("Research points %d/%d, change %d pts/turn.") % (task.currSci, researchSci, task.changeSci) item.statustip = item.tooltip item.tImpToMax = ["", "*"][task.improveToMax] item.tImproveToMax = task.improveToMax if task.currSci > 0: item.tProgress = _("%d %%") % int(task.currSci * 100 / researchSci) else: item.tProgress = _("-") if task.changeSci > 0: value = float(researchSci - task.currSci) / max(task.changeSci, player.effSciPoints) total += int(value + 1) total += float(maxImpTotalSci) / player.effSciPoints item.tETC = res.formatTime(value) elif task.changeSci < 0: value = - float(task.currSci) / min(task.changeSci, player.effSciPoints) item.tETC = _("[%s]") % res.formatTime(value) elif player.effSciPoints > 0: value = float(researchSci) / player.effSciPoints total += int(value + 1) total += float(maxImpTotalSci) / player.effSciPoints item.tETC = res.formatTime(value) else: item.tETC = res.getNA() item.tLevel = _("%d-%d") % (tech.level, task.improvement) items.append(item) index += 1 self.win.vRQueue.items = items self.win.vRQueue.itemsChanged() self.win.vRQueueTop.enabled = 0 self.win.vRQueueUp.enabled = 0 self.win.vRQueueDown.enabled = 0 self.win.vRQueueAbort.enabled = 0 self.win.vRQueueRepat.enabled = 0 self.win.vRQueueRepat.pressed = 0 self.win.vRQueueInfo.enabled = 0 self.win.vRTotal.text = res.formatTime(total) # Researchable techs items = [] for techID in client.getAllTechIDs(): if player.techs.has_key(techID) or techID in queueTechs \ or techID in disabled: continue # can check requirements tech = client.getTechInfo(techID) if not hasattr(tech, "partialData"): continue item = ui.Item(tech.name, tLevel = tech.level, techID = techID) if hasattr(tech, 'isStructure'): item.tStruct = ('', '*')[tech.isStructure] else: item.tStruct = '' if hasattr(tech, 'isShipEquip'): item.tShip = ('', '*')[tech.isShipEquip] else: item.tShip = '' if hasattr(tech, 'researchMod'): neededSci = Utils.getTechRCost(player, techID) if player.effSciPoints > 0: item.tETC = res.formatTime(float(neededSci) / player.effSciPoints) else: item.tETC = _("N/A") item.foreground = None else: item.tSci = res.getNA() item.foreground = (0xc0, 0xc0, 0xc0) # skip this item continue if hasattr(tech, "researchDisables") and tech.researchDisables: item.foreground = (0xff, 0xff, 0x00) if client.getFullTechInfo(techID).finishResearchHandler == TechHandlers.finishResTLAdvance: item.foreground = gdata.sevColors[gdata.CRI] items.append(item) self.win.vRTechs.items = items self.win.vRTechs.itemsChanged()
4c37fc6c7c62e4c470762352f7c3dd804a6e0d25 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10927/4c37fc6c7c62e4c470762352f7c3dd804a6e0d25/ResearchDlg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 4672, 7291, 273, 1004, 18, 588, 12148, 1435, 468, 2077, 365, 18, 8082, 18, 90, 54, 3183, 4247, 18, 955, 273, 389, 2668, 607, 73, 991, 2389, 9799, 72, 13397, 19, 20922, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 4672, 7291, 273, 1004, 18, 588, 12148, 1435, 468, 2077, 365, 18, 8082, 18, 90, 54, 3183, 4247, 18, 955, 273, 389, 2668, 607, 73, 991, 2389, 9799, 72, 13397, 19, 20922, ...
def supportsTransactionalUndo(self): return 1
def supportsTransactionalUndo(self): return 1
f595f7e744ab4563b9c1110f57e46dca888b385d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10048/f595f7e744ab4563b9c1110f57e46dca888b385d/FileStorage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6146, 3342, 287, 31224, 12, 2890, 4672, 327, 404, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6146, 3342, 287, 31224, 12, 2890, 4672, 327, 404, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if not find_in_path(os_environ['PATH'], 'rtmpdump'):
if not find_in_path(os.environ['PATH'], 'rtmpdump'):
def make_cmd_args(video, options, streaming=False): if not find_in_path(os_environ['PATH'], 'rtmpdump'): print >> stderr, 'Error: rtmpdump has not been found' exit(1) if 'rtmp_url' not in video: get_video_player_info(video, options) output_file = None if not streaming: output_file = urlparse.urlparse(video['url']).path.split('/')[-1] output_file = output_file.replace('.html', '_%s_%s.flv' % (options.quality, options.lang)) cmd_args = '--rtmp %s --flv %s --swfVfy %s' % (video['rtmp_url'], output_file, video['player_url']) else: cmd_args = '--rtmp %s --swfVfy %s' % (video['rtmp_url'], video['player_url']) if not options.verbose: cmd_args += ' --quiet' if not streaming: if os_path_exists(output_file): # try to resume a download cmd_args += ' --resume' print ':: Resuming download of %s' % output_file else: print ':: Downloading to %s' % output_file else: print ':: Streaming from %s' % video['rtmp_url'] return cmd_args
dd84159756778af9a20710245188c70555fadd0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11589/dd84159756778af9a20710245188c70555fadd0e/arte+7.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 4172, 67, 1968, 12, 9115, 16, 702, 16, 12833, 33, 8381, 4672, 309, 486, 1104, 67, 267, 67, 803, 12, 538, 18, 28684, 3292, 4211, 17337, 296, 3797, 1291, 8481, 11, 4672, 1172, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 4172, 67, 1968, 12, 9115, 16, 702, 16, 12833, 33, 8381, 4672, 309, 486, 1104, 67, 267, 67, 803, 12, 538, 18, 28684, 3292, 4211, 17337, 296, 3797, 1291, 8481, 11, 4672, 1172, ...
if rec["RECORD"] == "REMARK":
rec_type = rec["RECORD"] if rec_type == "REMARK":
def read_pdb(path): sec = time.time() records = pdbmodule.read(path) sec = time.time() - sec if records != None: print "%s: %d records in %.2f seconds" % ( path, len(records), sec) else: print "%s: NO RECORDS" % (path) for rec in records: if rec["RECORD"] == "REMARK": try: text = rec["text"] except KeyError: pass else: if text.find("RESOLUTION RANGE HIGH") == 1: print text
7ec4c6518170b22cfaef5e2cd7fdbf21624c8b92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/7ec4c6518170b22cfaef5e2cd7fdbf21624c8b92/test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 17414, 12, 803, 4672, 1428, 377, 273, 813, 18, 957, 1435, 3853, 273, 10892, 2978, 18, 896, 12, 803, 13, 1428, 377, 273, 813, 18, 957, 1435, 300, 1428, 225, 309, 3853, 480, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 17414, 12, 803, 4672, 1428, 377, 273, 813, 18, 957, 1435, 3853, 273, 10892, 2978, 18, 896, 12, 803, 13, 1428, 377, 273, 813, 18, 957, 1435, 300, 1428, 225, 309, 3853, 480, 5...