bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
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...
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...
476,400
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 ...
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 ...
476,401
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 ...
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 ...
476,402
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 ...
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 ...
476,403
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 ...
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 ...
476,404
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...
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...
476,405
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.
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.
476,406
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...
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...
476,407
def _appendToProjectsPy(self, moduleName, branchLocation, destination, template):
def _appendToProjectsPy(self, moduleName, branchLocation, destination, template):
476,408
def __init__(self): """ Initialization of members. No other functionality. """ usage = "" usage += "The list below shows global available options.\n"
def __init__(self): """ Initialization of members. No other functionality. """ usage = "" usage += "The list below shows global available options.\n"
476,409
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()
def update(self): value = zope.component.queryMultiAdapter( (self.context, self.request, self.widget, self.field, self.form, self.content), interfaces.IValue, name='message') if value is not None: self.message = value.get() else: self.message = self.createMessage()
476,410
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...
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...
476,411
def get(self): """See z3c.form.interfaces.IDataManager""" return self.data.get(self.field.__name__, self.field.missing_value)
def get(self): """See z3c.form.interfaces.IDataManager""" return self.data.get(self.field.__name__, self.field.missing_value)
476,412
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 ...
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 ...
476,413
def prep_annotation_file(self,basefile): print "prep_annotation_file"
def prep_annotation_file(self,basefile): print "prep_annotation_file"
476,414
def prep_annotation_file(self,basefile): print "prep_annotation_file"
def prep_annotation_file(self,basefile): print "prep_annotation_file"
476,415
def prep_annotation_file(self,basefile): print "prep_annotation_file"
def prep_annotation_file(self,basefile): print "prep_annotation_file"
476,416
def prep_annotation_file(self,basefile): print "prep_annotation_file"
def prep_annotation_file(self,basefile): print "prep_annotation_file"
476,417
def prep_annotation_file(self,basefile): print "prep_annotation_file"
defpass prep_annotation_file(self,basefile):pass printpass "prep_annotation_file"
476,418
def __str__(self): return repr(self.value)
def __str__(self): return repr(self.value)
476,419
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...
defparse(self,indata,baseuri="http://rinfo.lagrummet.se/publ/sfs/9999:999#K9P9S9P9",predicate=None):ifindata=="":returnindata#thisactuallytriggeredabug...#h=hashlib.sha1()#h.update(indata)#print"Calledwith%r(%s)(%s)"%(indata,h.hexdigest(),self.verbose)self.predicate=predicateself.baseuri=baseuriifbaseuri:m=self.re_uris...
476,420
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...
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...
476,421
def __init__(self, bundleDir, ipswDir, outDir, verbose): self.bundleDir = bundleDir self.ipswDir = ipswDir self.outDir = outDir self.verbose = verbose
def __init__(self, bundleDir, ipswDir, outDir, verbose): self.bundleDir = bundleDir self.ipswDir = ipswDir self.outDir = outDir self.verbose = verbose
476,422
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...
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...
476,423
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
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
476,424
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...
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 = self.xPts[ind-1] #get rightOfBox if ind == (self.numPts-1): if self.r...
476,425
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...
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...
476,426
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
def __init__(self, leftSide=None, spacing=None, numXPointsToBin=None): self.numXPointsToBin = numXPointsToBin self.xPts = [] self.yPts = [] self.leftSide = leftSide self.spacing = spacing
476,427
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...
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...
476,428
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__]
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__]
476,429
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__]
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__]
476,430
def onUnit(self, unit): if isinstance(unit, int) or isinstance(unit, float): return unit return unit.tostring()
def onUnit(self, unit): if isinstance(unit, int) or isinstance(unit, float) or isinstance(unit, long): return unit return unit.tostring()
476,431
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))
def addUploadBinariesStep(factory, binaries): for (local_name, remote_name) in binaries.items(): dst = WithProperties('public_html/binaries/' + remote_name, 'got_revision') factory.addStep(FileUpload(slavesrc=local_name, masterdest=dst, mode=0755))
476,432
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
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 :Preturn dt # found this online
476,433
def connect(self, thread_index): cherrypy.thread_data.db = sqlite3.connect('minitwit.sqlite') self.conn = cherrypy.thread_data.db self.c = self.conn.cursor()
def connect(self, thread_index): cherrypy.thread_data.db = sqlite3.connect('minitwit.sqlite') self.conn = cherrypy.thread_data.db self.c = self.conn.cursor()
476,434
def fetchone(self, query, args=()): self.c.execute(query, args) return self.c.fetchone()
def fetchone(self, query, args=()): c = self.get_cur() c.execute(query, args) return c.fetchone()
476,435
def fetchall(self, query, args=()): self.c.execute(query, args) return self.c.fetchalll()
def fetchall(self, query, args=()): c = self.get_cur() c.execute(query, args) return c.fetchall()
476,436
def query(self, query, args=()): self.c.execute(query, args) self.conn.commit()
def query(self, query, args=()): self.c.execute(query, args) self.conn.commit()
476,437
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...
def login(self, username='', password='', redirect='/'): message = None if len(username) > 0 and len(password) > 0: logged_in = db.fetchone("select rowid from users where username = ? and password = ?", (username, md5sum(password))) if logged_in is not None: cherrypy.session['logged_in'] = logged_in[0] raise cherrypy.H...
476,438
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
def get_logged_in(self): try: rowid = cherrypy.session.get('logged_in') r = db.fetchone('select rowid, username from users where rowid = ?', (rowid,)) return {'id': r[0], 'username': r[1]} except: return None
476,439
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
def default(self, id=None, text=None, last_update=None): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() m = cherrypy.request.method
476,440
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
def default(self, id=None, text=None): logged_in = Session().get_logged_in() m = cherrypy.request.method
476,441
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
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
476,442
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
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
476,443
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
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
476,444
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 ...
def index(self): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() 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])), '...
476,445
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...
def register(self, username='', password='', conf_password=''): message = None if len(username) > 0 and len(password) > 0 and password == conf_password: db.query('insert into users values (?, ?)', (username, md5sum(password))) raise cherrypy.HTTPRedirect('/session/login') elif password != conf_password: message = "Pass...
476,446
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...
def install(self): 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...
476,447
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
def getRequirements(self, jobNum): reqs = Module.getRequirements(self, jobNum) if self.dataSplitter != None: reqs.append((WMS.STORAGE, self.dataSplitter.getSplitInfo(jobNum).get(DataSplitter.SEList))) return reqs
476,448
def canSubmit(self, jobNum): if self.checkSE and (self.dataSplitter != None): return self.dataSplitter.getSplitInfo(jobNum)[DataSplitter.SEList] != [] return True
def canSubmit(self, jobNum): if self.checkSE and (self.dataSplitter != None): return self.dataSplitter.getSplitInfo(jobNum).get(DataSplitter.SEList) != [] return True
476,449
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_...
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_...
476,450
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_...
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_...
476,451
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,452
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,453
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,454
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
def parseJobState(self, state): if True in map(lambda x: 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
476,455
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
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: x in state, ['r', 't']): return Job.RUNNING return Job.READY
476,456
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
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
476,457
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)
def __init__(self, config, module, submodules): Monitoring.__init__(self, config, module) submodules = filter(lambda x: x != '', map(str.strip, submodules.split(","))) self.submodules = map(lambda x: Monitoring.open(x, config, module), submodules)
476,458
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...
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...
476,459
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...
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...
476,460
def lumiFilter(lfn): for lumi in listLumiInfo[lfn]: if selectLumi(lumi, self.selectedLumis): return True return self.selectedLumis == None
def lumiFilter(lfn): for lumi in listLumiInfo[lfn]: if selectLumi(lumi, self.selectedLumis): return True return self.selectedLumis == None
476,461
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(...
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(...
476,462
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(...
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(...
476,463
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(...
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(...
476,464
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; %...
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;...
476,465
def getSubmitArguments(self, jobNum, sandbox, stdout, stderr): # Restart jobs = no, job name params = ' -r n -N %s' % self.wms.getJobName(jobNum)
def getSubmitArguments(self, jobNum, sandbox, stdout, stderr): # Restart jobs = no, job name params = ' -r n -N %s' % self.wms.getJobName(jobNum)
476,466
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)
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)
476,467
def __init__(self, config, module, monitor): WMS.__init__(self, config, module, monitor, 'local')
def __init__(self, config, module, monitor): WMS.__init__(self, config, module, monitor, 'local')
476,468
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...
def getOutputDatasets(opts): # Get job numbers, task id, ... log = utils.ActivityLog(' * Reading task info...') jobList = utils.sorted(map(lambda (jobNum, path): jobNum, Job.readJobs(os.path.join(opts.workDir, 'jobs')))) taskInfo = utils.PersistentDict(os.path.join(opts.workDir, 'task.dat'), ' = ') del log print " * Re...
476,469
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)
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)
476,470
def processShorthand(optSet): if optSet: parser.parse_args(args = optSet.split() + sys.argv[1:], values = opts)
defrealmain(opts, args) processShorthand(optSet):realmain(opts, args) ifrealmain(opts, args) optSet:realmain(opts, args) parser.parse_args(argsrealmain(opts, args) =realmain(opts, args) optSet.split()realmain(opts, args) +realmain(opts, args) sys.argv[1:],realmain(opts, args) valuesrealmain(opts, args) =realmain(opts, ...
476,471
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,472
def __init__(self, config, datasetExpr, datasetNick, datasetID = 0): DataProvider.__init__(self, config, datasetExpr, datasetNick, datasetID) DataProvider.providers.update({'DBSApiv2': 'dbs'})
def __init__(self, config, datasetExpr, datasetNick, datasetID = 0): DataProvider.__init__(self, config, datasetExpr, datasetNick, datasetID) DataProvider.providers.update({'DBSApiv2': 'dbs'})
476,473
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...
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...
476,474
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...
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...
476,475
def main(args): help = \
def main(args): help = \
476,476
def main(args): help = \
def main(args): help = \
476,477
def processShorthand(optSet): if optSet: parser.parse_args(args = optSet.split() + sys.argv[1:], values = opts)
def processShorthand(optSet): if optSet: parser.parse_args(args = optSet.split() + sys.argv[1:], values = opts)
476,478
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())
def dlfs_rm(path, msg): procRM = se_utils.se_rm(path) if procRM.wait() != 0: print "\t\tUnable to remove %s!" % msg utils.eprint("%s\n\n" % procRM.getMessage())
476,479
def processSingleJob(jobNum): print "Job %d:" % jobNum,
def processSingleJob(jobNum): print "Job %d:" % jobNum,
476,480
def processSingleJob(jobNum): print "Job %d:" % jobNum,
def processSingleJob(jobNum): print "Job %d:" % jobNum,
476,481
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...
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...
476,482
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...
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...
476,483
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...
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...
476,484
def lumiFilter(lumilist): if self.selectedLumis: for lumi in lumilist: if selectLumi((lumi['RunNumber'], lumi['LumiSectionNumber']), self.selectedLumis): return True return self.selectedLumis == None
def lumiFilter(lumilist): if self.selectedLumis: for lumi in lumilist: if selectLumi((lumi['RunNumber'], lumi['LumiSectionNumber']), self.selectedLumis): return True return self.selectedLumis == None
476,485
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...
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 += ' -W %d' % ((reqs[WMS.WALLT...
476,486
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,487
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,488
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,489
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,490
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,491
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,492
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,493
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,494
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,495
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
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
476,496
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;...
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; %...
476,497
def incInfo(x): infos[x] = infos.get(x, 0) + 1
def incInfo(x): infos[x] = infos.get(x, 0) + 1
476,498
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)
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)
476,499