rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
self._source_dir = os.path.abspath(self._source_dir).replace('\\', '/')
self._source_dir = layout_package.path_utils.get_absolute_path( self._source_dir)
def __init__(self, options, args, test): # The known list of tests. # Recognise the original abbreviations as well as full executable names. self._test_list = { "base": self.TestBase, "base_unittests": self.TestBase, "browser": self.TestBrowser, "browser_tests": self.TestBrowser, "googleurl": self.TestG...
826716cf8f80fdf2d67e0d427ed89b309427e368 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/826716cf8f80fdf2d67e0d427ed89b309427e368/chrome_tests.py
def TestLayoutChunk(self, chunk_num, chunk_size): # Run tests [chunk_num*chunk_size .. (chunk_num+1)*chunk_size) from the # list of tests. Wrap around to beginning of list at end. # If chunk_size is zero, run all tests in the list once. # If a text file is given as argument, it is used as the list of tests. # # Build ...
826716cf8f80fdf2d67e0d427ed89b309427e368 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/826716cf8f80fdf2d67e0d427ed89b309427e368/chrome_tests.py
def TestLayoutChunk(self, chunk_num, chunk_size): # Run tests [chunk_num*chunk_size .. (chunk_num+1)*chunk_size) from the # list of tests. Wrap around to beginning of list at end. # If chunk_size is zero, run all tests in the list once. # If a text file is given as argument, it is used as the list of tests. # # Build ...
826716cf8f80fdf2d67e0d427ed89b309427e368 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/826716cf8f80fdf2d67e0d427ed89b309427e368/chrome_tests.py
script = os.path.join(self._source_dir, "third_party", "WebKit", "WebKitTools", "Scripts", "run-chromium-webkit-tests")
script = os.path.join(self._source_dir, "webkit", "tools", "layout_tests", "run_webkit_tests.py")
def TestLayoutChunk(self, chunk_num, chunk_size): # Run tests [chunk_num*chunk_size .. (chunk_num+1)*chunk_size) from the # list of tests. Wrap around to beginning of list at end. # If chunk_size is zero, run all tests in the list once. # If a text file is given as argument, it is used as the list of tests. # # Build ...
826716cf8f80fdf2d67e0d427ed89b309427e368 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/826716cf8f80fdf2d67e0d427ed89b309427e368/chrome_tests.py
def TestLayoutChunk(self, chunk_num, chunk_size): # Run tests [chunk_num*chunk_size .. (chunk_num+1)*chunk_size) from the # list of tests. Wrap around to beginning of list at end. # If chunk_size is zero, run all tests in the list once. # If a text file is given as argument, it is used as the list of tests. # # Build ...
826716cf8f80fdf2d67e0d427ed89b309427e368 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/826716cf8f80fdf2d67e0d427ed89b309427e368/chrome_tests.py
os.path.join(chrome_src, 'chrome', 'Release')],
os.path.join(chrome_src, 'build', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release'), os.path.join(chrome_src, 'build', 'Release')],
def _LocateBinDirs(): """Setup a few dirs where we expect to find dependency libraries.""" script_dir = os.path.dirname(__file__) chrome_src = os.path.join(script_dir, os.pardir, os.pardir, os.pardir) bin_dirs = { 'linux2': [ os.path.join(chrome_src, 'out', 'Debug'), os.path.join(chrome_src, 'sconsbuild', 'Debug'), os...
5ef62836924fcbc86b81b6988203cc6bb9025274 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/5ef62836924fcbc86b81b6988203cc6bb9025274/pyauto.py
BASE_DIRECTORY = BASE_DIRECTORY.lower()
def main(argv): usage = """Usage: python %prog [--root <root>] [tocheck] tocheck Specifies the directory, relative to root, to check. This defaults to "." so it checks everything.
2af82b1d4a3b9c163976e54cfbd0f8c35876c9de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/2af82b1d4a3b9c163976e54cfbd0f8c35876c9de/checkperms.py
if match: content = callback + '(' + content + ')'
if match: content = callback + '(' + content.decode('utf-8') + ')'
def get(self): extURL = cgi.escape(self.request.get('extURL')) extMethod = cgi.escape(self.request.get('extMethod')) queryString = cgi.escape(self.request.query_string) queryDict = dict(cgi.parse_qsl(queryString)) callback = cgi.escape(self.request.get('_callback')) if queryString: error = 1 method = urlfetch.POST if...
6c0c6127b88c8d22e8a85c061c829495e7b102cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4730/6c0c6127b88c8d22e8a85c061c829495e7b102cd/main.py
entry += " '%s', '%s', '%s'))\n" % ( moduleName, 'deprecated', 'deprecated' )
if kind == "Library": entry += " '%s', '%s', '%s'), '%s')\n" % ( moduleName, 'deprecated', 'deprecated', moduleName.upper()) else: entry += " '%s', '%s', '%s'))\n" % ( moduleName, 'deprecated', 'deprecated')
def _appendToProjectsPy(self, moduleName, branchLocation, destination, template):
3925db88d2e61520883dbac95d7c6c3a691b5a25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8259/3925db88d2e61520883dbac95d7c6c3a691b5a25/CreateModule.py
self.addPluginPath(os.path.join("/usr","lib", "python%d.%d" % (major, minor), "dist-packages", "openwns", "wrowser", "playgroundPlugins"))
self.addPluginPath(os.path.join("/usr","local","lib", "python%d.%d" % (major, minor), "dist-packages", "openwns", "wrowser", "playgroundPlugins"))
def __init__(self): """ Initialization of members. No other functionality. """ usage = "" usage += "The list below shows global available options.\n"
e36edf9b9c57abae39db63edbd5bd7eab0682e0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8259/e36edf9b9c57abae39db63edbd5bd7eab0682e0c/Core.py
self.field, self.form, self),
self.field, self.form, self.content),
def update(self): value = zope.component.queryMultiAdapter( (self.context, self.request, self.widget, self.field, self.form, self), interfaces.IValue, name='message') if value is not None: self.message = value.get() else: self.message = self.createMessage()
146fdad2add02d557db2e20767788118fb4c9db2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9738/146fdad2add02d557db2e20767788118fb4c9db2/error.py
iface = zope.interface.interface.InterfaceClass( 'IGeneratedForObject_%i' %hash(spec)) zope.interface.alsoProvides(spec, iface) spec = iface
ifaceName = 'IGeneratedForObject_%i' %hash(spec) existingInterfaces = [ i for i in zope.interface.directlyProvidedBy(spec) if i.__name__ == ifaceName ] if len(existingInterfaces) > 0: spec = existingInterfaces[0] else: iface = zope.interface.interface.InterfaceClass(ifaceName) zope.interface.alsoProvides(spec, i...
def getSpecification(spec, force=False): """Get the specification of the given object. If the given object is already a specification acceptable to the component architecture, it is simply returned. This is true for classes and specification objects (which includes interfaces). In case of instances, an interface is g...
be0bba083835a33b27b4b10491d68f7fc8329882 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9738/be0bba083835a33b27b4b10491d68f7fc8329882/util.py
return self.data.get(self.field.__name__, self.field.missing_value)
value = self.data.get(self.field.__name__, _marker) if value is _marker: raise AttributeError return value
def get(self): """See z3c.form.interfaces.IDataManager""" return self.data.get(self.field.__name__, self.field.missing_value)
f6391c0844f6d93d411beb0a137738bfb5fb71a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9738/f6391c0844f6d93d411beb0a137738bfb5fb71a8/datamanager.py
baseuri+"
baseuri+prefix,
def _construct_ids(self, element, prefix, baseuri, skip_fragments=[], find_definitions = False): find_definitions_recursive = find_definitions counters = defaultdict(int) if isinstance(element, CompoundStructure): # Hitta begreppsdefinitioner if isinstance(element, Paragraf): # kolla om frsta stycket innehller en text ...
21ee45414c1c3eda58f24ceeca3d664bce6dc2f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/21ee45414c1c3eda58f24ceeca3d664bce6dc2f5/SFS.py
sets = [{'label':'Naive set 1' 'predicate',TEMP['naive1'], 'data',rs1},
sets = [{'label':'Naive set 1', 'predicate':TEMP['naive1'], 'data':rs1},
def prep_annotation_file(self,basefile): print "prep_annotation_file"
78dffbf55cb8ad576cd25c3d3c8a3745589651ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/78dffbf55cb8ad576cd25c3d3c8a3745589651ab/EurlexTreaties.py
'predicate', TEMP['naive2'], 'data',rs2},
'predicate':TEMP['naive2'], 'data':rs2},
def prep_annotation_file(self,basefile): print "prep_annotation_file"
78dffbf55cb8ad576cd25c3d3c8a3745589651ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/78dffbf55cb8ad576cd25c3d3c8a3745589651ab/EurlexTreaties.py
'predicate', TEMP['naive3'], 'data',rs3},
'predicate':TEMP['naive3'], 'data':rs3},
def prep_annotation_file(self,basefile): print "prep_annotation_file"
78dffbf55cb8ad576cd25c3d3c8a3745589651ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/78dffbf55cb8ad576cd25c3d3c8a3745589651ab/EurlexTreaties.py
'predicate', TEMP['naive4'], 'data',rs4}]
'predicate':TEMP['naive4'], 'data':rs4}]
def prep_annotation_file(self,basefile): print "prep_annotation_file"
78dffbf55cb8ad576cd25c3d3c8a3745589651ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/78dffbf55cb8ad576cd25c3d3c8a3745589651ab/EurlexTreaties.py
pass
def prep_annotation_file(self,basefile): print "prep_annotation_file"
78dffbf55cb8ad576cd25c3d3c8a3745589651ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/78dffbf55cb8ad576cd25c3d3c8a3745589651ab/EurlexTreaties.py
re_urisegments = re.compile(r'([\w]+://[^/]+/[^\d]*)(\d+:(bih\. |N|)?\d+( s\.\d+|))
re_urisegments = re.compile(r'([\w]+://[^/]+/[^\d]*)(\d+:(bih\.[_ ]|N|)?\d+([_ ]s\.\d+|))
def __str__(self): return repr(self.value)
9d50284969d8486e199b290be7d233578695e282 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/9d50284969d8486e199b290be7d233578695e282/LegalRef.py
def parse(self, indata, baseuri="http://rinfo.lagrummet.se/publ/sfs/9999:999#K9P9S9P9",predicate=None): if indata == "": return indata # this actually triggered a bug... # h = hashlib.sha1() # h.update(indata) # print "Called with %r (%s) (%s)" % (indata, h.hexdigest(), self.verbose) self.predicate = predicate self.bas...
9d50284969d8486e199b290be7d233578695e282 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4027/9d50284969d8486e199b290be7d233578695e282/LegalRef.py
level = self.getFormData("level", None) if level is not None: if level=="top": query += ' AND dc_identifier:"http://purl.org/anzsrc/seo/ else: query += ' AND skos_broader:"%s"' % level
def __getSolrData(self): prefix = self.getSearchTerms() if prefix: query = '%(prefix)s OR %(prefix)s*' % { "prefix" : prefix } else: query = "*:*" req = SearchRequest(query) req.addParam("fq", 'item_type:"object"') req.addParam("fq", 'repository_type:"SEO"') req.setParam("fl", "score") req.setParam("sort", "score desc...
92e56881ea54a4103911238cb42ed8a8dc69509f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10451/92e56881ea54a4103911238cb42ed8a8dc69509f/lookup.py
def __init__(self, bundleDir, ipswDir, outDir, verbose): self.bundleDir = bundleDir self.ipswDir = ipswDir self.outDir = outDir self.verbose = verbose def fileWithSuffix(self, filePath, suffix): if filePath.lower().endswith('.dmg'): filePath = filePath[:-4] suffix = suffix + '.dmg' return path.join(self.outDir, path....
def __init__(self, bundleDir, ipswDir, outDir, verbose, x_opt): self.x_opt = x_opt self.bundleDir = bundleDir self.ipswDir = ipswDir self.outDir = outDir self.verbose = verbose def fileWithSuffix(self, filePath, suffix): if filePath.lower().endswith('.dmg'): filePath = filePath[:-4] suffix = suffix + '.dmg' return pat...
def __init__(self, bundleDir, ipswDir, outDir, verbose): self.bundleDir = bundleDir self.ipswDir = ipswDir self.outDir = outDir self.verbose = verbose
6bbaf82ec3652ee33831edd278e75b7ce0962e3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14010/6bbaf82ec3652ee33831edd278e75b7ce0962e3e/ipsw.py
parser = OptionParser() parser.add_option("-b", "--bundle", dest="bundle", help="Bundle directory to use", metavar="BUNDLE_DIR") parser.add_option("-i", "--ipsw", dest="ipsw", help="Unpacked IPSW directory", metavar="IPSW_DIR") parser.add_option("-o", "--out", dest="out", help="Output directory", metavar="OUT_DIR") par...
parser = OptionParser() parser.add_option("-b", "--bundle", dest="bundle", help="Bundle directory to use", metavar="BUNDLE_DIR") parser.add_option("-i", "--ipsw", dest="ipsw", help="Unpacked IPSW directory", metavar="IPSW_DIR") parser.add_option("-o", "--out", dest="out", help="Output directory", metavar="OUT_DIR") par...
def main(): parser = OptionParser() parser.add_option("-b", "--bundle", dest="bundle", help="Bundle directory to use", metavar="BUNDLE_DIR") parser.add_option("-i", "--ipsw", dest="ipsw", help="Unpacked IPSW directory", metavar="IPSW_DIR") parser.add_option("-o", "--out", dest="out", help="Output directory", metavar="O...
6bbaf82ec3652ee33831edd278e75b7ce0962e3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14010/6bbaf82ec3652ee33831edd278e75b7ce0962e3e/ipsw.py
kpatches = diff_kernel(sys.argv[3], sys.argv[4]) ibss = ibss_default_patches(sys.argv[1], sys.argv[2]) ibss_add_kpf(ibss, sys.argv[5]) ibss_add_kpatches(ibss, kpatches)
if len(sys.argv) < 6: print "Usage: ibss_patcher ibss_decrypted_orig ibss_out kernelcache_decrypted_orig kernelcache_decrypted_patched ibss_patchproc.bin" exit(1) kpatches = diff_kernel(sys.argv[3], sys.argv[4]) ibss = ibss_default_patches(sys.argv[1], sys.argv[2]) ibss_add_kpf(ibss, sys.argv[5]) ibss_add_kpatches(ibss...
def byte_search(image, bytes): for i in range(0, len(image) - len(bytes), 2): if image[i:i+len(bytes)] == bytes: return i return -1
b77b0fe1d965b627bf4bdd66b9aa0556fe154e8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14010/b77b0fe1d965b627bf4bdd66b9aa0556fe154e8a/ibss_patcher.py
leftOfBox = xPt[ind-1]
leftOfBox = self.xPts[ind-1]
def value(self): "preserve volume during the binning" totalVol = 0 for ind,xPt,yPt in zip(range(self.numPts), self.xPts, self.yPts): #get leftOfBox if ind == 0: if self.leftSide < xPt: leftOfBox = self.leftSide else: leftOfBox = xPt else: leftOfBox = xPt[ind-1] #get rightOfBox if ind == (self.numPts-1): if self.rightSi...
def0e7c7c6d0e42909a4dc36014312c805680c64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6231/def0e7c7c6d0e42909a4dc36014312c805680c64/SimpleRebin.py
rightOfBox=xPt[ind+1]
rightOfBox = self.xPts[ind+1]
def value(self): "preserve volume during the binning" totalVol = 0 for ind,xPt,yPt in zip(range(self.numPts), self.xPts, self.yPts): #get leftOfBox if ind == 0: if self.leftSide < xPt: leftOfBox = self.leftSide else: leftOfBox = xPt else: leftOfBox = xPt[ind-1] #get rightOfBox if ind == (self.numPts-1): if self.rightSi...
def0e7c7c6d0e42909a4dc36014312c805680c64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6231/def0e7c7c6d0e42909a4dc36014312c805680c64/SimpleRebin.py
self.value = 0.0
def __init__(self, leftSide=None, spacing=None, numXPointsToBin=None): self.numXPointsToBin = numXPointsToBin self.value = 0.0 self.xPts = [] self.yPts = [] self.leftSide = leftSide self.spacing = spacing
def0e7c7c6d0e42909a4dc36014312c805680c64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6231/def0e7c7c6d0e42909a4dc36014312c805680c64/SimpleRebin.py
if xPt >= currentBin.rightSide:
while xPt >= currentBin.rightSide:
def __init__(self, xDataP, yDataP, newBins=None, binValue = 'countPoints', format = 'columns'): xData = np.sort(xDataP) sortedInds = np.argsort(xDataP) yData = yDataP[sortedInds] self.bins=[] if type(newBins) is type(1): # this algorithm is for data that has already been binned and we're going over the bins to rebin i...
def0e7c7c6d0e42909a4dc36014312c805680c64 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6231/def0e7c7c6d0e42909a4dc36014312c805680c64/SimpleRebin.py
def onAxis(self, axesGrp, axis, index): #index: index of this axis in the axis array #we need to index that so that axis can be loaded #sequentially. mapper = axis._mapper type = types[mapper.__class__]
240e4410ae902463e8477a703c9381545269ddf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6231/240e4410ae902463e8477a703c9381545269ddf5/Renderer.py
axisGrp.create_dataset('bin centers', data = NdArray(bcs.datatype(), bcs))
axisGrp.create_dataset('bin centers', data = bcs)
def onAxis(self, axesGrp, axis, index): #index: index of this axis in the axis array #we need to index that so that axis can be loaded #sequentially. mapper = axis._mapper type = types[mapper.__class__]
240e4410ae902463e8477a703c9381545269ddf5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6231/240e4410ae902463e8477a703c9381545269ddf5/Renderer.py
if isinstance(unit, int) or isinstance(unit, float):
if isinstance(unit, int) or isinstance(unit, float) or isinstance(unit, long):
def onUnit(self, unit): if isinstance(unit, int) or isinstance(unit, float): return unit return unit.tostring()
e24de680ae382528064d4b06c84be243288fa2cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6231/e24de680ae382528064d4b06c84be243288fa2cb/Loader.py
dst = WithProperties('public_html/binaries/' + remote_name + '.bz2', 'got_revision')
dst = WithProperties('public_html/binaries/' + remote_name, 'got_revision')
def addUploadBinariesStep(factory, binaries): for (local_name, remote_name) in binaries.items(): dst = WithProperties('public_html/binaries/' + remote_name + '.bz2', 'got_revision') factory.addStep(FileUpload(slavesrc=local_name, masterdest=dst, mode=0755))
704fd5ef44d9d7d30dcbe2dbde78e42fb06afdf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1035/704fd5ef44d9d7d30dcbe2dbde78e42fb06afdf1/common.py
return pretty_date(dt)
return dt
def get_date(s): dt = datetime.strptime(s, '%Y-%m-%d %H:%M:%S') dt -= timedelta(seconds=time.timezone) # sqlite seems to save at GMT... ata :P return pretty_date(dt) # found this online
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
self.conn = cherrypy.thread_data.db self.c = self.conn.cursor()
def get_conn(self): return cherrypy.thread_data.db def get_cur(self): return self.get_conn().cursor() def fetchvar(self, query, args=()): c = self.get_cur() c.execute(query, args) return c.fetchone()[0]
def connect(self, thread_index): cherrypy.thread_data.db = sqlite3.connect('minitwit.sqlite') self.conn = cherrypy.thread_data.db self.c = self.conn.cursor()
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
self.c.execute(query, args) return self.c.fetchone()
c = self.get_cur() c.execute(query, args) return c.fetchone()
def fetchone(self, query, args=()): self.c.execute(query, args) return self.c.fetchone()
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
self.c.execute(query, args) return self.c.fetchalll()
c = self.get_cur() c.execute(query, args) return c.fetchall()
def fetchall(self, query, args=()): self.c.execute(query, args) return self.c.fetchalll()
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
self.c.execute(query, args) self.conn.commit()
c = self.get_cur() c.execute(query, args) self.get_conn().commit()
def query(self, query, args=()): self.c.execute(query, args) self.conn.commit()
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
conn = cherrypy.thread_data.db c = conn.cursor() c.execute("select rowid from users where username = ? and password = ?", (username, md5sum(password))) logged_in = c.fetchone()
logged_in = db.fetchone("select rowid from users where username = ? and password = ?", (username, md5sum(password)))
def login(self, username='', password='', redirect='/'): message = None if len(username) > 0 and len(password) > 0: conn = cherrypy.thread_data.db c = conn.cursor() c.execute("select rowid from users where username = ? and password = ?", (username, md5sum(password))) logged_in = c.fetchone() if logged_in is not None: c...
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
conn = cherrypy.thread_data.db c = conn.cursor() c.execute('select rowid, username from users where rowid = ?', (rowid,)) r = c.fetchone()
r = db.fetchone('select rowid, username from users where rowid = ?', (rowid,))
def get_logged_in(self): try: rowid = cherrypy.session.get('logged_in') conn = cherrypy.thread_data.db c = conn.cursor() c.execute('select rowid, username from users where rowid = ?', (rowid,)) r = c.fetchone() return {'id': r[0], 'username': r[1]} except: return None
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
def default(self, id=None, text=None):
def default(self, id=None, text=None, last_update=None):
def default(self, id=None, text=None): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() m = cherrypy.request.method
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
conn = cherrypy.thread_data.db c = conn.cursor()
def default(self, id=None, text=None): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() m = cherrypy.request.method
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
c.execute('select rowid, text, date from posts where rowid = ?', (id,)) r = c.fetchone()
r = db.fetchone('select rowid, text, date from posts where rowid = ?', (id,))
def default(self, id=None, text=None): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() m = cherrypy.request.method
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
c.execute('insert into posts values (?, ?, datetime("now"))', (logged_in['id'], text)) conn.commit()
db.query('insert into posts values (?, ?, datetime("now"))', (logged_in['id'], text))
def default(self, id=None, text=None): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() m = cherrypy.request.method
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
try: c.execute('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid order by date desc limit 10') return json.dumps([{'id': r[0], 'text': r[1], 'date': get_date(r[2]), 'username': r[3]} for r in c.fetchall()]) except: raise cherrypy.HTTPError(404)
if last_update is not None: last_update = int(last_update) / 1000 new_count = db.fetchvar('select count(*) from posts where strftime("%s", date) - ? > 0', (last_update,)) if int(new_count) == 0: return '[]' posts = db.fetchall('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid o...
def default(self, id=None, text=None): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() m = cherrypy.request.method
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
c.execute('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid order by date desc limit 10') posts = [{'id': r[0], 'text': r[1], 'date': get_date(r[2]), 'username': r[3]} for r in c.fetchall()]
posts = db.fetchall('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid order by date desc limit 10') posts = [{'id': r[0], 'text': r[1], 'date': pretty_date(get_date(r[2])), 'username': r[3]} for r in posts]
def index(self): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() c.execute('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid order by date desc limit 10') posts = [{'id': r[0], 'text': r[1], 'date': get_date(r[2]), 'username': r[3]} for r ...
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
c.execute('insert into users values (?, ?)', username, md5sum(password)) conn.commit()
db.query('insert into users values (?, ?)', (username, md5sum(password)))
def register(self, username='', password='', conf_password=''): message = None if len(username) > 0 and len(password) > 0 and password == conf_password: c.execute('insert into users values (?, ?)', username, md5sum(password)) conn.commit() raise cherrypy.HTTPRedirect('/session/login') elif password != conf_password: me...
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
conn = cherrypy.thread_data.db c = conn.cursor() c.execute("drop table if exists users") c.execute("drop table if exists posts") c.execute("create table users (username text, password text)") c.execute("create unique index username on users (username)") c.execute("create table posts (user int, text text, date text)") c...
db.query("drop table if exists users") db.query("drop table if exists posts") db.query("create table users (username text, password text)") db.query("create unique index username on users (username)") db.query("create table posts (user int, text text, date text)") db.query("create index user on posts (user)") db.query(...
def install(self): conn = cherrypy.thread_data.db c = conn.cursor() c.execute("drop table if exists users") c.execute("drop table if exists posts") c.execute("create table users (username text, password text)") c.execute("create unique index username on users (username)") c.execute("create table posts (user int, text t...
4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py
reqs.append((WMS.STORAGE, self.dataSplitter.getSplitInfo(jobNum)[DataSplitter.SEList]))
reqs.append((WMS.STORAGE, self.dataSplitter.getSplitInfo(jobNum).get(DataSplitter.SEList)))
def getRequirements(self, jobNum): reqs = Module.getRequirements(self, jobNum) if self.dataSplitter != None: reqs.append((WMS.STORAGE, self.dataSplitter.getSplitInfo(jobNum)[DataSplitter.SEList])) return reqs
93a456faf0c22bb4dbe3a0e8630cbf2d3bfef1af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/93a456faf0c22bb4dbe3a0e8630cbf2d3bfef1af/datamod.py
return self.dataSplitter.getSplitInfo(jobNum)[DataSplitter.SEList] != []
return self.dataSplitter.getSplitInfo(jobNum).get(DataSplitter.SEList) != []
def canSubmit(self, jobNum): if self.checkSE and (self.dataSplitter != None): return self.dataSplitter.getSplitInfo(jobNum)[DataSplitter.SEList] != [] return True
93a456faf0c22bb4dbe3a0e8630cbf2d3bfef1af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/93a456faf0c22bb4dbe3a0e8630cbf2d3bfef1af/datamod.py
lumis = []
runLumiDict = {}
def splitLumiRanges(lumis, off = 0, singlemode = False): # Split into single runs (todel, toadd) = (set(), set()) for (s, e) in lumis: if s[0] and e[0] and s[0] != e[0]: todel.add((s, e)) toadd.add((s, (s[0],None))) toadd.add(((e[0],1),e)) for x in range(s[0] + 1, e[0]): toadd.add(((x, 1), (x, None))) lumis.difference_...
52f35f2f956000a5deb28fa314db5301dbb0feb0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/52f35f2f956000a5deb28fa314db5301dbb0feb0/lumiInfo.py
lumis.append(([run_id, lumi_id], [run_id, lumi_id]))
if run_id not in runLumiDict: runLumiDict[run_id] = set() runLumiDict[run_id].add(lumi_id)
def splitLumiRanges(lumis, off = 0, singlemode = False): # Split into single runs (todel, toadd) = (set(), set()) for (s, e) in lumis: if s[0] and e[0] and s[0] != e[0]: todel.add((s, e)) toadd.add((s, (s[0],None))) toadd.add(((e[0],1),e)) for x in range(s[0] + 1, e[0]): toadd.add(((x, 1), (x, None))) lumis.difference_...
52f35f2f956000a5deb28fa314db5301dbb0feb0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/52f35f2f956000a5deb28fa314db5301dbb0feb0/lumiInfo.py
sys.stderr.write(se_utils.se_rm.lastlog)
utils.eprint(procRM.getMessage())
def incInfo(x): infos[x] = infos.get(x, 0) + 1
e76b3aedba65f87878b88516a5b506e24c9559f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/e76b3aedba65f87878b88516a5b506e24c9559f3/downloadFromSE.py
if not se_utils.se_rm(os.path.join(pathSE, name_dest)):
procRM = se_utils.se_rm(os.path.join(pathSE, name_dest)) if procRM.wait() != 0:
def incInfo(x): infos[x] = infos.get(x, 0) + 1
e76b3aedba65f87878b88516a5b506e24c9559f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/e76b3aedba65f87878b88516a5b506e24c9559f3/downloadFromSE.py
sys.stderr.write(se_utils.se_rm.lastlog)
utils.eprint(procRM.getMessage())
def incInfo(x): infos[x] = infos.get(x, 0) + 1
e76b3aedba65f87878b88516a5b506e24c9559f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/e76b3aedba65f87878b88516a5b506e24c9559f3/downloadFromSE.py
if True in map(lambda x in state, ['h', 's', 'S', 'T', 'w']):
if True in map(lambda x: x in state, ['h', 's', 'S', 'T', 'w']):
def parseJobState(self, state): if True in map(lambda x in state, ['h', 's', 'S', 'T', 'w']): return Job.QUEUED if True in map(lambda x in state, ['r', 't']): return Job.RUNNING return Job.READY
cb403baa4c61f0d5c1cea99708dd8cc658b66bb0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/cb403baa4c61f0d5c1cea99708dd8cc658b66bb0/sge.py
if True in map(lambda x in state, ['r', 't']):
if True in map(lambda x: x in state, ['r', 't']):
def parseJobState(self, state): if True in map(lambda x in state, ['h', 's', 'S', 'T', 'w']): return Job.QUEUED if True in map(lambda x in state, ['r', 't']): return Job.RUNNING return Job.READY
cb403baa4c61f0d5c1cea99708dd8cc658b66bb0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/cb403baa4c61f0d5c1cea99708dd8cc658b66bb0/sge.py
['CMSSW_DIR_UI', 'CMSSW_DIR_PRO']))
['CMSSW_DIR_USER', 'CMSSW_DIR_UI', 'CMSSW_DIR_PRO']))
def isInstrumented(cfgName): cfg = open(cfgName, 'r').read() for tag in [ "FILE_NAMES", "MAX_EVENTS", "SKIP_EVENTS" ]: if (not "__%s__" % tag in cfg) and (not "@%s@" % tag in cfg): return False return True
7ff28a826c9be976f35d0953647e71e6b446daee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7ff28a826c9be976f35d0953647e71e6b446daee/cmssw.py
submodules = map(str.strip, submodules.split(","))
submodules = filter(lambda x: x != '', map(str.strip, submodules.split(",")))
def __init__(self, config, module, submodules): Monitoring.__init__(self, config, module) submodules = map(str.strip, submodules.split(",")) self.submodules = map(lambda x: Monitoring.open(x, config, module), submodules)
426d0e5a98b3380f7db9453dfb4fd317f26ea10c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/426d0e5a98b3380f7db9453dfb4fd317f26ea10c/monitoring.py
print "You have selected the following runs and lumi sections:"
print "The following runs and lumi sections are selected:"
def __init__(self, config, datasetExpr, datasetNick, datasetID = 0): DataProvider.__init__(self, config, datasetExpr, datasetNick, datasetID) DataProvider.providers.update({'DBSApiv2': 'dbs'}) if config.getBool('CMSSW', 'dbs blacklist T1', True): T1SEs = ["-srmcms.pic.es", "-ccsrm.in2p3.fr", "-storm-fe-cms.cr.cnaf.infn...
f897484c5cce690ac68654e9232d688b164fd126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/f897484c5cce690ac68654e9232d688b164fd126/provider_dbsv2.py
else
else:
def __init__(self, config, datasetExpr, datasetNick, datasetID = 0): DataProvider.__init__(self, config, datasetExpr, datasetNick, datasetID) DataProvider.providers.update({'DBSApiv2': 'dbs'}) if config.getBool('CMSSW', 'dbs blacklist T1', True): T1SEs = ["-srmcms.pic.es", "-ccsrm.in2p3.fr", "-storm-fe-cms.cr.cnaf.infn...
f897484c5cce690ac68654e9232d688b164fd126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/f897484c5cce690ac68654e9232d688b164fd126/provider_dbsv2.py
result.append(blockInfo)
if len(blockInfo[DataProvider.FileList]) > 0: result.append(blockInfo)
def lumiFilter(lfn): for lumi in listLumiInfo[lfn]: if selectLumi(lumi, self.selectedLumis): return True return self.selectedLumis == None
f897484c5cce690ac68654e9232d688b164fd126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/f897484c5cce690ac68654e9232d688b164fd126/provider_dbsv2.py
if opts.save_exprgc: outputGC(lumis) if opts.save_exprjson: outputJSON(lumis)
if opts.diff: print "Unchanged:\n", 30 * "=" outputGC(mergeLumi(list(lumis_uc))) print "\nOnly in reference file:\n", 30 * "=" outputGC(mergeLumi(list(lumis_b))) print "\nNot in reference file:\n", 30 * "=" outputGC(mergeLumi(list(lumis_a))) else: if opts.save_exprgc: outputGC(lumis) if opts.save_exprjson: outputJSON(l...
def outputJSON(lumis, stream = sys.stdout): tmp = {} for rlrange in lumis: start, end = rlrange if start[0] != end[0]: raise if start[0] not in tmp: tmp[start[0]] = [] tmp[start[0]].append([start[1], end[1]]) stream.write("{\n") entries = map(lambda run: '\t"%d": %s' % (run, tmp[run]), sorted(tmp.keys())) stream.write(...
14a5baef75fc5cce95bc45aed6d882ef6f91d6e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/14a5baef75fc5cce95bc45aed6d882ef6f91d6e7/lumiInfo.py
fail("Could format lumi sections!" % args)
fail("Could format lumi sections!" % args)
def outputJSON(lumis, stream = sys.stdout): tmp = {} for rlrange in lumis: start, end = rlrange if start[0] != end[0]: raise if start[0] not in tmp: tmp[start[0]] = [] tmp[start[0]].append([start[1], end[1]]) stream.write("{\n") entries = map(lambda run: '\t"%d": %s' % (run, tmp[run]), sorted(tmp.keys())) stream.write(...
14a5baef75fc5cce95bc45aed6d882ef6f91d6e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/14a5baef75fc5cce95bc45aed6d882ef6f91d6e7/lumiInfo.py
splitter = DataSplitter.loadState(workDir)
splitter = DataSplitter.loadState(os.path.join(workDir, 'datamap.tar'))
def outputJSON(lumis, stream = sys.stdout): tmp = {} for rlrange in lumis: start, end = rlrange if start[0] != end[0]: raise if start[0] not in tmp: tmp[start[0]] = [] tmp[start[0]].append([start[1], end[1]]) stream.write("{\n") entries = map(lambda run: '\t"%d": %s' % (run, tmp[run]), sorted(tmp.keys())) stream.write(...
71b52549389d2ded282718a35b0b83df5fc57d02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/71b52549389d2ded282718a35b0b83df5fc57d02/lumiInfo.py
args = str.join(' ', map(lambda x: '"%s"' % ensurePrefix(x).replace('dir://', 'file://'), urls))
args = str.join(' ', map(lambda x: '"%s"' % ensurePrefix(x).replace('dir://', 'file:////'), urls))
def se_runcmd(cmd, varDict = {}, *urls): runLib = utils.pathGC('share', 'gc-run.lib') args = str.join(' ', map(lambda x: '"%s"' % ensurePrefix(x).replace('dir://', 'file://'), urls)) varString = str.join(' ', map(lambda x: 'export %s="%s";' % (x, varDict[x]), varDict)) return utils.LoggedProcess('source %s || exit 1; %...
e27c72169fa85a2d86bcb55f45c95fb861be5f69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/e27c72169fa85a2d86bcb55f45c95fb861be5f69/storage.py
params += " -l h_cpu=%s" % strTime(reqs[WMS.WALLTIME])
params += " -l h_cpu=%s" % strTime(reqs[WMS.CPUTIME])
def getSubmitArguments(self, jobNum, sandbox, stdout, stderr): # Restart jobs = no, job name params = ' -r n -N %s' % self.wms.getJobName(jobNum)
0cf9bdc4cfbefe2f95329ada2f3370f149e212a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/0cf9bdc4cfbefe2f95329ada2f3370f149e212a6/sge.py
yield utils.pathGC('python', 'grid_control_cms', 'share', 'DashboardAPI', file)
yield utils.pathGC('python', 'grid_control_cms', 'DashboardAPI', file)
def getFiles(self): for file in ('DashboardAPI.py', 'Logger.py', 'ProcInfo.py', 'apmon.py', 'report.py'): yield utils.pathGC('python', 'grid_control_cms', 'share', 'DashboardAPI', file)
3663b04e9a2b7dc039595413dcad2e0741efb021 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/3663b04e9a2b7dc039595413dcad2e0741efb021/dashboard.py
self.addAttr = dict(map(lambda item: (item, config.get(wmsapi, item)), config.parser.options(wmsapi)))
self.addAttr = {} if wmsapi in config.parser.sections(): self.addAttr = dict(map(lambda item: (item, config.get(wmsapi, item)), config.parser.options(wmsapi)))
def __init__(self, config, module, monitor): WMS.__init__(self, config, module, monitor, 'local')
b872b4f0bcdccea6c42bbdf863d5d755a5e9c377 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/b872b4f0bcdccea6c42bbdf863d5d755a5e9c377/local_wms.py
jobList = utils.sorted(map(lambda (jobNum, path): jobNum, Job.readJobs(opts.workDir)))
jobList = utils.sorted(map(lambda (jobNum, path): jobNum, Job.readJobs(os.path.join(opts.workDir, 'jobs'))))
def getOutputDatasets(opts): # Get job numbers, task id, ... log = utils.ActivityLog(' * Reading task info...') jobList = utils.sorted(map(lambda (jobNum, path): jobNum, Job.readJobs(opts.workDir))) taskInfo = utils.PersistentDict(os.path.join(opts.workDir, 'task.dat'), ' = ') del log print " * Reading task info - done...
d862606bc0fa59bbeb39d59a9febf18925bad8b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/d862606bc0fa59bbeb39d59a9febf18925bad8b3/datasetDBSAdd.py
tmp.sort(cmp=cmpLumi)
tmp.sort(cmpLumi)
def cmpLumi(a,b): (start_a_run, start_a_lumi) = a[0] (start_b_run, start_b_lumi) = b[0] if start_a_run == start_b_run: return cmp(start_a_lumi, start_b_lumi) else: return cmp(start_a_run, start_b_run)
d8c727b1ba9db51bcde07ea7b37433989a3240e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/d8c727b1ba9db51bcde07ea7b37433989a3240e8/provider_dbsv2.py
realmain(opts, args)
def processShorthand(optSet): if optSet: parser.parse_args(args = optSet.split() + sys.argv[1:], values = opts)
23d7c40a8f1f0faeeeaadfdd288f6348ecf9076e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/23d7c40a8f1f0faeeeaadfdd288f6348ecf9076e/downloadFromSE2.py
if job.get('download') == 'True' and not opt.markIgnoreDL:
if job.get('download') == 'True' and not opts.markIgnoreDL:
def incInfo(x): infos[x] = infos.get(x, 0) + 1
23d7c40a8f1f0faeeeaadfdd288f6348ecf9076e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/23d7c40a8f1f0faeeeaadfdd288f6348ecf9076e/downloadFromSE2.py
if not 'http://' in src: src = "http://cmsdbsprod.cern.ch/%s/servlet/DBSServlet" % src self.args['url'] = src
if src != '': if not 'http://' in src: src = "http://cmsdbsprod.cern.ch/%s/servlet/DBSServlet" % src self.args['url'] = src
def __init__(self, config, datasetExpr, datasetNick, datasetID = 0): DataProvider.__init__(self, config, datasetExpr, datasetNick, datasetID) DataProvider.providers.update({'DBSApiv2': 'dbs'})
8ff40c8a99d09910378a410fed5476f92791c590 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/8ff40c8a99d09910378a410fed5476f92791c590/provider_dbsv2.py
WMS.__init__(self, config, module, monitor, 'local', wmsapi)
WMS.__init__(self, config, module, monitor, 'local', self.api)
def __init__(self, config, module, monitor): wmsapi = config.get('local', 'wms', self._guessWMS()) if wmsapi != self._guessWMS(): utils.vprint('Default batch system on this host is: %s' % self._guessWMS(), -1, once = True) self.api = LocalWMSApi.open(wmsapi, config, self) utils.vprint('Using batch system: %s' % self.ap...
0cad501ee6fe7d11e4d244dfe26a572b1c45cfae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/0cad501ee6fe7d11e4d244dfe26a572b1c45cfae/local_wms.py
list = filter(lambda x: self._jobs.get(x, Job()).attempt < self.maxRetry, self.ready)
list = filter(lambda x: self._jobs.get(x, Job()).attempt - 1 < self.maxRetry, self.ready)
def getSubmissionJobs(self, maxsample): # Determine number of jobs to submit submit = self.nJobs nQueued = len(self.queued) if self.inQueue > 0: submit = min(submit, self.inQueue - nQueued) if self.inFlight > 0: submit = min(submit, self.inFlight - nQueued - len(self.running)) if self.config.opts.continuous: submit = m...
29ce5a23e477b88d191bb796bb2443bffeab4377 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/29ce5a23e477b88d191bb796bb2443bffeab4377/job_db.py
parser.add_option("-u", '--update', dest="update", default=False, action="store_true",
parser.add_option("-u", '--update', dest="update", default=False, action="store_true",
def main(args): help = \
c6a0ee5c2a66f2279cfdc6c8b3f53f6239ab6664 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/c6a0ee5c2a66f2279cfdc6c8b3f53f6239ab6664/downloadFromSE.py
opts.output = os.path.abspath(os.path.join(workDir, 'se_output'))
opts.output = os.path.join(workDir, 'se_output') opts.output = os.path.abspath(opts.output)
def main(args): help = \
c6a0ee5c2a66f2279cfdc6c8b3f53f6239ab6664 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/c6a0ee5c2a66f2279cfdc6c8b3f53f6239ab6664/downloadFromSE.py
if (realmain(opts, args) or not opts.loop) and not opts.infinite: break time.sleep(60)
try: if (realmain(opts, args) or not opts.loop) and not opts.infinite: break time.sleep(60) except KeyboardInterrupt: print "\n\nDownload aborted!\n" sys.exit(1)
def processShorthand(optSet): if optSet: parser.parse_args(args = optSet.split() + sys.argv[1:], values = opts)
45e0a8366ef09ad2b9900eb80d335aaa03af6bdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/45e0a8366ef09ad2b9900eb80d335aaa03af6bdc/downloadFromSE.py
utils.eprint(procRM.getMessage())
utils.eprint("%s\n\n" % procRM.getMessage())
def dlfs_rm(path, msg): procRM = se_utils.se_rm(path) if procRM.wait() != 0: print "\t\tUnable to remove %s!" % msg utils.eprint(procRM.getMessage())
45e0a8366ef09ad2b9900eb80d335aaa03af6bdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/45e0a8366ef09ad2b9900eb80d335aaa03af6bdc/downloadFromSE.py
procCP = se_utils.se_copy(os.path.join(pathSE, name_dest), outFilePath) if procCP.wait() != 0:
myGetSize = lambda x: "(%7s)" % gcSupport.prettySize(os.path.getsize(x.replace('file://', ''))) def monitorFile(path, lock): while not lock.acquire(False): try: print "\r\t", name_dest, myGetSize(path), sys.stdout.flush() except: pass time.sleep(1) lock.release() monitorLock = threading.Lock() monitorLock.acquire() mo...
def processSingleJob(jobNum): print "Job %d:" % jobNum,
45e0a8366ef09ad2b9900eb80d335aaa03af6bdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/45e0a8366ef09ad2b9900eb80d335aaa03af6bdc/downloadFromSE.py
checkPath = checkPath.replace('file://', '') print "(%s)" % gcSupport.prettySize(os.path.getsize(checkPath)), hashLocal = md5sum(checkPath) if 'file://' not in outFilePath:
hashLocal = md5sum(checkPath.replace('file://', '')) if not ('file://' in outFilePath):
def processSingleJob(jobNum): print "Job %d:" % jobNum,
45e0a8366ef09ad2b9900eb80d335aaa03af6bdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/45e0a8366ef09ad2b9900eb80d335aaa03af6bdc/downloadFromSE.py
lumirange = __LUMI_RANGE__
lumirange = [__LUMI_RANGE__]
def customise_for_gc(process): try: maxevents = __MAX_EVENTS__ process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(maxevents) ) except: pass # Dataset related setup try: tmp = __SKIP_EVENTS__ process.source = cms.Source("PoolSource", skipEvents = cms.untracked.uint32(__SKIP_EVENTS__), fileNames = cms.u...
ce7cd841de7e89cdc786fd2ac62df64694e8866c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/ce7cd841de7e89cdc786fd2ac62df64694e8866c/fragmentForCMSSW.py
self.sandPath = config.getPath('local', 'sandbox path', os.path.join(config.workDir, 'sandbox'))
self.sandPath = config.getPath('local', 'sandbox path', os.path.join(config.workDir, 'sandbox'), check=False)
def __init__(self, config, module, monitor): wmsapi = config.get('local', 'wms', self._guessWMS()) if wmsapi != self._guessWMS(): utils.vprint('Default batch system on this host is: %s' % self._guessWMS(), -1, once = True) self.api = LocalWMSApi.open(wmsapi, config, self) utils.vprint('Using batch system: %s' % self.ap...
a556cd996f24be393e47061c3bf846ea796f6039 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/a556cd996f24be393e47061c3bf846ea796f6039/local_wms.py
try: listBlockInfo = api.listBlocks(self.datasetPath, nosite=True) (listFileInfo, seList) = ([], {}) def listFileInfoThread(self, result): result.extend(api.listFiles(self.datasetPath, retriveList=QM(self.selectedLumis, ['retrive_lumi'], []))) tFile = utils.gcStartThread(listFileInfoThread, self, listFileInfo)
def getWithPhedex(listBlockInfo, seList):
def getBlocksInternal(self): import urllib2 api = createDBSAPI(self.url) try: listBlockInfo = api.listBlocks(self.datasetPath, nosite=True) # Start thread to retrieve list of files (listFileInfo, seList) = ([], {}) def listFileInfoThread(self, result): result.extend(api.listFiles(self.datasetPath, retriveList=QM(self.s...
e3a9bddbdd4b85bc176420dc537eed452b7b5157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/e3a9bddbdd4b85bc176420dc537eed452b7b5157/provider_dbsv2.py
blockInfo[DataProvider.SEList] = seList.get(block['Name'], [])
if self.phedex: blockInfo[DataProvider.SEList] = seList.get(block['Name'], []) else: blockInfo[DataProvider.SEList] = map(lambda x: x['Name'], block['StorageElementList'])
def lumiFilter(lumilist): if self.selectedLumis: for lumi in lumilist: if selectLumi((lumi['RunNumber'], lumi['LumiSectionNumber']), self.selectedLumis): return True return self.selectedLumis == None
e3a9bddbdd4b85bc176420dc537eed452b7b5157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/e3a9bddbdd4b85bc176420dc537eed452b7b5157/provider_dbsv2.py
params += ' -c %d' % ((reqs[WMS.WALLTIME] + 59) / 60)
params += ' -W %d' % ((reqs[WMS.WALLTIME] + 59) / 60) if WMS.CPUTIME in reqs: params += ' -c %d' % ((reqs[WMS.CPUTIME] + 59) / 60)
def getSubmitArguments(self, jobNum, sandbox, stdout, stderr, addAttr): # Job name params = ' -J %s' % self.wms.getJobName(jobNum) # Job requirements reqs = dict(self.wms.getRequirements(jobNum)) if WMS.SITES in reqs: params += ' -q %s' % reqs[WMS.SITES][0] if WMS.WALLTIME in reqs: params += ' -c %d' % ((reqs[WMS.WALLT...
3fafd09316edfac9bccc2d04886a8399a3e25d08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/3fafd09316edfac9bccc2d04886a8399a3e25d08/lsf.py
if opts.shuffle: random.shuffle(jobList) else: jobList.sort() for jobNum in jobList:
def processSingleJob(jobNum):
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
continue
return
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
incInfo("Processing") continue
return incInfo("Processing")
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
incInfo("Downloaded") continue
return incInfo("Downloaded")
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
break
sys.exit(1)
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
incInfo("No files") continue
return incInfo("No files")
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
continue
return
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
dlfs_rm('file://%s' % checkPath, 'SE file')
if 'file://' not in outFilePath: dlfs_rm('file://%s' % checkPath, 'SE file')
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
continue
return
def incInfo(x): infos[x] = infos.get(x, 0) + 1
7945a33e9682b7ed9f4328384dd89a4436769a03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/7945a33e9682b7ed9f4328384dd89a4436769a03/downloadFromSE.py
userDefaultsFile = resolvePath("~/.grid-control.conf", check = False)
userDefaultsFile = utils.resolvePath("~/.grid-control.conf", check = False)
def parseFileInt(fn): try: parser.readfp(open(fn, 'r')) except IOError: raise ConfigError("Error while reading configuration file '%s'!" % fn) except cp.Error: print "Configuration file `%s' contains an error:" % fn raise
545a17b18e0b5208d69b9ae3f55d6501cf3e90a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/545a17b18e0b5208d69b9ae3f55d6501cf3e90a0/config.py
args = str.join(' ', map(lambda x: '"%s"' % ensurePrefix(x).replace('dir://', 'file:////'), urls))
args = str.join(' ', map(lambda x: '"%s"' % ensurePrefix(x).replace('dir://', 'file://'), urls))
def se_runcmd(cmd, varDict = {}, *urls): runLib = utils.pathGC('share', 'gc-run.lib') args = str.join(' ', map(lambda x: '"%s"' % ensurePrefix(x).replace('dir://', 'file:////'), urls)) varString = str.join(' ', map(lambda x: 'export %s="%s";' % (x, varDict[x]), varDict)) return utils.LoggedProcess('source %s || exit 1;...
fbab9d43de135c3f1fbb52ffb38c27136d9d8f66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/fbab9d43de135c3f1fbb52ffb38c27136d9d8f66/storage.py
if infos["Downloaded"] == len(jobList):
if ("Downloaded" in infos) and (infos["Downloaded"] == len(jobList)):
def incInfo(x): infos[x] = infos.get(x, 0) + 1
944df4bf992b12542c467b72778c7eaa4cb156da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/944df4bf992b12542c467b72778c7eaa4cb156da/downloadFromSE.py
lambda se_rm(target) = utils.LoggedProcess(se_runcmd("url_rm", se_url(target)))
se_rm = lambda target: utils.LoggedProcess(se_runcmd("url_rm", se_url(target)))
def se_runcmd(cmd, urls): runLib = utils.pathGC('share', 'gc-run.lib') urlargs = str.join(' ', map(lambda x: '"%s"' % x.replace('dir://', 'file://'), urls)) return 'source %s || exit 1; print_and_eval "%s" %s' % (runLib, cmd, urlargs)
0bcba6fd56c2b09fe2b8c7a8a5bea812ed7b0651 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8443/0bcba6fd56c2b09fe2b8c7a8a5bea812ed7b0651/se_utils.py